Meal arrangement method and device based on food material inventory constraint and electronic equipment
By using a method based on food inventory constraints, the problem of multi-objective collaborative processing in existing meal preparation systems is solved, generating executable meal preparation plans, reducing food waste and improving users' food safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 杭州食方科技有限公司
- Filing Date
- 2026-05-06
- Publication Date
- 2026-07-31
AI Technical Summary
Existing meal preparation methods struggle to address multiple objectives simultaneously, such as nutritional balance, inventory depletion, and user preferences. They are unable to cope with temporary shortages of key ingredients or the needs of special dining groups, leading to interruptions in the meal preparation process, food waste, and reduced food safety for users.
By using a method based on food inventory constraints, parameter initialization, discrete variable construction, inventory constraint modeling, multi-objective function construction, and penalty term processing are performed to generate executable meal preparation candidate solutions and control the meal preparation robot to perform automated meal preparation.
It reduces food waste, improves food safety for users, ensures the compliance and quality of meal planning solutions, and meets the comprehensive optimization goals of different groups.
Smart Images

Figure CN122492079A_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, and more specifically to a meal preparation method, apparatus, and electronic device based on food inventory constraints. Background Technology
[0002] Currently, meal planning solutions for scenarios such as central kitchens or institutional canteens mainly rely on simple calculations based on fixed rules. These methods typically only consider single objectives such as nutritional balance or cost, and then match and adjust them according to simplified inventory or nutritional rules to generate meal plans and control equipment execution.
[0003] However, when using the above method to handle large-scale and real-time changing meal preparation needs, the following technical problems often arise: Existing methods struggle to coordinate multiple objectives, including nutritional balance, inventory depletion, and user preferences, and are unable to handle unforeseen circumstances such as temporary shortages of key ingredients, leading to interruptions in the meal preparation process due to overly restrictive constraints. Furthermore, fixed optimization weights and penalty mechanisms are ill-suited to meet the requirements of special dining groups (such as diabetic patients), and there is a disconnect between digital solutions and instructions for automated meal preparation equipment, resulting in substandard meal plans, food waste, and reduced food safety for users.
[0004] The information disclosed in this background section is only intended to enhance the understanding of the background of the present disclosure concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0006] Some embodiments of this disclosure provide meal preparation methods, apparatuses, electronic devices, and computer-readable media based on food inventory constraints to address one or more of the technical problems mentioned in the background section above.
[0007] In a first aspect, some embodiments of this disclosure provide a meal preparation method based on food inventory constraints. The method includes: in response to receiving a meal preparation instruction sent by a target user, initializing parameters on acquired meal preparation data to obtain a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a constraint condition set; constructing discrete variables on the aforementioned food inventory dataset to obtain a food usage variable set; modeling inventory constraints on the aforementioned food usage variable set and the aforementioned food inventory dataset to obtain a feasible solution set of inventory constraints; constructing multi-objective functions on the aforementioned feasible solution set of inventory constraints, the aforementioned nutritional requirement vector set, and the aforementioned user preference parameters to obtain a target meal preparation function set; constructing penalty terms on the aforementioned feasible solution set of inventory constraints and the aforementioned constraint condition set to obtain penalty term function values; performing multi-objective joint solution on the aforementioned feasible solution set of inventory constraints based on the aforementioned target meal preparation function set, the aforementioned multi-objective initial weight vector, and the aforementioned penalty term function values to obtain a food usage dataset; generating executable meal preparation candidate schemes based on the aforementioned food usage dataset; and controlling a meal preparation robot to perform automated meal preparation based on the aforementioned executable meal preparation candidate schemes.
[0008] Secondly, some embodiments of this disclosure provide a meal preparation device based on food inventory constraints. The device includes: a parameter initialization unit configured to initialize parameters of acquired meal preparation data in response to receiving a meal preparation instruction sent by a target user, thereby obtaining a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a constraint condition set; a discrete variable construction unit configured to construct discrete variables from the aforementioned food inventory dataset, thereby obtaining a food usage variable set; an inventory constraint modeling unit configured to perform inventory constraint modeling on the aforementioned food usage variable set and the aforementioned food inventory dataset, thereby obtaining a feasible solution set for inventory constraints; and a multi-objective function construction unit configured to perform multi-objective function modeling on the aforementioned... The system constructs a multi-objective function from the feasible solution set of inventory constraints, the aforementioned set of nutritional requirement vectors, and the aforementioned user preference parameters to obtain a target meal planning function set. A penalty term construction unit is configured to construct penalty terms from the feasible solution set of inventory constraints and the aforementioned set of constraint conditions to obtain penalty term function values. A multi-objective joint solution unit is configured to perform a multi-objective joint solution on the feasible solution set of inventory constraints based on the target meal planning function set, the aforementioned initial weight vectors of the multi-objectives, and the aforementioned penalty term function values to obtain a food ingredient usage dataset. A generation unit is configured to generate executable meal planning candidate schemes based on the aforementioned food ingredient usage dataset, and to control the meal planning robot to perform automated meal planning based on the executable meal planning candidate schemes.
[0009] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0010] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0011] The above-described embodiments of this disclosure have the following beneficial effects: the meal preparation method based on food inventory constraints according to some embodiments of this disclosure can reduce food waste and improve users' dietary safety. Specifically, the reasons for food waste and low dietary safety are: existing methods are difficult to coordinate multiple objectives such as nutritional balance, inventory consumption, and user preferences, and cannot handle emergencies such as temporary shortages of key ingredients, leading to interruptions in the meal preparation process due to excessive constraints. At the same time, fixed optimization weights and penalty mechanisms are difficult to meet the requirements of special dining groups (such as diabetic patients), and there is a gap in the conversion of digital solutions to instructions from automated meal preparation equipment, resulting in substandard meal preparation plans, which in turn leads to food waste and reduced dietary safety for users. Based on this, the meal preparation method based on food inventory constraints according to some embodiments of this disclosure firstly initializes the acquired meal preparation data in response to receiving a meal preparation instruction from the target user, obtaining a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a constraint condition set. This provides structured input data for subsequent processes. Secondly, discrete variables are constructed from the above-mentioned food inventory dataset to obtain a set of food usage variables. Therefore, the continuous food inventory in the physical world can be transformed into discrete decision variables. Next, inventory constraints are modeled on the aforementioned food usage variable set and food inventory dataset to obtain a feasible solution set. This ensures that feasible solutions still exist even when key food items are scarce. Then, a multi-objective function is constructed on the aforementioned feasible solution set, nutritional requirement vector set, and user preference parameters to obtain a target meal planning function set. This allows for the construction of a comprehensive optimization objective that can adapt to different population groups. Subsequently, a penalty term is constructed on the aforementioned feasible solution set and constraint set to obtain penalty term function values. This transforms soft constraints into quantifiable costs of violations, improving the compliance and quality of the solution. Then, based on the aforementioned target meal planning function set, the aforementioned initial weight vector for multiple objectives, and the aforementioned penalty term function values, a multi-objective joint solution is performed on the aforementioned feasible solution set to obtain a food usage dataset. This yields the food usage scheme with the best overall effect under various constraints. Finally, based on the aforementioned ingredient usage dataset, executable meal preparation candidate plans are generated, and based on these candidate plans, a meal preparation robot is controlled to perform automated meal preparation. Ultimately, this reduces food waste and improves food safety for users. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0013] Figure 1 This is a flowchart of some embodiments of the meal preparation method based on food inventory constraints according to this disclosure; Figure 2 These are schematic diagrams of some embodiments of a meal preparation device based on food inventory constraints according to this disclosure; Figure 3 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0016] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0017] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0018] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0019] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0020] Figure 1 A flow 100 of some embodiments of a meal preparation method based on food inventory constraints according to this disclosure is shown. This meal preparation method based on food inventory constraints includes the following steps: Step 101: In response to receiving the meal preparation instruction sent by the target user, initialize the parameters of the acquired meal preparation data to obtain the ingredient inventory dataset, nutritional requirement vector set, user preference parameters, multi-objective initial weight vector, and constraint condition set.
[0021] In some embodiments, the execution entity (e.g., a server) of the meal planning method based on ingredient inventory constraints can, in response to receiving a meal planning instruction from a target user, initialize the parameters of the acquired meal planning data to obtain an ingredient inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions. The meal planning instruction can be a user-initiated instruction requesting the system to generate a personalized meal plan. For example, a request submitted via a mobile application to "generate a lunch plan for diabetic patients." The meal planning data can be raw multi-source data collected from a backend database, real-time interfaces, and user input information, and may include basic user information, historical orders (user order information), current ingredient inventory lists, nutritional standard templates, etc. The ingredient inventory dataset can be a collection of data recording the name, current quantity, and unit of measurement of each available ingredient. The nutritional requirement vector set can be a quantitative target set consisting of the daily recommended intake of various nutrients (such as protein, carbohydrates, fats, vitamins, etc.) determined according to the individual user's situation. The user preference parameters can be feature parameters used to quantify the user's taste preferences and dietary restrictions. For example, a preference value for "spiciness" or a list of foods to avoid. The aforementioned multi-objective initial weight vector can be a set of initial weight coefficients used to balance the importance of multiple optimization objectives (such as nutritional deviation objective weight, inventory balance objective weight, and user preference objective weight). The aforementioned set of constraints can be a set of various restrictions (such as inventory limits, nutritional intake ranges, etc.) that must be met or should be met as much as possible during the meal preparation process.
[0022] In some optional implementations of certain embodiments, the aforementioned execution entity may, in response to receiving a meal preparation instruction from the target user, initialize the parameters of the acquired meal preparation data through the following steps to obtain a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions: Step one involves cleaning and standardizing the aforementioned meal preparation data to obtain standard meal preparation data. In practice, the executing entity can remove erroneous records and invalid fields (such as records with negative inventory quantities or orders with missing user information) from the meal preparation data to obtain cleaned meal preparation data. Next, missing values are imputed in the cleaned meal preparation data to obtain imputed meal preparation data. For example, when the number of diners is not specified by the user, the default value from historical orders is used as the number of diners. Finally, the imputed meal preparation data is standardized to obtain standard meal preparation data. As an example, the unit of ingredient weight can be standardized to "grams," and enumerated fields such as user gender and age group can be converted to standard codes.
[0023] Step two involves extracting ingredient information from the standard meal preparation data to obtain an ingredient inventory dataset. In practice, the implementing entity can extract at least one item of ingredient inventory data from the standard meal preparation data to obtain the ingredient inventory dataset. The ingredient inventory data in this dataset includes the ingredient name, current inventory quantity, unit of measurement, and the ingredient category (e.g., vegetables, meat, staple food).
[0024] Step 3: Based on the preset standard nutrition vector table, extract dietary goals from the aforementioned standard meal planning data to obtain a set of nutritional requirement vectors. In practice, the implementing entity can extract data (such as age, gender, and body mass index) related to the individual characteristics (basic user information) of the user from the aforementioned standard meal planning data to obtain user characteristic information. Then, select at least one standard nutrition vector from the aforementioned preset standard nutrition vector table that matches the aforementioned user characteristic information as the nutritional requirement vector, thus obtaining a set of nutritional requirement vectors. The aforementioned preset standard nutrition vector table can be a predefined data table of basic nutrient intake templates based on the recommended nutritional standards for different population groups (such as adults, the elderly, and pregnant women).
[0025] Step four involves extracting user order information from the aforementioned standard meal preparation data to generate user preference parameters. In practice, the executing entity can extract user order information from the standard meal preparation data. Then, through data analysis methods (such as weight calculation based on collaborative filtering or simple statistics), the user preference parameters corresponding to the aforementioned user order information are determined (e.g., determining the frequency of user selection of different ingredients). The aforementioned user order information can include user historical order records, feedback, manually set taste preferences, and other data.
[0026] Step 5: Based on the preset meal planning optimization goals, set the initial weight vector for multiple objectives. These preset optimization goals can be predefined main optimization directions, such as "nutritional balance," "inventory balance," and "meeting user preferences." The initial weight vector can be a numerical vector, where each component corresponds to the initial importance of an optimization goal, and the sum of all components is 1. For example, the initial weight vector could be (0.5, 0.3, 0.2), representing the initial weight vectors for the three objectives: nutrition, inventory balance, and user preferences.
[0027] Step Six: Based on the aforementioned food inventory dataset, nutritional requirement vector set, and user preference parameters, generate a set of constraint conditions. In practice, the executing entity can determine the inventory data of each food item in the aforementioned food inventory dataset as the upper limit of the food inventory constraint, thus generating an upper limit constraint condition set. For example, if the aforementioned food inventory data represents 3 potatoes, the upper limit constraint condition in the upper limit constraint condition set could be "number of potatoes ≤ 3". Next, extract the emergency and allergen information from the aforementioned user preference parameters to obtain a set of prohibited food constraint conditions. For example, if the aforementioned emergency and allergen information represents a peanut allergy, the prohibited food constraint condition in the set of prohibited food constraint conditions could be "number of peanuts = 0". Then, extract the upper and lower limits of the intake of various nutrients set in the aforementioned nutritional requirement vector to obtain a set of nutritional intake range constraint conditions. Finally, determine the aforementioned upper limit constraint condition set, the aforementioned prohibited food constraint condition set, and the aforementioned nutritional intake range constraint condition set as the constraint condition set.
[0028] Step 102: Construct discrete variables from the food inventory dataset to obtain the food usage variable set.
[0029] In some embodiments, the executing entity can construct discrete variables from the aforementioned food inventory dataset to obtain a set of food usage variables. This set of food usage variables can be a dataset of non-negative integers representing the specific amount of each food item used. The feasible domain can be a decision space comprised of theoretically possible combinations of food consumption amounts that satisfy all basic constraints.
[0030] In some optional implementations of certain embodiments, the aforementioned execution entity may construct a set of food usage variables by performing discrete variable construction on the aforementioned food inventory dataset through the following steps: Step 1: Based on the aforementioned food inventory dataset, generate a set of basic food specification parameters. In practice, the executing entity can search for the specification parameters corresponding to each food inventory data in the aforementioned food inventory dataset within a pre-defined food knowledge base, using these as the basic food specification parameters to obtain the set of basic food specification parameters. The pre-defined food knowledge base can be a structured database storing various basic attributes and specification parameters of food, which may include, but is not limited to, food identifiers (such as names or codes), minimum operable units (such as "1 piece", "1 slice", "50 grams"), basic nutritional content benchmarks (such as the number of grams of protein and fat contained per 100 grams), and food classification information (such as belonging to vegetables, meat, or staple food). The basic food specification parameters in the aforementioned set of basic food specification parameters can include the food identifier, the minimum operable unit, and the standard weight corresponding to the minimum operable unit. For example, the minimum operable unit corresponding to "chicken breast" is 1 piece, and the standard weight is 100 grams.
[0031] Step two: Based on the aforementioned set of basic ingredient specifications, discretize the unit values of each ingredient inventory data in the aforementioned ingredient inventory dataset to obtain a set of minimum ingredient portions. In practice, the executing entity can search for the corresponding basic ingredient specification parameters in the aforementioned set of basic ingredient specifications for each ingredient inventory data in the aforementioned ingredient inventory dataset, and determine the minimum ingredient portion for each ingredient inventory data in the aforementioned ingredient inventory dataset, thus obtaining a set of minimum ingredient portions. For example, determine that "rice" is defined as "50 grams" per serving, and "cooking oil" as "5 milliliters" per spoonful.
[0032] Step 3: Based on the aforementioned ingredient inventory dataset, generate a set of ingredient constraint rules. In practice, the executing entity can query the food constraint rules (such as pairing rules, mutual exclusion rules (e.g., pork and water chestnuts should not be eaten together), or fixed proportion rules) corresponding to each ingredient inventory data in the preset recipe knowledge graph to obtain the set of ingredient constraint rules. The preset recipe knowledge graph can be a pre-constructed, structured knowledge base stored in graph form to represent the relationships between ingredients and cooking rules. Nodes in the preset recipe knowledge graph can represent different ingredients or dishes. Edges in the preset recipe knowledge graph can represent various relationships between ingredients, such as pairing relationships, mutual exclusion relationships, and fixed proportion relationships.
[0033] Step four: Based on the aforementioned set of ingredient constraint rules and the aforementioned set of minimum ingredient portions, perform pre-pruning on the ingredient solution space to obtain a feasible solution space. In practice, the executing entity can obtain the ingredient solution space by determining the maximum number of usable portions of each ingredient in the aforementioned set of ingredient constraint rules and the aforementioned set of minimum ingredient portions (which can be obtained by dividing the ingredient inventory by the minimum ingredient portion and rounding down to the nearest integer). Then, the aforementioned set of ingredient constraint rules can be used as constraints to remove combinations in the ingredient solution space that violate the set of ingredient constraint rules, thus obtaining a feasible solution space. As an example, if the set of ingredient constraint rules includes pairing rules (such as using eggs requires using tomatoes), then the combination "tomato portions > 0 and egg portions = 0" will be eliminated. The aforementioned ingredient solution space can be the set of all possible combinations of ingredient usage quantities when only considering the upper limit of inventory quantity. The aforementioned feasible solution space can be the solution space (Solution space) obtained by reducing the aforementioned ingredient solution space regarding the quantity of ingredients used.
[0034] Step 5: Perform a parallel neighborhood search on the feasible solution space to obtain a candidate solution set. In practice, the execution entity can use a metaheuristic algorithm (such as an evolutionary algorithm or simulated annealing algorithm) to randomly generate an initial set of solutions (population) in the feasible solution space, and determine the fitness value of the initial solutions using a fitness function. Then, new solutions are evolved in parallel through operations such as "selection-mutation-crossover," and the solutions with the highest fitness values in the current population after multiple iterations (e.g., 10) are selected as the candidate solution set.
[0035] Step six: Perform executable verification on the above candidate solution set and the above minimum ingredient quantity set to obtain the ingredient usage variable set. In practice, the above executing entity can confirm at least one candidate solution in the above candidate solution set that meets the preset conditions as the ingredient usage variable, thus obtaining the ingredient usage variable set. The preset conditions may be that each value (number of ingredient portions) of the candidate solution is an integer and not greater than the corresponding maximum usable number of ingredient portions.
[0036] Step 103: Model inventory constraints using the variable set and the food inventory dataset to obtain a feasible solution set for inventory constraints.
[0037] In some embodiments, the aforementioned execution entity may use the variable set and the aforementioned food inventory dataset to perform inventory constraint modeling on the aforementioned food ingredients to obtain a feasible solution set for the inventory constraints.
[0038] In addressing the aforementioned technical problems in the application scenario—specifically, high-end nursing homes or post-operative rehabilitation nutrition canteens—the following technical challenges often arise: traditional methods cannot handle the coexistence of hard and soft constraints, temporary shortages of key ingredients, and complex conditions involving fixed weights for multiple objectives. This leads to constraints causing the inability to arrive at feasible solutions (e.g., meal plans that do not match the user's actual needs) or generating solutions that are unexecutable under actual inventory conditions. Ultimately, this results in the interruption of the meal preparation robot's process or the execution of invalid meal preparation instructions, leading to reduced nutritional safety for the user and unnecessary power consumption by the robot. Considering the following requirements for this application scenario—high robustness and strong executability—we have decided to adopt the following solution: In some optional implementations of certain embodiments, the aforementioned execution entity may perform inventory constraint modeling on the aforementioned ingredient usage variable set and the aforementioned ingredient inventory dataset through the following steps to obtain a feasible solution set for the inventory constraint: Step one involves constraining and classifying the aforementioned food inventory dataset to obtain a set of hard-constraint food identifiers and a set of soft-constraint food identifiers. In practice, the executing entity can identify the food identifiers corresponding to the food inventory data that meet the preset hard constraints in the aforementioned food inventory dataset as hard-constraint food identifiers, thus obtaining a set of hard-constraint food identifiers; and identify the food identifiers corresponding to the food inventory data that meet the preset soft constraints in the aforementioned food inventory dataset as soft-constraint food identifiers, thus obtaining a set of soft-constraint food identifiers. The preset soft constraints can be food pairing conditions that allow violation under certain conditions (such as limitations on the ideal nutritional intake range or recommendations on the proportion of major food categories (such as staple food and protein)). The preset hard constraints can be food pairing conditions that must be strictly met (such as not exceeding the real-time food inventory limit or prohibiting the use of allergenic foods).
[0039] Step two involves performing an availability check on the aforementioned food inventory dataset to obtain a set of food shortage identifiers. In practice, the executing entity can identify food inventory data in the aforementioned food inventory dataset that has zero current available inventory or that has a non-zero current available inventory but is less than the basic quantity corresponding to one unit defined in the aforementioned minimum portion size set of food as food shortage identifiers, thus obtaining a set of food shortage identifiers.
[0040] Step three: In response to the aforementioned set of shortage food ingredient identifiers being non-empty, based on the food ingredient substitution rule base, the shortage food ingredient identifiers in the aforementioned set of shortage food ingredient identifiers are matched and mapped to obtain a set of shortage food ingredient substitution solutions. In practice, the executing entity can query the aforementioned food ingredient substitution rule base to obtain the food ingredient substitution solution set by querying the food ingredient substitution rule base to find the food ingredient substitution rules that are consistent with the characteristics of each shortage food ingredient identifier in the aforementioned set of shortage food ingredient identifiers. The aforementioned food ingredient substitution rule base can be a knowledge base storing multi-dimensional similarity relationships between ingredients based on nutrition, taste, and other dimensions. The shortage food ingredient substitution solutions in the aforementioned set of shortage food ingredient substitution solutions can be one or more alternative food ingredient solutions provided for the set of shortage food ingredient substitution solutions.
[0041] Step four: Update the food inventory dataset according to the aforementioned set of alternative food shortage solutions to obtain an updated food inventory dataset. In practice, the executing entity can replace the shortage foods in the food inventory dataset with the corresponding shortage food alternatives from the aforementioned set of alternative food shortage solutions to obtain the updated food inventory dataset.
[0042] Step 5: Construct penalty terms for the aforementioned soft-constraint ingredient identifier set to obtain a relaxed constraint condition set. In practice, the executing entity can iterate through the aforementioned soft-constraint ingredient identifier set. For soft-constraint rules that can be reconstructed as "g(x) ≤ b" (e.g., total sodium intake g(x) ≤ 2000 mg b), add a relaxation variable s (s ≥ 0), then reconstruct the ingredient soft constraints into the form g(x) - s ≤ b, and assign penalty term weight coefficients λ to obtain the relaxed constraint condition set. As an example, for constraints with high importance (e.g., the carbohydrate limit for diabetic users), a larger penalty term weight coefficient (e.g., 100) can be assigned. The penalty term weight coefficient can be used to specify the cost coefficient for violating the ingredient soft constraints. The relaxation variables are used to quantify the degree to which the ingredient soft constraints are violated. The aforementioned g(x) can represent the actual amount that needs to be constrained based on the meal plan x (ingredient usage amount). The aforementioned b can be a predefined numerical constant used to represent the upper limit of ingredient usage.
[0043] Step Six: Based on the aforementioned set of hard-constraint ingredient identifiers, the updated ingredient inventory dataset, the set of ingredient usage variables, and the set of relaxed constraints, generate a preliminary feasible solution set. In practice, the executing entity can first determine each ingredient usage variable in the ingredient usage variable set as the decision variable of the mathematical programming model. Then, combine each hard-constraint ingredient identifier in the hard-constraint ingredient identifier set and each relaxed constraint condition in the relaxed constraint condition set with the updated ingredient inventory dataset to determine the constraints of the mathematical programming model. For example, the hard-constraint ingredient identifier representing "tomato usage must not exceed current inventory" and the "tomato inventory" in the updated ingredient inventory data can be transformed into "tomato usage ≤ tomato inventory". Next, the objective function of the mathematical programming model is set to a constant value to construct the mathematical programming model. Then, a mathematical programming solver (such as an integer programming solver) can be used to solve the mathematical programming model under the premise of satisfying the aforementioned set of hard-constraint ingredient identifiers and the set of relaxed constraints to obtain a preliminary feasible solution set. The mathematical programming model can be an integer programming (IP) model.
[0044] Step 7: Perform a reverse transformation on the aforementioned preliminary feasible solution set to obtain the inventory-constrained feasible solution set. In practice, the implementing entity can, in response to the existence of preliminary feasible solutions in the aforementioned preliminary feasible solution set within the aforementioned shortage food alternative solution set, convert the food usage in the preliminary feasible solution back to the theoretical usage of the corresponding food in the shortage food alternative solution set, thus obtaining the first inventory-constrained feasible solution set. For example, if the original shortage food is "eggs," and the alternative solution is "1 duck egg replaces 2 chicken eggs," and the preliminary feasible solution uses 3 duck eggs, then the theoretical usage of the original shortage food is 6. In response to the existence of preliminary feasible solutions in the aforementioned preliminary feasible solution set within the aforementioned shortage food alternative solution set, determine the preliminary feasible solution as the second inventory-constrained feasible solution, thus obtaining the second inventory-constrained feasible solution set. Subsequently, the aforementioned first inventory-constrained feasible solution set and the aforementioned second inventory-constrained feasible solution set are determined as the inventory-constrained feasible solution set.
[0045] Steps one through seven above, along with their related content, constitute an inventive point of this disclosure. Combined with step "107" below, they solve the technical problem that "meal plans must strictly meet each user's specific dietary needs (such as low sodium, low sugar, and high protein). Traditional methods cannot handle the complex conditions of coexisting hard and soft constraints, temporary shortages of key ingredients, and fixed weights for multiple objectives. This leads to rigid constraint handling, causing interruptions and conflicts in the meal planning process, preventing the generation of feasible solutions (such as meal plans that do not match the user's actual needs) or rendering the generated solutions unexecutable under actual inventory conditions. Ultimately, this results in interruptions in the meal planning process of the meal planning robot or the execution of invalid meal planning instructions, leading to reduced nutritional safety for users and adverse effects on the meal planning robot." The reason for the "ineffective power consumption" leading to reduced nutritional safety for users and ineffective power consumption by the meal preparation robot is that the meal preparation plan must strictly meet the specific dietary needs of each user (such as low sodium, low sugar, and high protein). Traditional methods cannot handle the coexistence of hard and soft constraints, temporary shortages of key ingredients, and complex conditions such as fixed weights for multiple objectives. This leads to rigid constraint processing, resulting in interruptions and conflicts during the meal preparation process, preventing the generation of feasible solutions (such as meal preparation plans that do not match the user's actual needs) or rendering the generated solutions unexecutable under actual inventory conditions. Ultimately, this causes the meal preparation robot to interrupt the meal preparation process or execute invalid meal preparation instructions, thus reducing nutritional safety for users and ineffective power consumption by the meal preparation robot. Solving these factors can resolve the problems of reduced nutritional safety for users and ineffective power consumption by the meal preparation robot. To achieve this, the first step is to perform constraint classification processing on the aforementioned ingredient inventory dataset to obtain hard-constraint ingredient identifier sets and soft-constraint ingredient identifier sets. This allows for a fundamental distinction between absolute restrictions that must be followed and permissible requirements, avoiding the complete rejection of the overall plan due to the failure of secondary rules. The second step involves performing an availability check on the aforementioned food inventory dataset to obtain a set of food shortage identifiers. This allows for the accurate identification of food items with zero or insufficient inventory. The third step, responding to the fact that the aforementioned set of food shortage identifiers is not empty, involves matching and mapping the food shortage identifiers in the aforementioned set of food shortage identifiers based on the food substitution rule base, to obtain a set of alternative solutions for the shortage food items. This allows for providing alternative solutions that conform to nutritional or business logic when critical food items are in short supply, thereby avoiding task interruptions due to the shortage of a single material. The fourth step involves updating the aforementioned food inventory dataset based on the set of alternative solutions for the shortage food items, to obtain an updated food inventory dataset. This eliminates the constraint of zero inventory. The fifth step involves constructing a penalty term on the aforementioned soft-constraint food identifier set to obtain a set of relaxed constraints. This allows for finding a comprehensive optimal solution. The sixth step involves generating a preliminary feasible solution set based on the aforementioned hard-constraint food identifier set, the aforementioned updated food inventory dataset, the aforementioned food usage variable set, and the aforementioned relaxed constraint set.Therefore, feasible solutions can be quickly found within a framework that integrates substitution mechanisms and constraint relaxation. The seventh step involves performing a reverse mapping on the initial feasible solution set to obtain an inventory-constrained feasible solution set. This yields executable solutions. Combining this with step 107 below, executable meal preparation candidate solutions are generated based on the aforementioned ingredient usage dataset. Based on these executable meal preparation candidate solutions, the meal preparation robot is controlled to perform automated meal preparation. Ultimately, this improves the nutritional safety of users and avoids unnecessary power consumption by the meal preparation robot.
[0046] Step 104: Construct a multi-objective function for the feasible solution set of inventory constraints, the set of nutritional requirements vectors, and user preference parameters to obtain the target meal planning function set.
[0047] In some embodiments, the executing entity may construct a multi-objective function from the feasible solution set of inventory constraints, the set of nutritional requirements vectors, and the user preference parameters to obtain a set of target meal planning functions. The target meal planning functions in this set include a nutritional deviation minimization function, an inventory consumption balancing function, and a preference matching maximization function.
[0048] In addressing the technical problems mentioned above by adopting technical solutions, the application scenario—personalized nutritional meal planning for patients (such as cancer patients undergoing radiotherapy and chemotherapy)—often presents the following technical challenges: When multiple strict constraints exist (e.g., the patient's meal plan needs to precisely meet nutritional goals such as high protein, adequate carbohydrates, and micronutrient supplementation), traditional meal planning methods cannot meet the user's health needs, leading to reduced user safety and waste of food resources, resulting in ineffective power consumption by the meal planning robot. Considering the following requirements for this application scenario: precise quantification of multiple objectives and dynamic priority adjustment, we have decided to adopt the following solution: In some optional implementations of certain embodiments, the execution entity can construct a multi-objective function set for the aforementioned feasible solution set of inventory constraints, the aforementioned nutritional requirement vector set, and the aforementioned user preference parameters through the following steps: Step 1: Construct functions for the aforementioned feasible solutions to inventory constraints, user preference parameters, and nutrient requirement vector sets to obtain the original nutrient deviation function, the original inventory equilibrium function, and the original preference matching function. The original nutrient deviation function can be a function used to determine the total difference between the actual nutrient supply corresponding to each feasible solution to inventory constraints and the corresponding nutrient requirement vector in the nutrient requirement vector set. The output can be in units of mass or energy. For example, it can determine the absolute value of the difference between the main nutrients such as protein, fat, and carbohydrates in the meal plan and the target requirement value. The original inventory equilibrium function can be a function used to assess the uniformity of consumption of various food ingredients. The output value can be a dimensionless value reflecting the dispersion of consumption proportions. For example, it can determine the percentage of each food ingredient consumed in the meal plan, and then determine the standard deviation of the percentage consumption values of each food ingredient. The original preference matching function can be a function used to quantify the degree to which the meal plan conforms to the aforementioned user preference parameters. The output value can be a score value based on historical behavior prediction. For example, it can be a weighted sum of the ingredients used in the meal plan based on the user's preference for different ingredients in the aforementioned user preference parameters. This can be obtained through the following formula: .
[0049] .
[0050] .
[0051] .
[0052] .
[0053] .
[0054] in, Indicates the adoption of a meal plan At that time, the first intake The total amount of each nutrient. The first unit represents the quantity of the unit. The first ingredient contained in the food Content of various nutrients. This represents an index indicating the type of nutrient, with values ranging from 1 to... . This indicates the total number of different types of nutrients. This indicates the total number of food ingredients. Indicates the index of the ingredient, with a value ranging from 1 to... . This represents a specific meal preparation plan (a feasible solution with inventory constraints). Indicates the first Target intake of each nutrient. This indicates that the absolute value is being calculated. This indicates a summation. Indicates the adoption of a meal plan At that time, the first The proportion of food inventory consumed. Indicates the first The amount of each ingredient used. Indicates the first The total amount of currently available inventory of a certain type of food ingredient. This indicates the percentage of all food ingredients consumed from inventory. The arithmetic mean. Indicates the user's opinion on the first The preference weight of each type of food ingredient. Indicates meal plan The original nutrient deviation function. Indicates meal plan The original inventory equilibrium function. Indicates meal plan The original preference matching function.
[0055] Step two involves sampling the function values of the original nutritional deviation function, the original inventory balance function, and the original preference matching function to obtain a set of sample values for the objective function. In practice, the implementing entity can select a random number (e.g., 5) of candidate meal planning schemes from the feasible solution set of the inventory constraints, and substitute them into the original nutritional deviation function, the original inventory balance function, and the original preference matching function respectively to obtain the nutritional deviation value, the inventory balance value, and the preference matching value. These nutritional deviation values, the inventory balance value, and the preference matching value are then determined as the set of sample values for the objective function, thus obtaining the target function sample value set.
[0056] Step three: Based on the aforementioned objective function sample value set and standardization method, the original nutrient deviation function, original inventory equilibrium function, and original preference matching function are dimensionless to obtain the standard nutrient deviation function, standard inventory equilibrium function, and standard preference matching function. In practice, the implementing entity can analyze and determine the statistical characteristics (such as mean, standard deviation, maximum, and minimum) of the nutrient deviation value, inventory equilibrium value, and preference matching value in each objective function sample value set within the aforementioned objective function sample value set. Then, using a standardization method (such as Z-score standardization), the original nutrient deviation function, original inventory equilibrium function, and original preference matching function are standardized to obtain the standard nutrient deviation function, standard inventory equilibrium function, and standard preference matching function.
[0057] Step four: In response to receiving the target user's current health status data, dynamically evaluate the current health status data to obtain a target dynamic weight vector. In practice, the executing entity can determine the target dynamic weight vector based on the current health status data. As an example, in response to the current health status data containing "diabetes," the weight of the nutrition target is increased from the baseline value of 0.4 to 0.6. The current health status data can be data representing the user's current health attributes or needs, such as medical diagnostic labels (e.g., "type 2 diabetes"), temporary physiological states (e.g., mid-pregnancy), or proactively set short-term goals (e.g., "weight loss period"). The target dynamic weight vector can be a numerical vector containing three components, dynamically adjusted according to the health status, reflecting the real-time importance weights of the three targets: nutrition, inventory, and preferences.
[0058] Step five involves weighting and synthesizing the aforementioned standard nutrient deviation function, standard inventory equilibrium function, and standard preference matching function with the target dynamic weight vector to obtain the final nutrient deviation function, final inventory equilibrium function, and final preference matching function. In practice, the executing entity can multiply the aforementioned standard nutrient deviation function, standard inventory equilibrium function, and standard preference matching function by the corresponding weight components in the target dynamic weight vector to obtain the final nutrient deviation function, final inventory equilibrium function, and final preference matching function.
[0059] Step six involves verifying and analyzing the final nutritional deviation function, the final inventory equilibrium function, and the final preference matching function to obtain the nutritional deviation minimization function, the inventory consumption equilibrium function, and the preference matching maximization function. In practice, the executing entity can verify whether the final nutritional deviation function, the final inventory equilibrium function, and the final preference matching function are differentiable with respect to the decision variables, and whether they are differentiable in response to these functions. By then, the final nutritional deviation function, the final inventory equilibrium function, and the final preference matching function are determined as the nutritional deviation minimization function, the inventory consumption equilibrium function, and the preference matching maximization function, respectively, thus obtaining the target meal planning function set.
[0060] Steps one through six and their related content, as an inventive point of this disclosure, combined with step 107 below, solve the technical problem that "traditional meal preparation methods cannot meet the user's health needs when there are multiple strict target constraints (such as the need for precise nutritional goals such as high protein, adequate carbohydrates, and micronutrient supplementation in the patient's meal plan), leading to reduced user safety, waste of food resources, and consequently, ineffective power consumption by the meal preparation robot." The reason for this ineffective power consumption is that traditional meal preparation methods cannot meet the user's health needs when there are multiple strict target constraints (such as the need for precise nutritional goals such as high protein, adequate carbohydrates, and micronutrient supplementation in the patient's meal plan), leading to reduced user safety, waste of food resources, and consequently, ineffective power consumption by the meal preparation robot. Solving these factors will resolve the problem of ineffective power consumption by the meal preparation robot. To achieve this effect, the first step involves constructing functions for the aforementioned feasible solution set of inventory constraints, user preference parameters, and nutritional requirement vector set, respectively, to obtain the original nutritional deviation function, original inventory equilibrium function, and original preference matching function. This transforms fuzzy health requirements into calculable mathematical indicators. The second step involves sampling the function values of the original nutritional deviation function, original inventory equilibrium function, and original preference matching function to obtain a set of target function sample values. This determines the possible numerical range and distribution of each target function under the current inventory conditions. The third step involves using the target function sample value set and standardization methods to perform dimensionless processing on the original nutritional deviation function, original inventory equilibrium function, and original preference matching function, respectively, to obtain the standard nutritional deviation function, standard inventory equilibrium function, and standard preference matching function. This eliminates the differences between different functions and avoids over-allocation caused by numerical differences. The fourth step involves dynamically evaluating the current health status data of the target user upon receipt, obtaining a target dynamic weight vector. This allows for dynamic adjustment of the target's weight priority based on the user's real-time status. The fifth step involves weighting and synthesizing the aforementioned standard nutritional deviation function, standard inventory equilibrium function, and standard preference matching function with the aforementioned target dynamic weight vector to obtain the final nutritional deviation function, final inventory equilibrium function, and final preference matching function. This allows for the construction of a comprehensive objective, facilitating the acquisition of the optimal meal plan while meeting the user's real-time needs. The sixth step involves validating and analyzing the aforementioned final nutritional deviation function, final inventory equilibrium function, and final preference matching function to obtain the nutritional deviation minimization function, inventory consumption equilibrium function, and preference matching maximization function.This ensures that the constructed multi-objective function is mathematically continuous and solvable. Combined with step 107 below, executable meal preparation candidate schemes are generated based on the ingredient usage dataset, and the meal preparation robot is controlled to perform automated meal preparation based on these candidate schemes. Ultimately, this solves the problem of ineffective power consumption by the meal preparation robot.
[0061] Step 105: Perform penalty term construction processing on the feasible solution set and constraint condition set of inventory constraints to obtain the penalty term function value.
[0062] In some embodiments, the execution entity may perform penalty term construction processing on the feasible solution set of the inventory constraints and the set of constraints to obtain the penalty term function value.
[0063] In some optional implementations of certain embodiments, the execution entity may perform penalty term construction processing on the feasible solution set of the inventory constraints and the set of constraints through the following steps to obtain the penalty term function value: Step 1: Generate a target constraint set based on the aforementioned set of constraints. In practice, the executing entity can select at least one constraint from the set of constraints that meets preset selection conditions as the target constraint, thus obtaining the target constraint set. The preset selection conditions can be numerical range constraints or proportional constraints. Numerical range constraints can be upper or lower limits set for the intake of a certain food or nutrient. Proportional constraints can be constraints on the proportion of food combinations or the proportion of nutrients. For example, "vegetables ≥ 0.3". As an example, if the constraints in the aforementioned set of constraints include "peanuts prohibited", "daily carbohydrate intake ≤ 180 grams", and "sodium intake ≤ 2000 grams", then "daily carbohydrate intake ≤ 180 grams" and "sodium intake ≤ 2000 grams" can be determined as target constraints, thus obtaining the target constraint set.
[0064] Step two involves performing an importance analysis on the aforementioned set of target constraints to obtain a set of importance levels for the target constraints. In practice, the implementing entity can set the importance level of target constraints that represent "strict upper limits for specific nutrients (such as sodium and added sugar)" to "high," and assign a corresponding weight of 0.75. The importance level of target constraints that represent "balanced food combinations" can be set to "medium," with a corresponding weight of 0.55. The importance level of target constraints that represent "taste preferences" can be set to "low," with a corresponding weight of 0.35, thus obtaining the set of importance levels for the target constraints.
[0065] Step three involves recalibrating the aforementioned set of importance levels for target constraints to obtain a set of target constraint weights. In practice, the implementing entity can adjust the weight values of the aforementioned set of importance levels for target constraints based on the current health status data to obtain the target constraint weight set. For example, for users with "hypertension," the weight value of the upper limit of sodium intake can be increased, while the weight value of "carbohydrate percentage" can be decreased.
[0066] Step four involves normalizing the aforementioned target constraint weight set to obtain a standard target constraint weight set. In practice, the executing entity can determine the sum of the target constraint weights in the aforementioned target constraint weight set. Then, each target constraint weight in the aforementioned target constraint weight set is divided by the sum of the aforementioned target constraint weights to obtain the standard target constraint weights, thus generating the standard target constraint weight set.
[0067] Step 5: Based on the feasible solution set of the inventory constraints described above, determine the violation degree vector in the set of standard target constraint weights, thus obtaining a violation degree vector set. In practice, the implementing entity can determine whether each candidate meal planning scheme in the feasible solution set of the inventory constraints violates the standard target constraint weights corresponding to the set of standard target constraint weights, and obtain a judgment result. Then, in response to the judgment result representing the violation, determine the absolute amount of the violation (e.g., actual sodium intake minus the recommended upper limit), as the violation degree vector, thus obtaining a violation degree vector set.
[0068] Step six involves weighted fusion of the aforementioned violation vector set and the aforementioned standard target constraint weight set to obtain the penalty term function value. This penalty term function value can be obtained by summing the products of each violation vector in the aforementioned violation vector set and the corresponding standard soft constraint weights in the aforementioned standard target constraint weight set. The penalty term function value can be obtained using the following formula: .
[0069] in, Indicates the first Standard target constraint weights. This indicates finding the maximum value. Index representing the standard objective constraint. Indicates meal plan The The absolute amount of violation corresponding to each standard objective constraint. This represents the value of the penalty function. This indicates a summation. This indicates a violation of the degree vector.
[0070] Step 106: Based on the target meal planning function set, the multi-objective initial weight vector, and the penalty term function value, perform multi-objective joint solution of the feasible solution set of inventory constraints to obtain the ingredient usage dataset.
[0071] In some embodiments, the execution entity may perform multi-objective joint solution of the feasible solution set of the inventory constraint based on the target meal allocation function set, the multi-objective initial weight vector and the penalty term function value to obtain the food usage dataset.
[0072] In some optional implementations of certain embodiments, the execution entity can perform a multi-objective joint solution to the feasible solution set of the inventory constraint by following the steps described above: based on the target meal allocation function set, the multi-objective initial weight vector, and the penalty term function value, to obtain the ingredient usage dataset. Step one involves weighting the aforementioned target meal planning function set, the aforementioned initial weight vector for multiple objectives, and the aforementioned penalty term function value to obtain the multi-objective problem function. In practice, the executing entity can add the aforementioned target meal planning function set and the aforementioned penalty term function value to obtain the initial multi-objective problem function. Then, the aforementioned initial weight vector for multiple objectives is weighted and summed with the aforementioned initial multi-objective problem function to obtain the multi-objective problem function. As an example, the multi-objective problem function can be obtained using the following formula: .
[0073] in, Indicates meal plan The multi-objective problem function. This represents a specific meal preparation plan (a feasible solution with inventory constraints). The weighting coefficient represents the nutritional deficit target. The weighting coefficients represent the inventory balance objective. This represents the weighting coefficient of user preference goals. This represents the value of the penalty function. Indicates meal plan The function for minimizing nutritional deviation. Indicates meal plan The inventory consumption equilibrium function. Indicates meal plan The preference matching maximization function.
[0074] Step two involves initial sampling of the feasible solutions to the inventory constraints to obtain an initial candidate solution set. In practice, the executing entity can use a sampling algorithm (such as random sampling) to select a predetermined number (e.g., 10) of feasible solutions to the inventory constraints as initial candidate solutions, thus obtaining the initial candidate solution set.
[0075] Step three: Based on the aforementioned multi-objective problem function, determine the objective value of each initial candidate solution in the initial candidate solution set, thus obtaining the initial candidate objective value set. In practice, the executing entity can substitute each initial candidate objective value from the initial candidate objective value set into the aforementioned multi-objective problem function to obtain the initial candidate objective value set.
[0076] Step four: Based on the aforementioned initial candidate objective value set, iterative optimization is performed on the initial candidate solution set to obtain an optimized candidate solution set. In practice, the executing entity can use an optimization algorithm (such as simulated annealing) to determine the initial candidate solution set as the initial population. In each iteration, initial candidate solutions are generated through crossover (e.g., combining different initial candidate solutions) and mutation (e.g., randomly changing the amount of some ingredients in the initial candidate solutions), ensuring that the new initial candidate solutions are within the feasible solution set of the inventory constraint. Then, the new initial candidate solutions whose multi-objective problem function values are higher than the corresponding initial candidate objective values in the aforementioned initial candidate objective value set are determined as optimized candidate solutions, thus obtaining the optimized candidate solution set.
[0077] Step five involves verifying the feasibility of the aforementioned candidate solutions to obtain the ingredient usage dataset. In practice, the implementing entity can determine the candidate solutions that satisfy the hard constraint ingredient identifier set in the aforementioned candidate solution set as the ingredient usage dataset. This ingredient usage dataset can be a specific ingredient usage quantity that achieves the optimal objective function while satisfying all hard constraints, taking into account factors such as nutrition, inventory consumption balance, user preferences, and constraint violation penalties. The ingredient usage data in this dataset can represent the specific quantity of ingredients used.
[0078] Step 107: Based on the ingredient usage dataset, generate executable meal preparation candidate schemes, and based on the executable meal preparation candidate schemes, control the meal preparation robot to perform automated meal preparation.
[0079] In some embodiments, the executing entity can generate executable meal preparation candidate schemes based on the aforementioned ingredient usage dataset, and control a meal preparation robot to perform automated meal preparation based on the aforementioned executable meal preparation candidate schemes. The meal preparation robot can be an automated device or combination of devices capable of ingredient grasping, conveying, cooking, and plating.
[0080] In some optional implementations of certain embodiments, the aforementioned execution entity may generate executable meal preparation candidate schemes based on the aforementioned ingredient usage dataset through the following steps, and control the meal preparation robot to perform automated meal preparation based on the aforementioned executable meal preparation candidate schemes: Step one: Based on the aforementioned ingredient usage dataset, obtain an executable meal plan. In practice, the executing entity can query the basic ingredient information database for the meal plan corresponding to the usage data of each ingredient in the dataset to obtain the executable meal plan. This basic ingredient information database can be a database containing ingredient names. The executable meal plan can be a JSON document, including the dish name, the types and quantities of required ingredients, the estimated total calories, and the content of major nutrients.
[0081] Step two involves analyzing the cooking procedures and parameters of the aforementioned executable meal plan to obtain a sequence of cooking procedure information. In practice, the executing entity can search for a standard process template matching the dish name in the executable meal plan from a food process knowledge base. Then, the specific ingredient quantities from the executable meal plan are substituted into the standard process template to obtain the cooking procedure information sequence. This food process knowledge base can be a database storing standardized operating steps and process parameters (such as temperature, time, and seasoning order) for various standard dishes from preparation to completion.
[0082] Step three involves converting the above cooking process information sequence into instructions to obtain a control instruction set. In practice, the executing entity can convert the cooking process information sequence into machine-readable instructions to obtain a control instruction set. The control instructions in this set can include device drive instructions, motion trajectory instructions, and I / O instructions. For example, it could be "move the robotic arm to coordinates (X, Y, Z)".
[0083] Step four: Control the food preparation robot to perform automated food preparation according to the above control instruction set. In practice, the execution entity can send the above control instruction set to the food preparation robot through an industrial communication interface to achieve automated food preparation.
[0084] The above-described embodiments of this disclosure have the following beneficial effects: the meal preparation method based on food inventory constraints according to some embodiments of this disclosure can reduce food waste and improve users' dietary safety. Specifically, the reasons for food waste and low dietary safety are: existing methods are difficult to coordinate multiple objectives such as nutritional balance, inventory consumption, and user preferences, and cannot handle emergencies such as temporary shortages of key ingredients, leading to interruptions in the meal preparation process due to excessive constraints. At the same time, fixed optimization weights and penalty mechanisms are difficult to meet the requirements of special dining groups (such as diabetic patients), and there is a gap in the conversion of digital solutions to instructions from automated meal preparation equipment, resulting in substandard meal preparation plans, which in turn leads to food waste and reduced dietary safety for users. Based on this, the meal preparation method based on food inventory constraints according to some embodiments of this disclosure firstly initializes the acquired meal preparation data in response to receiving a meal preparation instruction from the target user, obtaining a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a constraint condition set. This provides structured input data for subsequent processes. Secondly, discrete variables are constructed from the above-mentioned food inventory dataset to obtain a set of food usage variables. Therefore, the continuous food inventory in the physical world can be transformed into discrete decision variables. Next, inventory constraints are modeled on the aforementioned food usage variable set and food inventory dataset to obtain a feasible solution set. This ensures that feasible solutions still exist even when key food items are scarce. Then, a multi-objective function is constructed on the aforementioned feasible solution set, nutritional requirement vector set, and user preference parameters to obtain a target meal planning function set. This allows for the construction of a comprehensive optimization objective that can adapt to different population groups. Subsequently, a penalty term is constructed on the aforementioned feasible solution set and constraint set to obtain penalty term function values. This transforms soft constraints into quantifiable costs of violations, improving the compliance and quality of the solution. Then, based on the aforementioned target meal planning function set, the aforementioned initial weight vector for multiple objectives, and the aforementioned penalty term function values, a multi-objective joint solution is performed on the aforementioned feasible solution set to obtain a food usage dataset. This yields the food usage scheme with the best overall effect under various constraints. Finally, based on the aforementioned ingredient usage dataset, executable meal preparation candidate plans are generated, and based on these candidate plans, a meal preparation robot is controlled to perform automated meal preparation. Ultimately, this reduces food waste and improves food safety for users.
[0085] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a meal preparation device based on food inventory constraints. These device embodiments are similar to... Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0086] like Figure 2 As shown, a meal preparation device 200 based on food inventory constraints in some embodiments includes: a parameter initialization unit 201, a discrete variable construction unit 202, an inventory constraint modeling unit 203, a multi-objective function construction unit 204, a penalty term construction unit 205, a multi-objective joint solution unit 206, and a generation unit 207. Specifically, the parameter initialization unit 201 is configured to initialize the acquired meal preparation data in response to receiving a meal preparation instruction from a target user, obtaining a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions; the discrete variable construction unit 202 is configured to construct discrete variables from the aforementioned food inventory dataset, obtaining a food usage variable set; the inventory constraint modeling unit 203 is configured to perform inventory constraint modeling on the aforementioned food usage variable set and the aforementioned food inventory dataset, obtaining a feasible solution set for inventory constraints; the multi-objective function construction unit 204 is configured to perform inventory constraint modeling on the aforementioned feasible solution set for inventory constraints and the aforementioned nutritional requirement vector set, obtaining a feasible solution set for inventory constraints; and the multi-objective function construction unit 204 is configured to perform multi-objective joint solution on the aforementioned feasible solution set for inventory constraints and the aforementioned nutritional requirement vector set. The quantity set and the aforementioned user preference parameters are used to construct a multi-objective function to obtain a target meal preparation function set; the penalty term construction unit 205 is configured to perform penalty term construction processing on the aforementioned feasible solution set of inventory constraints and the aforementioned constraint condition set to obtain penalty term function values; the multi-objective joint solution unit 206 is configured to perform multi-objective joint solution on the aforementioned feasible solution set of inventory constraints based on the aforementioned target meal preparation function set, the aforementioned multi-objective initial weight vector, and the aforementioned penalty term function values to obtain a food ingredient usage dataset; the generation unit 207 is configured to generate executable meal preparation candidate schemes based on the aforementioned food ingredient usage datasets, and control the meal preparation robot to perform automated meal preparation based on the aforementioned executable meal preparation candidate schemes.
[0087] It is understandable that the units described in the device 200 are related to the reference. Figure 2 The steps in the described method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 200 and the units contained therein, and will not be repeated here.
[0088] The following is for reference. Figure 3 It shows a schematic diagram of the structure of an electronic device (e.g., an electronic device) 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0089] like Figure 3As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0090] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0091] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0092] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0093] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0094] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following actions: In response to receiving a meal preparation instruction sent by a target user, the electronic device initializes the acquired meal preparation data to obtain a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions; it constructs discrete variables from the aforementioned food inventory dataset to obtain a set of food usage variables; it models inventory constraints on the aforementioned set of food usage variables and the aforementioned food inventory dataset to obtain a feasible solution set of inventory constraints; it constructs multi-objective functions from the aforementioned feasible solution set of inventory constraints, the aforementioned nutritional requirement vector set, and the aforementioned user preference parameters to obtain a set of target meal preparation functions; it constructs penalty terms from the aforementioned feasible solution set of inventory constraints and the aforementioned set of constraint conditions to obtain penalty term function values; it performs multi-objective joint solution on the aforementioned feasible solution set of inventory constraints based on the aforementioned target meal preparation function set, the aforementioned multi-objective initial weight vector, and the aforementioned penalty term function values to obtain a set of food usage dataset; it generates executable meal preparation candidate schemes based on the aforementioned food usage dataset; and it controls a meal preparation robot to perform automated meal preparation based on the aforementioned executable meal preparation candidate schemes.
[0095] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0097] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a parameter initialization unit, a discrete variable construction unit, an inventory constraint modeling unit, a multi-objective function construction unit, a penalty term construction unit, a multi-objective joint solution unit, and a generation unit. The names of these units do not necessarily limit the unit itself; for example, the parameter initialization unit may also be described as "a unit that, in response to receiving a meal preparation instruction sent by a target user, initializes the acquired meal preparation data with parameters to obtain a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions."
[0098] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0099] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A meal preparation method based on food inventory constraints, comprising: In response to receiving a meal preparation instruction from the target user, the parameters of the acquired meal preparation data are initialized to obtain the food inventory dataset, the nutritional requirement vector set, the user preference parameters, the multi-objective initial weight vector, and the constraint condition set. Discrete variables are constructed from the food inventory dataset to obtain a set of food usage variables; The food ingredients are modeled using a variable set and the food ingredient inventory dataset to obtain a feasible solution set for the inventory constraints. A multi-objective function is constructed from the feasible solution set of the inventory constraint, the set of nutritional requirements vectors, and the user preference parameters to obtain a set of target meal planning functions; The feasible solution set of the inventory constraints and the set of constraints are processed to construct a penalty term, thereby obtaining the penalty term function value; Based on the target meal planning function set, the multi-objective initial weight vector, and the penalty term function value, the feasible solution set of the inventory constraint is solved jointly by multiple objectives to obtain the ingredient usage dataset. Based on the ingredient usage dataset, generate executable meal preparation candidate schemes, and control the meal preparation robot to perform automated meal preparation based on the executable meal preparation candidate schemes.
2. The method according to claim 1, wherein, The step of generating executable meal preparation candidate solutions based on the ingredient usage dataset, and controlling the meal preparation robot to perform automated meal preparation based on the executable meal preparation candidate solutions, includes: Based on the ingredient usage dataset, an executable meal preparation plan is obtained; The executable meal preparation plan is analyzed for cooking procedures and parameters to obtain a sequence of cooking procedure information. The cooking process information sequence is converted into a control instruction set. The control robot is controlled to perform automated meal preparation according to the control instruction set.
3. The method according to claim 1, wherein, The response to receiving a meal preparation instruction from the target user involves initializing the parameters of the acquired meal preparation data to obtain a food inventory dataset, a nutritional requirement vector set, user preference parameters, a multi-objective initial weight vector, and a set of constraint conditions, including: The meal preparation data is cleaned and standardized to obtain standard meal preparation data; The ingredient information is extracted from the standard meal preparation data to obtain an ingredient inventory dataset; Based on the preset standard nutrition vector table, dietary goals are extracted from the standard meal planning data to obtain a set of nutritional requirements vectors; Extract user order information from the standard meal preparation data to generate user preference parameters; Based on the preset meal planning optimization goals, set the initial weight vector for multiple objectives; A set of constraints is generated based on the food inventory dataset, the nutritional requirement vector set, and the user preference parameters.
4. The method according to claim 1, wherein, The target meal planning function set includes a function to minimize nutritional deviation, a function to balance inventory consumption, and a function to maximize preference matching.
5. The method according to claim 1, wherein, The process of constructing a penalty term for the feasible solution set of the inventory constraints and the set of constraints to obtain the penalty term function value includes: Based on the aforementioned constraints, a target constraint set is generated. An importance analysis is performed on the set of target constraints to obtain a set of importance levels for the target constraints; The target constraint importance level set is recalibrated to obtain the target constraint weight set; The target constraint weight set is normalized to obtain the standard target constraint weight set; Based on the feasible solution set of the inventory constraints, the violation vector in the standard target constraint weight set is determined, and the violation vector set is obtained. The penalty term function value is obtained by weighted fusion of the violation degree vector set and the standard target constraint weight set.
6. The method according to claim 1, wherein, The step involves jointly solving the feasible solution set of inventory constraints based on the target meal planning function set, the multi-objective initial weight vector, and the penalty term function value to obtain the ingredient usage dataset, including: The multi-objective problem function is obtained by weighted solving of the target meal planning function set, the multi-objective initial weight vector, and the penalty term function value. Initialize the feasible solution set of the inventory constraint by sampling to obtain an initial candidate solution set; Based on the target meal matching function set, determine the target value of each initial candidate solution in the initial candidate solution set to obtain the initial candidate target value set; Based on the initial candidate target value set, the initial candidate solution set is iteratively optimized to obtain an optimized candidate solution set; The feasibility of the proposed optimization candidate solution set is verified to obtain the ingredient usage dataset.
7. The method according to claim 1, wherein, The process of constructing discrete variables from the food inventory dataset to obtain a set of food usage variables includes: Based on the food inventory dataset, generate a set of basic food specification parameters; Based on the set of basic food specifications, the food inventory data of each food item in the food inventory dataset is discretized to obtain the set of minimum food portions. Based on the food inventory dataset, a set of food constraint rules is generated; Based on the set of food constraint rules and the set of minimum food portions, the food solution space is pre-pruned to obtain a feasible solution space. A parallel neighborhood search is performed on the feasible solution space to obtain a set of candidate solutions; An executable verification is performed on the candidate solution set and the minimum portion size set of ingredients to obtain the ingredient usage variable set.
8. A meal preparation device based on food inventory constraints, comprising: The parameter initialization unit is configured to initialize the parameters of the acquired meal preparation data in response to receiving the meal preparation instruction sent by the target user, and obtain the ingredient inventory dataset, the nutritional requirement vector set, the user preference parameters, the multi-objective initial weight vector and the constraint condition set. The discrete variable construction unit is configured to construct discrete variables from the food inventory dataset to obtain a set of food usage variables. The inventory constraint modeling unit is configured to perform inventory constraint modeling on the ingredients using a set of variables and the ingredients inventory dataset to obtain a feasible solution set for the inventory constraints. The multi-objective function construction unit is configured to construct multi-objective functions on the feasible solution set of the inventory constraints, the set of nutritional requirements vectors, and the user preference parameters to obtain a set of target meal planning functions. The penalty term construction unit is configured to perform penalty term construction processing on the feasible solution set of the inventory constraints and the set of constraints to obtain the penalty term function value; The multi-objective joint solution unit is configured to perform multi-objective joint solution on the feasible solution set of the inventory constraint based on the objective meal planning function set, the multi-objective initial weight vector and the penalty term function value, to obtain the ingredient usage dataset. The generation unit is configured to generate executable meal preparation candidate schemes based on the ingredient usage dataset, and to control the meal preparation robot to perform automated meal preparation based on the executable meal preparation candidate schemes.
9. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.