Food material purchase list generation method and device, equipment and storage medium
By combining the smart refrigerator's food inventory, historical statistics, and sales point details to generate a food purchase list, the problem of inaccurate shopping suggestions in existing technologies is solved, resulting in a more efficient and convenient shopping experience.
Patent Information
- Application Number
- CN202411361835.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-03-27
AI Technical Summary
Existing smart refrigerators mainly focus on simple recommendations based on users' historical purchases and consumption patterns, which cannot meet users' actual needs, resulting in inaccurate and inconvenient shopping lists.
By combining current food inventory information, historical statistics of various food items, and detailed information on food purchase points, a food purchase list is generated, including the types of food items to be purchased and recommended sales points. The food list prediction model is then used for prediction and adjustment.
The generated grocery shopping list better meets user needs, improves purchasing efficiency and convenience, avoids duplicate or missed purchases, and enhances the user's shopping experience.
Smart Images

Figure CN121745820A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, device, and storage medium for generating a food purchase list. Background Technology
[0002] With the continuous development of technology, smart home devices are becoming increasingly popular. Smart refrigerators, as an important component, offer not only basic refrigeration and freezing functions but also intelligent features such as food management and shopping suggestions. However, current smart refrigerators primarily rely on simple recommendations based on users' historical purchase and consumption patterns, resulting in shopping lists that are far from meeting users' actual needs. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for generating a food purchase list. The food purchase list, which combines current food inventory information, historical statistical information of various food items, and food details of each food item at the purchase point, better meets the needs of users and makes it easier for users to make purchases, thereby improving the efficiency of user procurement and the convenience of life.
[0004] In a first aspect, embodiments of this application provide a method for generating a food purchase list, which involves obtaining current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points for a target user, wherein the detailed information of each food item includes food details for each of the aforementioned food items; and generating a food purchase list based on the current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points, wherein the food purchase list includes multiple food items to be purchased, and each of the food items to be purchased belongs to one of the multiple food items.
[0005] Secondly, embodiments of this application provide a food purchase list generation device, including an information acquisition module and a list generation module. The information acquisition module is used to acquire current food inventory information corresponding to a target user, historical statistical information of multiple food items, and detailed information of multiple food sales points, wherein the detailed information of each food item includes food details for each of the aforementioned food items. The list generation module is used to generate a food purchase list based on the current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points, wherein the food purchase list includes multiple food items to be purchased, and each of the food items to be purchased belongs to one of the multiple food items.
[0006] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the above-described method.
[0008] The method, apparatus, device, and computer-readable storage medium for generating a food purchase list provided in this application embodiment include: obtaining current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points corresponding to a target user, wherein the detailed information of each food sales point includes food details for each of the aforementioned food items; generating a food purchase list based on the current food inventory information, the historical statistical information of multiple food items, and the detailed information of multiple food sales points, wherein the food purchase list includes multiple food items to be purchased, and each of the food items to be purchased belongs to one of the multiple food items. Since the historical statistical information of multiple food items reflects the user's food usage habits, the food purchase list determined by combining the current food inventory information, the historical statistical information of multiple food items, and the food details of each food item at the food sales points better meets the user's needs and makes it easier for the user to make purchases, improving the user's purchasing efficiency and convenience. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 The illustration shows a flowchart of a method for generating a food purchase list according to an embodiment of this application.
[0011] Figure 2 It shows Figure 1 A flowchart of step S120.
[0012] Figure 3 It shows Figure 2 A flowchart illustrating step S122.
[0013] Figure 4 A flowchart illustrating a method for generating a food purchase list according to another embodiment of this application is shown.
[0014] Figure 5 This illustration shows a flowchart of a method for generating a food purchase list according to another embodiment of this application.
[0015] Figure 6 This illustration shows a flowchart of a method for generating a food purchase list according to another embodiment of this application.
[0016] Figure 7 The diagram illustrates an application scenario of the method for generating a food purchase list on the server in this application.
[0017] Figure 8 A block diagram of a server provided in an embodiment of this application is shown.
[0018] Figure 9 The diagram shows a block diagram of a food purchase list generation device provided in an embodiment of this application.
[0019] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0020] Figure 11 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of this application is shown. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0022] Please see Figure 1 , Figure 1 A schematic flowchart of a method for generating a food purchase list according to an embodiment of this application is shown. The method for generating the food purchase list can be applied to an electronic device, which may be a server, a terminal device, or a food storage device.
[0023] In some embodiments, the server may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0024] Terminal devices can be smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, etc., but are not limited to these.
[0025] Food storage equipment can be categorized into ambient temperature food storage equipment and low-temperature food storage equipment. Ambient temperature food storage equipment stores food at room temperature, typically containing ingredients that can be preserved at room temperature for extended periods. Examples of ambient temperature food storage equipment include grain storage equipment and edible oil storage equipment, such as rice containers or flour containers with built-in processors and communication chips. Low-temperature food storage equipment stores food at temperatures below room temperature, typically containing ingredients that are easily perishable at room temperature. Examples of low-temperature food storage equipment include refrigerators and freezers.
[0026] The method for generating the food purchase list may specifically include the following steps S110 to S120.
[0027] Step S110: Obtain the current food inventory information, historical statistical information of various food ingredients, and detailed information of multiple food ingredient sales points corresponding to the target user. The detailed information of the food ingredient sales points includes the food details of each of the food ingredients.
[0028] The target user refers to any user who needs to purchase ingredients. The current ingredient inventory information can be collected by the ingredient storage device. The ingredient inventory information can include information about the ingredients stored in the ingredient storage device, such as the type of ingredients, quantity of ingredients, or weight of ingredients.
[0029] Accordingly, the current food inventory information for the target user can be obtained by acquiring the current food inventory information collected by the food storage device associated with the target user, or by receiving the current food inventory information input by the target user through terminal devices, food storage devices, etc.
[0030] Historical statistics for various food ingredients may include one or more of the following: total number of purchases, purchase frequency, total number of uses, and usage frequency.
[0031] Historical statistics on various food ingredients are obtained by compiling historical food ingredient purchase information or historical food ingredient inventory information corresponding to multiple historical time points.
[0032] In one possible implementation, the historical statistical information of various ingredients is obtained by statistically analyzing historical ingredient purchase information corresponding to multiple historical time points.
[0033] For example, if the target user's historical purchase information at multiple points in time is as follows: At the first historical point in time, they purchased ingredients A, B, C, and D; at the second historical point in time, they purchased ingredients B, C, D, and E; at the third historical point in time, they purchased ingredients A, B, D, and F; at the fourth historical point in time, they purchased ingredients B, D, F, and G; and at the fifth historical point in time, the food storage device contains ingredients A, B, H, and J. By statistically analyzing the food purchase information at these multiple historical points in time, we can obtain the following historical purchase counts: 3 for ingredient A, 5 for ingredient B, 2 for ingredient C, 4 for ingredient D, 1 for ingredient E, 2 for ingredient F, 1 for ingredient G, 1 for ingredient H, and 1 for ingredient J.
[0034] In another possible implementation, obtaining historical statistical information on multiple ingredients corresponding to the target user can also involve obtaining historical ingredient inventory information collected by the ingredient storage device corresponding to the target user at multiple historical time points, and statistically analyzing the historical ingredient inventory information at multiple historical time points to obtain historical statistical information on multiple ingredients; alternatively, it can involve obtaining historical statistical information on multiple ingredients compiled by the ingredient storage device corresponding to the target user.
[0035] Among them, the food storage device can record the food in the food storage device when a change is detected, mark the newly added food, and obtain historical food inventory information and the corresponding historical time.
[0036] By statistically analyzing historical food inventory information corresponding to multiple historical time points, we can obtain historical information on various foods, such as the number of times they were used and purchased. Historical information can also include the frequency of use and the frequency of purchase.
[0037] For example, at the first historical time point, the food storage device stores food A (newly added), food B (newly added), food C (newly added), food D (newly added), and food F (newly added); at the second historical time point, the food storage device stores food C, food E (newly added), food G (newly added), and food H (newly added); at the third historical time point, the food storage device stores food A (newly added), food B (newly added), food D (newly added), and food F (newly added); at the fourth historical time point, the food storage device stores food B (newly added), food D, and food G (newly added); and at the fifth historical time point, the food storage device stores food A (newly added), food C (newly added), food D, food H (newly added), and food J (newly added). It should be understood that if a food item stored at a historical time point does not exist at the next moment of that historical time, it indicates that the food item has been used. By statistically analyzing the historical food information corresponding to the above-mentioned historical time points, we can obtain the following results: Food A has been used 3 times and purchased 3 times; Food B has been used 3 times and purchased 3 times; Food C has been used 2 times and purchased 2 times; Food D has been used 1 time and purchased 2 times; Food E has been used 1 time and purchased 1 time; Food F has been used 2 times and purchased 2 times; Food G has been used 2 times and purchased 2 times; Food H has been used 1 time and purchased 2 times; and Food J has been used 0 times and purchased 1 time.
[0038] A food sales point refers to a store or supermarket that sells food ingredients. The details of a food sales point can include the details of the food ingredients it sells, the distance between the food sales point and the food storage equipment, and the distance between the food sales point and the user. The details of the food ingredients sold at the food sales point can include one or more of the following: the freshness of the food, the amount of food remaining, and the price of the food.
[0039] Accordingly, obtaining detailed information about food sales points can include obtaining detailed information from the e-commerce platforms or websites corresponding to the food sales points, obtaining detailed information through the application programming interfaces (APIs) of the food sales points, or obtaining detailed information through dedicated applications, such as food delivery platforms.
[0040] The aforementioned multiple food sales points can be multiple food sales points within a preset distance range from the food storage equipment, or multiple food sales points within a preset distance range from the user (the user's terminal device). The preset distance range can be 1 kilometer, 3 kilometers, or 5 kilometers, etc.
[0041] Step S120: Generate an ingredient purchase list based on the current ingredient inventory information, historical statistical information of multiple ingredients, and detailed information of multiple ingredient sales points. The ingredient purchase list includes multiple ingredients to be purchased, and each ingredient to be purchased belongs to one of the multiple ingredients.
[0042] The ingredients to be purchased in the ingredient purchase list are the ingredients recommended for users to buy. The ingredient purchase list may also include at least one ingredient sales point, which is the ingredient sales point that users are recommended to go to to buy ingredients.
[0043] In one possible implementation, step S130 may generate multiple candidate ingredients based on historical statistical information of multiple ingredients and detailed information of multiple ingredient sales points, and generate an ingredient purchase list based on multiple candidate ingredients and current ingredient inventory information.
[0044] For example, ingredients with a historical usage count or purchase count greater than a preset number can be selected from the historical statistical information of various ingredients as reference ingredients, such as 2 times. Then, for each reference ingredient, an ingredient score is obtained based on the ingredient details of each ingredient sales point. Reference ingredients with ingredient scores ranked at the top preset threshold (e.g., top 5, top 6, or top 4) are selected as candidate ingredients. From the candidate ingredients, other candidate ingredients besides those included in the current ingredient inventory information are selected to generate an ingredient purchase list.
[0045] In another implementation, a food purchase list is predicted using a food inventory prediction model based on current food inventory information, historical statistical information of various foods, and detailed information of multiple food sales points.
[0046] In this implementation, the ingredient list prediction model can be trained based on multiple training samples, each training sample corresponding to an ingredient list label. The specific training process of the ingredient purchase list prediction model is as follows: the feature extraction network in the ingredient purchase list prediction model extracts features from the training samples to obtain sample features; the classification network in the ingredient purchase list prediction model classifies based on the sample features to obtain the predicted ingredient list corresponding to the training sample; a loss value is obtained based on the predicted ingredient list and ingredient list label of the training sample; and the model parameters of the ingredient purchase list prediction model are adjusted based on the loss value. The neural network used in the ingredient purchase list prediction model can be, but is not limited to, ResNet (Residual Network), VGG (Visual Geometry Group Network), Inception (Inception Convolutional Neural Network), etc.
[0047] The above method of obtaining the ingredient purchase list is only illustrative; there are many other ways to obtain it, which will not be elaborated here.
[0048] By employing the method described in this application, after obtaining the target user's current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points, when generating a food purchase list based on the current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points, the food purchase list determined by combining the current food inventory information, historical statistical information of multiple food items, and detailed information of each food item at the food sales points better meets the user's needs, facilitates the user's purchasing, and improves the user's purchasing efficiency and convenience.
[0049] Please see Figure 3 As shown, in one possible implementation, step S120 includes steps S121-S124.
[0050] Step S121: If it is determined that ingredients need to be purchased, multiple candidate ingredients are determined from the multiple ingredients based on the current ingredient database information and the historical statistical information of multiple ingredients.
[0051] There are several ways to determine whether or not you need to buy ingredients.
[0052] In one possible implementation, it can be determined whether the time elapsed between the last time ingredients were purchased and the current time is greater than a preset time. If it is, then it is determined that ingredients need to be purchased. The preset time can be 3 days, 5 days, or a week, etc., and can be set according to actual needs. For example, it can be determined based on the average shelf life of ingredients.
[0053] In another possible implementation, if the current food inventory information indicates the weight of the food currently stored in the food storage device, it can be determined whether the weight of the currently stored food is less than a preset weight. If it is less, it is determined that food needs to be purchased. The preset weight can be 1 kg, 2 kg, or 5 kg, etc., and can be set according to historical food usage, such as based on the average food usage per day or per meal.
[0054] In another possible implementation, if the current food inventory information indicates the types of food currently stored in the food storage device, it can be determined whether the current number of food types in stock is less than a preset quantity. If the current number of food types in stock is less than the preset quantity, it is determined that food needs to be purchased. The aforementioned quantity can be 2, 3, or 4, and can be set according to the types of food needed for one day, one meal, or two days.
[0055] In another possible implementation, the need to purchase ingredients can be determined when any of the conditions in the foregoing embodiments are met, to ensure that the ingredients stored in the food storage device are sufficient for the user's use.
[0056] By generating a food purchase list only after determining that food needs to be purchased, the problem of wasting computing resources by performing subsequent calculations when food storage devices have sufficient food can be avoided.
[0057] Among them, the historical statistical information of various ingredients can include the historical purchase frequency or historical usage frequency of various ingredients. The current ingredient inventory information can indicate the types of ingredients stored in the ingredient storage equipment. The current ingredient inventory information can also indicate the quantity of ingredients stored in the ingredient storage equipment.
[0058] In one possible implementation, step S121 may involve selecting a target ingredient from a variety of ingredients whose historical purchase frequency or historical usage frequency exceeds a preset number of times (frequency). This target ingredient is not an ingredient stored in the ingredient storage device. By adopting the above method, it can be ensured that frequently used ingredients have sufficient inventory.
[0059] In another possible implementation, step S121 may also be to determine whether there is a specified ingredient in the current ingredient inventory information that has a historical purchase frequency or historical usage frequency greater than a preset number of times (frequency) and a quantity less than a preset quantity value, based on the historical purchase frequency or historical usage frequency of multiple ingredients. Candidate ingredients are obtained based on the historical purchase frequency or historical usage frequency of multiple ingredients and the specified ingredient, wherein the candidate ingredients include the specified ingredient.
[0060] By adopting the above methods, it can be ensured that even frequently used ingredients with low current inventory can be replenished in a timely manner.
[0061] Step S122: Determine the comprehensive score of the candidate ingredients based on the sales details of the candidate ingredients at multiple ingredient purchase points.
[0062] The details of food items for sale may include one or more of the following: freshness, price, remaining quantity, and shelf life. Different food vendors may offer different information regarding freshness, price, and remaining quantity for different ingredients.
[0063] Considering that users might choose other ingredients when the ingredients are not fresh or the price is too high, and that they might not be able to buy the ingredients when the remaining quantity is too low, in order to ensure that the ingredients in the generated ingredient purchase list are the ingredients that users would actually buy, in one implementation, if the ingredient details include the remaining quantity of the ingredients, the freshness of the ingredients, and the price of the ingredients; the above step S122 may include steps S122a, S122b, and S122c.
[0064] Step S122a: Determine the scores corresponding to the remaining quantity of the candidate ingredients at the ingredient sales point, the freshness of the ingredients, and the price of the ingredients.
[0065] Among them, for each type of ingredient, the score corresponding to the remaining quantity sold is different, the score corresponding to the freshness of the ingredient is different, and the score corresponding to the price of the ingredient is also different.
[0066] For example, when lettuce is included as a candidate ingredient, the score1 for the remaining quantity of lettuce sold for different ingredients is as follows: 10 points for 0-1 kg, 30 points for 1-3 kg, 60 points for 3-10 kg, and 100 points for more than 10 kg; the score2 for different freshness of ingredients is = freshness × 100, where freshness is between 0 and 1; the score3 for different prices of ingredients is = 100 - (current price - reference price) × a, where a is a value greater than 1, which can be 20, 30 or 50.
[0067] Different ingredient listings have different ratings, which can be set according to the user's actual needs. For example, if the user is more concerned about cost-effectiveness, the rating corresponding to the ingredient price can be given a higher weight; if the user is more concerned about the ingredient freshness, the rating corresponding to the ingredient freshness can be given a higher weight.
[0068] Step S122b: The scores corresponding to the remaining quantity of the candidate ingredients at the ingredient sales point, the freshness of the ingredients, and the price of the ingredients are weighted and summed to obtain the score of the ingredient purchase point for the candidate ingredients.
[0069] For example, a food sales point (e.g., food sales point A) may assign a score A to a candidate food ingredient (e.g., food ingredient A) as follows: score A = score1A × W1 + score2A × W2 + score3A × W3, where score1A is the score corresponding to the remaining quantity of food ingredient A, score2A is the score corresponding to the freshness of food ingredient A, score3A is the score corresponding to the price of food ingredient A, W1 is the weight of the score corresponding to the remaining quantity of food ingredient A, W2 is the weight of the score corresponding to the freshness of food ingredient A, and W3 is the weight of the score corresponding to the price of food ingredient A.
[0070] The total weight of the ratings for different ingredient details can be 1.
[0071] Step S122c: Based on the ratings of the candidate ingredients from multiple ingredient purchase points, obtain a comprehensive rating for the candidate ingredients.
[0072] In one possible implementation, the average or median score of the candidate ingredients can be calculated from the scores of multiple ingredient purchase points to obtain a comprehensive score for the candidate ingredients.
[0073] In another possible implementation, the detailed information of the food sales point also includes the distance value corresponding to the food sales point; the above step S122c can also be: determining the weight of the food sales point based on the distance value corresponding to the food sales point; and obtaining the comprehensive score of the candidate food based on the scores of multiple food purchase points for the candidate food and the weight of each food sales point.
[0074] In this implementation, the distance value corresponding to the food vending point can indicate the distance from the food vending point to the food storage equipment, or the distance from the food vending point to the user (e.g., the user's terminal device). The distance value corresponding to the food vending point can be negatively correlated with the weight of the food vending point.
[0075] By setting the distance value corresponding to the food sales point to be negatively correlated with the weight of the food sales point, users can more easily buy food and improve the efficiency of their food purchases.
[0076] For example, if multiple food purchase points include food purchase point A, food purchase point B, and food purchase point C, then the comprehensive score A for food A is: score A = score A × W A + score B A × W B + score C A × W C, where score A is the score given by food purchase point A for candidate food A, W A is the weight of food purchase point A, score B is the score given by food purchase point B for candidate food A, W B is the weight of food purchase point B, score C is the score given by food purchase point C for candidate food A, and W C is the weight of food purchase point C.
[0077] Step S123: Select the N candidate ingredients with the highest comprehensive scores as the ingredients to be purchased, where N is an integer greater than 1.
[0078] Step S124: Generate an ingredient purchase list including the ingredients to be purchased.
[0079] By adopting the above steps S122-S124, it is possible to take into account user habits and the different food sales points for each food item's inventory, freshness, and price, and select cost-effective, user-friendly, and easily accessible food items to form a food purchase list for users to make purchases.
[0080] In one possible implementation, please refer to Figure 4 The ingredient purchase list also includes the target ingredient purchase points, and the method further includes:
[0081] Step S130: Obtain the ingredient purchase point score based on the score given by the ingredient purchase point for each candidate ingredient.
[0082] In one possible implementation, the scores for each candidate ingredient at the ingredient purchase point can be weighted and summed to obtain the ingredient purchase point score.
[0083] In another possible implementation, a weight value can be determined based on the distance corresponding to the food purchase point, and a reference score for the food purchase point can be obtained by weighted summation of the scores for each candidate food item. The reference score is then multiplied by the weight value to obtain the food purchase point score.
[0084] Step S140: Determine the K highest-scoring ingredient purchase points from the ingredient purchase reviews as the target ingredient purchase points, where K is an integer greater than 1.
[0085] Step S124 can also be: generating a food purchase list that includes the target ingredient purchase point and the ingredients to be purchased.
[0086] By employing the above methods, the resulting food purchase list takes into account user habits and the inventory, freshness, and price of each ingredient at different vendors, selecting ingredients that offer high value for money, align with user habits, and are easily accessible. Furthermore, it includes a list of target food purchase points, allowing users to directly visit and purchase from these points, significantly improving purchasing efficiency and convenience. In addition, directly using the food purchase list effectively avoids duplicate or missed purchases due to incomplete memory or information recording.
[0087] Please see Figure 5 As shown, in one possible implementation, step S120 can also be to use a food ingredient list prediction model to predict a food ingredient purchase list based on current food ingredient inventory information, historical statistical information of multiple food ingredients, and detailed information of multiple food ingredient sales points.
[0088] In this implementation, before performing step S120, the method further includes:
[0089] Step S210: Obtain training samples and a sample ingredient purchase list corresponding to the training samples. The training samples include sample ingredient inventory information, historical statistical information of various sample ingredients, and detailed information of multiple sample sales points.
[0090] The above-mentioned method of obtaining training samples and sample ingredient purchase lists can be obtained from a database, which stores historical ingredient purchase details of different users based on ingredients stored in corresponding ingredient storage devices, as well as ingredient purchase details of multiple ingredient sales points at different times.
[0091] For each user in the database, the user's food inventory information at the first moment is obtained as the sample food inventory. The food items in the historical food purchase details generated after the user made a purchase corresponding to the sample food inventory at the first moment are used as the food items in the sample food purchase list. The food items purchased by the user in the historical food purchase details before the first moment are statistically analyzed to obtain historical food statistics information for various sample food items. The food sales points within a preset range from the user at the first moment are determined as sample sales points. In this way, training samples and the corresponding food purchase tags can be obtained.
[0092] Step S220: Use the ingredient list prediction model to extract features from the training samples to obtain sample features.
[0093] The ingredient list prediction model can include a feature extraction network, which is a neural network used to encode features from training samples. Examples include convolutional neural networks, pooling neural networks, or Transformer networks.
[0094] For example, taking the use of convolutional neural networks to extract features from training samples, multiple convolutional layers can be used to extract the features corresponding to the sample food inventory information, the historical statistical information of various sample food ingredients, and the detailed information of various sample sales points. Then, the dimensionality of the features corresponding to the sample food inventory information, the historical statistical information of various sample food ingredients, and the detailed information of various sample sales points is reduced by the pooling layer before being input into the fully connected layer for feature fusion, and finally the sample features are output.
[0095] Step S230: Generate a predicted food purchase list based on the sample features using the food list prediction model.
[0096] Specifically, the classification network in the food ingredient prediction model can be used to predict the probability of purchasing each candidate food ingredient based on sample features. The top K ingredients with the highest probabilities are then selected as the ingredients in the predicted food ingredient purchase list, thus obtaining the predicted food ingredient purchase list.
[0097] Step S240: Obtain the prediction loss based on the predicted food purchase list and the sample food purchase list corresponding to the training sample.
[0098] The predicted loss can be calculated by using the cross-entropy loss function, IoU loss function, weighted cross-entropy loss function, mean squared error loss function, Manhattan distance loss function, and cosine similarity loss function, based on the predicted food purchase list and the sample food purchase list corresponding to the training sample.
[0099] Step S250: Adjust the model parameters of the food ingredient list prediction model based on the predicted loss.
[0100] After obtaining the model loss, the model parameters can be adjusted based on the model loss to minimize it. The training termination condition can be that the number of iterations of the object detection model reaches a preset number, or the model loss is less than a preset loss threshold.
[0101] By employing steps S210-S250 above and utilizing training samples, a food item prediction model is trained. This model can analyze the historical purchase records of different users to capture their preferences and habits. It also learns the inventory cycles of different ingredients to predict when to purchase again, learns price information from different sales points to select more cost-effective sources, and ultimately learns how to integrate inventory information, historical statistics, and sales point information to make purchasing decisions, thereby generating personalized shopping lists for users. The prediction process using the food item prediction model considers the user's historical food purchases and detailed information about nearby food purchase points to generate the most suitable ingredients and purchasing plan for the user.
[0102] In one possible implementation, the method for generating a food purchase list can be applied to a server, which can be associated with multiple terminal devices and corresponding food storage devices for each terminal device. Please refer to [link to relevant documentation]. Figure 6 The method further includes: step S260: sending the food purchase list to the target terminal, wherein the target terminal is the terminal associated with the target user.
[0103] The server can locate the target terminal based on the target user's user identifier and send the food purchase list to the target terminal. The food purchase list can be sent to the target terminal via email, SMS, or push notifications.
[0104] Step S270: Receive feedback information generated by the target terminal based on the food purchase list.
[0105] After receiving the food purchase list, the terminal device can display the food purchase list so that the target user can input feedback information based on the food purchase list. The feedback information may include the target user's rating or evaluation of the food purchase list, and may also include a target purchase list returned based on the food purchase list. The target purchase list may include at least one food item that is different from the food purchase list.
[0106] Step S280: If the feedback information includes a target ingredient list, obtain a recommendation prediction loss based on the target ingredient list and the ingredient purchase list, and adjust the model parameters of the ingredient list prediction model based on the recommendation prediction loss, wherein the target ingredient list is obtained by modifying at least one ingredient in the ingredient purchase list.
[0107] By sending a food purchase list to the target terminal, receiving feedback, and adjusting the food list prediction model, the food list prediction model can gradually adapt to the user's unique needs, thereby further improving the accuracy and personalization of subsequent predictions.
[0108] In another possible implementation, the method further includes: if the feedback information indicates that the food purchase list is inaccurate, using the food list prediction model again based on the current food inventory information, historical statistical information of multiple foods and detailed information of multiple food sales points, to predict a first food purchase list, and sending the first food purchase list to the target terminal.
[0109] By following the steps above, if the target user feedback list is inaccurate, the previous errors can be corrected in a timely manner by regenerating the list, ensuring that the list is closer to the actual needs of the target user, thereby significantly improving the accuracy of the system and user satisfaction.
[0110] Please see Figure 7 The method for generating a food purchase list according to this application is applied to a server, and the server is associated with management devices corresponding to different food sales points, terminal devices of different users, and refrigerators corresponding to each terminal device. The server contains multiple software program modules, such as... Figure 8 As shown, the multiple software program modules include a data acquisition module, a data processing module, a prediction module, and a user interaction module.
[0111] When using a refrigerator to store food, data can be collected through a data acquisition module. Specifically, the refrigerator can collect current food inventory information and upload it to a server through either a camera installed in the refrigerator or manual input by the user. When the refrigerator determines that it needs to purchase food based on the current inventory, it can send a food purchase instruction to the server. Upon receiving the instruction, the server can obtain historical food purchase information of the target user at multiple points in time. It also collects detailed information about food purchase points (e.g., shopping malls) within a preset distance from the refrigerator, including the remaining quantity of each food item, its price, shelf life, and freshness. The target user is the user associated with the refrigerator. For example, the server can be associated with management devices that manage different food purchase points to obtain the food purchase point details stored in those devices.
[0112] The data processing module is responsible for cleaning and organizing the aforementioned collected data, extracting useful information, such as statistically analyzing historical food purchase information at multiple points in time to obtain historical statistical information on various foods (e.g., historical purchase time, purchase or usage frequency, etc.).
[0113] The prediction module utilizes a food inventory prediction model to generate a predicted food purchase list based on current food inventory information, historical statistics of various foods, and details of multiple food sales points. This allows for a comprehensive consideration of the user's purchase history, usage habits, and details of nearby shopping malls, recommending the most suitable foods and purchasing options.
[0114] The user interaction module sends the food purchase list to the target client to present it to the user in a user-friendly manner. Users can view the list via mobile app, webpage, or other channels, and modify and confirm it according to their needs. It can also receive user feedback on the food purchase list, such as evaluations and modifications, to adjust the food purchase list prediction model based on this feedback. This helps the system continuously optimize the food purchase list prediction model. Furthermore, when feedback indicates that the food purchase list is inaccurate, the module can again use the food purchase list prediction model based on current food inventory information, historical statistics of various foods, and details of multiple food sales points to predict a first food purchase list, which is then sent to the target terminal.
[0115] In some implementations, the prediction module can also be directly used to perform the following process: For example, based on historical statistical information of various ingredients, such as sorting various ingredients in descending order of historical purchase frequency, a ranking of ingredients that conforms to user habits is obtained, and various candidate ingredients are selected from them. When it is detected that the amount of ingredients in the refrigerator is too small, the server will obtain the remaining quantity of each candidate ingredient, the price, the shelf life, and the freshness of each ingredient in the surrounding stores. Based on the remaining quantity of each candidate ingredient, the price, the shelf life, and the freshness of each ingredient in the stores, combined with the distance between the stores, a comprehensive score is given to the various candidate ingredients, and they are sorted according to the comprehensive score of each candidate ingredient. Based on the sorting order, a recommended list of ingredients that is most cost-effective and conforms to user habits and preferences is given and actively pushed to the target client.
[0116] By using the above methods, since historical food purchase information reflects users' habits, and based on current food inventory information, historical statistics of various foods, and detailed information of multiple food sales points, when generating a food purchase list, the system takes into account surrounding shopping malls, current food inventory, and user habits, and launches the most cost-effective food purchase list that is convenient for users to purchase and conforms to their habits. This improves users' purchasing efficiency and the convenience of their lives, and avoids duplicate purchases or omissions caused by incomplete user memory and information records.
[0117] Please see Figure 9As shown in the illustration, this application provides a food purchase list generation device 300, which includes an information acquisition module 310 and a list generation module 320. The information acquisition module 310 is used to acquire current food inventory information corresponding to a target user, historical statistical information of multiple food items, and detailed information of multiple food sales points. The detailed information of the food sales points includes food details for each of the aforementioned food items. The list generation module 320 is used to generate a food purchase list based on the current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points. The food purchase list includes multiple food items to be purchased, and each of the food items to be purchased belongs to one of the multiple food items.
[0118] In one possible implementation, the list generation module 310 includes an ingredient selection submodule, a rating determination submodule, an ingredient determination submodule, and a list generation submodule. The ingredient selection submodule is used to determine multiple candidate ingredients from a variety of ingredients based on the current ingredient inventory information and historical statistical information of multiple ingredients when it is determined that ingredients need to be purchased based on the current ingredient inventory information. The rating determination submodule is used to determine the comprehensive rating of the candidate ingredients based on the sales details of the candidate ingredients at multiple ingredient purchase points. The ingredient determination submodule is used to determine the N candidate ingredients with the highest comprehensive rating as the ingredients to be purchased. The list generation submodule is used to generate an ingredient purchase list including the ingredients to be purchased, where N is an integer greater than 1.
[0119] In one possible implementation, the ingredient details include the remaining quantity of ingredients sold, the freshness of ingredients, and the price of ingredients; the scoring determination submodule is further used to determine the scores corresponding to the remaining quantity of ingredients sold, the freshness of ingredients, and the price of ingredients at each ingredient sales point; the scores corresponding to the remaining quantity of ingredients sold, the freshness of ingredients, and the price of ingredients at each ingredient sales point are weighted and summed to obtain the score of the ingredient purchase point for the candidate ingredient; based on the scores of the candidate ingredient from multiple ingredient purchase points, a comprehensive score of the candidate ingredient is obtained.
[0120] In one possible implementation, the detailed information of the food sales point also includes the distance value corresponding to the food sales point; the scoring determination submodule is further used to determine the weight of the food sales point based on the distance value corresponding to the food sales point; and to obtain a comprehensive score of the candidate food based on the scores of multiple food purchase points for the candidate food and the weight of each food sales point.
[0121] In one possible implementation, the food purchase list generation device 300 further includes a purchase point rating acquisition module and a purchase point determination module. The purchase point rating acquisition module obtains a purchase point rating based on the rating of each candidate food item at the purchase point. The purchase point determination module is used to determine the K food purchase points with the highest purchase review scores as target food purchase points, where K is an integer greater than 1. The list generation submodule is also used to generate a food purchase list including the target food purchase points and the food items to be purchased.
[0122] In one possible implementation, the food purchase list generation device 300 further includes a food purchase demand determination module, which is used to determine whether the current number of food inventory types is less than a preset quantity. If the current number of food inventory types is less than the preset quantity, it is determined that food needs to be purchased.
[0123] In one implementation, the list generation module 320 is also used to predict the food purchase list based on the current food inventory information, historical statistical information of multiple food items, and detailed information of multiple food sales points using a food list prediction model.
[0124] In one possible implementation, the ingredient purchase list generation device 300 further includes a list sending module, a feedback information receiving module, and a model adjustment module. The list sending module is used to send the ingredient purchase list to a target terminal, where the target terminal is a terminal associated with the target user. The feedback information receiving module is used to receive feedback information generated by the target terminal based on the ingredient purchase list. The model adjustment module is used to, if the feedback information includes a target ingredient list, obtain a recommendation prediction loss based on the target ingredient list and the ingredient purchase list, and adjust the model parameters of the ingredient list prediction model based on the recommendation prediction loss, wherein the target ingredient list is obtained by modifying at least one ingredient in the ingredient purchase list.
[0125] In one possible implementation, the list generation module 3 is further configured to, when the feedback information indicates that the food purchase list is inaccurate, again utilize the food list prediction model based on current food inventory information, historical statistical information of multiple foods, and detailed information of multiple food sales points to predict a first food purchase list. The list sending module is further configured to send the first food purchase list to the target terminal.
[0126] In one possible implementation, the food purchase list generation device further includes a sample acquisition module, a feature extraction module, a prediction module, a loss acquisition module, and a parameter adjustment module. The sample acquisition module acquires training samples and sample food purchase lists corresponding to the training samples. The training samples include sample food inventory information, historical statistical information of various sample foods, and detailed information of multiple sample sales points. The feature extraction module extracts features from the training samples using a food purchase list prediction model to obtain sample features. The prediction module generates a predicted food purchase list based on the sample features using the food purchase list prediction model. The loss acquisition module obtains a prediction loss based on the predicted food purchase list and the sample food purchase lists corresponding to the training samples. The parameter adjustment module adjusts the model parameters of the food purchase list prediction model based on the prediction loss.
[0127] In one possible implementation, the information acquisition module is also used to statistically analyze historical food inventory information corresponding to multiple historical time points to obtain historical statistical information on various food ingredients.
[0128] Each module in the aforementioned ingredient purchase list generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module. It should be noted that the device embodiments in this application correspond to the aforementioned method embodiments; the specific principles of the device embodiments can be found in the content of the aforementioned method embodiments, and will not be repeated here.
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0130] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0131] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0132] Please see Figure 10 , Figure 10A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. The electronic device 400 may include the following components: a memory 430, one or more processors 440, and one or more application programs, wherein the one or more application programs are stored in the memory 430 and are used to cause the electronic device 400 to execute a method for generating a food purchase list applied to the electronic device when invoked by one or more processors 440.
[0133] The processor 440 may include one or more processing cores. The processor 440 connects to various parts within the electronic device 400 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory, and by calling data stored in memory. Optionally, the processor may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. It is understood that the aforementioned modem may also not be integrated into the processor 440, but may be implemented separately through a communication chip.
[0134] The memory 430 may include random access memory (RAM) or read-only memory (ROM). The memory 430 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 430 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, etc. The data storage area may store data created during the use of the electronic device.
[0135] Please see Figure 11 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 500 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0136] The computer-readable storage medium 500 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code 510 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 510 may, for example, be compressed in a suitable form.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating a food purchase list, characterized in that, include: Obtain the current food inventory information, historical statistical information of various foods, and detailed information of multiple food sales points corresponding to the target user. The detailed information of the food sales points includes the food details of each of the foods. Based on the current food inventory information, historical statistics of various food ingredients, and details of various food sales points, a food purchase list is generated. The food purchase list includes various food ingredients to be purchased, and each of the food ingredients to be purchased belongs to one of the various food ingredients.
2. The method according to claim 1, characterized in that, The process of generating a food purchase list based on the current food inventory information, historical food usage statistics, and details of multiple food sales points includes: If it is determined that ingredients need to be purchased, multiple candidate ingredients are determined from the current ingredient database information and historical statistical information of multiple ingredients. The overall score of the candidate ingredients is determined based on the sales details of the candidate ingredients at multiple ingredient purchase points; The N candidate ingredients with the highest overall scores are selected as the ingredients to be purchased. Generate a food purchase list that includes the ingredients to be purchased, where N is an integer greater than 1.
3. The method according to claim 2, characterized in that, The details of the ingredients include the remaining quantity of ingredients, their freshness, and their prices; The step of determining the comprehensive score of the candidate ingredients based on the sales details of the candidate ingredients at multiple ingredient purchase points includes: Determine the scores corresponding to the remaining quantity of the candidate ingredients at the ingredient sales point, the freshness of the ingredients, and the price of the ingredients; The scores for the candidate ingredients at the food sales point are weighted and summed based on the remaining quantity of the ingredients, the freshness of the ingredients, and the price of the ingredients, respectively, to obtain the score of the food purchase point for the candidate ingredients. A comprehensive score for the candidate ingredients is obtained based on the ratings given by multiple ingredient purchase points.
4. The method according to claim 3, characterized in that, The detailed information of the food sales points also includes the distance value corresponding to the food sales points; The process of obtaining a comprehensive score for the candidate ingredients based on ratings from multiple ingredient purchase points includes: The weight of each food selling point is determined based on the distance value corresponding to that point. A comprehensive score for the candidate ingredients is obtained based on the ratings given to the candidate ingredients by multiple purchase points and the weight of each sales point.
5. The method according to claim 3, characterized in that, The ingredient purchase list also includes the target ingredient purchase points, and the method further includes: Based on the ratings given by the food purchase points for each of the candidate food ingredients, a food purchase point rating is obtained; The K highest-scoring food purchase reviews are identified as the target food purchase points, where K is an integer greater than 1. Generate a food purchase list that includes the ingredients to be purchased, including: Generate a food purchase list that includes the target ingredient purchase points and the ingredients to be purchased.
6. The method according to claim 2, characterized in that, The current food inventory information includes the number of types of food currently in stock. Before determining multiple candidate foods based on the current food inventory information and historical food statistics, the method further includes: Determine whether the current number of food items in stock is less than a preset quantity. If the current number of food items in stock is less than the preset quantity, determine that food items need to be purchased.
7. The method according to claim 1, characterized in that, The process of generating a food purchase list based on the current food inventory information, historical statistical information of various food ingredients, and detailed information of multiple food sales points includes: The food purchase list prediction model is used to predict the food purchase list based on current food inventory information, historical statistical information of various foods, and detailed information of multiple food sales points.
8. The method according to claim 7, characterized in that, The method further includes: Send the food purchase list to the target terminal, where the target terminal is the terminal associated with the target user; Receive feedback information generated by the target terminal based on the food purchase list; If the feedback information includes a target ingredient list, a recommendation prediction loss is obtained based on the target ingredient list and the ingredient purchase list. The model parameters of the ingredient list prediction model are adjusted based on the recommendation prediction loss. The target ingredient list is obtained by modifying at least one ingredient in the ingredient purchase list.
9. The method according to claim 8, characterized in that, The method further includes: If the feedback information indicates that the food purchase list is inaccurate, the food purchase list prediction model is used again to predict a first food purchase list based on the current food inventory information, historical statistical information of multiple foods, and detailed information of multiple food sales points, and the first food purchase list is sent to the target terminal.
10. The method according to claim 7, characterized in that, The ingredient list prediction model was trained in the following way: Obtain training samples and a sample ingredient purchase list corresponding to the training samples. The training samples include sample ingredient inventory information, historical statistical information of various sample ingredients, and detailed information of multiple sample sales points. The training samples are used to extract features using the ingredient list prediction model to obtain sample features; The food ingredient list prediction model is used to generate a predicted food ingredient purchase list based on the sample features; The prediction loss is obtained based on the predicted food purchase list and the sample food purchase list corresponding to the training sample. The model parameters of the food ingredient list prediction model are adjusted based on the predicted loss.
11. The method according to any one of claims 1-10, characterized in that, Obtain historical statistical information on ingredients, including: By statistically analyzing historical food inventory information corresponding to multiple historical time points, historical statistical information on various food ingredients is obtained.
12. A device for generating a food purchase list, characterized in that, include: The information acquisition module is used to acquire the current food inventory information of the target user, historical statistical information of multiple food ingredients, and detailed information of multiple food ingredient sales points. The detailed information of the food ingredient sales points includes the food details of each of the food ingredients. The list generation module is used to generate an ingredient purchase list based on the current ingredient inventory information, historical statistical information of multiple ingredients, and detailed information of multiple ingredient sales points. The ingredient purchase list includes multiple ingredients to be purchased, and each ingredient to be purchased belongs to one of the multiple ingredients.
13. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-11.