Recipe recommendation method and device based on smart band, electronic device and medium
1. A recipe recommendation method based on an intelligent bracelet is characterized by comprising the following steps:
analyzing the received recipe recommendation request to acquire basic information, an intelligent bracelet identification code and current time information of a target customer;
acquiring first data of a plurality of indexes in the intelligent bracelet corresponding to the intelligent bracelet identification code, and acquiring second data of the plurality of indexes from a historical record of the intelligent bracelet;
analyzing the first data of the indexes to determine a first analysis result of the target customer, and analyzing the second data of the indexes to determine a second analysis result of the target customer;
determining a plurality of labels of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer;
constructing a client portrait of the target client according to the plurality of labels of the target client, and determining a preference label of the target client according to the basic information of the target client;
and determining at least one target recommended recipe from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information.
2. The recipe recommendation method based on the smart band as claimed in claim 1, wherein the determining at least one target recommended recipe from a preset recipe database according to the client image, the preference tag and the current time information of the target client comprises:
converting the current time information into a recipe recommendation label according to a preset conversion rule;
matching a plurality of first recommended recipes corresponding to the recipe recommended labels from a preset recipe database;
calculating the similarity between the client image of the target client and each first recommended recipe, and selecting a plurality of first recommended recipes with high similarity from the calculated similarity as a plurality of second recommended recipes;
and matching at least one target recommended recipe corresponding to the preference label from the second recommended recipes.
3. The method for recommending recipes on a smart band according to claim 1, wherein the obtaining second data for a plurality of metrics from the history of the smart band comprises:
acquiring the index attribute of each index, and determining a preset time period threshold value of the corresponding index from a preset index library according to the index attribute of each index;
and acquiring second data within a preset time period threshold corresponding to each index from the historical record of the intelligent bracelet.
4. The smart band-based recipe recommendation method of claim 1, wherein the analyzing the first data of the plurality of indicators and the determining the first analysis result of the target customer comprises:
classifying the first data of the multiple indexes to obtain first subdata of each index;
performing trend analysis on the first subdata of each index to obtain a third analysis result;
determining a target scoring function matched with the third analysis result from the preset function library;
analyzing the first subdata of each index, determining a plurality of operation parameter values of the target scoring function, substituting the operation parameter values into the target scoring function for calculation to obtain a first score of each index, and determining the first score of each index as a first analysis result of the target customer.
5. The smart band-based recipe recommendation method of claim 1, wherein the analyzing the second data of the plurality of indicators and determining the second analysis result of the target customer comprises:
classifying the second data of the multiple indexes to obtain second subdata of each index;
dividing the second data of each index according to a preset period to obtain a plurality of third subdata;
performing trend analysis on each third subdata to obtain a fourth analysis result of each third subdata;
determining a target scoring function matched with the fourth analysis result of each third subdata from a preset function library;
analyzing each third subdata, determining a plurality of operation parameter values of the corresponding target scoring function, substituting the operation parameter values into the corresponding target scoring function for calculation, and obtaining a second score of each third subdata;
identifying whether the second score of each third subdata meets the score threshold range of the corresponding index;
and when the second score of each third subdata meets the score threshold range of the corresponding index, reserving the second score of the corresponding third subdata, averaging the reserved second scores of the plurality of third subdata to obtain the third score of each index, and determining the third scores of the plurality of indexes as the second analysis result of the target client.
6. The smart band-based recipe recommendation method of claim 1, wherein the determining the plurality of labels of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer comprises:
calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result to obtain a fourth score of each index;
calculating the product of the fourth score of each index and the preset weight value of the corresponding index to obtain the target score of each index;
and determining a plurality of labels matched with the target scores of the indexes from a preset label library, and determining the labels as the labels of the target customers.
7. The smart band-based recipe recommendation method of claim 1, wherein the determining the preference tag of the target customer according to the basic information of the target customer comprises:
extracting multi-dimensional target features from the basic information of the target customer, and classifying the multi-dimensional target features according to a preset classification model to obtain a preference label of the target customer.
8. The utility model provides a device is recommended to recipe based on intelligence bracelet, its characterized in that, the device includes:
the acquisition module is used for analyzing the received recipe recommendation request and acquiring basic information, an intelligent bracelet identification code and current time information of a target client;
the acquisition module is used for acquiring first data of a plurality of indexes in the smart band corresponding to the smart band identification code and acquiring second data of the plurality of indexes from a historical record of the smart band;
the analysis module is used for analyzing the first data of the multiple indexes to determine a first analysis result of the target customer, and analyzing the second data of the multiple indexes to determine a second analysis result of the target customer;
the first determining module is used for determining a plurality of labels of the target customer according to a first analysis result of the target customer and a second analysis result of the target customer;
the construction module is used for constructing a client portrait of the target client according to the plurality of labels of the target client and determining a preference label of the target client according to the basic information of the target client;
and the second determination module is used for determining at least one target recommended recipe from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information.
9. An electronic device, characterized in that the electronic device comprises a processor and a memory, the processor being configured to implement the smart band-based recipe recommendation method according to any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the smart band-based recipe recommendation method according to any one of claims 1 to 7.
Background
With the improvement of the attention degree of people to the health of the diet, the recipe recommendation technology is various, and there are recipe recommendation for chronic patients and recipe recommendation based on sensor data.
However, because the physical state of the user is not constant, the current recipe recommendation algorithm is mostly based on a stable and unchangeable index, only focuses on the current physical state of the user, ignores the long-term living habits and activity rules of the daily life of the user, and causes the accuracy of the recommended recipe to be low.
Therefore, it is necessary to provide a method for recommending recipes quickly and accurately.
Disclosure of Invention
In view of the above, it is necessary to provide a recipe recommendation method, device, electronic device and medium based on a smart band, which perform recipe recommendation by considering multiple dimensions such as current time information, current body state data, historical body state data, and preferences, so as to improve recommendation accuracy and rationality of recipe recommendation.
The invention provides a recipe recommendation method based on an intelligent bracelet, which comprises the following steps:
analyzing the received recipe recommendation request to acquire basic information, an intelligent bracelet identification code and current time information of a target customer;
acquiring first data of a plurality of indexes in the intelligent bracelet corresponding to the intelligent bracelet identification code, and acquiring second data of the plurality of indexes from a historical record of the intelligent bracelet;
analyzing the first data of the indexes to determine a first analysis result of the target customer, and analyzing the second data of the indexes to determine a second analysis result of the target customer;
determining a plurality of labels of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer;
constructing a client portrait of the target client according to the plurality of labels of the target client, and determining a preference label of the target client according to the basic information of the target client;
and determining at least one target recommended recipe from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information.
Optionally, the determining at least one target recommended recipe from a preset recipe database according to the client image, the preference tag, and the current time information of the target client includes:
converting the current time information into a recipe recommendation label according to a preset conversion rule;
matching a plurality of first recommended recipes corresponding to the recipe recommended labels from a preset recipe database;
calculating the similarity between the client image of the target client and each first recommended recipe, and selecting a plurality of first recommended recipes with high similarity from the calculated similarity as a plurality of second recommended recipes;
and matching at least one target recommended recipe corresponding to the preference label from the second recommended recipes.
Optionally, the obtaining second data of a plurality of indexes from the history of the smart band includes:
acquiring the index attribute of each index, and determining a preset time period threshold value of the corresponding index from a preset index library according to the index attribute of each index;
and acquiring second data within a preset time period threshold corresponding to each index from the historical record of the intelligent bracelet.
Optionally, the analyzing the first data of the plurality of indexes and determining the first analysis result of the target customer includes:
classifying the first data of the multiple indexes to obtain first subdata of each index;
performing trend analysis on the first subdata of each index to obtain a third analysis result;
determining a target scoring function matched with the third analysis result from the preset function library;
analyzing the first subdata of each index, determining a plurality of operation parameter values of the target scoring function, substituting the operation parameter values into the target scoring function for calculation to obtain a first score of each index, and determining the first score of each index as a first analysis result of the target customer.
Optionally, the analyzing the second data of the plurality of indexes and determining the second analysis result of the target customer includes:
classifying the second data of the multiple indexes to obtain second subdata of each index;
dividing the second data of each index according to a preset period to obtain a plurality of third subdata;
performing trend analysis on each third subdata to obtain a fourth analysis result of each third subdata;
determining a target scoring function matched with the fourth analysis result of each third subdata from a preset function library;
analyzing each third subdata, determining a plurality of operation parameter values of the corresponding target scoring function, substituting the operation parameter values into the corresponding target scoring function for calculation, and obtaining a second score of each third subdata;
identifying whether the second score of each third subdata meets the score threshold range of the corresponding index;
and when the second score of each third subdata meets the score threshold range of the corresponding index, reserving the second score of the corresponding third subdata, averaging the reserved second scores of the plurality of third subdata to obtain the third score of each index, and determining the third scores of the plurality of indexes as the second analysis result of the target client.
Optionally, the determining the plurality of tags of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer comprises:
calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result to obtain a fourth score of each index;
calculating the product of the fourth score of each index and the preset weight value of the corresponding index to obtain the target score of each index;
and determining a plurality of labels matched with the target scores of the indexes from a preset label library, and determining the labels as the labels of the target customers.
Optionally, the determining the preference tag of the target customer according to the basic information of the target customer includes:
extracting multi-dimensional target features from the basic information of the target customer, and classifying the multi-dimensional target features according to a preset classification model to obtain a preference label of the target customer.
A second aspect of the present invention provides a recipe recommendation device based on a smart band, the device comprising:
the acquisition module is used for analyzing the received recipe recommendation request and acquiring basic information, an intelligent bracelet identification code and current time information of a target client;
the acquisition module is used for acquiring first data of a plurality of indexes in the smart band corresponding to the smart band identification code and acquiring second data of the plurality of indexes from a historical record of the smart band;
the analysis module is used for analyzing the first data of the multiple indexes to determine a first analysis result of the target customer, and analyzing the second data of the multiple indexes to determine a second analysis result of the target customer;
the first determining module is used for determining a plurality of labels of the target customer according to a first analysis result of the target customer and a second analysis result of the target customer;
the construction module is used for constructing a client portrait of the target client according to the plurality of labels of the target client and determining a preference label of the target client according to the basic information of the target client;
and the second determination module is used for determining at least one target recommended recipe from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information.
A third aspect of the present invention provides an electronic device, which includes a processor and a memory, wherein the processor is configured to implement the method for recommending recipes based on a smart band when executing a computer program stored in the memory.
A fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for recommending recipes based on a smart band.
In summary, according to the recipe recommendation method, device, electronic device and medium based on the smart band, on one hand, at least one target recommended recipe is determined by considering a plurality of dimensions such as current time information, current body state of a target client, historical body state, diet preference and the like, so that the recommendation accuracy and rationality of recipe recommendation are improved, and meanwhile, the satisfaction degree of the target client is improved by considering the dimensions of the diet preference of the target client; on the other hand, according to the first analysis result of the target client and the second analysis result of the target client, a plurality of labels of the target client are determined, the first score of each index calculated according to the current data and the third score calculated according to the historical data are averaged, and the current body state and the historical body state of the target client are considered, so that the target score of the recipe recommendation is obtained, the accuracy of the target score is improved, and the accuracy of the subsequent recipe recommendation is improved; and finally, a grading threshold range is set for each index in advance, whether the calculated second grade is in the grading threshold range or not is judged, and after the second grade with larger deviation is deleted according to the judgment result, the remaining second grades are averaged to obtain a second analysis result of the target client, so that the accuracy of the second analysis result is improved.
Drawings
Fig. 1 is a flowchart of a recipe recommendation method based on a smart band according to an embodiment of the present invention.
Fig. 2 is a structural diagram of a recipe recommendation device based on a smart band according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Example one
Fig. 1 is a flowchart of a recipe recommendation method based on a smart band according to an embodiment of the present invention.
In this embodiment, the recipe recommendation method based on the smart band may be applied to an electronic device, and for an electronic device that needs to perform recipe recommendation based on the smart band, the function of recipe recommendation based on the smart band provided by the method of the present invention may be directly integrated on the electronic device, or may be run in the electronic device in a Software Development Kit (SDK) form.
As shown in fig. 1, the recipe recommendation method based on the smart band specifically includes the following steps, and the order of the steps in the flowchart may be changed and some may be omitted according to different requirements.
And S11, analyzing the received recipe recommendation request, and acquiring the basic information, the intelligent bracelet identification code and the current time information of the target customer.
In this embodiment, when a client needs recipe recommendation, a recipe recommendation request is initiated to a server through a client, specifically, the client may be a smart phone, an IPAD, or other intelligent devices, the server may be a recipe recommendation subsystem, and in a recipe recommendation process, for example, the client may send the recipe recommendation request to the recipe recommendation subsystem, and the recipe recommendation subsystem is configured to receive the recipe recommendation request sent by the client.
In this embodiment, the smart band identification code is used to uniquely identify the identity of the wearable device of the target customer.
S12, collecting first data of a plurality of indexes in the intelligent bracelet corresponding to the intelligent bracelet identification code, and acquiring second data of the plurality of indexes from the historical record of the intelligent bracelet.
In this embodiment, mainly built-in acceleration sensor, gyroscope, photoelectric sensor etc. in the intelligent bracelet, the intelligent bracelet can gather in real time the data value of a plurality of indexs of target customer, specifically, the index can include: sleep index, basic energy consumption index, exercise index and the like.
In an optional real-time example, the obtaining second data of a plurality of indexes from the history of the smart band includes:
acquiring the index attribute of each index, and determining a preset time period threshold value of the corresponding index from a preset index library according to the index attribute of each index;
and acquiring second data within a preset time period threshold corresponding to each index from the historical record of the intelligent bracelet.
In this embodiment, the index attribute is used to represent a weight influence of each index on the recommended recipe, and a preset time period threshold for obtaining the second data of each index is determined according to the weight influence of each index on the recommended recipe, for example, for a sports index, since the weight influence of sports on the recipe recommendation is large, a corresponding preset time period threshold is determined to be longer, generally 1 month, and data corresponding to a one-month sports index is obtained as the second data of the sports index.
In this embodiment, different preset time period thresholds are set for different indexes, so that the reasonability of the acquired second data of the multiple indexes is ensured.
S13, analyzing the first data of the indexes to determine the first analysis result of the target customer, and analyzing the second data of the indexes to determine the second analysis result of the target customer.
In this embodiment, the first analysis result includes current index scores of a plurality of indexes of the target customer, and the second analysis result includes historical index scores of a plurality of indexes of the target customer.
In an optional embodiment, the analyzing the first data of the plurality of metrics and determining the first analysis result of the target customer includes:
classifying the first data of the multiple indexes to obtain first subdata of each index;
performing trend analysis on the first subdata of each index to obtain a third analysis result;
determining a target scoring function matched with the third analysis result from the preset function library;
analyzing the first subdata of each index, determining a plurality of operation parameter values of the target scoring function, substituting the operation parameter values into the target scoring function for calculation to obtain a first score of each index, and determining the first score of each index as a first analysis result of the target customer.
In this embodiment, different indexes correspond to different scoring rules, and the overall trend of different indexes can be determined by analyzing the first subdata of each index according to different scoring rules, where the overall trend is different and the corresponding preset scoring functions are also different.
Illustratively, a scoring rule is set for the exercise indexes, and the trend analysis is performed on the first sub-data of each index according to the scoring rule to obtain a third analysis result, specifically, 3 exercise time critical points are set in the exercise process: x is the number of1,x2,x3Wherein x is1Represents the minimum number of motion steps, x2Representing a reasonable number of steps in the movement, x3Representing the highest exercise step number, and the scoring rule is as follows: if x < x1If the number of the exercise steps does not reach the minimum standard, the exercise is basically invalid, and the exercise score is close to 0 point; if x1≤x<x2The exercise score increases continuously with the increase of the number of exercise steps; x is the number of2≤x<x3The score increases and slows down with the increase of the number of the steps; x is the number of3X, the increase of the number of the movement steps does not cause too large influence on the score any more, and the movement score is close to 100.
If the number x of the motion steps of the target client is 20000 steps, x is satisfied1≤x<x2And then the third analysis result is: and matching a target scoring function from a preset function library according to the third analysis result as the exercise score is continuously increased along with the increase of the exercise step number: the sigmoid function is:wherein the content of the first and second substances,according to the step frequency in the first subdata of the motion index, the fast walking time is 6 hours, x1=3300,x3=57600,x230450, a first score of the athletic metric is calculated as: and 76, taking 76 as a first analysis result of the motion index.
In an optional embodiment, the analyzing the second data of the plurality of metrics and determining the second analysis result of the target customer includes:
classifying the second data of the multiple indexes to obtain second subdata of each index;
dividing the second data of each index according to a preset period to obtain a plurality of third subdata;
performing trend analysis on each third subdata to obtain a fourth analysis result of each third subdata;
determining a target scoring function matched with the fourth analysis result of each third subdata from a preset function library;
analyzing each third subdata, determining a plurality of operation parameter values of the corresponding target scoring function, substituting the operation parameter values into the corresponding target scoring function for calculation, and obtaining a second score of each third subdata;
identifying whether the second score of each third subdata meets the score threshold range of the corresponding index;
and when the second score of each third subdata meets the score threshold range of the corresponding index, reserving the second score of the corresponding third subdata, averaging the reserved second scores of the plurality of third subdata to obtain the third score of each index, and determining the third scores of the plurality of indexes as the second analysis result of the target client.
Further, the method further comprises:
and when the second score of each third subdata does not meet the score threshold range of the corresponding index, deleting the second score of the corresponding third subdata, averaging the second scores of the remaining third subdata meeting the score threshold range of the corresponding index to obtain a third score of each index, and determining the third scores of the multiple indexes as a second analysis result of the target client.
In this embodiment, a division period may be preset, and specifically, if second data corresponding to a one-month motion index is obtained, the preset division period may be preset to divide the second data every day to obtain third sub-data of each day corresponding to the index, and calculate a second score of the third sub-data of each day.
In this embodiment, a scoring threshold range is set for each index in advance, whether the calculated second score is within the scoring threshold range is determined, and after the second score with a large deviation is deleted according to the determination result, the remaining second scores are averaged to obtain the second analysis result of the target client, so that the accuracy of the second analysis result is improved.
S14, determining a plurality of labels of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer.
In this embodiment, the label is determined based on the analysis results of the plurality of indices.
In an optional embodiment, the determining the plurality of tags of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer comprises:
calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result to obtain a fourth score of each index;
calculating the product of the fourth score of each index and the preset weight value of the corresponding index to obtain the target score of each index;
and determining a plurality of labels matched with the target scores of the indexes from a preset label library, and determining the labels as the labels of the target customers.
In this embodiment, a weight value may be set for each index in advance, and a fourth score of each index is obtained by calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result.
S15, constructing the client image of the target client according to the plurality of labels of the target client, and determining the preference label of the target client according to the basic information of the target client.
In this embodiment, the plurality of tags of the target customer may include: sedentary, morning exercise, late sleep, early morning, etc., a customer representation of the target customer may be constructed from the target customer's plurality of tags.
In this embodiment, the basic information includes other basic information such as the age, sex, height, weight, eating habits, consumption records, and the like of the target client, and the preference tag of the target client may be determined according to the basic information of the target client.
In an alternative embodiment, said building a client representation of said target client from a plurality of tags of said target client comprises:
inputting the plurality of labels into a pre-trained recipe recommendation score model for identification to obtain a recommendation score of each label;
and merging the plurality of labels and the recommendation scores corresponding to each label to obtain the client portrait of the target client.
In this embodiment, different recommendation scores are set for different labels, and a recipe recommendation score model can be trained in advance.
Specifically, the training process of the recipe recommendation score model comprises the following steps:
acquiring a plurality of historical tags and the recommendation score of each historical tag to form a data set;
randomly dividing the data set into a first number of training sets and a second number of test sets;
inputting the training set into a preset convolutional neural network for training to obtain a recipe recommendation scoring model;
inputting the test set into the recipe recommendation scoring model for testing to obtain a test passing rate;
judging whether the test passing rate is greater than a preset passing rate threshold value or not;
when the test passing rate is greater than or equal to the preset passing rate threshold value, finishing the training of the recipe recommendation scoring model; or when the test passing rate is smaller than the preset passing rate threshold, increasing the number of the training sets, and re-training the recipe recommendation scoring model.
In an optional embodiment, the determining the preference tag of the target client according to the basic information of the target client comprises:
extracting multi-dimensional target features from the basic information of the target customer, and classifying the multi-dimensional target features according to a preset classification model to obtain a preference label of the target customer.
In this embodiment, the target features refer to the age, sex, height, weight, eating habits, consumption records, and the like of the target client in the basic information, and the target features are classified according to a clustering algorithm to obtain a preference tag of the target client, specifically, the preference tag may include: preference for acid, preference for sweet and habit of eating breakfast, etc.
For example, whether the target customer prefers sour or sweet may be determined for the consumption record of the target customer, and if the consumption record of the target customer mostly contains sweet food, the target customer prefers sweet, and if the breakfast of the target customer has a breakfast consumption record every day, the target customer is determined to be used to eat breakfast.
And S16, determining at least one target recommended recipe from a preset recipe database according to the client image, the preference label and the current time information of the target client.
In this embodiment, the current time information includes a season recommended by the recipe and a recommended recipe type, and specifically, the recommended recipe type includes: breakfast recipes, Chinese meal recipes, dinner recipes, and night recipes.
In an optional embodiment, the determining at least one target recommended recipe from a preset recipe database according to the client image, the preference tag and the current time information of the target client comprises:
converting the current time information into a recipe recommendation label according to a preset conversion rule;
matching a plurality of first recommended recipes corresponding to the recipe recommended labels from a preset recipe database;
calculating the similarity between the client image of the target client and each first recommended recipe, and selecting a plurality of first recommended recipes with high similarity from the calculated similarity as a plurality of second recommended recipes;
and matching at least one target recommended recipe corresponding to the preference label from the second recommended recipes.
In this embodiment, a conversion rule may be preset, specifically, the preset conversion rule is set according to time information, for example, the current time information is: "6 am 8/5/1998", the current time information is converted into a recipe recommendation label according to a preset conversion rule: summer and breakfast.
In this embodiment, because the influence of seasons and dining times on the body is large, a plurality of first recommended recipes corresponding to the recipe recommendation tags may be matched from a preset recipe database, then, by calculating the similarity between the client image of the target client and each first recipe, specifically, the similarity may adopt a cosine similarity calculation method, and finally, according to the preference tag of the target client, at least one target recommended recipe may be determined from a plurality of second recommended recipes.
In the embodiment, at least one target recommendation recipe is determined by considering a plurality of dimensions such as current time information, the current body state, the historical body state and the diet preference of the target client, so that the recommendation accuracy and the rationality of the recipe recommendation are improved, and the satisfaction degree of the target client is improved by considering the dimensions of the diet preference of the target client.
In summary, according to the recipe recommendation method based on the smart band in this embodiment, on one hand, at least one target recommended recipe is determined from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information, and the at least one target recommended recipe is determined by considering a plurality of dimensions such as the current time information, the current body state of the target client, the historical body state, the diet preference and the like, so that the recommendation accuracy and rationality of recipe recommendation are improved, and meanwhile, the satisfaction of the target client is improved by considering the dimensions of the diet preference of the target client; on the other hand, according to the first analysis result of the target client and the second analysis result of the target client, a plurality of labels of the target client are determined, the first score of each index calculated according to the current data and the third score calculated according to the historical data are averaged, and the current body state and the historical body state of the target client are considered, so that the target score of the recipe recommendation is obtained, the accuracy of the target score is improved, and the accuracy of the subsequent recipe recommendation is improved; and finally, a grading threshold range is set for each index in advance, whether the calculated second grade is in the grading threshold range or not is judged, and after the second grade with larger deviation is deleted according to the judgment result, the remaining second grades are averaged to obtain a second analysis result of the target client, so that the accuracy of the second analysis result is improved.
Example two
Fig. 2 is a structural diagram of a recipe recommendation device based on a smart band according to a second embodiment of the present invention.
In some embodiments, the smart band-based recipe recommendation device 20 may include a plurality of functional modules composed of program code segments. Program code of various program segments in the smart band-based recipe recommendation device 20 may be stored in a memory of the electronic device and executed by the at least one processor to perform (see detailed description of fig. 1) functions of the smart band-based recipe recommendation.
In this embodiment, the recipe recommendation device 20 based on the smart band may be divided into a plurality of functional modules according to the functions executed by the device. The functional module may include: the system comprises an acquisition module 201, an acquisition module 202, an analysis module 203, a first determination module 204, a construction module 205 and a second determination module 206. The module referred to herein is a series of computer readable instruction segments stored in a memory that can be executed by at least one processor and that can perform a fixed function. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The obtaining module 201 is configured to analyze the received recipe recommendation request, and obtain basic information of the target client, the smart band identification code, and current time information.
In this embodiment, when a client needs recipe recommendation, a recipe recommendation request is initiated to a server through a client, specifically, the client may be a smart phone, an IPAD, or other intelligent devices, the server may be a recipe recommendation subsystem, and in a recipe recommendation process, for example, the client may send the recipe recommendation request to the recipe recommendation subsystem, and the recipe recommendation subsystem is configured to receive the recipe recommendation request sent by the client.
In this embodiment, the smart band identification code is used to uniquely identify the identity of the wearable device of the target customer.
The acquisition module 202 is used for acquiring first data of a plurality of indexes in the smart band corresponding to the smart band identification code, and acquiring second data of the plurality of indexes from the historical record of the smart band.
In this embodiment, mainly built-in acceleration sensor, gyroscope, photoelectric sensor etc. in the intelligent bracelet, the intelligent bracelet can gather in real time the data value of a plurality of indexs of target customer, specifically, the index can include: sleep index, basic energy consumption index, exercise index and the like.
In an optional real-time example, the acquiring module 202 acquires second data of a plurality of indexes from the history of the smart band includes:
acquiring the index attribute of each index, and determining a preset time period threshold value of the corresponding index from a preset index library according to the index attribute of each index;
and acquiring second data within a preset time period threshold corresponding to each index from the historical record of the intelligent bracelet.
In this embodiment, the index attribute is used to represent a weight influence of each index on the recommended recipe, and a preset time period threshold for obtaining the second data of each index is determined according to the weight influence of each index on the recommended recipe, for example, for a sports index, since the weight influence of sports on the recipe recommendation is large, a corresponding preset time period threshold is determined to be longer, generally 1 month, and data corresponding to a one-month sports index is obtained as the second data of the sports index.
In this embodiment, different preset time period thresholds are set for different indexes, so that the reasonability of the acquired second data of the multiple indexes is ensured.
The analysis module 203 is configured to analyze the first data of the multiple indexes to determine a first analysis result of the target customer, and analyze the second data of the multiple indexes to determine a second analysis result of the target customer.
In this embodiment, the first analysis result includes current index scores of a plurality of indexes of the target customer, and the second analysis result includes historical index scores of a plurality of indexes of the target customer.
In an optional embodiment, the analyzing module 203 analyzes the first data of the plurality of indexes, and determining the first analysis result of the target customer includes:
classifying the first data of the multiple indexes to obtain first subdata of each index;
performing trend analysis on the first subdata of each index to obtain a third analysis result;
determining a target scoring function matched with the third analysis result from the preset function library;
analyzing the first subdata of each index, determining a plurality of operation parameter values of the target scoring function, substituting the operation parameter values into the target scoring function for calculation to obtain a first score of each index, and determining the first score of each index as a first analysis result of the target customer.
In this embodiment, different indexes correspond to different scoring rules, and the overall trend of different indexes can be determined by analyzing the first subdata of each index according to different scoring rules, where the overall trend is different and the corresponding preset scoring functions are also different.
Illustratively, a scoring rule is set for the exercise indexes, and the trend analysis is performed on the first sub-data of each index according to the scoring rule to obtain a third analysis result, specifically, 3 exercise time critical points are set in the exercise process: x is the number of1,x2,x3Wherein x is1Represents the minimum number of motion steps, x2Representing a reasonable number of steps in the movement, x3Representing the highest exercise step number, and the scoring rule is as follows: if x < x1If the number of the exercise steps does not reach the minimum standard, the exercise is basically invalid, and the exercise score is close to 0 point; if x1≤x<x2The exercise score increases continuously with the increase of the number of exercise steps; x is the number of2≤x<x3The score increases and slows down with the increase of the number of the steps; x is the number of3X, the increase of the number of the movement steps does not cause too large influence on the score any more, and the movement score is close to 100.
If the number x of the motion steps of the target client is 20000 steps, x is satisfied1≤x<x2And then the third analysis result is: and matching a target scoring function from a preset function library according to the third analysis result as the exercise score is continuously increased along with the increase of the exercise step number: the sigmoid function is:wherein the content of the first and second substances,according to the step frequency in the first subdata of the motion index, the fast walking time is 6 hours, x1=3300,x3=57600,x230450, a first score of the athletic metric is calculated as: score 76, and score 76 is used as the first index of motionAnd (6) analyzing the result.
In an optional embodiment, the analyzing module 203 analyzes the second data of the plurality of indexes, and determining the second analysis result of the target customer includes:
classifying the second data of the multiple indexes to obtain second subdata of each index;
dividing the second data of each index according to a preset period to obtain a plurality of third subdata;
performing trend analysis on each third subdata to obtain a fourth analysis result of each third subdata;
determining a target scoring function matched with the fourth analysis result of each third subdata from a preset function library;
analyzing each third subdata, determining a plurality of operation parameter values of the corresponding target scoring function, substituting the operation parameter values into the corresponding target scoring function for calculation, and obtaining a second score of each third subdata;
identifying whether the second score of each third subdata meets the score threshold range of the corresponding index;
and when the second score of each third subdata meets the score threshold range of the corresponding index, reserving the second score of the corresponding third subdata, averaging the reserved second scores of the plurality of third subdata to obtain the third score of each index, and determining the third scores of the plurality of indexes as the second analysis result of the target client.
Further, when the second score of each third subdata does not meet the score threshold range of the corresponding index, deleting the second score of the corresponding third subdata, averaging the second scores of the remaining third subdata meeting the score threshold range of the corresponding index to obtain a third score of each index, and determining the third scores of the multiple indexes as a second analysis result of the target client.
In this embodiment, a division period may be preset, and specifically, if second data corresponding to a one-month motion index is obtained, the preset division period may be preset to divide the second data every day to obtain third sub-data of each day corresponding to the index, and calculate a second score of the third sub-data of each day.
In this embodiment, a scoring threshold range is set for each index in advance, whether the calculated second score is within the scoring threshold range is determined, and after the second score with a large deviation is deleted according to the determination result, the remaining second scores are averaged to obtain the second analysis result of the target client, so that the accuracy of the second analysis result is improved.
A first determining module 204, configured to determine a plurality of tags of the target customer according to the first analysis result of the target customer and the second analysis result of the target customer.
In this embodiment, the label is determined based on the analysis results of the plurality of indices.
In an alternative embodiment, the determining the plurality of tags of the target customer by the first determining module 204 according to the first analysis result of the target customer and the second analysis result of the target customer includes:
calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result to obtain a fourth score of each index;
calculating the product of the fourth score of each index and the preset weight value of the corresponding index to obtain the target score of each index;
and determining a plurality of labels matched with the target scores of the indexes from a preset label library, and determining the labels as the labels of the target customers.
In this embodiment, a weight value may be set for each index in advance, and a fourth score of each index is obtained by calculating an average value of a first score of each index in the first analysis result and a third score of a corresponding index in the second analysis result.
A construction module 205, configured to construct a client representation of the target client according to the plurality of tags of the target client, and determine a preference tag of the target client according to the basic information of the target client.
In this embodiment, the plurality of tags of the target customer may include: sedentary, morning exercise, late sleep, early morning, etc., a customer representation of the target customer may be constructed from the target customer's plurality of tags.
In this embodiment, the basic information includes other basic information such as the age, sex, height, weight, eating habits, consumption records, and the like of the target client, and the preference tag of the target client may be determined according to the basic information of the target client.
In an alternative embodiment, the building module 205 building a customer representation of the target customer based on the plurality of tags of the target customer comprises:
inputting the plurality of labels into a pre-trained recipe recommendation score model for identification to obtain a recommendation score of each label;
and merging the plurality of labels and the recommendation scores corresponding to each label to obtain the client portrait of the target client.
In this embodiment, different recommendation scores are set for different labels, and a recipe recommendation score model can be trained in advance.
Specifically, the training process of the recipe recommendation score model comprises the following steps:
acquiring a plurality of historical tags and the recommendation score of each historical tag to form a data set;
randomly dividing the data set into a first number of training sets and a second number of test sets;
inputting the training set into a preset convolutional neural network for training to obtain a recipe recommendation scoring model;
inputting the test set into the recipe recommendation scoring model for testing to obtain a test passing rate;
judging whether the test passing rate is greater than a preset passing rate threshold value or not;
when the test passing rate is greater than or equal to the preset passing rate threshold value, finishing the training of the recipe recommendation scoring model; or when the test passing rate is smaller than the preset passing rate threshold, increasing the number of the training sets, and re-training the recipe recommendation scoring model.
In an alternative embodiment, the building module 205 determining the preference tag of the target customer according to the basic information of the target customer comprises:
extracting multi-dimensional target features from the basic information of the target customer, and classifying the multi-dimensional target features according to a preset classification model to obtain a preference label of the target customer.
In this embodiment, the target features refer to the age, sex, height, weight, eating habits, consumption records, and the like of the target client in the basic information, and the target features are classified according to a clustering algorithm to obtain a preference tag of the target client, specifically, the preference tag may include: preference for acid, preference for sweet and habit of eating breakfast, etc.
For example, whether the target customer prefers sour or sweet may be determined for the consumption record of the target customer, and if the consumption record of the target customer mostly contains sweet food, the target customer prefers sweet, and if the breakfast of the target customer has a breakfast consumption record every day, the target customer is determined to be used to eat breakfast.
And a second determining module 206, configured to determine at least one target recommended recipe from a preset recipe database according to the client image, the preference tag, and the current time information of the target client.
In this embodiment, the current time information includes a season recommended by the recipe and a recommended recipe type, and specifically, the recommended recipe type includes: breakfast recipes, Chinese meal recipes, dinner recipes, and night recipes.
In an optional embodiment, the second determining module 206 determines at least one target recommended recipe from a preset recipe database according to the client image, the preference tag and the current time information of the target client, including:
converting the current time information into a recipe recommendation label according to a preset conversion rule;
matching a plurality of first recommended recipes corresponding to the recipe recommended labels from a preset recipe database;
calculating the similarity between the client image of the target client and each first recommended recipe, and selecting a plurality of first recommended recipes with high similarity from the calculated similarity as a plurality of second recommended recipes;
and matching at least one target recommended recipe corresponding to the preference label from the second recommended recipes.
In this embodiment, a conversion rule may be preset, specifically, the preset conversion rule is set according to time information, for example, the current time information is: "6 am 8/5/1998", the current time information is converted into a recipe recommendation label according to a preset conversion rule: summer and breakfast.
In this embodiment, because the influence of seasons and dining times on the body is large, a plurality of first recommended recipes corresponding to the recipe recommendation tags may be matched from a preset recipe database, then, by calculating the similarity between the client image of the target client and each first recipe, specifically, the similarity may adopt a cosine similarity calculation method, and finally, according to the preference tag of the target client, at least one target recommended recipe may be determined from a plurality of second recommended recipes.
In the embodiment, at least one target recommendation recipe is determined by considering a plurality of dimensions such as current time information, the current body state, the historical body state and the diet preference of the target client, so that the recommendation accuracy and the rationality of the recipe recommendation are improved, and the satisfaction degree of the target client is improved by considering the dimensions of the diet preference of the target client.
In summary, in the recipe recommendation device based on the smart band according to the embodiment, on one hand, at least one target recommended recipe is determined from a preset recipe database according to the client portrait of the target client, the preference tag and the current time information, and the at least one target recommended recipe is determined by considering a plurality of dimensions such as the current time information, the current body state of the target client, the historical body state, the diet preference and the like, so that the recommendation accuracy and rationality of recipe recommendation are improved, and meanwhile, the satisfaction of the target client is improved by considering the dimensions of the diet preference of the target client; on the other hand, according to the first analysis result of the target client and the second analysis result of the target client, a plurality of labels of the target client are determined, the first score of each index calculated according to the current data and the third score calculated according to the historical data are averaged, and the current body state and the historical body state of the target client are considered, so that the target score of the recipe recommendation is obtained, the accuracy of the target score is improved, and the accuracy of the subsequent recipe recommendation is improved; and finally, a grading threshold range is set for each index in advance, whether the calculated second grade is in the grading threshold range or not is judged, and after the second grade with larger deviation is deleted according to the judgment result, the remaining second grades are averaged to obtain a second analysis result of the target client, so that the accuracy of the second analysis result is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. In the preferred embodiment of the present invention, the electronic device 3 comprises a memory 31, at least one processor 32, at least one communication bus 33 and a transceiver 34.
It will be appreciated by those skilled in the art that the configuration of the electronic device shown in fig. 3 does not constitute a limitation of the embodiment of the present invention, and may be a bus-type configuration or a star-type configuration, and the electronic device 3 may include more or less other hardware or software than those shown, or a different arrangement of components.
In some embodiments, the electronic device 3 is an electronic device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The electronic device 3 may also include a client device, which includes, but is not limited to, any electronic product that can interact with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, and the like.
It should be noted that the electronic device 3 is only an example, and other existing or future electronic products, such as those that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
In some embodiments, the memory 31 is used for storing program codes and various data, such as the smart band-based recipe recommending apparatus 20 installed in the electronic device 3, and realizes high-speed and automatic access to programs or data during the operation of the electronic device 3. The Memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an electronically Erasable rewritable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only disk (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer capable of carrying or storing data.
In some embodiments, the at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The at least one processor 32 is a Control Unit (Control Unit) of the electronic device 3, connects various components of the electronic device 3 by using various interfaces and lines, and executes various functions and processes data of the electronic device 3 by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31.
In some embodiments, the at least one communication bus 33 is arranged to enable connection communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the electronic device 3 may further include a power supply (such as a battery) for supplying power to each component, and optionally, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, an electronic device, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present invention.
In a further embodiment, in conjunction with fig. 2, the at least one processor 32 may execute an operating device of the electronic device 3 and various installed applications (such as the smart band-based recipe recommendation device 20), program codes, and the like, for example, the above modules.
The memory 31 has program code stored therein, and the at least one processor 32 can call the program code stored in the memory 31 to perform related functions. For example, the modules illustrated in fig. 2 are program codes stored in the memory 31 and executed by the at least one processor 32, so as to implement the functions of the modules for the purpose of recipe recommendation based on the smart band.
Illustratively, the program code may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 32 to accomplish the present application. The one or more modules/units may be a series of computer readable instruction segments capable of performing certain functions, which are used for describing the execution process of the program code in the electronic device 3. For example, the program code may be partitioned into an acquisition module 201, an acquisition module 202, an analysis module 203, a first determination module 204, a construction module 205, and a second determination module 206.
In one embodiment of the present invention, the memory 31 stores a plurality of computer readable instructions that are executed by the at least one processor 32 to implement the functionality of smart band-based recipe recommendation.
Specifically, the at least one processor 32 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, and details are not repeated here.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the present invention may also be implemented by one unit or means through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.