Method and device for constructing and using target food material replacement relationship library
By building a target ingredient replacement relationship library, the problem of the inability to replace recipes based on the food in users’ homes in the existing technology is solved, and the practicality and convenience of ingredient replacement are achieved, reducing food waste and improving user experience.
Patent Information
- Application Number
- CN202510033815.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-23
AI Technical Summary
The existing recipe recommendation system cannot replace seasonings and side dishes based on the ingredients that users already have at home, and cannot effectively manage the ingredients stored at home, resulting in waste of food and poor user experience.
Build a target ingredient replacement relationship library, and establish an initial and target ingredient replacement relationship library by obtaining historical ingredients and current ingredient types, filter out replaceable ingredients, and improve the practicality and convenience of ingredient replacement.
It improves the practicality and convenience of ingredient replacement in cooking recipes, improves the efficiency of users in managing the ingredients in their homes, reduces food waste, and improves the user experience.
Smart Images

Figure CN120030054A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent recipes, and in particular to a method and device for constructing and using a target ingredient replacement relationship library. Background Art
[0002] With the development of network technology and recommendation systems, users can obtain recipes, cooking methods and lists through various software. However, in daily cooking, it is often found that some seasonings or side dishes are missing when cooking according to the recipe list, and these seasonings or side dishes can sometimes be omitted or replaced. At the same time, users often forget about the ingredients and seasonings stored in the refrigerator, especially in the freezer, after a long time. When they find the ingredients, they are often expired, resulting in food waste.
[0003] However, existing recipe recommendation systems only recommend existing recipe lists and cannot replace seasonings and side dishes based on the ingredients already available at home. Existing recipe recommendation systems cannot manage the ingredients and seasonings stored at home, and often recommend recipes to users based on price, freshness, and storage capacity, without considering whether the user wants to taste the food. Summary of the invention
[0004] The present application provides a method and device for constructing and using a target ingredient replacement relationship library, which can improve the practicality and convenience of ingredient replacement in cooking recipes, enhance the user experience, and improve the efficiency of users in managing ingredients at home.
[0005] On the one hand, the present application provides a method for constructing a target food ingredient replacement relationship library, comprising:
[0006] Get historical ingredients for multiple preset objects;
[0007] Determining, according to the historical ingredients, a historical ingredient type corresponding to the historical ingredients and a historical ingredient set corresponding to the historical ingredient type;
[0008] Building an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type;
[0009] Get the current ingredient type of the current ingredient of the target object;
[0010] Searching the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and acquiring a target ingredient set corresponding to the target ingredient type;
[0011] Filtering ingredients matching the current ingredient are filtered out from the target ingredient set, and a target ingredient replacement relationship library is constructed according to the corresponding relationship between the target ingredient type and the filtering ingredients.
[0012] In an exemplary embodiment, determining, based on the historical ingredient, a historical ingredient type corresponding to the historical ingredient and a historical ingredient set corresponding to the historical ingredient type includes:
[0013] Determining, according to the historical food material, the historical food material type corresponding to the historical food material and the historical food material attribute information corresponding to the historical food material;
[0014] The historical ingredient set corresponding to the historical ingredient type is determined according to the historical ingredient attribute information corresponding to the historical ingredient.
[0015] In an exemplary embodiment, the step of screening the target ingredient set for a screening ingredient that matches the current ingredient, and constructing a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the screening ingredient, includes:
[0016] Screening a screening ingredient matching the current ingredient in the target ingredient set; the similarity between the screening ingredient and the current ingredient being greater than a first preset similarity threshold;
[0017] Determining a set of filtered ingredients corresponding to the target ingredient type according to the target ingredient type and the filtered ingredients matching the current ingredient;
[0018] A target ingredient replacement relationship library is constructed according to the corresponding relationship between each target ingredient type and the screening ingredient set corresponding to each target ingredient type.
[0019] In an exemplary embodiment, after screening the target ingredient set for the screening ingredient that matches the current ingredient and constructing a target ingredient replacement relationship library according to the correspondence between the target ingredient type and the screening ingredient, the method further includes:
[0020] Obtaining the current cooking recipe of the target object;
[0021] According to the current cooking recipe, determining a preset ingredient corresponding to the current cooking recipe;
[0022] Determining the preset ingredient type and preset ingredient attribute information according to the preset ingredient;
[0023] Searching the target ingredient replacement relationship library for a preset ingredient set that matches each of the preset ingredient types;
[0024] Controlling to determine the similarity between each of the preset ingredients and a set of preset ingredients matching each of the preset ingredient types using a preset algorithm to obtain a current similarity;
[0025] If the current similarity is greater than a second preset similarity threshold, a target preset ingredient set corresponding to each of the preset ingredients is obtained.
[0026] In an exemplary embodiment, if the current similarity is greater than a second preset similarity threshold, after obtaining a target preset ingredient set corresponding to each preset ingredient, the method includes:
[0027] A candidate ingredient set matching the candidate ingredient is screened from the target preset ingredient set; the similarity between any ingredient in the candidate ingredient set and the candidate ingredient is greater than the second preset similarity threshold; the candidate ingredient is any ingredient in the preset ingredients;
[0028] Determining a current ingredient set according to the current ingredient of the target object;
[0029] Querying whether there is an ingredient matching a preset actual ingredient in the candidate ingredient set; the preset actual ingredient is any ingredient in the current ingredient set;
[0030] If there is an ingredient matching the preset actual ingredient in the candidate ingredient set, the target current ingredient is obtained.
[0031] In an exemplary embodiment, the method further comprises:
[0032] Updating the preset ingredient to the target current ingredient to obtain the updated preset ingredient;
[0033] Obtaining an updated cooking recipe according to the updated preset ingredients;
[0034] generating account information of each of the target current ingredients according to the updated cooking recipe;
[0035] If there is no ingredient matching the preset actual ingredient in the candidate ingredient set, ingredient warning information is generated.
[0036] In an exemplary embodiment, after screening the target ingredient set for the screening ingredient that matches the current ingredient and constructing a target ingredient replacement relationship library according to the correspondence between the target ingredient type and the screening ingredient, the method further includes:
[0037] Acquire the real-time ingredient type of the real-time ingredient of the target object;
[0038] Querying the target ingredient replacement relationship library to determine whether there is a preset ingredient type corresponding to the real-time ingredient type;
[0039] If there is no preset food type corresponding to the real-time food type, construct a real-time food replacement relationship library according to the real-time food;
[0040] The target ingredient replacement relationship library is updated to the real-time ingredient replacement relationship library.
[0041] On the other hand, a method for using a target ingredient replacement relationship library is provided, the method comprising:
[0042] Get the type of ingredients to be used for the list to be cooked;
[0043] The target ingredient type matching the ingredient type to be used is queried in the target ingredient replacement relationship library to obtain the target ingredient corresponding to the target ingredient type; wherein the target ingredient replacement relationship library is obtained based on the method for constructing the target ingredient replacement relationship library according to any one of claims 1 to 7.
[0044] On the other hand, a device for constructing a target food ingredient replacement relationship library is provided, the device comprising:
[0045] A historical food material acquisition module is used to acquire historical food materials of multiple preset objects;
[0046] A historical information acquisition module, used to determine, based on the historical ingredients, a historical ingredient type corresponding to the historical ingredients and a historical ingredient set corresponding to the historical ingredient type;
[0047] An initial replacement library module, used to construct an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type;
[0048] The current ingredient module is used to obtain the current ingredient type of the current ingredient of the target object;
[0049] A target ingredient module, configured to search the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and obtain a target ingredient set corresponding to the target ingredient type;
[0050] The target ingredient replacement relationship library module is used to filter the selected ingredients matching the current ingredient in the target ingredient set, and to construct a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the selected ingredients.
[0051] On the other hand, a device for using a target food material replacement relationship library is provided, wherein the device comprises:
[0052] A module for obtaining a list of ingredients to be cooked, used to obtain the types of ingredients to be used in the list of ingredients to be cooked;
[0053] A replacement result determination module is used to query the target ingredient type that matches the to-be-used ingredient type in the target ingredient replacement relationship library, and obtain the target ingredient corresponding to the target ingredient type; wherein the target ingredient replacement relationship library is obtained based on the method for constructing the target ingredient replacement relationship library described in any one of claims 1-7.
[0054] On the other hand, an electronic device is provided, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded by the processor and executing the method for constructing a target ingredient replacement relationship library or the method for using a target ingredient replacement relationship library as described above.
[0055] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the method for constructing a target ingredient replacement relationship library or the method for using a target ingredient replacement relationship library as described above.
[0056] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the method for constructing a target ingredient substitution relationship library or the method for using a target ingredient substitution relationship library as described above.
[0057] The present application obtains historical ingredients of multiple preset objects; according to the historical ingredients, determines the historical ingredient type corresponding to the historical ingredient and the historical ingredient set corresponding to the historical ingredient type; according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type, constructs an initial ingredient replacement relationship library; obtains the current ingredient type of the current ingredient of the target object; searches for the target ingredient type matching the current ingredient type in the initial ingredient replacement relationship library, and obtains the target ingredient set corresponding to the target ingredient type; filters the filtered ingredients matching the current ingredient in the target ingredient set, and constructs the target ingredient replacement relationship library according to the correspondence between the target ingredient type and the filtered ingredients. The present application constructs an initial ingredient replacement relationship library through historical ingredients; then, through the current ingredients of the target, filters out ingredients matching the current ingredients, and constructs a target ingredient relationship library. When in use, the ingredients recommended for replacement in the cooking list are all currently stored by the user, which improves the practicality and convenience of ingredient replacement in the cooking list and enhances the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions and advantages of the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 It is a flowchart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0060] Figure 2 It is a flowchart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0061] Figure 3 It is a flowchart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0062] Figure 4 It is a flowchart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0063] Figure 5 It is a flowchart of a method for using a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0064] Figure 6 It is a flowchart of a method for constructing and using a target food ingredient replacement relationship library provided in an embodiment of this specification;
[0065] Figure 7 It is a structural schematic diagram of a device for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification.
[0066] Figure 8 It is a structural schematic diagram of a device for using a target ingredient replacement relationship library provided in an embodiment of this specification.
[0067] Fig. 9 It is a structural diagram of a server for target food replacement provided in an embodiment of this specification. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0070] The following describes a method for constructing a target food material replacement relationship library of the present application. Figure 1 It is a flow chart of a method for constructing a target ingredient replacement relationship library provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 1 As shown, the method can be applied to a control unit in a recipe recommendation system, and the method may include:
[0071] S101: Acquire historical ingredients of multiple preset objects.
[0072] In the embodiment of this specification, historical ingredients of multiple preset objects are obtained through big data and laboratory tests. The historical ingredients may include side dishes, seasonings or other raw materials used for cooking.
[0073] S103: Determine, according to the historical ingredient, a historical ingredient type corresponding to the historical ingredient and a historical ingredient set corresponding to the historical ingredient type.
[0074] In the embodiment of the present specification, determining, according to the historical ingredients, the historical ingredient type corresponding to the historical ingredients and the historical ingredient set corresponding to the historical ingredient type includes:
[0075] Determining, according to the historical food material, the historical food material type corresponding to the historical food material and the historical food material attribute information corresponding to the historical food material;
[0076] The historical ingredient set corresponding to the historical ingredient type is determined according to the historical ingredient attribute information corresponding to the historical ingredient.
[0077] In the embodiment of the present specification, the historical food attribute information includes the taste, smell, touch, mouthfeel or other attribute information of the historical food.
[0078] S105: constructing an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type.
[0079] In the embodiment of the present specification, the historical food types can be distinguished according to the existing data classification method, which can be, for example, a decision tree, a support vector set, a K-nearest neighbor algorithm or other algorithms that can be used for food classification; the initial food replacement relationship library can be a set of different types of food, which can be, for example,
[0080] X={X i}|i=1,2,3...n
[0081] Among them, X represents the initial food material replacement relationship library, X i Indicates food data that can be classified into the same category, and i represents different food types.
[0082] Ingredients of the same ingredient type can be used interchangeably without affecting the taste of the recipe.
[0083] S107: Obtain the current ingredient type of the current ingredient of the target object;
[0084] In the embodiments of the present specification, ingredient-related data such as the ingredient type, storage time, storage weight and storage location of the current ingredient of the target object can be extracted based on image recognition, voice interaction, weight detection and other Internet data-related technologies.
[0085] S109: searching the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and acquiring a target ingredient set corresponding to the target ingredient type.
[0086] In the embodiments of the present specification, an initial screening is performed by first searching for ingredients that match the current ingredient type in the initial ingredient replacement relationship library, and possible replaceable ingredients of the same type as the current ingredient are obtained, thereby improving the efficiency and accuracy of ingredient replacement in cooking recipes.
[0087] S111: screening ingredients matching the current ingredient in the target ingredient set, and constructing a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the screening ingredients.
[0088] In the embodiment of the present specification, the target ingredient set is screened for screening ingredients that match the current ingredient, and a target ingredient replacement relationship library is constructed according to the corresponding relationship between the target ingredient type and the screening ingredients, such as Figure 2 As shown, Figure 2 : is a flow chart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification, comprising:
[0089] S201: screening ingredients matching the current ingredient in the target ingredient set; the similarity between the screened ingredients and the current ingredient is greater than a first preset similarity threshold.
[0090] In the embodiment of the present specification, the first preset similarity threshold can be set according to the actual situation, and can be 0.9 for example, and the similarity between the filtered ingredients and the current ingredients is greater than 0.9. By filtering ingredients whose similarity with the current ingredients is greater than the first preset similarity threshold in the target ingredient set, the filtered replaceable ingredients are close to the current ingredients, thereby ensuring that the taste of the cooked recipe is not affected, improving the user experience, and improving the practicality of ingredient replacement in the cooking recipe.
[0091] S202: Determine a set of filtered ingredients corresponding to the target ingredient type according to the target ingredient type and the filtered ingredients matching the current ingredient.
[0092] In the embodiment of the present specification, the screening ingredient set corresponding to the target ingredient type can be, for example,
[0093]
[0094] in, represents the set of filtered ingredients corresponding to each target ingredient type, X j represents the set of filtered ingredients corresponding to any target ingredient type, and X j The similarity between any ingredient and the current ingredient is greater than the first preset similarity threshold, which can be expressed by a formula. For example, it can be
[0095] X j |{p( x j,y)>0.9}
[0096] Among them, y represents the food attribute information of the current food; p(x j ,y) represents X j The similarity between any ingredient and the current ingredient, and p(x j ,y) can be represented by calculating the Euclidean distance between vectors.
[0097] S203: constructing a target ingredient replacement relationship library according to the corresponding relationship between each target ingredient type and the screening ingredient set corresponding to each target ingredient type.
[0098] In the embodiment of the present specification, the target food material replacement relationship library can be represented by a formula, which can be, for example,
[0099]
[0100] in, represents the target ingredient replacement relation library, n represents the number of target ingredient types, i represents different target ingredient types, Represents the set of filtered ingredients corresponding to each target ingredient type.
[0101] Each set of filtered ingredients corresponding to each target ingredient type is merged to construct a target ingredient replacement relationship library.
[0102] In the embodiment of the present specification, after the target ingredient set is screened for the screening ingredients that match the current ingredient, and a target ingredient replacement relationship library is constructed according to the correspondence between the target ingredient type and the screening ingredients, as shown in FIG. Figure 3 As shown, Figure 3 : is a flow chart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification, comprising:
[0103] S301: Acquire the current cooking recipe of the target object.
[0104] In the embodiment of the present specification, the current cooking recipe of the target object is obtained through image recognition, voice interaction, text input, etc.
[0105] S302: Determine, according to the current cooking recipe, preset ingredients corresponding to the current cooking recipe.
[0106] S303: Determine the preset ingredient type and preset ingredient attribute information according to the preset ingredient.
[0107] S304: searching the target ingredient replacement relationship library for a preset ingredient set that matches each of the preset ingredient types.
[0108] S305: controlling to determine the similarity between each of the preset ingredients and a set of preset ingredients matching each of the preset ingredient types using a preset algorithm to obtain a current similarity.
[0109] In the embodiment of the present specification, the current similarity can be the average similarity between each preset ingredient and the preset ingredient set matching each preset ingredient type; first obtain the similarity between each preset ingredient and any ingredient in the preset ingredient set matching each preset ingredient type, then take the average value to obtain the current similarity. The current similarity can be expressed by a formula, for example, it can be
[0110]
[0111] in, Indicates the current similarity, Indicates the target ingredient replacement relation library The i-th category in x ij represents the jth ingredient in the i-th category, n represents the number of ingredients, p(x ij , z) represents the similarity between the jth ingredient in the ith category and the preset ingredient z.
[0112] S306: If the current similarity is greater than a second preset similarity threshold, a target preset ingredient set corresponding to each of the preset ingredients is obtained.
[0113] In the embodiment of the present specification, the second preset similarity threshold can be set according to the actual situation, and can be 0.98 for example. When the current similarity is greater than 0.98 and has the highest probability among the target ingredient types, a target preset ingredient set corresponding to each of the preset ingredients is obtained. The acquisition condition of the target preset ingredient set can be expressed by a formula, and can be
[0114]
[0115] in, represents the current similarity corresponding to each target ingredient type, i represents different target ingredient types, It indicates that the probability of satisfying all target ingredient types is the highest, and P indicates that the probability of satisfying all target ingredient types is the highest and the similarity is greater than 0.98.
[0116] In the embodiment of the present specification, if the current similarity is greater than the second preset similarity threshold, after obtaining the target preset ingredient set corresponding to each preset ingredient, as follows Figure 4 As shown, Figure 4 : is a flow chart of a method for constructing a target food ingredient replacement relationship library provided in an embodiment of this specification, comprising:
[0117] S401: Filtering a candidate ingredient set matching a candidate ingredient from the target preset ingredient set; the similarity between any ingredient in the candidate ingredient set and the candidate ingredient is greater than the second preset similarity threshold; the candidate ingredient is any ingredient in the preset ingredients;
[0118] S402: Determine a current ingredient set according to the current ingredient of the target object;
[0119] S403: Querying whether there is an ingredient matching a preset actual ingredient in the candidate ingredient set; the preset actual ingredient is any ingredient in the current ingredient set;
[0120] S404: If there is an ingredient matching the preset actual ingredient in the candidate ingredient set, obtain the target current ingredient.
[0121] In the embodiment of the present specification, the current ingredient set Y is determined according to the current ingredient of the target object. The target current ingredient can be represented by δ. The acquisition condition of the target current ingredient δ can be represented by a formula. For example, it can be
[0122]
[0123] in, Indicates the target ingredient replacement relation library The i-th category in the formula; z represents the preset ingredients, p(x ij , z) represents the similarity between the jth ingredient in the ith category and the preset ingredient z, and it is greater than 0.98; p(δ,z) represents the similarity between the target current ingredient δ and the preset ingredient z, and it is greater than 0.98.
[0124] In the embodiment of the present specification, after screening the screening ingredients matching the current ingredient in the target ingredient set and constructing a target ingredient replacement relationship library according to the correspondence between the target ingredient type and the screening ingredients, the method further includes:
[0125] Acquire the real-time ingredient type of the real-time ingredient of the target object;
[0126] Querying the target ingredient replacement relationship library to determine whether there is a preset ingredient type corresponding to the real-time ingredient type;
[0127] If there is no preset food type corresponding to the real-time food type, construct a real-time food replacement relationship library according to the real-time food;
[0128] The target ingredient replacement relationship library is updated to the real-time ingredient replacement relationship library.
[0129] In the embodiment of the present specification, when the user stores ingredients, the ingredient information is updated, and thus the target ingredient replacement relationship library is also updated, so that when replacing ingredients in cooking recipes, the recommended ingredients are all the user's existing ingredients. After the target ingredient replacement relationship library is updated, after the user obtains the latest cooking recipe, he or she will search the latest target ingredient replacement relationship library to see whether the target current ingredient exists, which improves the practicality and accuracy of ingredient replacement in cooking recipes and enhances the user's experience.
[0130] In the embodiment of this specification, the method further includes:
[0131] Updating the preset ingredient to the target current ingredient to obtain the updated preset ingredient;
[0132] Obtaining an updated cooking recipe according to the updated preset ingredients;
[0133] generating account information of each of the target current ingredients according to the updated cooking recipe;
[0134] If there is no ingredient matching the preset actual ingredient in the candidate ingredient set, ingredient warning information is generated.
[0135] In the embodiments of this specification, the account information may be the storage location information of the ingredients; the ingredient warning information is used to remind the user that the home is short of relevant replaceable ingredients and needs to be purchased in time. The cooking recipe is updated by updating the preset ingredients in the cooking dish to the target current ingredients, and the updated cooking recipe maintains the original taste; the user is informed of the storage location of the ingredients to facilitate the user to find, and at the same time the user is reminded of the ingredients that are missing at home, thereby avoiding the situation where the user makes repeated purchases and wastes expired ingredients, taking into account the emotional value of the user and improving the user's experience.
[0136] This manual also provides a method for using a target ingredient replacement relationship library, such as Figure 5 As shown, Figure 5: is a flowchart of a method for using a target ingredient replacement relationship library provided in an embodiment of this specification, the method comprising:
[0137] S501: Obtain the types of ingredients to be used in the cooking list.
[0138] In the embodiment of the present specification, the to-be-cooked list is obtained through image recognition, voice interaction, text input, etc., and thereby the ingredient types of the to-be-cooked ingredients in the to-be-cooked list are obtained.
[0139] S503: Querying the target ingredient type that matches the ingredient type to be used in the target ingredient replacement relationship library, and obtaining the target ingredient corresponding to the target ingredient type; wherein the target ingredient replacement relationship library is obtained based on the above-mentioned target ingredient replacement relationship library construction method.
[0140] In the embodiment of the present specification, the process of querying the target ingredient type matching the to-be-used ingredient type in the target ingredient replacement relationship library is similar to the process of querying the preset ingredient set matching each of the preset ingredient types in the target ingredient replacement relationship library; first, the target ingredient type matching the to-be-used ingredient type is queried in the target ingredient replacement relationship library, thereby obtaining the target screening ingredients matching the target ingredient type, thereby obtaining the final target use ingredients corresponding to the target ingredient type. In the process of using the target ingredient replacement relationship library, the user's existing ingredients that can be replaced with the ingredients in the to-be-cooked list are obtained, which improves the practicality and convenience of ingredient replacement in the cooking recipe, enhances the user's experience, and takes into account the user's emotional value.
[0141] In an exemplary embodiment, Figure 6 As shown, Figure 6 This is a flow chart of a method for constructing and using a target food ingredient replacement relationship library provided in an embodiment of this specification, including:
[0142] S601: Obtain food attribute information through big data and laboratory results.
[0143] In the embodiments of the present specification, the food attribute information may include information on the taste, smell, touch, mouthfeel, etc. of the food and seasoning.
[0144] S602: Data classification.
[0145] In the embodiment of the present specification, the replaceable ingredients are classified into data using a classification algorithm, which may include existing data classification methods such as decision trees, support vector sets, and K-nearest neighbor algorithms.
[0146] S603: Establish a large model for replacing ingredients.
[0147] In the embodiment of this specification, the ingredient replacement model includes different ingredient types and replaceable ingredient sets corresponding to different ingredient types. By replacing ingredients of the same category, the taste of the cooking recipe is ensured to be unaffected, the preparation and practicality of ingredient replacement in the cooking recipe is improved, and the user experience is enhanced.
[0148] S604: The user purchases food.
[0149] S605: Obtaining food characteristic information.
[0150] In the embodiments of the present specification, characteristic information of food ingredients is obtained through image recognition, voice interaction, weight detection and Internet data technology; the characteristic information of food ingredients may include storage type, storage time, storage weight and storage location of the food ingredients.
[0151] S606: Acquire food material data;
[0152] In the embodiment of the present specification, the food data is composed of the storage type, storage time, storage weight and storage location of the food.
[0153] S607: Acquire food storage data.
[0154] In the embodiment of this specification, the food storage data is obtained through the food data of different food ingredients.
[0155] S608: Construct a family-specific food ingredient replacement model.
[0156] In the embodiment of the present specification, a family-specific ingredient replacement model is constructed by screening replaceable ingredients that match the ingredient storage data in the ingredient replacement model and merging the replaceable ingredients corresponding to each ingredient type.
[0157] S609: Obtain a list of cooking ingredients.
[0158] In the embodiments of this specification, a list of cooking ingredients is obtained through image recognition, voice interaction, text input, etc.
[0159] S610: Obtain a list of available ingredients.
[0160] In the embodiment of the present specification, the available ingredient list is input into the household-specific ingredient replacement model to obtain replaceable ingredients with ingredients in the cooking ingredient list, and the cooking ingredient list is updated to obtain the available ingredient list.
[0161] This embodiment first constructs a large model for food replacement, classifies data for a wide range of different food materials, and determines the replaceable food materials of different types of food materials; then, the large model for food replacement is preliminarily screened for food materials in the user's home, and the replaceable food materials with those in the user's home are obtained, and a family-specific food replacement model is obtained; finally, for the cooking food list, combined with the family-specific food replacement model, the replaceable food materials available at home that match the cooking food list desired by the user are obtained, and while recommending replaceable food materials, the user's desired recipe taste is retained, the user's emotional value is taken into consideration, and the user's experience is improved. By screening replaceable food materials step by step, the accuracy, practicality, and convenience of food replacement in cooking recipes are improved.
[0162] It can be seen from the technical solutions provided by the above embodiments of this specification that the embodiments of this specification obtain historical ingredients of multiple preset objects; based on the historical ingredients, determine the historical ingredient type corresponding to the historical ingredient and the historical ingredient set corresponding to the historical ingredient type; construct an initial ingredient replacement relationship library based on the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type; obtain the current ingredient type of the current ingredient of the target object; search for the target ingredient type that matches the current ingredient type in the initial ingredient replacement relationship library, and obtain the target ingredient set corresponding to the target ingredient type; filter the filtered ingredients that match the current ingredient in the target ingredient set, and construct a target ingredient replacement relationship library based on the correspondence between the target ingredient type and the filtered ingredients. This application first classifies the historical ingredients of multiple preset objects to construct an initial ingredient replacement relationship library; then screens the initial ingredient replacement relationship library through the current ingredients of the target object to obtain the target ingredient replacement relationship library, thereby screening the target current ingredients for the current cooking recipe, and updating the current cooking recipe, generating prompt information for the target current ingredients to prompt the user of the storage location of the target current ingredients, and generating ingredient warning information for ingredients that cannot be replaced at all to remind the user to purchase them in time. This application improves the accuracy, practicality and convenience of ingredient replacement in cooking recipes by replacing the existing seasonings and side dishes in the user's home and using the existing ingredients to complete cooking; and the replacement of ingredients is based on the user's expected cooking recipes, taking into account the user's emotional value; and while recommending recipes, this application manages the existing ingredients and seasonings at home, prompts the user of the storage location of ingredients, avoids repeated purchases, expiration and other food waste, and reminds the user to purchase the missing ingredients, improves the saving performance, and enhances the user's experience.
[0163] This specification also provides a device for constructing a target food material replacement relationship library, such as Figure 7 As shown, the device comprises:
[0164] A historical food material acquisition module 701 is used to acquire historical food materials of multiple preset objects;
[0165] A historical information acquisition module 702 is used to determine, based on the historical ingredients, a historical ingredient type corresponding to the historical ingredient and a historical ingredient set corresponding to the historical ingredient type;
[0166] An initial replacement library module 703 is used to construct an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type;
[0167] The current ingredient module 704 is used to obtain the current ingredient type of the current ingredient of the target object;
[0168] A target ingredient module 705 is used to search the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and obtain a target ingredient set corresponding to the target ingredient type;
[0169] The target ingredient replacement relationship library module 706 is used to filter the target ingredient set to match the current ingredient, and to construct a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the filter ingredient.
[0170] In some embodiments, the historical information acquisition module further includes:
[0171] An information determination unit is used to determine, according to the historical ingredients, the historical ingredient type corresponding to the historical ingredients and the historical ingredient attribute information corresponding to the historical ingredients.
[0172] The historical food set determining unit is used to determine the historical food set corresponding to the historical food type according to the historical food attribute information corresponding to the historical food.
[0173] In some embodiments, the target ingredient replacement relationship library further includes:
[0174] The ingredient screening unit is used to screen the screening ingredients matching the current ingredient in the target ingredient set; the similarity between the screening ingredients and the current ingredient is greater than a first preset similarity threshold.
[0175] The screening ingredient set unit is used to determine the screening ingredient set corresponding to the target ingredient type according to the target ingredient type and the screening ingredients matching the current ingredient.
[0176] The construction unit is used to construct a target ingredient replacement relationship library according to the corresponding relationship between each target ingredient type and the screening ingredient set corresponding to each target ingredient type.
[0177] In some embodiments, the apparatus further comprises:
[0178] The current cooking recipe module is used to obtain the current cooking recipe of the target object.
[0179] The preset ingredient module is used to determine the preset ingredients corresponding to the current cooking recipe according to the current cooking recipe.
[0180] The preset information module is used to determine the preset ingredient type and preset ingredient attribute information according to the preset ingredient.
[0181] The preset ingredient set module is used to search the target ingredient replacement relationship library for a preset ingredient set that matches each preset ingredient type.
[0182] The current similarity module is used to control the use of a preset algorithm to determine the similarity between each of the preset ingredients and a set of preset ingredients that match each of the preset ingredient types, so as to obtain a current similarity.
[0183] The target preset ingredient set module is used to obtain a target preset ingredient set corresponding to each preset ingredient if the current similarity is greater than a second preset similarity threshold.
[0184] In some embodiments, the apparatus further comprises:
[0185] A candidate ingredient set module is used to screen a candidate ingredient set that matches the candidate ingredient in the target preset ingredient set; the similarity between any ingredient in the candidate ingredient set and the candidate ingredient is greater than the second preset similarity threshold; and the candidate ingredient is any ingredient in the preset ingredients.
[0186] The current ingredient set module is used to determine the current ingredient set according to the current ingredient of the target object.
[0187] The preset actual ingredient module is used to query whether there is an ingredient matching the preset actual ingredient in the candidate ingredient set; the preset actual ingredient is any ingredient in the current ingredient set.
[0188] The target current ingredient module is used to obtain the target current ingredient if there is an ingredient matching the preset actual ingredient in the candidate ingredient set.
[0189] In some embodiments, the apparatus further comprises:
[0190] An updated preset ingredient module for updating the preset ingredient to the target current ingredient to obtain the updated preset ingredient.
[0191] An updated cooking recipe module for obtaining an updated cooking recipe according to the updated preset ingredient.
[0192] An account information module for generating account information for each target current ingredient according to the updated cooking recipe.
[0193] An ingredient warning information module for generating ingredient warning information if there is no ingredient in the candidate ingredient set that matches the preset actual ingredient.
[0194] In some embodiments, the device further includes:
[0195] A real-time ingredient type module for obtaining the real-time ingredient type of the real-time ingredients of the target object.
[0196] A preset ingredient type module for querying in the target ingredient substitution relationship library whether there is a preset ingredient type corresponding to the real-time ingredient type.
[0197] A real-time ingredient substitution relationship library module for constructing a real-time ingredient substitution relationship library according to the real-time ingredient if there is no preset ingredient type corresponding to the real-time ingredient type.
[0198] An updated target ingredient substitution relationship module for updating the target ingredient substitution relationship library to the real-time ingredient substitution relationship library.
[0199] This specification also provides a device for using a target ingredient substitution relationship library, as Figure 8 shown, the device includes:
[0200] A to-be-cooked list acquisition module 801 for acquiring the to-be-used ingredient type of the to-be-cooked list.
[0201] A substitution result determination module 802 for querying in the target ingredient substitution relationship library the target ingredient type that matches the to-be-used ingredient type and obtaining the target used ingredient corresponding to the target ingredient type; wherein, the target ingredient substitution relationship library is obtained based on the above-mentioned method for constructing the target ingredient substitution relationship library.
[0202] The device in the device embodiment and the method embodiment are based on the same inventive concept.
[0203] An embodiment of the present specification provides an electronic device of a target ingredient replacement relationship library, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement a method for constructing a target ingredient replacement relationship library as provided in the above method embodiment or a method for using a target ingredient replacement relationship library as provided in the above method embodiment.
[0204] An embodiment of the present application also provides a computer storage medium, which can be set in a terminal to store at least one instruction or at least one program related to a method for constructing a target ingredient replacement relationship library or a method for using a target ingredient replacement relationship library in a method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the method for constructing a target ingredient replacement relationship library provided in the above method embodiment or the method for using a target ingredient replacement relationship library provided in the above method embodiment.
[0205] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes to implement the method for constructing the target ingredient replacement relationship library provided by the above method embodiment or the method for using the target ingredient replacement relationship library provided by the above method embodiment.
[0206] The memory described in the embodiments of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0207] The methods for constructing a target ingredient replacement relationship library or using a target ingredient replacement relationship library provided in the embodiments of this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig. 9 This is a hardware structure block diagram of a server for a method for constructing a target ingredient replacement relationship library or a method for using a target ingredient replacement relationship library provided in an embodiment of this specification. Fig. 9As shown, the server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 910 (the central processing unit 910 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 930 for storing data, and one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be short-term storage or permanent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the server 900. The server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or one or more operating systems 921, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0208] The input / output interface 940 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 900. In one example, the input / output interface 940 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 940 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0209] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.
[0210] It can be seen from the embodiments of the method and device for constructing and using a target ingredient replacement relationship library provided by the present application that the present application obtains historical ingredients of multiple preset objects; based on the historical ingredients, determines the historical ingredient type corresponding to the historical ingredient and the historical ingredient set corresponding to the historical ingredient type; constructs an initial ingredient replacement relationship library based on the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type; obtains the current ingredient type of the current ingredient of the target object; searches for the target ingredient type that matches the current ingredient type in the initial ingredient replacement relationship library, and obtains the target ingredient set corresponding to the target ingredient type; filters the filtered ingredients that match the current ingredient in the target ingredient set, and constructs a target ingredient replacement relationship library based on the correspondence between the target ingredient type and the filtered ingredients. The present application first classifies the historical ingredients of multiple preset objects to construct an initial ingredient replacement relationship library; then screens the initial ingredient replacement relationship library through the current ingredients of the target object to obtain the target ingredient replacement relationship library, thereby screening the target current ingredients for the current cooking recipe, and updating the current cooking recipe, generating prompt information for the target current ingredients to prompt the user of the storage location of the target current ingredients, and generating ingredient warning information for completely irreplaceable ingredients to remind the user to purchase them in time; and updating the target ingredient replacement relationship library in real time for the ingredients stored by the user to ensure that the ingredients recommended for replacement in the cooking recipe are all available at the user's home. The present application improves the accuracy, practicality and convenience of ingredient replacement in the cooking recipe by replacing the existing seasonings and side dishes at the user's home and completing the cooking with the existing ingredients; and the replacement of ingredients is based on the user's expected cooking recipe, taking into account the user's emotional value; and while recommending recipes, the present application manages the existing ingredients and seasonings at home, prompts the user of the storage location of ingredients, avoids the waste of ingredients such as repeated purchases and expiration, and reminds the purchase of missing ingredients, improves the saving performance, and enhances the user's experience.
[0211] It should be noted that the above sequence of the embodiments of this specification is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0212] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0213] Those skilled in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by a program to instruct the relevant hardware to complete the steps. The program can be stored in a computer storage medium, and the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc. The above is only a preferred embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for constructing a target food material replacement relationship library, characterized in that: include: Get historical ingredients for multiple preset objects; Determining, according to the historical ingredients, a historical ingredient type corresponding to the historical ingredients and a historical ingredient set corresponding to the historical ingredient type; Building an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type; Get the current ingredient type of the current ingredient of the target object; Searching the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and acquiring a target ingredient set corresponding to the target ingredient type; Filtering ingredients that match the current ingredient in the target ingredient set, and constructing a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the filtering ingredients.
2. The method according to claim 1, characterized in that The step of determining, according to the historical ingredients, a historical ingredient type corresponding to the historical ingredients and a historical ingredient set corresponding to the historical ingredient type includes: Determining, according to the historical food material, the historical food material type corresponding to the historical food material and the historical food material attribute information corresponding to the historical food material; The historical ingredient set corresponding to the historical ingredient type is determined according to the historical ingredient attribute information corresponding to the historical ingredient.
3. The method according to claim 1, characterized in that The step of screening the target ingredients that match the current ingredient from the target ingredient set and constructing a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the screening ingredients includes: Screening a screening ingredient matching the current ingredient in the target ingredient set; the similarity between the screening ingredient and the current ingredient being greater than a first preset similarity threshold; Determining a set of filtered ingredients corresponding to the target ingredient type according to the target ingredient type and the filtered ingredients matching the current ingredient; A target ingredient replacement relationship library is constructed according to the corresponding relationship between each target ingredient type and the screening ingredient set corresponding to each target ingredient type.
4. The method according to claim 1, characterized in that: After screening the screening ingredients matching the current ingredient in the target ingredient set and building a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the screening ingredients, the method further includes: Obtaining the current cooking recipe of the target object; According to the current cooking recipe, determining a preset ingredient corresponding to the current cooking recipe; Determining the preset ingredient type and preset ingredient attribute information according to the preset ingredient; Searching the target ingredient replacement relationship library for a preset ingredient set that matches each of the preset ingredient types; Controlling to determine the similarity between each of the preset ingredients and a set of preset ingredients matching each of the preset ingredient types using a preset algorithm to obtain a current similarity; If the current similarity is greater than a second preset similarity threshold, a target preset ingredient set corresponding to each of the preset ingredients is obtained.
5. The method according to claim 4, characterized in that If the current similarity is greater than a second preset similarity threshold, after obtaining a target preset ingredient set corresponding to each preset ingredient, the method includes: A candidate ingredient set matching the candidate ingredient is screened from the target preset ingredient set; the similarity between any ingredient in the candidate ingredient set and the candidate ingredient is greater than the second preset similarity threshold; the candidate ingredient is any ingredient in the preset ingredients; Determining a current ingredient set according to the current ingredient of the target object; Querying whether there is an ingredient matching a preset actual ingredient in the candidate ingredient set; the preset actual ingredient is any ingredient in the current ingredient set; If there is an ingredient matching the preset actual ingredient in the candidate ingredient set, the target current ingredient is obtained.
6. The method according to claim 5, characterized in that The method further comprises: Updating the preset ingredient to the target current ingredient to obtain the updated preset ingredient; Obtaining an updated cooking recipe according to the updated preset ingredients; generating account information of each of the target current ingredients according to the updated cooking recipe; If there is no ingredient matching the preset actual ingredient in the candidate ingredient set, ingredient warning information is generated.
7. The method according to claim 1, characterized in that After screening the screening ingredients matching the current ingredient in the target ingredient set and building a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the screening ingredients, the method further includes: Acquire the real-time ingredient type of the real-time ingredient of the target object; Querying the target ingredient replacement relationship library to determine whether there is a preset ingredient type corresponding to the real-time ingredient type; If there is no preset food type corresponding to the real-time food type, construct a real-time food replacement relationship library according to the real-time food; The target ingredient replacement relationship library is updated to the real-time ingredient replacement relationship library.
8. A method for using a target food material replacement relationship library, characterized in that: The method comprises: Get the type of ingredients to be used for the list to be cooked; The target ingredient type matching the ingredient type to be used is queried in the target ingredient replacement relationship library to obtain the target ingredient corresponding to the target ingredient type; wherein the target ingredient replacement relationship library is obtained based on the method for constructing the target ingredient replacement relationship library according to any one of claims 1 to 7.
9. A device for constructing a target food material replacement relationship library, characterized in that: The device comprises: A historical food material acquisition module is used to acquire historical food materials of multiple preset objects; A historical information acquisition module, used to determine, based on the historical ingredients, a historical ingredient type corresponding to the historical ingredients and a historical ingredient set corresponding to the historical ingredient type; An initial replacement library module, used to construct an initial ingredient replacement relationship library according to the correspondence between the historical ingredient type and the historical ingredient set corresponding to the historical ingredient type; The current ingredient module is used to obtain the current ingredient type of the current ingredient of the target object; A target ingredient module, configured to search the initial ingredient replacement relationship library for a target ingredient type that matches the current ingredient type, and obtain a target ingredient set corresponding to the target ingredient type; The target ingredient replacement relationship library module is used to filter the selected ingredients matching the current ingredient in the target ingredient set, and to construct a target ingredient replacement relationship library according to the corresponding relationship between the target ingredient type and the selected ingredients.
10. A device for using a target food material replacement relationship library, characterized in that: The device comprises: A module for obtaining a list of ingredients to be cooked, used to obtain the types of ingredients to be used in the list of ingredients to be cooked; A replacement result determination module is used to query the target ingredient type that matches the to-be-used ingredient type in the target ingredient replacement relationship library, and obtain the target ingredient corresponding to the target ingredient type; wherein the target ingredient replacement relationship library is obtained based on the method for constructing the target ingredient replacement relationship library described in any one of claims 1-7.
11. An electronic device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method for constructing a target ingredient replacement relationship library as described in any one of claims 1 to 7 or the method for using a target ingredient replacement relationship library as described in claim 8.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the method for constructing the target ingredient substitution relationship library as described in any one of claims 1 to 7 or the method for using the target ingredient substitution relationship library as described in claim 8.