WO2021120891A1 - Diet data generation method and device, and storage medium and electronic device - Google Patents
Diet data generation method and device, and storage medium and electronic device Download PDFInfo
- Publication number
- WO2021120891A1 WO2021120891A1 PCT/CN2020/125497 CN2020125497W WO2021120891A1 WO 2021120891 A1 WO2021120891 A1 WO 2021120891A1 CN 2020125497 W CN2020125497 W CN 2020125497W WO 2021120891 A1 WO2021120891 A1 WO 2021120891A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- diet
- target
- data
- nutrition
- relationship
- Prior art date
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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- 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
- G16H70/00—ICT specially adapted for the handling or processing of medical references
- G16H70/20—ICT specially adapted for the handling or processing of medical references relating to practices or guidelines
Definitions
- This application relates to the field of pushing diet data, and specifically to a method and device for generating diet data, a storage medium, and an electronic device.
- the existing nutrition recommendation systems mainly include:
- Food recommendation system for medical institutions This system has certain advantages in practicability. Medical institutions combine the knowledge and experience of experts, according to the patient's physical condition, combined with the treatment characteristics of traditional Chinese medicine or Western medicine, to formulate nutritional rations for the patient in line with the condition. The foods issued by this type of system are generally more specific, and the recipes issued for most illnesses are the same.
- Dietary nutrition catering system This type of system customizes a diet plan for the user according to the relevant nutritional model by obtaining the user's personal information.
- the system generally regards nutrient intake balance as the basic requirement, and on this basis, recommends foods that meet the requirements as much as possible through linear programming or Gaussian principal element reduction method.
- the nutrition recommendation system of the existing scheme has the problem that it is only for special populations or the nutrition data that is pushed is not perfect, and it cannot realize the comprehensiveness and automation of generating or pushing diet data.
- the embodiments of the present application provide a method and device for generating diet data, a storage medium, and an electronic device to at least solve the problem that the nutrition recommendation system in the related art is only for special populations or the nutrition data generated is not complete.
- a method for generating diet data including: acquiring first tag information and second tag information corresponding to a target user, wherein the first tag information refers to Basic information related to the user; the second label information refers to the information of the target user's dietary needs; the target diet data is determined from the nutrition database according to the first label information and the second label information; wherein ,
- the nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure includes: entity attributes, and relationships between entities and entities; and the target diet data includes at least one of the following: data related to the target recipe , Data related to the target ingredient.
- a device for generating diet data including: an acquisition module configured to acquire first tag information and second tag information corresponding to a target user, wherein the first tag information Refers to the basic information related to the target user; the second label information refers to the information of the target user’s dietary needs; the determining module is set to be based on the first label information and the second label information
- the target diet data is determined from the nutrition database; wherein, the nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure includes entity attributes and the relationship between entities and entities; and the target diet data includes At least one of the following: data related to the target recipe, data related to the target ingredient.
- 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 method embodiments when running.
- an electronic device including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute any of the above Steps in the method embodiment.
- the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user. Since the target diet data is based on the nutrition database obtained by including the nutrition ontology structure constructed based on the knowledge graph, the nutrition The nutritional data in the database is more comprehensive and rich, and does not limit the target user group. Only the first label information and the second label information of the target user can generate the target diet data, which solves the problem that the nutrition recommendation system in the related technology is only oriented to The problem of insufficient nutrition data for special populations or pushes has achieved the comprehensiveness and automation of push diet data.
- FIG. 1 is a block diagram of the hardware structure of a terminal of a method for generating diet data according to an embodiment of the present application
- Fig. 2 is a flowchart of a method for generating diet data according to an embodiment of the present application
- Fig. 3 is a structural block diagram of a device for generating diet data according to an embodiment of the present application
- Fig. 4 is an optional structural block diagram of a device for generating diet data according to an embodiment of the present application.
- Diet pattern refers to the dietary structure. In short, it refers to our long-term stable eating habits, such as the Deshu diet (DASH), basic diet, Mediterranean diet, and ketogenic diet, which include the supply of ingredients. Energy percentage information, as well as the relationship between the number of meals and the energy supply of the ingredients.
- DASH Deshu diet
- basic diet basic diet
- Mediterranean diet Mediterranean diet
- ketogenic diet ketogenic diet
- Diet model The diet model is based on the diet model, plus a series of restrictions, such as the number of meals and meal function ratio, diet preference, dietary contraindications, the function ratio of the three major nutrients, and the upper and lower limits of the intake of related nutrients (such as: sodium, dietary fiber, protein, fat and carbohydrates, etc.).
- Semantic network is a data structure used to store knowledge, that is, a graph-based data structure.
- the graph here can be a directed graph or an undirected graph.
- Semantic Web A network that describes things in a way that can be understood by computers.
- Ontology The concept of Ontology originates from the field of philosophy. It is defined in philosophy as "the systematic description of objective things in the world, that is, ontology". The ontology in philosophy is concerned with the abstract nature of objective reality. In the computer field, ontology can describe knowledge at the semantic level, and can be seen as a general conceptual model describing knowledge in a certain subject domain.
- Entities are matters related to human health, including but not limited to food ingredients, recipes, nutrients, eating patterns, and diseases.
- the entities are food materials, recipes, nutrients, diet patterns, and diseases. Entities are the most basic elements in the knowledge graph, and different entities have different relationships.
- FIG. 1 is a hardware structure block diagram of a terminal in a method for generating diet data according to an embodiment of the present application.
- the terminal 10 may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) And the memory 104 for storing data.
- the aforementioned terminal may also include a transmission device 106 and an input/output device 108 for communication functions.
- FIG. 1 is only for illustration, and does not limit the structure of the foregoing terminal.
- the terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration from that shown in FIG.
- the memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the method for generating diet data in the embodiments of the present application.
- the processor 102 runs the computer programs stored in the memory 104 to thereby Execute various functional applications and data processing, that is, realize the above-mentioned methods.
- the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
- the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the terminal 10 via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
- the transmission device 106 is used to receive or send data via a network.
- the above-mentioned specific examples of the network may include a wireless network provided by the communication provider of the terminal 10.
- the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
- the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
- RF Radio Frequency
- FIG. 2 is a flowchart of a method for generating diet data according to an embodiment of the present application. As shown in FIG. 2, the process includes the following steps:
- Step S202 Acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
- Step S204 Determine the target diet data from the nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutrition ontology structure constructed based on the knowledge graph; the target diet data includes at least one of the following: related to the target recipe Data, data related to the target food;
- the entity in this embodiment includes at least one of the following: ingredients, recipes, nutrients, diet patterns, and diseases; and the relationship between the entity and the entity includes at least one of the following: the relationship between the food and the recipe, The relationship between ingredients and nutrients, the relationship between diseases and ingredients, the relationship between diseases and recipes, the relationship between diseases and nutrients, the relationship between eating patterns and recipes.
- the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user, because the target diet data is a nutrition database obtained from a nutrition ontology structure constructed based on a knowledge graph.
- the nutrition data in the nutrition database is more comprehensive and rich, and does not limit the target user group, only the first label information and the second label information of the target user are needed to generate the corresponding target diet data, thereby solving the related technology
- the Chinese Nutrition Recommendation System is only oriented to special populations or the problem of insufficient nutrition data pushed, achieving the comprehensiveness and automation of pushing diet data.
- the method steps in this embodiment may further include: step S206, pushing the target diet data to the target user. That is to say, the target diet data can be pushed to the target user when the target diet data is generated, and the push method may be in the form of a message, or an email, or other methods.
- the nutrition database in this embodiment is used to define the attributes of entities in the nutrition ontology structure and the relationships between entities and entities.
- nutrition data is obtained through the following method steps:
- Step S102 constructing the nutrition ontology structure based on the knowledge graph, wherein the nutrition ontology structure includes: entity attributes and the relationship between the entities and the entities;
- step S102 it is a dietary nutrition database established based on the knowledge graph technology, wherein, based on the knowledge graph ontology construction technology, a bottom-up and top-down hybrid method is used to construct the nutrition database.
- the ontology structure includes five types of entities, namely: food, recipes, nutrients, diet patterns, and diseases) and six types of relationships, namely: the relationship between food and recipe, the relationship between food and nutrients, the relationship between disease and food
- the relationship between entities has been fully defined to facilitate the continuous update of the subsequent database.
- the structured definition of entities can comprehensively define these five categories of entities and the relationship between entities and entities by integrating resources such as nutrition experts, books, and the Web.
- the entity definition is similar to the upper-level architecture.
- the entity definition is carried out in accordance with the principle of defining the entity as complete as possible, so that subsequent database updates only need to be filled with data and do not need to move the basic part.
- the nutrition database in the prior art does not fully cover these 5 categories of entities and 6 categories of relationships. Most of them are ingredients, recipes, and nutrients. A few include ingredients, recipes, nutrients, and diseases, which are not complete enough. .
- Step S104 obtaining corresponding nutritional data according to the entity attributes in the nutritional ontology structure and the relationship between the entities and the entities, and uniformly naming the obtained nutritional data to obtain standard structured nutritional data;
- step S104 it should be noted that related information such as food materials, recipes, nutrients, and diseases can be obtained based on the web crawler, and the obtained original data can be defined according to entities, relationships between entities and their attributes.
- the data of each source Knowledge is structured and reorganized, and finally a consistent structure is obtained, so as to solve the problems of entity attributes and confusion of entity and entity relationship due to the different emphasis, form or expression of the content of different sources, because the content of different sources is not focused.
- Mint.net has aliases, nutrient content, etc.
- Nutritional Foods website has characteristics, English name, nutrient content, etc., and even if there are nutrient content in the two sources, there are differences, such as Mint.
- Mint. There is iron content and no zinc content, while the Nutrition Food Network has zinc content. That is, it is necessary to consider the similarities and differences of different sources, and integrate different sources to make them consistent.
- the data needs to be further standardized, because each food website has its own set of naming rules, plus the difference in food materials It is called, food ingredients have their real names and aliases, and there is a large amount of data obtained from the heterogeneous information of food ingredients.
- the entity alignment technology is used to normalize the heterogeneous information of food ingredients, and the process is as follows:
- Step S11 for the normalization process between the long-name food entities, tf-idf (term frequency-inverse document frequency) is used to calculate the cos similarity (cosine similarity) of the pair of two entities;
- Step S12 for the normalization processing between the food entities of the long name and the short name, preferably, word2vec and char2vec are trained using wiki, Baidu Encyclopedia data set, etc., to calculate the cos similarity of the two entity pairs, more preferably Yes, in order to obtain more comprehensive and accurate data, use the wiki data set;
- Step S13 for the normalization process between the food entities of the short name, the character (char) and the word (word) are respectively the basic features, and the jaccard similarity and dice similarity of the pair of entities are calculated;
- Step S14 using the method of constructing an index, perform preliminary clustering of the entity pairs with similarity score>0.5; in a specific embodiment, any one of the jaccard similarity and dice similarity of the two entity pairs calculated in step S13 If the similarity is greater than 0.5, preliminary clustering is performed.
- Step S15 in order to enhance the granularity of the clustering, a gradient threshold clustering method is used
- the method of gradient threshold clustering is that the cos similarity, the jaccard similarity and the dice similarity will be within the range of 0.5-1 respectively, and the similarity interval of 0.01-0.2 will be continuously increased recursively within the range of 0.5-1.
- Automatic classification is completed. The classification is completed. Entity alignment, fusion of the results of cos similarity, jaccard similarity and dice similarity, the entity groups of the preliminary clustering are grouped in detail, so as to realize the alignment of the entities and obtain the final result.
- the similarity interval of 0.05 is continuously increased and recursively.
- the food corresponding to each ingredient ID is unique, and there will be no different foods whose IDs are the same, which may cause confusion in subsequent recommendations.
- those with more than 10 characters are regarded as long-name food entities, and those with less than or equal to 10 characters are regarded as short-name food entities.
- different numbers of characters can be used to define long or short name entities according to actual needs. For example, 8 characters, 12 characters, etc.
- the structure of the data before storage can be: for entities, such as food, ensure that each record of the source file before storage corresponds to an ID; for the import of relational data
- the library ensures that each record corresponds to a specific relationship between two entities (such as the content relationship between spinach and cellulose).
- entities such as food
- the library ensures that each record corresponds to a specific relationship between two entities (such as the content relationship between spinach and cellulose).
- entity ID if the defined field is in an array format, another file is used to save the related data of the field, and a new ID is created for the field at the same time. Each line of the file is recorded as the new ID Corresponding to the subject ID.
- a record in a relational database, is equivalent to a row in an Excel table.
- a specific food has a specific ID.
- one record corresponds to a certain relationship.
- the content relationship between spinach and cellulose is one record
- the content relationship between spinach and vitamin A is another record.
- the data format of the standard structured nutrition data is JSON (JavaScript Object Notation) format.
- JSON JavaScript Object Notation
- internally developed scripts are used to convert the ontology JSON format into Python objects in batches. Conducive to processing in Python language.
- the dictionary key-value pair method is adopted, and the layered links are finally associated with the subject ID.
- the structured data is imported into MongoDB, MySQL and other databases in batches according to the designed ontology structure.
- the MongoDB database is preferred, and the final entry is There are 8835 food material records, 56 nutrient records and 10416 recipe records behind the library. The relevant data can also be continuously updated and accumulated.
- Step S106 Import the standard structured nutrition data into the nutrition database according to the nutrition ontology structure.
- a general import format is defined for the ontology and relational entity structure.
- Knowledge information within the scope of any source can be converted into this format and then stored in a unified database, thus laying a foundation for importing more third-party similar libraries.
- the method of determining the target diet data from the nutrition database based on the first label information and the second label information involved in step S202 may further be:
- Step S202-11 Select a target diet pattern from a plurality of diet patterns in the nutrition database, where the target diet pattern includes: information on the energy supply ratio of ingredients, the relationship between the number of meals and the energy supply of the ingredients
- Step S202-12 Determine the nutrient requirement per unit time required by the target user according to the first label information and the second label information;
- Step S202-13 Determine the target diet data from the nutrition database according to the nutrient requirements.
- the target diet pattern can be selected from a plurality of diet patterns in the nutrition database, where the target diet pattern includes: the energy supply ratio of the ingredients Information, as well as the relationship between the number of meals and the energy provided by the ingredients; after selecting the diet mode, the relevant parameters of the diet model can be set, such as the number of meals and the ratio of meals, diet preferences, dietary taboos, and three major nutrient functions Setting the upper and lower limits of the ratio and related nutrient intake (such as sodium, dietary fiber, protein, fat and carbohydrates, etc.). The setting of diet model parameters makes the final recipes and ingredients more suitable for the user’s personalization. demand.
- the diet model involved in this embodiment may be a basic diet model, a DASH diet model, a Mediterranean diet model, a vegan diet model, a ketogenic diet model and other diet modules.
- a basic diet model a basic diet model
- DASH diet model a Mediterranean diet model
- a vegan diet model a ketogenic diet model and other diet modules.
- the structuring of the diet pattern is mainly based on the basic nutrition (the ratio of the three major nutrients) as the starting point for the dietitian. According to the recommended foods and servings of different diet patterns, firstly, determine the weight and calories of each type of ingredient; secondly, calculate the difference The number and weight of each type of food required by people with energy requirements; finally, the basic diet is structured.
- Table 1 The proportion of energy supplied by food ingredients (basic diet model)
- Table 2 Meal number and energy supply ratio table (basic diet model)
- the method of determining the target diet data from the nutrition database according to the nutrient demand involved in the above step S202-13 may further include:
- Steps S202-131 allocating the required amount of nutrients to different meals in a unit time according to a preset ratio
- Steps S202-132 according to the nutrient requirements for different meals, determine the recipes corresponding to different meals per unit time from the candidate recipes.
- step S202-13 For the method involved in the above step S202-13, in specific application scenarios, it can be: First, calculate the daily energy required and the conversion ratio between energy and the three major energy supply nutrients (carbohydrate, protein, fat) , And then calculate the daily demand of the three major energy supply nutrients of the target user.
- the calculation process is as follows:
- BMR Basal Metabolic Rate
- the energy conversion ratio (Energy to gram) of carbohydrates, protein and fat is 4:4:9. That is, each gram of carbohydrates and protein produce heat 4kCal, and each gram of fat produces 9kCal.
- the user's daily energy and the three major energy supply nutrient requirements are allocated to different meals in proportion.
- Filter specific candidate recipes in the recipe library according to the tag information of the target user (eliminate allergens; select a custom diet mode, such as DASH diet mode or basic diet mode; select specific meal recipes, such as breakfast recipes, etc.), and randomly select candidate recipes to fill in
- the over-determined linear equations are solved to obtain the Choose the recipe size, and finally get the daily recipe list.
- the recipe portion calculation process is:
- A, B, C respectively refer to: carbohydrate, protein, vitamin/mineral; "1” refers to energy (kCal); “2” refers to carbohydrate content (g); “3” refers to protein Content (g); “4" refers to fat content (g). It should be noted that the content is the content per hundred grams of the recipe (kCal; g).
- x, y, and z are the respective portions of the three recipes obtained by solving the overdetermined linear equations, where x is the portion of A (carbohydrate-based recipe) obtained by solving the equation; y is the portion obtained by solving the equation The amount of B (protein-based recipe); z is the amount of C (vitamin/mineral-based recipe) obtained by solving the equation.
- the random selection process is repeated until the set number of iterations ends: a.
- the amount of the recipe exceeds the generally defined amount (can be preset, such as 0.5 to 1.5); b.
- the recipe is not "dry” ", "dilute” collocation; c.
- the content of other nutrients in the daily diet does not meet the requirements (can be preset, such as the cellulose content is greater than 25g).
- the method of determining target diet data from the nutrition database according to the nutrient requirements involved in step S203-13 may further include:
- Steps S202-133 determining the required amount of food by using the nutrient demand and the functional proportion information of the food;
- Steps S202-134 according to the relationship between the number of meals and the energy supply of the ingredients, the required amount of ingredients is allocated to different meals per unit time, and the ingredients corresponding to the different meals are obtained.
- step S202-13 in a specific application scenario, it may also be: First, according to the daily energy required and the proportion of the energy supplied by the ingredients, the energy supplied by each ingredient group is calculated. Secondly, select specific candidate ingredients in the food library based on the label information of the target user (for example, eliminate allergens, etc.), randomly select the ingredients, and calculate the required amount of ingredients based on the energy of the ingredients and the content of the three major energy-supplying nutrients (in units of 100 grams) .
- Food_amount total_energy*Food_ratio/Num/Food_energy
- Food_ratio refers to the energy ratio of food ingredients (for example, 0.23, available in Table 1).
- the table look-up method is to lock the food group according to the category of the food, that is, the Group in Table 1; lock the nearest energy level (such as 2000kCal) according to total_energy; the corresponding energy ratio under the two conditions is the Food_ratio used in the formula.
- total_energy*Food_ratio is the energy supply of each food ingredient group; Num refers to the number of portions corresponding to the food ingredient group, corresponding to NUM in the energy supply ratio of the food ingredient in Table 1; Food_energy refers to the content per hundred grams of the food (kCal); amount refers to the formula Solve for the amount of the ingredient.
- the presentation of the diet data generation method in this embodiment on the client side may be: the target user uploads his own first tag information and second tag information, and then selects the existing diet pattern structure according to his own Actually need to customize the diet model, and then set a series of related parameters related to the diet model (such as the number of meals and the energy ratio of meals, diet preference, dietary contraindications, the energy supply ratio of the three major nutrients, and related nutrients such as sodium and dietary fiber , Protein, fat, or carbon water intake upper and lower limits, etc.), upload it to the back-end, interact with the front-end and back-end through API (Application Programming Interface), and finally return to the user a complete diet plan, including ingredients and recipe.
- the target user can also click to view the specific nutrient information of a certain ingredient. If the information is biased or some nutrient information is blank, the user can correct, edit and supplement it online. The revised information will be stored in the nutrition knowledge base next time. Can be called.
- 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 enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.
- a device for generating diet data is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations, and those that have been described will not be repeated.
- the term "module” can implement a combination of software and/or hardware with predetermined functions.
- the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
- Fig. 3 is a structural block diagram of a device for generating diet data according to an embodiment of the present application.
- the device includes: an acquisition module 32 configured to acquire first tag information and second tag information corresponding to a target user, Among them, the first label information refers to the basic information related to the target user; the second label information refers to the information of the target user’s dietary needs; the determining module 34 is configured to obtain information from the nutrition database according to the first label information and the second label information.
- the target diet data is determined in the database; wherein the nutrition database includes a nutrition ontology structure constructed based on the knowledge graph; the nutrition ontology structure includes: entity attributes and the relationship between entities and entities; the target diet data includes at least one of the following: related to the target recipe Data, data related to the target ingredient.
- the nutrition database may be obtained in the following manner: before obtaining the first label information and the second label information corresponding to the target user, the nutrition ontology structure is constructed based on the knowledge graph; according to the nutrition ontology The entity attributes in the structure and the relationship between the entity and the entity obtain the corresponding nutrition data, and the obtained nutrition data is named uniformly to obtain the standard structured nutrition data; the standard structured nutrition data is imported and obtained according to the nutrition ontology structure Nutritional data.
- the entity in this embodiment includes at least one of the following: ingredients, recipes, nutrients, eating patterns, and diseases.
- the relationship between the entity and the entity includes at least one of the following: the relationship between the food and the recipe, the relationship between the food and the nutrient, the relationship between the disease and the food, the relationship between the disease and the recipe, the relationship between the disease and the nutrient The relationship between dietary patterns and recipes.
- the determining module 34 in this embodiment may further include: a selection unit configured to select a target diet pattern from a plurality of diet patterns in the nutrition database, wherein the nutritional information in the target diet pattern includes: The relationship between the energy supply ratio information of the ingredients, the number of meals and the energy supply of the ingredients; the first determining unit is set to determine the nutrient needs of the target user per unit time according to the first label information and the second label information The second determination unit is configured to determine the target diet data from the nutrition database according to the nutrient requirements.
- the determination module further includes: a second selection unit configured to select the target diet model from a plurality of diet models in the nutrition database before determining the target diet data from the nutrition database according to the nutrient requirements, wherein the diet
- the information of the model includes: the number of meals and the proportion of energy provided by meals, eating habits, the energy supply ratio of nutrients, or the upper and lower limits of nutrient intake.
- the second determining unit may further include: a first distribution subunit, configured to distribute nutrient requirements to different meals within a unit time according to a preset ratio; and the first determining subunit is configured to distribute according to different meals The required nutrient requirements determine the recipes corresponding to different meals per unit time from the candidate recipes.
- the second determining unit may further include: a second determining subunit, configured to determine the required amount of ingredients based on the nutrient demand and the functional proportion information of the ingredients; the second allocating subunit, set to dine according to the food The relationship between the number and the energy supply of the ingredients allocates the required amount of ingredients to different meals per unit time, and obtains the ingredients corresponding to the different meals.
- Fig. 4 is an optional structural block diagram of a device for generating diet data according to an embodiment of the present application. As shown in Fig. 4, the device includes a pushing device 42 configured to push target nutritional data to a user.
- each of the above modules can be implemented by software or hardware.
- it can be implemented in the following manner, 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 method embodiments when running.
- the aforementioned storage medium may be configured to store a computer program for executing the following steps:
- first tag information and second tag information corresponding to the target user where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
- the target diet data includes at least one of the following: Data, data related to the target ingredient.
- the foregoing storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as mobile hard disks, magnetic disks, or optical disks.
- the embodiment of the present application also provides an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute the steps in any of the foregoing method embodiments.
- the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
- the foregoing processor may be configured to execute the following steps through a computer program:
- first tag information and second tag information corresponding to the target user where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
- the target diet data includes at least one of the following: Data, data related to the target ingredient.
- modules or steps of this application can be implemented by a general 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 codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, and in some cases, they can be executed in a different order than here.
- the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user. Since the target diet data is based on the nutrition database obtained by including the nutrition ontology structure constructed based on the knowledge graph, the nutrition The nutritional data in the database is more comprehensive and rich, and does not limit the target user group. Only the first label information and the second label information of the target user can generate the target diet data, which solves the problem that the nutrition recommendation system in the related technology is only oriented to The problem of insufficient nutrition data for special populations or pushes has achieved the comprehensiveness and automation of push diet data.
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Epidemiology (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Primary Health Care (AREA)
- Public Health (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Nutrition Science (AREA)
- Bioethics (AREA)
- Medical Treatment And Welfare Office Work (AREA)
Abstract
A diet data generation method and device, and a storage medium and an electronic device. The method comprises: obtaining first label information and second label information corresponding to a target user, wherein the first label information refers to basic information related to the target user, and the second label information refers to information of the target user for a diet demand (S202); and determining target diet data from a nutrition database according to the first label information and the second label information, wherein the nutrition database comprises a nutrition ontology structure constructed on the basis of a knowledge graph, the nutrition ontology structure comprises an entity attribute and a relationship between entities, and the target diet data comprises at least one of the followings: data related to a target recipe and data related to a target food material (S204). The method solves the problem in the related art that a nutrition recommendation system is only oriented to special crowds or pushed nutrition data is not perfect.
Description
本申请涉及饮食数据的推送领域,具体而言,涉及一种饮食数据的生成方法及装置、存储介质和电子装置。This application relates to the field of pushing diet data, and specifically to a method and device for generating diet data, a storage medium, and an electronic device.
现有的营养推荐系统主要有:The existing nutrition recommendation systems mainly include:
1,医疗机构的食品推荐系统:该系统在实用性具有一定的优势。医疗机构结合专家的知识经验,根据病人的身体状况,结合中医或西医的治疗特点,为病人制定符合病情的营养配餐。这类系统开具的食品一般比较特定化,对于大部分病情开具的食谱单雷同。1. Food recommendation system for medical institutions: This system has certain advantages in practicability. Medical institutions combine the knowledge and experience of experts, according to the patient's physical condition, combined with the treatment characteristics of traditional Chinese medicine or Western medicine, to formulate nutritional rations for the patient in line with the condition. The foods issued by this type of system are generally more specific, and the recipes issued for most illnesses are the same.
2,膳食营养配餐系统:这类系统通过获取用户的个人信息,根据相关营养模型,为用户定制一套饮食方案。该系统一般将营养素摄入平衡作为基本要求,在此基础上通过线性规划或是高斯主元削去法给用户推荐尽可能满足要求的食物。2. Dietary nutrition catering system: This type of system customizes a diet plan for the user according to the relevant nutritional model by obtaining the user's personal information. The system generally regards nutrient intake balance as the basic requirement, and on this basis, recommends foods that meet the requirements as much as possible through linear programming or Gaussian principal element reduction method.
3,大众点评系统:根据不同客户对同一种食品的不同评分,计算该食品的总体评分,从而推荐得分最高的食品。3. Public comment system: According to the different scores of different customers on the same food, the overall score of the food is calculated, so as to recommend the food with the highest score.
4,个人膳食营养评价:这类系统是通过对用户提交的一天或是一段时间内的膳食结构记录,采取不同的营养标准模型(BFF法,DDP法和INQ法等)对膳食结构计算分析,进而对其饮食营养评分或是提出进一步的改进。4. Personal dietary nutrition evaluation: This type of system uses different nutritional standard models (BFF method, DDP method, INQ method, etc.) to calculate and analyze the dietary structure by recording the dietary structure submitted by the user for a day or a period of time. And then its dietary nutrition score or propose further improvements.
但现有的方案的营养推荐系统存在只面向特殊人群或推送的营养数据不够完善的问题,不能实现生成或推送饮食数据的全面性和自动化。However, the nutrition recommendation system of the existing scheme has the problem that it is only for special populations or the nutrition data that is pushed is not perfect, and it cannot realize the comprehensiveness and automation of generating or pushing diet data.
发明内容Summary of the invention
本申请实施例提供了一种饮食数据的生成方法及装置、存储介质和电 子装置,以至少解决相关技术中营养推荐系统只面向特殊人群或生成的营养数据不够完善的问题。The embodiments of the present application provide a method and device for generating diet data, a storage medium, and an electronic device to at least solve the problem that the nutrition recommendation system in the related art is only for special populations or the nutrition data generated is not complete.
根据本申请的一个实施例,提供了一种饮食数据的生成方法,包括:获取与目标用户对应的第一标签信息和第二标签信息,其中,所述第一标签信息是指与所述目标用户自身相关的基础信息;所述第二标签信息是指所述目标用户对饮食需求的信息;根据所述第一标签信息和所述第二标签信息从营养数据库中确定出目标饮食数据;其中,所述营养数据库包括基于知识图谱构建的营养本体结构;所述营养本体结构包括:实体属性,实体与实体之间的关系;所述目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。According to an embodiment of the present application, there is provided a method for generating diet data, including: acquiring first tag information and second tag information corresponding to a target user, wherein the first tag information refers to Basic information related to the user; the second label information refers to the information of the target user's dietary needs; the target diet data is determined from the nutrition database according to the first label information and the second label information; wherein , The nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure includes: entity attributes, and relationships between entities and entities; and the target diet data includes at least one of the following: data related to the target recipe , Data related to the target ingredient.
根据本申请的另一个实施例,提供了一种饮食数据的生成装置,包括:获取模块,设置为获取与目标用户对应的第一标签信息和第二标签信息,其中,所述第一标签信息是指与所述目标用户自身相关的基础信息;所述第二标签信息是指所述目标用户对饮食需求的信息;确定模块,设置为根据所述第一标签信息和所述第二标签信息从营养数据库中确定出目标饮食数据;其中,所述营养数据库包括基于知识图谱构建的营养本体结构;所述营养本体结构包括:实体属性,实体与实体之间的关系;所述目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。According to another embodiment of the present application, there is provided a device for generating diet data, including: an acquisition module configured to acquire first tag information and second tag information corresponding to a target user, wherein the first tag information Refers to the basic information related to the target user; the second label information refers to the information of the target user’s dietary needs; the determining module is set to be based on the first label information and the second label information The target diet data is determined from the nutrition database; wherein, the nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure includes entity attributes and the relationship between entities and entities; and the target diet data includes At least one of the following: data related to the target recipe, data related to the target ingredient.
根据本申请的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, there is also provided 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 method embodiments when running.
根据本申请的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, there is also provided an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute any of the above Steps in the method embodiment.
通过本申请,根据目标用户的第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据,由于目标饮食数据是根据包括基于知识图谱 构建的营养本体结构得到的营养数据库,从而使得营养数据库中的营养数据更加全面和丰富,而且不限定目标用户的群体,只需要目标用户的第一标签信息和第二标签信息就能够生成目标饮食数据,从而解决了相关技术中营养推荐系统只面向特殊人群或推送的营养数据不够完善的问题,达到了推送饮食数据的全面性和自动化。Through this application, the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user. Since the target diet data is based on the nutrition database obtained by including the nutrition ontology structure constructed based on the knowledge graph, the nutrition The nutritional data in the database is more comprehensive and rich, and does not limit the target user group. Only the first label information and the second label information of the target user can generate the target diet data, which solves the problem that the nutrition recommendation system in the related technology is only oriented to The problem of insufficient nutrition data for special populations or pushes has achieved the comprehensiveness and automation of push diet data.
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中: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 attached picture:
图1是本申请实施例的一种饮食数据的生成方法的终端的硬件结构框图;FIG. 1 is a block diagram of the hardware structure of a terminal of a method for generating diet data according to an embodiment of the present application;
图2是根据本申请实施例的饮食数据的生成方法的流程图;Fig. 2 is a flowchart of a method for generating diet data according to an embodiment of the present application;
图3是根据本申请实施例的饮食数据的生成装置的结构框图;Fig. 3 is a structural block diagram of a device for generating diet data according to an embodiment of the present application;
图4是根据本申请实施例饮食数据的生成装置的可选结构框图。Fig. 4 is an optional structural block diagram of a device for generating diet data according to an embodiment of the present application.
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the 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 application and the features in the embodiments can be combined with each other if there is no conflict.
首先,对本实施例中的术语进行相应的解释;First, the terms in this embodiment are explained accordingly;
饮食模式:所谓饮食模式就是指膳食结构,简而言之,就是指我们长期形成的稳定饮食习惯,如得舒饮食(DASH),基础饮食、地中海饮食和生酮饮食等,其包括食材的供能占比信息,以及食用餐数与食材供能之间的关系等。Diet pattern: The so-called diet pattern refers to the dietary structure. In short, it refers to our long-term stable eating habits, such as the Deshu diet (DASH), basic diet, Mediterranean diet, and ketogenic diet, which include the supply of ingredients. Energy percentage information, as well as the relationship between the number of meals and the energy supply of the ingredients.
饮食模型:饮食模型是指在饮食模式的基础上,加上一系列限制条件,如餐数及餐次功能比、饮食偏好、饮食禁忌、三大营养素功能比以及相关营养素摄入量上下限(如:钠、膳食纤维、蛋白质、脂肪和碳水化合物等)。Diet model: The diet model is based on the diet model, plus a series of restrictions, such as the number of meals and meal function ratio, diet preference, dietary contraindications, the function ratio of the three major nutrients, and the upper and lower limits of the intake of related nutrients ( Such as: sodium, dietary fiber, protein, fat and carbohydrates, etc.).
语义网络:是一种用于存储知识的数据结构,即基于图的数据结构,这里的图可以是有向图,也可以是无向图。Semantic network: is a data structure used to store knowledge, that is, a graph-based data structure. The graph here can be a directed graph or an undirected graph.
语义网:一种使用可以被计算机理解的方式描述事物的网络。Semantic Web: A network that describes things in a way that can be understood by computers.
本体:本体(Ontology)的概念源自于哲学领域,在哲学中的定义为“对世界上客观事物的系统描述,即存在论”。哲学中的本体关心的是客观现实的抽象本质。而在计算机领域,本体可以在语义层次上描述知识,可以看成描述某个学科领域知识的一个通用概念模型。Ontology: The concept of Ontology originates from the field of philosophy. It is defined in philosophy as "the systematic description of objective things in the world, that is, ontology". The ontology in philosophy is concerned with the abstract nature of objective reality. In the computer field, ontology can describe knowledge at the semantic level, and can be seen as a general conceptual model describing knowledge in a certain subject domain.
实体:实体为与人健康相关的事务,包括但不限于食材、食谱、营养素、饮食模式以及疾病。在本申请的一个优选实施例中,实体为食材、食谱、营养素、饮食模式以及疾病。实体是知识图谱中的最基本元素,不同的实体间存在不同的关系。Entities: Entities are matters related to human health, including but not limited to food ingredients, recipes, nutrients, eating patterns, and diseases. In a preferred embodiment of the present application, the entities are food materials, recipes, nutrients, diet patterns, and diseases. Entities are the most basic elements in the knowledge graph, and different entities have different relationships.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and not necessarily used to describe a specific sequence or sequence.
实施例1Example 1
本申请实施例一所提供的方法实施例可以在终端、计算机终端或者类似的运算装置中执行。以运行在终端上为例,图1是本申请实施例的一种饮食数据的生成方法的终端的硬件结构框图。如图1所示,终端10可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述终端的结构造成限定。例如,终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in Embodiment 1 of the present application may be executed in a terminal, a computer terminal, or a similar computing device. Taking running on a terminal as an example, FIG. 1 is a hardware structure block diagram of a terminal in a method for generating diet data according to an embodiment of the present application. As shown in FIG. 1, the terminal 10 may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) And the memory 104 for storing data. Optionally, the aforementioned terminal may also include a transmission device 106 and an input/output device 108 for communication functions. Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is only for illustration, and does not limit the structure of the foregoing terminal. For example, the terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration from that shown in FIG.
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本申请实施例中的饮食数据的生成方法对应的计算机程序,处理 器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the method for generating diet data in the embodiments of the present application. The processor 102 runs the computer programs stored in the memory 104 to thereby Execute various functional applications and data processing, that is, realize the above-mentioned methods. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the terminal 10 via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
传输设备106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括终端10的通信供应商提供的无线网络。在一个实例中,传输设备106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by the communication provider of the terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
在本实施例中提供了一种运行于上述终端的饮食数据的生成方法,图2是根据本申请实施例的饮食数据的生成方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for generating diet data running on the aforementioned terminal is provided. FIG. 2 is a flowchart of a method for generating diet data according to an embodiment of the present application. As shown in FIG. 2, the process includes the following steps:
步骤S202,获取与目标用户对应的第一标签信息和第二标签信息,其中,第一标签信息是指与目标用户自身相关的基础信息;第二标签信息是指目标用户对饮食需求的信息;Step S202: Acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
步骤S204,根据第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据;其中,营养数据库包括基于知识图谱构建的营养本体结构;目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据;Step S204: Determine the target diet data from the nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutrition ontology structure constructed based on the knowledge graph; the target diet data includes at least one of the following: related to the target recipe Data, data related to the target food;
需要说明的是,本实施例中的实体包括以下至少之一:食材、食谱、营养素、饮食模式以及疾病;而实体与实体之间的关系包括以下至少之一:食材与食谱之间的关系、食材与营养素之间的关系、疾病与食材之间的关系、疾病与食谱之间的关系、疾病和营养素之间的关系、饮食模式和食谱 之间的关系。It should be noted that the entity in this embodiment includes at least one of the following: ingredients, recipes, nutrients, diet patterns, and diseases; and the relationship between the entity and the entity includes at least one of the following: the relationship between the food and the recipe, The relationship between ingredients and nutrients, the relationship between diseases and ingredients, the relationship between diseases and recipes, the relationship between diseases and nutrients, the relationship between eating patterns and recipes.
通过上述步骤S202至步骤S204,根据目标用户的第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据,由于目标饮食数据是根据包括基于知识图谱构建的营养本体结构得到的营养数据库,从而使得营养数据库中的营养数据更加全面和丰富,而且不限定目标用户的群体,只需要目标用户的第一标签信息和第二标签信息就能够生成对应的目标饮食数据,从而解决了相关技术中营养推荐系统只面向特殊人群或推送的营养数据不够完善的问题,达到了推送饮食数据的全面性和自动化。Through the above steps S202 to S204, the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user, because the target diet data is a nutrition database obtained from a nutrition ontology structure constructed based on a knowledge graph. , So that the nutrition data in the nutrition database is more comprehensive and rich, and does not limit the target user group, only the first label information and the second label information of the target user are needed to generate the corresponding target diet data, thereby solving the related technology The Chinese Nutrition Recommendation System is only oriented to special populations or the problem of insufficient nutrition data pushed, achieving the comprehensiveness and automation of pushing diet data.
可选地,在本实施例的方法步骤还可以包括:步骤S206,向目标用户推送目标饮食数据。也就是说,在生成目标饮食数据可以向目标用户推送,该推送的方式可以是以消息的方式,或者邮件的方式推送,或者其他方式。Optionally, the method steps in this embodiment may further include: step S206, pushing the target diet data to the target user. That is to say, the target diet data can be pushed to the target user when the target diet data is generated, and the push method may be in the form of a message, or an email, or other methods.
此外,需要说明的是,本实施例中的营养数据库是用于对所述营养本体结构中的实体属性以及实体与实体之间的关系进行定义的。具体地,在本实施例的可选实施方式中,通过以下方法步骤获取营养数据:In addition, it should be noted that the nutrition database in this embodiment is used to define the attributes of entities in the nutrition ontology structure and the relationships between entities and entities. Specifically, in an optional implementation of this embodiment, nutrition data is obtained through the following method steps:
步骤S102,基于知识图谱对营养本体结构进行构建,其中,营养本体结构包括:实体属性,实体与实体之间的关系;Step S102, constructing the nutrition ontology structure based on the knowledge graph, wherein the nutrition ontology structure includes: entity attributes and the relationship between the entities and the entities;
其中,对于该步骤S102需要说明的是,在本实施例中是基于知识图谱技术建立的饮食营养数据库,其中,基于知识图谱本体构建技术,采用自底向上和自顶向下的混合法构建营养领域的本体结构;For this step S102, it should be noted that, in this embodiment, it is a dietary nutrition database established based on the knowledge graph technology, wherein, based on the knowledge graph ontology construction technology, a bottom-up and top-down hybrid method is used to construct the nutrition database. The ontology structure of the domain;
其中,本体结构包含5大类实体,即:食材、食谱、营养素、饮食模式以及疾病)和6大类关系,即:食材和食谱间的关系、食材和营养素之间的关系、疾病和食材之间的关系、疾病与食谱之间的关系、疾病和营养素之间的关系以及饮食模式和食谱之间的关系,并对实体相关的属性(如定义、中英文名、特征以及来源等等)以及实体间的关系等均进行了较全面的定义,方便后续数据库的持续更新。Among them, the ontology structure includes five types of entities, namely: food, recipes, nutrients, diet patterns, and diseases) and six types of relationships, namely: the relationship between food and recipe, the relationship between food and nutrients, the relationship between disease and food The relationship between the disease, the relationship between the disease and the recipe, the relationship between the disease and the nutrient, the relationship between the diet pattern and the recipe, and the attributes related to the entity (such as definition, Chinese and English name, characteristics, source, etc.) and The relationship between entities has been fully defined to facilitate the continuous update of the subsequent database.
其中,实体结构化定义可以综合营养专家、书籍和Web等资源对这5 大类实体和实体与实体间的关系进行尽可能全面的定义。此外,实体定义类似于上层架构,本实例中,遵循对实体进行尽可能完整定义的原则进行实体定义,这样后续数据库更新只需要进行数据填充,不需要动根基部分。现有技术中的营养数据库并未完全囊括这5大类实体和6大类关系,大多是食材、食谱、营养素这三类,少数有食材、食谱、营养素和疾病这4类,其完整度不够。Among them, the structured definition of entities can comprehensively define these five categories of entities and the relationship between entities and entities by integrating resources such as nutrition experts, books, and the Web. In addition, the entity definition is similar to the upper-level architecture. In this example, the entity definition is carried out in accordance with the principle of defining the entity as complete as possible, so that subsequent database updates only need to be filled with data and do not need to move the basic part. The nutrition database in the prior art does not fully cover these 5 categories of entities and 6 categories of relationships. Most of them are ingredients, recipes, and nutrients. A few include ingredients, recipes, nutrients, and diseases, which are not complete enough. .
步骤S104,根据营养本体结构中的实体属性和实体与实体之间的关系获取对应的营养数据,并对获取到的营养数据进行统一命名获得标准结构化的营养数据;Step S104, obtaining corresponding nutritional data according to the entity attributes in the nutritional ontology structure and the relationship between the entities and the entities, and uniformly naming the obtained nutritional data to obtain standard structured nutritional data;
其中,对于该步骤S104需要说明的是,可以基于网络爬虫获取食材、食谱、营养素和疾病等相关信息,对获得的原始数据按照实体,以及实体间关系及其属性进行定义。一个优选的实施例中,为了更好地根据营养本体结构中的实体属性和实体与实体之间的关系获取对应的营养数据,在忠于源数据的清洗原则指导下,对各个来源的数据中的知识进行结构化重组,最终获得一致性结构,从而解决因为不同的源的内容的侧重、形式或表述等不一样导致实体属性、实体与实体关系混乱等问题,因为不同的源的内容侧重点不一样,比如某食材,薄荷网有别名、各营养素含量等内容;营养食品网有特性,英文名,营养素含量等内容,而且两个源中即使都有营养素含量,但也有不同,如薄荷网可能有铁含量没有锌含量,而营养食品网有锌含量。即需要考量不同的源同异性,将不同源整合使其一致。For this step S104, it should be noted that related information such as food materials, recipes, nutrients, and diseases can be obtained based on the web crawler, and the obtained original data can be defined according to entities, relationships between entities and their attributes. In a preferred embodiment, in order to better obtain the corresponding nutrition data according to the entity attribute in the nutrition ontology structure and the relationship between the entity and the entity, under the guidance of the principle of cleaning loyal to the source data, the data of each source Knowledge is structured and reorganized, and finally a consistent structure is obtained, so as to solve the problems of entity attributes and confusion of entity and entity relationship due to the different emphasis, form or expression of the content of different sources, because the content of different sources is not focused. The same, for example, for a certain food material, Mint.net has aliases, nutrient content, etc.; Nutritional Foods website has characteristics, English name, nutrient content, etc., and even if there are nutrient content in the two sources, there are differences, such as Mint. There is iron content and no zinc content, while the Nutrition Food Network has zinc content. That is, it is necessary to consider the similarities and differences of different sources, and integrate different sources to make them consistent.
在一个优选的实施例中,在进行常规数据清洗和结构化后,为了满足入库要求,需要对数据进一步标准化,由于每个食材网站都有自己的一套命名规则,再加上食材的不同叫法,食材存在本名和别名,食材异构信息在爬取得到的数据大量存在。基于此,采用实体对齐技术对食材异构信息进行归一化处理,其流程为:In a preferred embodiment, after routine data cleaning and structuring, in order to meet the storage requirements, the data needs to be further standardized, because each food website has its own set of naming rules, plus the difference in food materials It is called, food ingredients have their real names and aliases, and there is a large amount of data obtained from the heterogeneous information of food ingredients. Based on this, the entity alignment technology is used to normalize the heterogeneous information of food ingredients, and the process is as follows:
步骤S11,针对长名称食物实体之间的归一化处理,采用tf-idf(term frequency–inverse document frequency),计算两两实体对的cos相似度(余 弦相似度);Step S11, for the normalization process between the long-name food entities, tf-idf (term frequency-inverse document frequency) is used to calculate the cos similarity (cosine similarity) of the pair of two entities;
步骤S12,针对长名称和短名称的食物实体之间的归一化处理,优选的,采用wiki、百度百科数据集等语料训练word2vec和char2vec,分别计算两两实体对的cos相似度,更优选的,为了获得更全面、更准确的数据,采用wiki数据集;Step S12, for the normalization processing between the food entities of the long name and the short name, preferably, word2vec and char2vec are trained using wiki, Baidu Encyclopedia data set, etc., to calculate the cos similarity of the two entity pairs, more preferably Yes, in order to obtain more comprehensive and accurate data, use the wiki data set;
步骤S13,针对短名称的食物实体之间的归一化处理,以字符(char)以及词(word)分别为基本特征,计算两两实体对的jaccard相似度和dice相似度;Step S13, for the normalization process between the food entities of the short name, the character (char) and the word (word) are respectively the basic features, and the jaccard similarity and dice similarity of the pair of entities are calculated;
步骤S14,利用构建index的方式,将相似度score>0.5的实体对进行初步聚类;在一个具体实施例中,步骤S13计算的两两实体对的jaccard相似度和dice相似度中,任一个相似度大于0.5即进行初步聚类。Step S14, using the method of constructing an index, perform preliminary clustering of the entity pairs with similarity score>0.5; in a specific embodiment, any one of the jaccard similarity and dice similarity of the two entity pairs calculated in step S13 If the similarity is greater than 0.5, preliminary clustering is performed.
步骤S15,为了增强聚类的颗粒度,利用梯度阈值聚类的方式Step S15, in order to enhance the granularity of the clustering, a gradient threshold clustering method is used
其中,梯度阈值聚类的方式是将cos相似度、jaccard相似度和dice相似度会分别依次0.5-1范围内在内部以0.01-0.2的相似度区间不断递增递归,自动分类,分类完成就是完成了实体对齐,融合cos相似度、jaccard相似度和dice相似度的结果,将初步聚类的实体组在细化分组,从而实现实体的对齐,得到最终的结果。优选的,以0.05的相似度区间不断递增递归。Among them, the method of gradient threshold clustering is that the cos similarity, the jaccard similarity and the dice similarity will be within the range of 0.5-1 respectively, and the similarity interval of 0.01-0.2 will be continuously increased recursively within the range of 0.5-1. Automatic classification is completed. The classification is completed. Entity alignment, fusion of the results of cos similarity, jaccard similarity and dice similarity, the entity groups of the preliminary clustering are grouped in detail, so as to realize the alignment of the entities and obtain the final result. Preferably, the similarity interval of 0.05 is continuously increased and recursively.
通过上述步骤S11至步骤S15,使得每一个食材ID对应的食物是唯一的,不会出现不同的食物其ID是相同的而导致后续推荐出现混乱。本实施例中,大于10个字符的认为是长名称食物实体,小于等于10个字符的认为是短名称食物实体,当然也可以根据实际的需要,采用不同的字符数定义长或短名称实体,比如8个字符,12个字符等。Through the above steps S11 to S15, the food corresponding to each ingredient ID is unique, and there will be no different foods whose IDs are the same, which may cause confusion in subsequent recommendations. In this embodiment, those with more than 10 characters are regarded as long-name food entities, and those with less than or equal to 10 characters are regarded as short-name food entities. Of course, different numbers of characters can be used to define long or short name entities according to actual needs. For example, 8 characters, 12 characters, etc.
需要说明的是,为方便后续数据库的持续更新,数据入库前的结构形式可以为:对于实体,如食物,保证入库前的源文件每一条记录对应的是一个ID;对于关系数据的入库,保证每一条记录对应的是两两实体间某项特定的关系(如菠菜和纤维素间的含量关系)。在保证一条记录一个实 体ID的前提下,若定义的字段为数组格式时,采用另外一份文件对该字段相关数据进行保存,同时为该字段建立新的ID,文件每行记录为该新ID与主体ID相对应,若数组中嵌套数组,又采取另外一份文件保存数据,为该被嵌套的字段建立新的ID,文件每行记录为该被嵌套字段ID和嵌套字段ID相对应,依次类推,对于关系数据处理也是如此操作。It should be noted that, in order to facilitate the continuous update of the subsequent database, the structure of the data before storage can be: for entities, such as food, ensure that each record of the source file before storage corresponds to an ID; for the import of relational data The library ensures that each record corresponds to a specific relationship between two entities (such as the content relationship between spinach and cellulose). Under the premise of ensuring that a record has an entity ID, if the defined field is in an array format, another file is used to save the related data of the field, and a new ID is created for the field at the same time. Each line of the file is recorded as the new ID Corresponding to the subject ID. If the array is nested in the array, another file is used to save the data, and a new ID is created for the nested field. Each line of the file is recorded as the nested field ID and the nested field ID Correspondingly, and so on, the same is true for relational data processing.
在一个优选实施例中,在关系数据库里,一条记录相当于Excel表格里的一行。对于实体,一具体食物一个特定ID,对于两两实体关系,就一条记录对应某项关系,如菠菜和纤维素间含量关系为一条记录,菠菜和维生素A间含量关系又为另一条记录。这样一方面方便入库程序的撰写,另一方面方便后续数据库更新,即仅仅对需要更新的部分更新,不需要牵动整体,在一定程度上可减少关系数据库更新的固有弊端。In a preferred embodiment, in a relational database, a record is equivalent to a row in an Excel table. For an entity, a specific food has a specific ID. For a relationship between two entities, one record corresponds to a certain relationship. For example, the content relationship between spinach and cellulose is one record, and the content relationship between spinach and vitamin A is another record. This way, on the one hand, it facilitates the writing of warehousing programs, and on the other hand, it facilitates subsequent database updates, that is, only the parts that need to be updated are updated without affecting the whole, which can reduce the inherent drawbacks of relational database updates to a certain extent.
在一个具体的应用场景中,标准结构化的营养数据的数据格式为JSON(JavaScript Object Notation)格式,为了方便后续入库程序开发,采用内部开发的脚本,批量将本体JSON格式转为Python对象,利于用Python语言处理。对于字段为数组嵌套的,采用字典键值对方式,层层链接最终与主体ID关联,最后将结构化数据按照已设计好的本体结构批量导入MongoDB、MySQL等数据库,优选MongoDB数据库,最后入库后有8835条食材记录、56条营养素记录和10416条食谱记录,相关的数据也可以持续更新积累。In a specific application scenario, the data format of the standard structured nutrition data is JSON (JavaScript Object Notation) format. In order to facilitate the subsequent development of the library program, internally developed scripts are used to convert the ontology JSON format into Python objects in batches. Conducive to processing in Python language. For fields with nested arrays, the dictionary key-value pair method is adopted, and the layered links are finally associated with the subject ID. Finally, the structured data is imported into MongoDB, MySQL and other databases in batches according to the designed ontology structure. The MongoDB database is preferred, and the final entry is There are 8835 food material records, 56 nutrient records and 10416 recipe records behind the library. The relevant data can also be continuously updated and accumulated.
步骤S106,将标准结构化的营养数据按照营养本体结构导入营养数据库。Step S106: Import the standard structured nutrition data into the nutrition database according to the nutrition ontology structure.
也就是说,在本实施例中对于本体和关系实体结构定义了通用导入格式。任何来源的范畴内知识信息,均可以通过转换为该格式后统一入库,从而为导入更多第三方类似库奠定了基础。That is to say, in this embodiment, a general import format is defined for the ontology and relational entity structure. Knowledge information within the scope of any source can be converted into this format and then stored in a unified database, thus laying a foundation for importing more third-party similar libraries.
在本实施例的可选实施方式中,对于步骤S202中涉及到的根据第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据的方式进一步可以是:In an optional implementation of this embodiment, the method of determining the target diet data from the nutrition database based on the first label information and the second label information involved in step S202 may further be:
步骤S202-11,根据营养数据库中的多个饮食模式中选择出目标饮食模式,其中,所述目标饮食模式中包括:食材的供能占比信息、食用餐数与食材供能之间的关系Step S202-11: Select a target diet pattern from a plurality of diet patterns in the nutrition database, where the target diet pattern includes: information on the energy supply ratio of ingredients, the relationship between the number of meals and the energy supply of the ingredients
步骤S202-12,根据第一标签信息和第二标签信息确定出目标用户单位时间内所需的营养素的需求量;Step S202-12: Determine the nutrient requirement per unit time required by the target user according to the first label information and the second label information;
步骤S202-13,根据营养素的需求量从营养数据库中确定出目标饮食数据。Step S202-13: Determine the target diet data from the nutrition database according to the nutrient requirements.
此外,在根据营养素的需求量从营养数据库中确定出目标饮食数据之前,可以从营养数据库中的多个饮食模式中选择出目标饮食模式,其中,目标饮食模式中包括:食材的供能占比信息,以及食用餐数与食材供能之间的关系;在选择完饮食模式后可进行饮食模型相关参数的设定,如餐数和餐次功能比、饮食偏好、饮食禁忌、三大营养素功能比以及相关营养素摄入量上下限(如:钠、膳食纤维、蛋白质、脂肪和碳水化合物等)等的设定,饮食模型参数的设定使最后生成的食谱和食材更贴合用户的个性化需求。In addition, before the target diet data is determined from the nutrition database according to the nutrient requirements, the target diet pattern can be selected from a plurality of diet patterns in the nutrition database, where the target diet pattern includes: the energy supply ratio of the ingredients Information, as well as the relationship between the number of meals and the energy provided by the ingredients; after selecting the diet mode, the relevant parameters of the diet model can be set, such as the number of meals and the ratio of meals, diet preferences, dietary taboos, and three major nutrient functions Setting the upper and lower limits of the ratio and related nutrient intake (such as sodium, dietary fiber, protein, fat and carbohydrates, etc.). The setting of diet model parameters makes the final recipes and ingredients more suitable for the user’s personalization. demand.
需要说明的是,本实施例中涉及到的饮食模式可以是基础饮食模式、DASH饮食模式、地中海饮食模式、Vegan饮食模式、生酮饮食模式等其他饮食模块。下面将以基础饮食模式对本申请进行举例说明;It should be noted that the diet model involved in this embodiment may be a basic diet model, a DASH diet model, a Mediterranean diet model, a Vegan diet model, a ketogenic diet model and other diet modules. The following will illustrate this application with a basic diet model;
饮食模式结构化主要是营养师以基础营养(三大营养素配比)为出发点,根据不同饮食模式推荐的食物及份数,首先,确定每类食材每份的重量及热量;其次,计算出不同能量需要水平的人所需要的每类食物的份数及重量;最后,基础饮食结构化。The structuring of the diet pattern is mainly based on the basic nutrition (the ratio of the three major nutrients) as the starting point for the dietitian. According to the recommended foods and servings of different diet patterns, firstly, determine the weight and calories of each type of ingredient; secondly, calculate the difference The number and weight of each type of food required by people with energy requirements; finally, the basic diet is structured.
计算每种食材种类在不同的能量层级下所占的比例和份数得到食材供能占比如表1所示,以及每种食材在不同的餐次所占的比例得到餐数及供能比如表2所示。不同的饮食模式有自身独特的饮食结构,可根据基础饮食模式和DASH饮食模式的膳食结构,最后计算得到两种饮食模式的食材供能占比和餐数及供能比。Calculate the proportion and number of servings of each type of ingredient under different energy levels to obtain the ratio of the energy supply of the ingredients as shown in Table 1, and the proportion of each ingredient in different meals to obtain the number of meals and the ratio of energy supply. 2 shown. Different diet patterns have their own unique diet structure. According to the dietary structure of the basic diet pattern and the DASH diet pattern, the energy supply ratio and the number of meals and the energy supply ratio of the two diet patterns can be finally calculated.
表1:食材供能占比表(基础饮食模式)Table 1: The proportion of energy supplied by food ingredients (basic diet model)
需要说明的是,第2列Num中的数字表示各个类别的食材所占的份数,第2列往后各列表示不同的能量层级下(1400KJ,1800KJ....)各个类别的食材所占的比例,每列比例总和约等于1。It should be noted that the numbers in the second column Num indicate the number of servings of the ingredients of each category, and the following columns in the second column indicate the ingredients of each category under different energy levels (1400KJ, 1800KJ...) The proportion of each column is approximately equal to 1.
groupgroup | 早餐breakfast | 午餐lunch | 晚餐dinner |
谷薯类|精制谷物Cereals and Potatoes | Refined Grains | 00 | 0.520.52 | 0.480.48 |
谷薯类|全谷物及杂豆Cereals and potatoes|whole grains and mixed beans | 0.460.46 | 0.540.54 | 00 |
谷薯类|薯类Cereals and Tubers| Tubers | 11 | 00 | 00 |
蔬菜|其他蔬菜Vegetables|Other Vegetables | 00 | 00 | 11 |
蔬菜|深色蔬菜Vegetables | Dark Vegetables | 00 | 11 | 00 |
水果fruit | 11 | 00 | 00 |
畜禽肉蛋类Livestock and poultry meat and eggs | 00 | 11 | 00 |
水产品Aquatic products | 00 | 00 | 11 |
乳类及其制品Milk and its products | 11 | 00 | 00 |
大豆及其制品Soybean and its products | 00 | 0.80.8 | 0.20.2 |
坚果、种子Nuts, seeds | 11 | 00 | 00 |
烹饪油Cooking oil | 00 | 0.50.5 | 0.50.5 |
表2:餐数及供能比表(基础饮食模式)Table 2: Meal number and energy supply ratio table (basic diet model)
需要说明的是,表2中数字代表不同的食材类别在不同的餐次中所占的比例。It should be noted that the numbers in Table 2 represent the proportions of different types of ingredients in different meals.
进一步地,在本实施例的可选实施方式中,对于上述步骤S202-13中涉及到的根据营养素的需求量从营养数据库中确定出目标饮食数据的方式,进一步可以包括:Further, in an optional implementation manner of this embodiment, the method of determining the target diet data from the nutrition database according to the nutrient demand involved in the above step S202-13 may further include:
步骤S202-131,将营养素的需求量按照预设比例分配到单位时间内的不同餐次;Steps S202-131, allocating the required amount of nutrients to different meals in a unit time according to a preset ratio;
步骤S202-132,根据不同餐次所需的营养素的需求量从候选食谱中确定出单位时间内不同餐次所对应的食谱。Steps S202-132, according to the nutrient requirements for different meals, determine the recipes corresponding to different meals per unit time from the candidate recipes.
对于上述步骤S202-13中涉及到的方式,在具体应用场景中可以是:首先,计算得到每日所需能量,及能量与三大供能营养素(碳水化合物、蛋白质、脂肪)间的转换比,进而计算得到目标用户每日三大供能营养素的需求量,其计算过程为:For the method involved in the above step S202-13, in specific application scenarios, it can be: First, calculate the daily energy required and the conversion ratio between energy and the three major energy supply nutrients (carbohydrate, protein, fat) , And then calculate the daily demand of the three major energy supply nutrients of the target user. The calculation process is as follows:
首先,计算活动代谢率(Active Metabolic Rate,简称为AMR),表3为运动量与活动代谢率预估值对应关系表,如表3所示;First, calculate the Active Metabolic Rate (Active Metabolic Rate, referred to as AMR). Table 3 shows the corresponding relationship between the amount of exercise and the estimated value of the Active Metabolic Rate, as shown in Table 3.
表3table 3
此外,活动代谢率预估值(MET)与AMR对应关系如下:(1)在MET<=1.4的情况下,AMR=0;(2)在1.4<MET<=1.69的情况下,AMR=1;(2)在1.69<MET<=2.59的情况下,AMR=2;(3)在MET>2.59的情况下,AMR=3。In addition, the corresponding relationship between the estimated value of active metabolic rate (MET) and AMR is as follows: (1) In the case of MET<=1.4, AMR=0; (2) In the case of 1.4<MET<=1.69, AMR=1 ; (2) In the case of 1.69<MET<=2.59, AMR=2; (3) in the case of MET>2.59, AMR=3.
其次,计算基础代谢率(Basal Metabolic Rate,简称为BMR),根据性别计算相应的BMR(weight、height和age分别对应体重(kg)、身高(cm)和年龄(年)):Second, calculate the basal metabolic rate (Basal Metabolic Rate, referred to as BMR), and calculate the corresponding BMR based on gender (weight, height, and age correspond to weight (kg), height (cm), and age (years)):
男性BMR=13.397*weight+4.799*height-5.677*age+88.362Male BMR=13.397*weight+4.799*height-5.677*age+88.362
女性BMR=9.247*weight+3.098*height-4.33*age+447.593Female BMR=9.247*weight+3.098*height-4.33*age+447.593
然后,计算每日所需能量(kCal),其中,每日所需能量值(Energy)=BMR*(1.2+AMR*0.175);根据预设的三大营养素供能比,如碳水:蛋白:脂肪=5.5:2:2.5,求得相应营养素能量;然后通过能量与三大供能营养素间的转换比,得到它们各自的质量需求。碳水化合物、蛋白质和脂肪的能量转换比(Energy to gram)为4:4:9。即:每克碳水化合物和蛋白质分别产热4kCal,每克脂肪产热9kCal。Then, calculate the daily required energy (kCal), where the daily required energy value (Energy)=BMR*(1.2+AMR*0.175); according to the preset energy supply ratio of the three major nutrients, such as carbon water: protein: Fat=5.5:2:2.5 to obtain the corresponding nutrient energy; then through the conversion ratio between energy and the three major energy supply nutrients, their respective quality requirements are obtained. The energy conversion ratio (Energy to gram) of carbohydrates, protein and fat is 4:4:9. That is, each gram of carbohydrates and protein produce heat 4kCal, and each gram of fat produces 9kCal.
最后,根据预设的各餐次供能比,将用户每日所需能量及三大供能营养素需求量按比例分配到不同餐次。根据目标用户的标签信息筛选食谱库特定候选食谱(剔除过敏原;选择自定义饮食模式,如DASH饮食模式或是基础饮食模式;选择特定餐食谱,如早餐食谱等),随机选择候选食谱填充至不同餐次,根据用户每日所需能量及三大供能营养素的需求量,结合食谱能量及三大供能营养素含量(以每百克为单位),通过解超定线性方程组,得到所选食谱份量,最终得到每日食谱清单。Finally, according to the preset energy supply ratio of each meal, the user's daily energy and the three major energy supply nutrient requirements are allocated to different meals in proportion. Filter specific candidate recipes in the recipe library according to the tag information of the target user (eliminate allergens; select a custom diet mode, such as DASH diet mode or basic diet mode; select specific meal recipes, such as breakfast recipes, etc.), and randomly select candidate recipes to fill in For different meals, according to the daily energy required by the user and the requirements of the three major energy-supplying nutrients, combined with the dietary energy and the content of the three major energy-supplying nutrients (in units of 100 grams), the over-determined linear equations are solved to obtain the Choose the recipe size, and finally get the daily recipe list.
食谱份量计算过程为:The recipe portion calculation process is:
A_1*x+B_1*y+C_1*z=total_energy(总能量)A_1*x+B_1*y+C_1*z=total_energy (total energy)
A_2*x+B_2*y+C_2*z=total_carbohydrates(总碳水化合物)A_2*x+B_2*y+C_2*z=total_carbohydrates (total carbohydrates)
A_3*x+B_3*y+C_3*z=total_protein(总蛋白质)A_3*x+B_3*y+C_3*z=total_protein
A_4*x+B_4*y+C_4*z=total_fat(总脂肪)A_4*x+B_4*y+C_4*z=total_fat (total fat)
其中,A,B,C:分别是指:碳水化合物,蛋白质,维生素/矿物质;“1”是指能量(kCal);“2”是指碳水化合物含量(g);“3”是指蛋白质含量(g);“4”是指脂肪含量(g)。需要说明的是,含量均为该食谱每百克含量(kCal;g)。Among them, A, B, C: respectively refer to: carbohydrate, protein, vitamin/mineral; "1" refers to energy (kCal); "2" refers to carbohydrate content (g); "3" refers to protein Content (g); "4" refers to fat content (g). It should be noted that the content is the content per hundred grams of the recipe (kCal; g).
此外,x、y、z是通过超定线性方程组求解得到的三个食谱分别的份量,其中,x为方程求解得到的A(碳水化合物为主的食谱)的份量;y为方程求解得到的B(蛋白质为主的食谱)的份量;z为方程求解得到的C(维生素/矿物质为主的食谱)的份量。In addition, x, y, and z are the respective portions of the three recipes obtained by solving the overdetermined linear equations, where x is the portion of A (carbohydrate-based recipe) obtained by solving the equation; y is the portion obtained by solving the equation The amount of B (protein-based recipe); z is the amount of C (vitamin/mineral-based recipe) obtained by solving the equation.
另外,若不满足以下任一条件,则随机选取过程重复进行,至所设迭代次数结束:a.食谱份量超过一般定义份量(可预设,如0.5至1.5份);b.食谱非“干”,“稀”搭配;c.一日食谱其它营养元素含量不符合要求(可预设,如纤维素含量大于25g)。In addition, if any of the following conditions are not met, the random selection process is repeated until the set number of iterations ends: a. The amount of the recipe exceeds the generally defined amount (can be preset, such as 0.5 to 1.5); b. The recipe is not "dry" ", "dilute" collocation; c. The content of other nutrients in the daily diet does not meet the requirements (can be preset, such as the cellulose content is greater than 25g).
在本实施例的再一个可选实施方式中,对于步骤S203-13中涉及到的根据营养素的需求量从营养数据库中确定出目标饮食数据的方式,还可以进一步包括:In yet another optional implementation manner of this embodiment, the method of determining target diet data from the nutrition database according to the nutrient requirements involved in step S203-13 may further include:
步骤S202-133,将营养素的需求量以及食材的功能占比信息确定出所需食材量;Steps S202-133, determining the required amount of food by using the nutrient demand and the functional proportion information of the food;
步骤S202-134,根据食用餐数与食材供能之间的关系将所需食材量分配到单位时间的不同餐次,得到不同餐次所对应的食材。Steps S202-134, according to the relationship between the number of meals and the energy supply of the ingredients, the required amount of ingredients is allocated to different meals per unit time, and the ingredients corresponding to the different meals are obtained.
对于上述步骤S202-13中涉及到的方式,在具体应用场景中还可以是:首先,根据每日所需能量,及食材供能占比,计算得到各食材组供能量。其次,根据目标用户的标签信息筛选食材库特定候选食材(例如,剔除过敏原等),随机选择食材并根据食材能量及三大供能营养素含量(以每百克为单位)计算所需食材量。Regarding the methods involved in the above step S202-13, in a specific application scenario, it may also be: First, according to the daily energy required and the proportion of the energy supplied by the ingredients, the energy supplied by each ingredient group is calculated. Secondly, select specific candidate ingredients in the food library based on the label information of the target user (for example, eliminate allergens, etc.), randomly select the ingredients, and calculate the required amount of ingredients based on the energy of the ingredients and the content of the three major energy-supplying nutrients (in units of 100 grams) .
食材量计算过程为:The process of calculating the amount of ingredients is:
Food_amount=total_energy*Food_ratio/Num/Food_energyFood_amount=total_energy*Food_ratio/Num/Food_energy
其中,Food_ratio是指食材能量占比(如:0.23,查表1食材供能占比表可得)。查表方式为根据食材所归属类别锁定食材组,即表1中的Group;根据total_energy锁定最邻近能量层级(如:2000kCal);两条件下对应的能量占比即为公式所用Food_ratio。total_energy*Food_ratio即为各食材组供能量;Num是指食材组对应份数,对应表1食材供能占比中的NUM; Food_energy是指该食材每百克含量(kCal);amount是指通过公式求解得到的该食材的份量。Among them, Food_ratio refers to the energy ratio of food ingredients (for example, 0.23, available in Table 1). The table look-up method is to lock the food group according to the category of the food, that is, the Group in Table 1; lock the nearest energy level (such as 2000kCal) according to total_energy; the corresponding energy ratio under the two conditions is the Food_ratio used in the formula. total_energy*Food_ratio is the energy supply of each food ingredient group; Num refers to the number of portions corresponding to the food ingredient group, corresponding to NUM in the energy supply ratio of the food ingredient in Table 1; Food_energy refers to the content per hundred grams of the food (kCal); amount refers to the formula Solve for the amount of the ingredient.
最后,根据表1和表2中的餐数及供能比,将随机选择的食材分配到不同餐次,最终得到每日食材清单。Finally, according to the number of meals and the energy supply ratio in Table 1 and Table 2, randomly selected ingredients are allocated to different meals, and finally a list of daily ingredients is obtained.
此外,需要说明的是,对于本实施例中的饮食数据生成方法在客户端的呈现可以是:目标用户上传自身的第一标签信息和第二标签信息,进而选择已有的饮食模式结构,依照自己实际所需,自定义饮食模式,之后再设置一系列有关饮食模型相关参数(比如餐数和餐次供能比、饮食偏好、饮食禁忌、三大营养素供能比以及相关营养素如钠、膳食纤维、蛋白质、脂肪或碳水等摄入量上下限等),并将其上传至后端,通过API(Application Programming Interface应用程序接口)前后端交互,最后返回给用户返回一整套饮食方案,包括食材和食谱。目标用户也可点击查看某食材的具体营养素信息,若信息存在偏差或某些营养素信息为空白,用户可在线对其校正编辑与补充,修改后的信息将会存储在营养知识库中,下次即可调用。In addition, it should be noted that the presentation of the diet data generation method in this embodiment on the client side may be: the target user uploads his own first tag information and second tag information, and then selects the existing diet pattern structure according to his own Actually need to customize the diet model, and then set a series of related parameters related to the diet model (such as the number of meals and the energy ratio of meals, diet preference, dietary contraindications, the energy supply ratio of the three major nutrients, and related nutrients such as sodium and dietary fiber , Protein, fat, or carbon water intake upper and lower limits, etc.), upload it to the back-end, interact with the front-end and back-end through API (Application Programming Interface), and finally return to the user a complete diet plan, including ingredients and recipe. The target user can also click to view the specific nutrient information of a certain ingredient. If the information is biased or some nutrient information is blank, the user can correct, edit and supplement it online. The revised information will be stored in the nutrition knowledge base next time. Can be called.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如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 enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.
实施例2Example 2
在本实施例中还提供了一种饮食数据的生成装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的 实现也是可能并被构想的。In this embodiment, a device for generating diet data is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and/or hardware with predetermined functions. Although the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
图3是根据本申请实施例的饮食数据的生成装置的结构框图,如图3所示,该装置包括:获取模块32,设置为获取与目标用户对应的第一标签信息和第二标签信息,其中,第一标签信息是指与目标用户自身相关的基础信息;第二标签信息是指目标用户对饮食需求的信息;确定模块34,设置为根据第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据;其中,营养数据库包括基于知识图谱构建的营养本体结构;营养本体结构包括:实体属性,实体与实体之间的关系;目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。Fig. 3 is a structural block diagram of a device for generating diet data according to an embodiment of the present application. As shown in Fig. 3, the device includes: an acquisition module 32 configured to acquire first tag information and second tag information corresponding to a target user, Among them, the first label information refers to the basic information related to the target user; the second label information refers to the information of the target user’s dietary needs; the determining module 34 is configured to obtain information from the nutrition database according to the first label information and the second label information. The target diet data is determined in the database; wherein the nutrition database includes a nutrition ontology structure constructed based on the knowledge graph; the nutrition ontology structure includes: entity attributes and the relationship between entities and entities; the target diet data includes at least one of the following: related to the target recipe Data, data related to the target ingredient.
在本实施例的可选实施方式中,可以通过以下方式获取营养数据库:在获取与目标用户对应的第一标签信息和第二标签信息之前,基于知识图谱对营养本体结构进行构建;根据营养本体结构中的实体属性和实体与实体之间的关系获取对应的营养数据,并对获取到的营养数据进行统一命名获得标准结构化的营养数据;对标准结构化的营养数据按照营养本体结构导入获得营养数据。In an alternative implementation of this embodiment, the nutrition database may be obtained in the following manner: before obtaining the first label information and the second label information corresponding to the target user, the nutrition ontology structure is constructed based on the knowledge graph; according to the nutrition ontology The entity attributes in the structure and the relationship between the entity and the entity obtain the corresponding nutrition data, and the obtained nutrition data is named uniformly to obtain the standard structured nutrition data; the standard structured nutrition data is imported and obtained according to the nutrition ontology structure Nutritional data.
需要说明的是,本实施例中的实体包括以下至少之一:食材、食谱、营养素、饮食模式以及疾病。实体与实体之间的关系包括以下至少之一:食材与食谱之间的关系、食材与营养素之间的关系、疾病与食材之间的关系、疾病与食谱之间的关系、疾病和营养素之间的关系、饮食模式和食谱之间的关系。It should be noted that the entity in this embodiment includes at least one of the following: ingredients, recipes, nutrients, eating patterns, and diseases. The relationship between the entity and the entity includes at least one of the following: the relationship between the food and the recipe, the relationship between the food and the nutrient, the relationship between the disease and the food, the relationship between the disease and the recipe, the relationship between the disease and the nutrient The relationship between dietary patterns and recipes.
可选地,本实施例中的确定模块34进一步可以包括:选择单元,设置为根据营养数据库中的多个饮食模式中选择出目标饮食模式,其中,所述目标饮食模式中的营养信息包括:食材的供能占比信息、食用餐数与食材供能之间的关系;第一确定单元,设置为根据第一标签信息和第二标签信息确定出目标用户单位时间内所需的营养素的需求量;第二确定单元,设置为根据营养素的需求量从营养数据库中确定出目标饮食数据。Optionally, the determining module 34 in this embodiment may further include: a selection unit configured to select a target diet pattern from a plurality of diet patterns in the nutrition database, wherein the nutritional information in the target diet pattern includes: The relationship between the energy supply ratio information of the ingredients, the number of meals and the energy supply of the ingredients; the first determining unit is set to determine the nutrient needs of the target user per unit time according to the first label information and the second label information The second determination unit is configured to determine the target diet data from the nutrition database according to the nutrient requirements.
此外,该确定模块还包括:第二选择单元,设置为在根据营养素的需 求量从营养数据库中确定出目标饮食数据之前,在营养数据库中多个饮食模型中选择出目标饮食模型,其中,饮食模型的信息包括:食用餐数和食用餐次供能占比信息、饮食习惯、营养素供能比或营养素摄入量上下限。In addition, the determination module further includes: a second selection unit configured to select the target diet model from a plurality of diet models in the nutrition database before determining the target diet data from the nutrition database according to the nutrient requirements, wherein the diet The information of the model includes: the number of meals and the proportion of energy provided by meals, eating habits, the energy supply ratio of nutrients, or the upper and lower limits of nutrient intake.
其中,该第二确定单元进一步可以包括:第一分配子单元,设置为将营养素的需求量按照预设比例分配到单位时间内的不同餐次;第一确定子单元,设置为根据不同餐次所需的营养素的需求量从候选食谱中确定出单位时间内不同餐次所对应的食谱。Wherein, the second determining unit may further include: a first distribution subunit, configured to distribute nutrient requirements to different meals within a unit time according to a preset ratio; and the first determining subunit is configured to distribute according to different meals The required nutrient requirements determine the recipes corresponding to different meals per unit time from the candidate recipes.
此外,该第二确定单元还可以进一步包括:第二确定子单元,设置为将营养素的需求量以及食材的功能占比信息确定出所需食材量;第二分配子单元,设置为根据食用餐数与食材供能之间的关系将所需食材量分配到单位时间的不同餐次,得到不同餐次所对应的食材。In addition, the second determining unit may further include: a second determining subunit, configured to determine the required amount of ingredients based on the nutrient demand and the functional proportion information of the ingredients; the second allocating subunit, set to dine according to the food The relationship between the number and the energy supply of the ingredients allocates the required amount of ingredients to different meals per unit time, and obtains the ingredients corresponding to the different meals.
图4是根据本申请实施例的饮食数据的生成装置的可选结构框图,如图4所示,该装置包括:推送装置42,设置为向用户推送目标营养数据。Fig. 4 is an optional structural block diagram of a device for generating diet data according to an embodiment of the present application. As shown in Fig. 4, the device includes a pushing device 42 configured to push target nutritional data to a user.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following manner, 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.
实施例3Example 3
本申请的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。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 method embodiments when running.
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the aforementioned storage medium may be configured to store a computer program for executing the following steps:
S1,获取与目标用户对应的第一标签信息和第二标签信息,其中,第一标签信息是指与目标用户自身相关的基础信息;第二标签信息是指目标用户对饮食需求的信息;S1. Acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
S2,根据第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据;其中,营养数据库包括基于知识图谱构建的营养本体结构;目标 饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。S2. Determine the target diet data from the nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutritional ontology structure constructed based on the knowledge graph; the target diet data includes at least one of the following: Data, data related to the target ingredient.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the foregoing storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as mobile hard disks, magnetic disks, or optical disks.
本申请的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。The embodiment of the present application also provides an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute the steps in any of the foregoing method embodiments.
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the foregoing processor may be configured to execute the following steps through a computer program:
S1,获取与目标用户对应的第一标签信息和第二标签信息,其中,第一标签信息是指与目标用户自身相关的基础信息;第二标签信息是指目标用户对饮食需求的信息;S1. Acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to information about the target user's dietary needs;
S2,根据第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据;其中,营养数据库包括基于知识图谱构建的营养本体结构;目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。S2. Determine the target diet data from the nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutritional ontology structure constructed based on the knowledge graph; the target diet data includes at least one of the following: Data, data related to the target ingredient.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the above-mentioned embodiments and optional implementation manners, and details are not described herein again 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 computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices. Above, alternatively, they can be implemented with program codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, and in some cases, they can be executed in a different order than here. Perform the steps shown or described, or fabricate them into individual integrated circuit modules respectively, or fabricate multiple modules or steps of them into a single integrated circuit module for implementation. In this way, this application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the application, and are not intended to limit the application. For those skilled in the art, the application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principles of this application shall be included in the protection scope of this application.
通过本申请,根据目标用户的第一标签信息和第二标签信息从营养数据库中确定出目标饮食数据,由于目标饮食数据是根据包括基于知识图谱构建的营养本体结构得到的营养数据库,从而使得营养数据库中的营养数据更加全面和丰富,而且不限定目标用户的群体,只需要目标用户的第一标签信息和第二标签信息就能够生成目标饮食数据,从而解决了相关技术中营养推荐系统只面向特殊人群或推送的营养数据不够完善的问题,达到了推送饮食数据的全面性和自动化。Through this application, the target diet data is determined from the nutrition database according to the first label information and the second label information of the target user. Since the target diet data is based on the nutrition database obtained by including the nutrition ontology structure constructed based on the knowledge graph, the nutrition The nutritional data in the database is more comprehensive and rich, and does not limit the target user group. Only the first label information and the second label information of the target user can generate the target diet data, which solves the problem that the nutrition recommendation system in the related technology is only oriented to The problem of insufficient nutrition data for special populations or pushes has achieved the comprehensiveness and automation of push diet data.
Claims (20)
- 一种饮食数据的生成方法,包括:A method for generating diet data includes:获取与目标用户对应的第一标签信息和第二标签信息,其中,所述第一标签信息是指与所述目标用户自身相关的基础信息;所述第二标签信息是指所述目标用户对饮食需求的信息;Acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to the target user’s Information on dietary requirements;根据所述第一标签信息和所述第二标签信息从营养数据库中确定出目标饮食数据;其中,所述营养数据库包括基于知识图谱构建的营养本体结构;所述营养本体结构包括:实体属性,实体与实体之间的关系;所述目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。The target diet data is determined from the nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure includes entity attributes, The relationship between the entity and the entity; the target diet data includes at least one of the following: data related to the target recipe and data related to the target food material.
- 根据权利要求1所述的方法,其中,所述营养数据库用于对所述营养本体结构中的实体属性以及实体与实体之间的关系进行定义。The method according to claim 1, wherein the nutrition database is used to define the attributes of entities in the nutrition ontology structure and the relationships between entities and entities.
- 根据权利要求1所述的方法,其中,通过以下方式获取所述营养数据库:The method according to claim 1, wherein the nutrition database is obtained in the following manner:基于所述知识图谱对所述营养本体结构进行构建;Constructing the nutritional ontology structure based on the knowledge map;根据所述营养本体结构中的实体属性和所述实体与所述实体之间的关系获取对应的营养数据,并对获取到的营养数据进行统一命名获得标准结构化的营养数据;Obtaining corresponding nutritional data according to the entity attributes in the nutritional ontology structure and the relationship between the entity and the entity, and uniformly naming the obtained nutritional data to obtain standard structured nutritional data;对所述标准结构化的营养数据按照所述营养本体结构导入获得所述营养数据库。Import the standard structured nutritional data according to the nutritional ontology structure to obtain the nutritional database.
- 根据权利要求3所述的方法,其中,The method of claim 3, wherein:所述实体包括以下至少之一:食材、食谱、营养素、饮食模式以及疾病;The entity includes at least one of the following: ingredients, recipes, nutrients, diet patterns, and diseases;所述实体与所述实体之间的关系包括以下至少之一:所述食材与所述食谱之间的关系、所述食材与所述营养素之间的关系、所述疾病 与所述食材之间的关系、所述疾病与所述食谱之间的关系、所述疾病和所述营养素之间的关系、所述饮食模式和所述食谱之间的关系。The relationship between the entity and the entity includes at least one of the following: the relationship between the food material and the recipe, the relationship between the food material and the nutrient, the disease and the food material The relationship between the disease, the relationship between the disease and the diet, the relationship between the disease and the nutrient, the relationship between the diet pattern and the diet.
- 根据权利要求1所述的方法,其中,根据所述第一标签信息和所述第二标签信息从营养数据库中确定出目标饮食数据包括:The method according to claim 1, wherein determining the target diet data from a nutrition database according to the first label information and the second label information comprises:根据营养数据库中的多个饮食模式中选择出目标饮食模式,其中,所述目标饮食模式中包括:食材的供能占比信息、食用餐数与食材供能之间的关系;The target eating pattern is selected according to a plurality of eating patterns in the nutrition database, wherein the target eating pattern includes: information on the proportion of energy supplied by the ingredients, the relationship between the number of meals and the energy supplied by the ingredients;根据所述第一标签信息和所述第二标签信息确定出所述目标用户单位时间内所需的营养素的需求量;Determining the required amount of nutrients required by the target user per unit time according to the first label information and the second label information;根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据。The target diet data is determined from the nutrition database according to the required amount of the nutrient.
- 根据权利要求5所述的方法,其中,在根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据之前,还包括在营养数据库中多个饮食模型中选择出目标饮食模型,其中,所述饮食模型的信息包括:食用餐数和食用餐次供能占比信息、饮食习惯、营养素供能比或营养素摄入量上下限。The method of claim 5, wherein before determining the target diet data from the nutrition database according to the nutrient requirements, further comprising selecting a target diet model from a plurality of diet models in the nutrition database Wherein, the information of the diet model includes: the number of meals and the energy supply ratio information of the meals, eating habits, nutrient energy supply ratio, or upper and lower limits of nutrient intake.
- 根据权利要求6所述的方法,其中,根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据包括:The method according to claim 6, wherein determining the target diet data from the nutrition database according to the nutrient requirement comprises:将所述营养素的需求量按照预设比例分配到单位时间内的不同餐次;Allocating the required amount of nutrients to different meals in a unit time according to a preset ratio;根据不同餐次所需的营养素的需求量从候选食谱中确定出单位时间内不同餐次所对应的食谱。According to the nutrient requirements of different meals, the recipes corresponding to different meals per unit time are determined from the candidate recipes.
- 根据权利要求6所述的方法,其中,根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据包括:The method according to claim 6, wherein determining the target diet data from the nutrition database according to the nutrient requirement comprises:将所述营养素的需求量以及食材的功能占比信息确定出所需食材量;Determining the amount of food required by the information on the required amount of nutrients and the functional proportion of the food;根据所述食用餐数与食材供能之间的关系将所述所需食材量分配到单位时间的不同餐次,得到不同餐次所对应的食材。According to the relationship between the number of meals and the energy supply of the ingredients, the required amount of ingredients is allocated to different meals per unit time, and the ingredients corresponding to the different meals are obtained.
- 根据权利要求1至8中任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:向目标用户推送所述目标饮食数据。Push the target diet data to the target user.
- 一种饮食数据的生成装置,包括:A device for generating diet data includes:获取模块,设置为获取与目标用户对应的第一标签信息和第二标签信息,其中,所述第一标签信息是指与所述目标用户自身相关的基础信息;所述第二标签信息是指所述目标用户对饮食需求的信息;The acquiring module is configured to acquire first tag information and second tag information corresponding to the target user, where the first tag information refers to basic information related to the target user itself; the second tag information refers to Information about the dietary needs of the target user;确定模块,设置为根据所述第一标签信息和所述第二标签信息从营养数据库中确定出目标饮食数据;其中,所述营养数据库包括基于知识图谱构建的营养本体结构;所述营养本体结构包括:实体属性,实体与实体之间的关系;所述目标饮食数据包括以下至少之一:与目标食谱相关的数据、与目标食材相关的数据。The determining module is configured to determine target diet data from a nutrition database according to the first label information and the second label information; wherein the nutrition database includes a nutrition ontology structure constructed based on a knowledge graph; the nutrition ontology structure Including: entity attributes, the relationship between the entity and the entity; the target diet data includes at least one of the following: data related to the target recipe and data related to the target food.
- 根据权利要求10所述的装置,其中,所述营养数据库用于对所述营养本体结构中的实体属性以及实体与实体之间的关系进行定义。The device according to claim 10, wherein the nutrition database is used to define the attributes of entities in the nutrition ontology structure and the relationships between entities and entities.
- 根据权利要求10所述的装置,其中,通过以下方式获取营养数据库:The device according to claim 10, wherein the nutrition database is obtained in the following manner:在获取与目标用户对应的第一标签信息和第二标签信息之前,基于所述知识图谱对所述营养本体结构进行构建;Before acquiring the first label information and the second label information corresponding to the target user, construct the nutrition ontology structure based on the knowledge graph;根据所述营养本体结构中的实体属性和所述实体与所述实体之间的关系获取对应的营养数据,并对获取到的营养数据进行统一命名获得标准结构化的营养数据;Obtaining corresponding nutritional data according to the entity attributes in the nutritional ontology structure and the relationship between the entity and the entity, and uniformly naming the obtained nutritional data to obtain standard structured nutritional data;对所述标准结构化的营养数据按照所述营养本体结构导入获得所 述营养数据库。Import the standard structured nutritional data according to the nutritional ontology structure to obtain the nutritional database.
- 根据权利要求11所述的装置,其中,The device according to claim 11, wherein:所述实体包括以下至少之一:食材、食谱、营养素、饮食模式以及疾病;The entity includes at least one of the following: ingredients, recipes, nutrients, diet patterns, and diseases;所述实体与所述实体之间的关系包括以下至少之一:所述食材与所述食谱之间的关系、所述食材与所述营养素之间的关系、所述疾病与所述食材之间的关系、所述疾病与所述食谱之间的关系、所述疾病和所述营养素之间的关系、所述饮食模式和所述食谱之间的关系。The relationship between the entity and the entity includes at least one of the following: the relationship between the food material and the recipe, the relationship between the food material and the nutrient, the disease and the food material The relationship between the disease, the relationship between the disease and the diet, the relationship between the disease and the nutrient, the relationship between the diet pattern and the diet.
- 根据权利要求10所述的装置,其中,所述确定模块包括:The device according to claim 10, wherein the determining module comprises:第一选择单元,设置为根据营养数据库中的多个饮食模式中选择出目标饮食模式,其中,所述目标饮食模式中的营养信息包括:食材的供能占比信息、食用餐数与食材供能之间的关系;The first selection unit is configured to select a target diet pattern from a plurality of diet patterns in the nutrition database, wherein the nutritional information in the target diet pattern includes: information on the energy supply ratio of ingredients, the number of meals and the amount of ingredients provided Relationship between energy第一确定单元,设置为根据所述第一标签信息和所述第二标签信息确定出所述目标用户单位时间内所需的营养素的需求量;The first determining unit is configured to determine the required amount of nutrients required by the target user per unit time according to the first label information and the second label information;第二确定单元,设置为根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据。The second determining unit is configured to determine the target diet data from the nutrition database according to the nutrient demand.
- 根据权利要求14所述的装置,其中,所述确定模块还包括:第二选择单元,设置为在根据所述营养素的需求量从所述营养数据库中确定出所述目标饮食数据之前,在营养数据库中多个饮食模型中选择出目标饮食模型,其中,所述饮食模型的信息包括:食用餐数和食用餐次供能占比信息、饮食习惯、营养素供能比或营养素摄入量上下限。The device according to claim 14, wherein the determining module further comprises: a second selection unit configured to determine the target diet data from the nutrition database according to the nutrient requirement, before the nutrition The target diet model is selected from a plurality of diet models in the database, wherein the information of the diet model includes: the number of meals and the energy supply ratio information of meals, eating habits, nutrient energy supply ratio, or upper and lower limits of nutrient intake.
- 根据权利要求15所述的装置,其中,所述第二确定单元包括:The device according to claim 15, wherein the second determining unit comprises:第一分配子单元,设置为将所述营养素的需求量按照预设比例分配到单位时间内的不同餐次;The first distribution subunit is configured to distribute the nutrient requirements to different meals in a unit time according to a preset ratio;第一确定子单元,设置为根据不同餐次所需的营养素的需求量从候选食谱中确定出单位时间内不同餐次所对应的食谱。The first determining subunit is configured to determine the recipes corresponding to different meals in a unit time from the candidate recipes according to the nutrient requirements of different meals.
- 根据权利要求15所述的装置,其中,所述第二确定单元包括:The device according to claim 15, wherein the second determining unit comprises:第二确定子单元,设置为将所述营养素的需求量以及食材的功能占比信息确定出所需食材量;The second determining subunit is configured to determine the required amount of food material by determining the required amount of the nutrient and the functional proportion information of the food material;第二分配子单元,设置为根据所述食用餐数与食材供能之间的关系将所述所需食材量分配到单位时间的不同餐次,得到不同餐次所对应的食材。The second allocation subunit is configured to allocate the required amount of food material to different meals per unit time according to the relationship between the number of meals and the energy supply of the food materials, so as to obtain the food materials corresponding to the different meals.
- 根据权利要求10至17中任一项所述的装置,其中,所述装置还包括:The device according to any one of claims 10 to 17, wherein the device further comprises:推送模块,设置为向目标用户推送所述目标饮食数据。The push module is configured to push the target diet data to the target user.
- 一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至9任一项中所述的方法。A storage medium in which a computer program is stored, wherein the computer program is configured to execute the method described in any one of claims 1 to 9 when running.
- 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至9任一项中所述的方法。An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 9.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911311565.0A CN111883230B (en) | 2019-12-18 | 2019-12-18 | Diet data generation method and device, storage medium and electronic device |
CN201911311565.0 | 2019-12-18 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021120891A1 true WO2021120891A1 (en) | 2021-06-24 |
Family
ID=73153901
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/125497 WO2021120891A1 (en) | 2019-12-18 | 2020-10-30 | Diet data generation method and device, and storage medium and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111883230B (en) |
WO (1) | WO2021120891A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132768A (en) * | 2024-05-08 | 2024-06-04 | 青岛国创智能家电研究院有限公司 | Method for constructing diet knowledge graph, storage medium and program product |
CN118645214A (en) * | 2024-08-16 | 2024-09-13 | 北京语言大学 | Nutritional scheme recommendation method and system based on data fusion and knowledge graph |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112528008A (en) * | 2020-12-07 | 2021-03-19 | 北京健康有益科技有限公司 | Diabetic catering method and device based on knowledge graph |
CN112699107B (en) * | 2020-12-25 | 2024-05-17 | 北京优奥创思科技发展有限公司 | Data management platform supporting high definition |
CN113035317A (en) * | 2021-03-16 | 2021-06-25 | 北京懿医云科技有限公司 | User portrait generation method and device, storage medium and electronic equipment |
CN113051391A (en) * | 2021-03-29 | 2021-06-29 | 深圳软通动力信息技术有限公司 | Personalized diet recommendation method based on food nutrition and health knowledge base |
CN114613472A (en) * | 2022-03-10 | 2022-06-10 | 佛山市顺德区美的洗涤电器制造有限公司 | Recipe pushing method and device, cooking equipment and medium |
CN114758749B (en) * | 2022-03-23 | 2023-08-25 | 清华大学 | Nutritional diet management map creation method and device based on gestation period |
CN115035982A (en) * | 2022-06-28 | 2022-09-09 | 北京飞拓互联科技有限公司 | Data processing method, device and equipment |
CN116417115B (en) * | 2023-06-07 | 2023-12-01 | 北京四海汇智科技有限公司 | Personalized nutrition scheme recommendation method and system for gestational diabetes patients |
CN116525067A (en) * | 2023-06-21 | 2023-08-01 | 安徽宏元聚康医疗科技有限公司 | Nutrient recipe recommendation system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105512196A (en) * | 2015-11-27 | 2016-04-20 | 朱威 | Personalized nutritional recipe recommendation method and system based on users' conditions |
CN106776825A (en) * | 2016-11-24 | 2017-05-31 | 竹间智能科技(上海)有限公司 | User preference entity classification method and system based on level mapping |
CN109256190A (en) * | 2017-07-13 | 2019-01-22 | 杨俊� | A method of professional knowledge is made into software and helps family's selection best foods |
CN110504019A (en) * | 2019-08-30 | 2019-11-26 | 北京妙医佳健康科技集团有限公司 | User individual dietary recommendations continued method, apparatus, electronic equipment and storage medium |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3833005B2 (en) * | 1999-05-13 | 2006-10-11 | 大阪瓦斯株式会社 | Alternative food presentation device, method, and recording medium |
CA2864741C (en) * | 2012-02-17 | 2023-04-25 | Good Measures, Llc | Systems and methods for user-specific modulation of nutrient intake |
CN104731846B (en) * | 2014-11-17 | 2018-10-23 | 陕西师范大学 | Personalized dining recommending method and system based on multiple target |
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 |
EP3516556A1 (en) * | 2016-09-21 | 2019-07-31 | Telecom Italia S.p.A. | Method and system for supporting a user in the selection of food |
CN108595418A (en) * | 2018-04-03 | 2018-09-28 | 上海透云物联网科技有限公司 | A kind of commodity classification method and system |
CN109493944A (en) * | 2018-10-09 | 2019-03-19 | 珠海亿联德源信息技术有限公司 | A kind of dietary management system |
CN111435609B (en) * | 2019-01-11 | 2023-05-30 | 深圳微伴医学检验实验室 | Nutrient information generation method, nutrient information generation device, nutrient information generation computer equipment and nutrient information storage medium |
CN111161837B (en) * | 2019-01-15 | 2023-06-20 | 深圳碳云智能数字生命健康管理有限公司 | Food information pushing method and device and storage medium |
CN110502621B (en) * | 2019-07-03 | 2023-06-13 | 平安科技(深圳)有限公司 | Question answering method, question answering device, computer equipment and storage medium |
-
2019
- 2019-12-18 CN CN201911311565.0A patent/CN111883230B/en active Active
-
2020
- 2020-10-30 WO PCT/CN2020/125497 patent/WO2021120891A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105512196A (en) * | 2015-11-27 | 2016-04-20 | 朱威 | Personalized nutritional recipe recommendation method and system based on users' conditions |
CN106776825A (en) * | 2016-11-24 | 2017-05-31 | 竹间智能科技(上海)有限公司 | User preference entity classification method and system based on level mapping |
CN109256190A (en) * | 2017-07-13 | 2019-01-22 | 杨俊� | A method of professional knowledge is made into software and helps family's selection best foods |
CN110504019A (en) * | 2019-08-30 | 2019-11-26 | 北京妙医佳健康科技集团有限公司 | User individual dietary recommendations continued method, apparatus, electronic equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132768A (en) * | 2024-05-08 | 2024-06-04 | 青岛国创智能家电研究院有限公司 | Method for constructing diet knowledge graph, storage medium and program product |
CN118645214A (en) * | 2024-08-16 | 2024-09-13 | 北京语言大学 | Nutritional scheme recommendation method and system based on data fusion and knowledge graph |
Also Published As
Publication number | Publication date |
---|---|
CN111883230A (en) | 2020-11-03 |
CN111883230B (en) | 2024-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021120891A1 (en) | Diet data generation method and device, and storage medium and electronic device | |
Motiejunaite et al. | Family policy, employment and gender-role attitudes: a comparative analysis of Russia and Sweden | |
Brin et al. | Some preliminary findings on the nutritional status of the aged in Onondaga County, New York. | |
Beguerisse-Díaz et al. | The ‘who’and ‘what’of# diabetes on Twitter | |
Wilde et al. | Using the thrifty food plan to assess the cost of a nutritious diet | |
Melby et al. | Agricultural food production diversity and dietary diversity among female small holder farmers in a region of the Ecuadorian Andes experiencing nutrition transition | |
Govender et al. | Consumer perceptions and acceptability of traditional dishes prepared with provitamin A-biofortified maize and sweet potato | |
Jennings et al. | Food, home and health: the meanings of food amongst Bengali women in London | |
Piperata et al. | Measuring food insecurity: An introduction to tools for human biologists and ecologists | |
US12001796B2 (en) | Methods and systems for personal recipe generation | |
Juras | Estimates of intraclass correlation coefficients and other design parameters for studies of school-based nutritional interventions | |
Hinojosa-Nogueira et al. | Stance4Health nutritional APP: a path to personalized smart nutrition | |
Brüggemann et al. | Framing food in the news: Still keeping the politics out of the broccoli | |
Cui et al. | Construction of recipe knowledge graph based on user knowledge demands | |
Needham et al. | Interactions between People and Breadfruit in Hawai’i: Consumption, Preparation, and Sourcing Patterns | |
Blumfield et al. | Diet and economic modelling to improve the quality and affordability of the Australian diet for low and medium socioeconomic households | |
Kadiyala et al. | Rural transformation and the double burden of malnutrition among rural youth in developing countries | |
Sandri et al. | Plant-Based Diets versus the Mediterranean Dietary Pattern and Their Socio-Demographic Determinants in the Spanish Population: Influence on Health and Lifestyle Habits | |
Cunningham et al. | Foodgpt: Amachine learning approach to ingredient substitution and recipe recommendation | |
Urke et al. | Child diet and healthy growth in the context of rural poverty in the Peruvian Andes: What influences primary caregivers’ opportunities and choices? | |
Rani et al. | Product or Item‐Based Recommender System | |
Adorni et al. | Lifestyle Profiles and Their Sociodemographic Correlate in an Academic Community Sample | |
Oleksiv et al. | Information System of Dynamic and Adaptive Control of Human Diet Based on Machine Learning Technology. | |
Martos-Barrachina et al. | A novel cost-palatability bi-objective approach to the menu planning problem with an innovative similarity metric using a path relinking algorithm | |
KR102609726B1 (en) | System for recommending personalized fruit and vegetables based on artificial intelligence |
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: 20903895 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 17/11/2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20903895 Country of ref document: EP Kind code of ref document: A1 |