A food ingredient query method, device, medium and food safety platform

By obtaining user historical dining information and prioritizing the configuration of nutritional ingredient database, combining prefix matching and dictionary tree structure query methods, the problem of low efficiency in food ingredient query in group meal environment is solved, and efficient and accurate food ingredient query is achieved.

CN117909456BActive Publication Date: 2025-02-18CNNC KELLY (SHENZHEN) CATERING MANAGEMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311654204.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2025-02-18
Estimated Expiration
2043-12-05

AI Technical Summary

Technical Problem

It is difficult to achieve accurate and efficient food ingredient query in the prior art, especially in group meal environments, users need to query the nutritional components of various ingredients or dishes through multiple channels, which is inefficient and the data is not real-time.

Method used

By obtaining the user's historical dining information, prioritize the food entries in the nutritional ingredient library, and query using prefix matching and dictionary tree structure, identifying dining images based on the user's historical dining data, and calculating nutritional ingestion.

Benefits of technology

It enables users to obtain the food ingredients of their interest more efficiently and accurately when querying nutritional ingredients, improves query efficiency and accuracy, and meets users' real-time query needs for food ingredients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117909456B_ABST
    Figure CN117909456B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, medium and food safety platform for querying food ingredients. The method includes: obtaining historical dining information of a user within a preset time period; prioritizing each food entry in a preset nutritional ingredient library according to the historical dining information; receiving a query character input by a user on a query page; prefix matching the query character with each food entry, and displaying the selected food entries with successful prefix matching in a display area according to priority sorting; determining a target food entry and displaying the nutritional ingredient details of the target food entry in response to a selection operation of the user in the display area. By presetting a nutritional ingredient library that matches actual meals and configuring the priority of entries in combination with the user's historical dining information, users can more efficiently and accurately obtain the food ingredients they are interested in when querying nutritional ingredients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a food ingredient query method, device, medium and food safety platform. Background Art

[0002] Group meals are a type of centralized meal management for a group. Based on its large service user base and widely distributed catering institutions, and in an environment where more and more attention is paid to food safety, it is very necessary to strengthen safety supervision and management of catering institutions through a digital food safety platform, standardize restaurant behavior, and enhance information service capabilities and Internet operation capabilities.

[0003] In food safety, the nutritional composition of ingredients is the basis of diet and health. For the wide variety of ingredients and dishes in group meals, if diners need to understand their own nutritional intake, they need to query the nutritional composition of each ingredient or dish in turn through other channels such as nutrition apps, browser search engines, etc. This method is not only inefficient but also different from the ingredient data of the user's actual meal, making it difficult to achieve accurate and efficient food ingredient query. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a food ingredient query method, device, medium and food safety platform, aiming to achieve accurate and efficient food ingredient query.

[0005] The technical solution of the present invention is as follows:

[0006] A method for querying food ingredients comprises the following steps:

[0007] Obtain the user's historical dining information within a preset time period;

[0008] Prioritizing each food item in a preset nutritional component library according to the historical dining information;

[0009] Receive the query characters entered by the user on the query page;

[0010] Prefix matching is performed between the query character and each food entry, and the food entries to be selected with successful prefix matching are displayed in a display area in order of priority;

[0011] In response to a selection operation by a user in the display area, a target food item is determined and a nutritional component detail of the target food item is displayed.

[0012] In one embodiment, the prioritization of each food item in the preset nutritional component library according to the historical dining information includes:

[0013] Counting the dishes in the historical dining information to obtain the number of times each dish and each ingredient were ordered;

[0014] The priority of each dish and ingredient in the nutritional component library is configured accordingly according to the number of times each dish is ordered and the number of times each ingredient is ordered.

[0015] In one embodiment, performing prefix matching between the query character and each food entry, and displaying the selected food entries with successful prefix matching in the display area in order of priority, includes:

[0016] Perform prefix matching of food terms in corresponding partitions according to the query characters, the partitions being used to store food terms having a preset data structure;

[0017] Get the candidate food entries with successful prefix matching and their priorities;

[0018] The food items to be selected are displayed in a display area in a descending order of priority.

[0019] In one embodiment, the preset data structure is a dictionary tree structure.

[0020] In one embodiment, after obtaining the user's historical dining information within a preset time period, the method further includes:

[0021] In response to the nutrition intake query instruction, acquiring a specified meal image;

[0022] Based on the historical dining information, the meal image is subjected to dish recognition to confirm the dining data;

[0023] The nutritional component intake of the meal image is calculated according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library.

[0024] In one embodiment, the step of performing dish recognition on the dining image based on the historical dining information and confirming the dining data includes:

[0025] Obtaining a standard image of each dish in the historical dining information;

[0026] matching the dining image with the standard image;

[0027] identifying a target dish in the dining image and image parameters of the target dish according to the matching result;

[0028] The weight of the target dish is estimated according to the image parameters.

[0029] In one embodiment, the calculating the nutritional component intake of the meal image according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library includes:

[0030] Retrieving the nutritional component details of the target dish from the nutritional component library;

[0031] The nutritional component intake of the meal image is calculated according to the nutritional component details and weight of the target dish.

[0032] A food ingredient query device, comprising:

[0033] The acquisition module is used to obtain the user's historical dining information within a preset time period;

[0034] A configuration module, used for configuring the priority of each food item in the preset nutritional component library according to the historical dining information;

[0035] A receiving module, used to receive the query characters input by the user on the query page;

[0036] A matching and display module, used for performing prefix matching between the query characters and each food entry, and displaying the food entries for selection with successful prefix matching in a display area in order of priority;

[0037] The detail display module is used to determine the target food entry and display the nutritional component details of the target food entry in response to the user's selection operation in the display area.

[0038] Yet another embodiment of the present invention further provides a food safety platform, the food safety platform comprising at least one processor; and

[0039] a memory communicatively connected to the at least one processor; wherein,

[0040] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned food ingredient query method.

[0041] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned food ingredient query method.

[0042] Beneficial effects: The present invention discloses a food ingredient query method, device, medium and food safety platform. Compared with the prior art, the embodiments of the present invention use a preset nutritional ingredient library that is consistent with actual meals, and configure the priority of entries in combination with the user's historical dining information, so that users can more efficiently and accurately obtain the food ingredients they are interested in when querying nutritional ingredients. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0044] Figure 1 A flowchart of a preferred embodiment of the food ingredient query method provided by the present invention;

[0045] Figure 2 A schematic diagram of functional modules of a preferred embodiment of the food composition query device provided by the present invention;

[0046] Figure 3 A schematic diagram of the hardware structure of a preferred embodiment of the food safety platform provided by the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0048] See also Figure 1 The food ingredient query method provided by the present invention comprises the following steps:

[0049] S100, obtaining historical dining information of the user within a preset time period;

[0050] S200: Prioritize each food item in a preset nutrient component library according to the historical dining information.

[0051] In this embodiment, a database is pre-established to store the nutritional component data of the actual dishes and ingredients supplied, forming a nutritional component library, and the food safety platform communicates with the nutritional component library, so that users can implement a food ingredient query function that is consistent with the actual dining data on the food safety platform.

[0052] When implementing food ingredient query, first obtain the user's historical dining information within a preset time period. For example, when it is detected that the user enters the query page, the historical dining information is obtained based on the preset time period configured in advance. The preset time period can be the same day, the past three days, five days, a week, etc. The historical dining information can be manually entered into the platform by the user after each meal, or the dining information can be automatically extracted and uploaded to the platform based on the checkout voucher of each meal ordered by the user. Since the user's historical dining information can reflect the food that the user is interested in, the priority of each food entry in the nutritional ingredient library is configured based on the user's actual dining history, so that the user can more quickly query the food ingredients that he is interested in.

[0053] In one embodiment, step S200 includes:

[0054] Counting the dishes in the historical dining information to obtain the number of times each dish and each ingredient were ordered;

[0055] The priority of each dish and ingredient in the nutritional component library is configured accordingly according to the number of times each dish is ordered and the number of times each ingredient is ordered.

[0056] In this embodiment, statistics are collected for the historical dining information, specifically by dish name, to obtain the number of times each dish is ordered within a preset time period. The standard recipe of each dish is also obtained, and the ingredients required for each dish are recorded in the standard recipe. Therefore, the number of times each ingredient is ordered can be calculated based on the standard recipe of each dish. The number of orders is used as the basis for configuring the priority of each dish and ingredient in the nutritional component library, that is, the more times a dish or ingredient is ordered, the higher the priority. Therefore, the priority when querying food is configured in combination with the user's actual dining, so as to reflect the user's food interests and improve query efficiency.

[0057] S300: receiving a query character input by a user on a query page.

[0058] In this embodiment, when searching for food ingredients, the user may enter at least one query character in the text input box of the query page, that is, may enter a complete query term or the first character of a term.

[0059] S400: Prefix matching is performed between the query character and each food entry, and the food entries to be selected with successful prefix matching are displayed in a display area in order of priority.

[0060] In this embodiment, based on the query characters input by the user, prefix matching is performed with all food terms in the nutritional component library, that is, the terms with prefix characters consistent with the query characters in the nutritional component library are searched as the food terms to be selected, and the food terms to be selected are displayed in the display area according to priority, so as to realize automatic prompting of food component query. Specifically, the number of terms displayed in the display area can be set, for example, it is set to 5, and the food terms to be selected arranged in the top five are displayed according to priority. It is understandable that the more the number of query characters, the fewer the number of food terms to be selected. When the user enters the complete query terms, if the match is successful, the display area only displays the unique food terms to be selected. If all food terms in the nutritional component library fail to match the query characters, the prompt information that has not been included yet is output, prompting the user to query through other channels, and promptly reminding the administrator to add the nutritional component data of the corresponding food terms.

[0061] In one embodiment, step S400 includes:

[0062] Perform prefix matching of food terms in corresponding partitions according to the query characters, the partitions being used to store food terms having a preset data structure;

[0063] Get the candidate food entries with successful prefix matching and their priorities;

[0064] The food items to be selected are displayed in a display area in a descending order of priority.

[0065] In this embodiment, the food entries in the nutritional component library have a preset data structure and are stored in partitions, wherein the preset data structure is specifically a dictionary tree structure, which is a tree structure with a root node that does not contain characters, and each node except the root node contains only one character; from the root node to a certain node, the characters passed on the path are connected to form a character string corresponding to the node; all child nodes of each node contain different characters, so the dictionary tree structure can use the common prefix of the character string to reduce the query time, minimize unnecessary string comparisons, and have high query efficiency.

[0066] Partitioned storage can be partitioned according to the first character of each food entry, and food entries with the same first character can be stored in the same partition. When performing a query, prefix matching of food entries can be performed in a partition based on the query characters, thereby improving query matching efficiency.

[0067] Through efficient partition matching, the candidate food entries with successful prefix matching and the priority of each candidate food entry are obtained. When there are multiple candidate food entries, the candidate food entries are arranged and displayed in the display area in descending order of priority for users to select and query, thereby realizing automatic prompt input query and improving query efficiency.

[0068] S500: In response to a selection operation of the user in the display area, a target food entry is determined and a nutritional component detail of the target food entry is displayed.

[0069] In this embodiment, the user can select the food entry he wants to query in the display area through selection operations such as mouse clicking, short touch, etc. After the target food entry is determined based on the user's selection operation, the corresponding nutritional ingredient details can be retrieved and displayed from the nutritional ingredient library, thereby realizing efficient and accurate food ingredient query.

[0070] In one embodiment, after step S100, the method further includes:

[0071] In response to the nutrition intake query instruction, acquiring a specified meal image;

[0072] Based on the historical dining information, the meal image is subjected to dish recognition to confirm the dining data;

[0073] The nutritional component intake of the meal image is calculated according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library.

[0074] In this embodiment, when the user wishes to query the overall nutritional intake for historical meal content, the user can enter a nutritional intake query instruction by, for example, clicking a preset button in the query page. At this time, the specified meal image is obtained, which can be uploaded by the user in real time, or selected and uploaded from a stored album. Based on the historical meal message, the meal image is identified with dishes to obtain corresponding meal data, including the name of the actual meal, the weight of the dish, etc., so as to calculate the nutritional intake of the meal image by combining the actual meal data with the nutritional details of the corresponding food entry in the nutritional library. The nutritional intake of the overall meal can be obtained by uploading the image with one click. On the basis of realizing the nutritional query of a single dish or ingredient, it provides users with a more convenient and practical nutritional query method.

[0075] In one embodiment, the step of performing dish recognition on the dining image based on the historical dining information and confirming the dining data includes:

[0076] Obtaining a standard image of each dish in the historical dining information;

[0077] matching the dining image with the standard image;

[0078] identifying a target dish in the dining image and image parameters of the target dish according to the matching result;

[0079] The weight of the target dish is estimated according to the image parameters.

[0080] In this embodiment, a standard image is pre-stored for each dish currently served. When performing dish recognition on a dining image, the standard image of each dish in the historical dining information is first obtained, and the dining image is matched with the standard image of each dish in the dining information to narrow the scope of matching recognition and improve recognition efficiency. Based on the matching result, the target dish in the dining image is identified, that is, the dish that matches the standard image, and the corresponding image parameters are extracted through the image area occupied by the target dish in the dining image. The specific image parameter is the dish area, and the weight of the target dish is estimated based on the dish area.

[0081] Specifically, the standard weight and standard area can be stored corresponding to the standard image of each dish. When estimating the weight of the dish, a unified reference object (such as a standard dinner plate) is used as a reference, and the size of the dining image is processed so that the size of the reference objects in the two are consistent before extracting the dish area, and then the weight of the target dish is estimated by the dish area, standard weight and standard area. Of course, in other embodiments, for example, the density of the dish can be stored, and the dish volume can be obtained by modeling after extracting the dish area and calculating the weight in combination with the density, etc. This embodiment does not limit this.

[0082] In one embodiment, the calculating the nutritional component intake of the meal image according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library includes:

[0083] Retrieving the nutritional component details of the target dish from the nutritional component library;

[0084] The nutritional component intake of the meal image is calculated according to the nutritional component details and weight of the target dish.

[0085] In this embodiment, after the target dish in the meal image is identified, the nutritional component details of the target dish are retrieved from the nutritional component library, and the nutritional component intake of the meal image can be quickly obtained in combination with the identified weight, so that the user can easily estimate the actual meal nutrition, providing a convenient and efficient query method for user groups who need to pay close attention to the nutritional component intake.

[0086] It can be seen from the above method embodiments that the food ingredient query method provided by the present invention uses a preset nutritional ingredient library that is consistent with actual meals, and configures the priority of entries in combination with the user's historical dining information, so that users can more efficiently and accurately obtain the food ingredients they are interested in when querying nutritional ingredients.

[0087] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0088] Another embodiment of the present invention provides a food ingredient query device, such as Figure 2 As shown, the device 1 comprises:

[0089] The acquisition module 11 is used to acquire the historical dining information of the user within a preset time period;

[0090] A configuration module 12, configured to prioritize each food item in a preset nutritional component library according to the historical dining information;

[0091] The receiving module 13 is used to receive the query characters input by the user on the query page;

[0092] A matching display module 14 is used to perform prefix matching between the query character and each food entry, and to display the selected food entries with successful prefix matching in a display area according to priority;

[0093] The detail display module 15 is used to determine the target food entry and display the nutritional component details of the target food entry in response to the user's selection operation in the display area.

[0094] The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which are more suitable for describing the execution process of the food ingredient query device than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.

[0095] Another embodiment of the present invention provides a food safety platform, which can be a computing device such as a mobile terminal, a desktop computer, a notebook, a palm computer, and a server. Figure 3 As shown, the food safety platform 10 includes:

[0096] One or more processors 110 and memory 120, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0097] The processor 110 is used to complete various control logics of the food safety platform 10, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (AcornRISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any conventional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP, or any other such configuration.

[0098] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the food ingredient query method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the food safety platform 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, the food ingredient query method in the above method embodiment is implemented.

[0099] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the food safety platform 10, etc. In addition, the memory 120 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 non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the food safety platform 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0100] One or more units are stored in the memory 120, and when executed by one or more processors 110, the food ingredient query method in any of the above method embodiments is executed, for example, the food ingredient query method described above is executed. Figure 1 The method comprises steps S100 to S500.

[0101] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S500.

[0102] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Sync Link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these or any other suitable types of memory.

[0103] In summary, the present invention discloses a method, device, medium and food safety platform for querying food ingredients. The method obtains the user's historical dining information within a preset time period; prioritizes each food entry in a preset nutritional ingredient library according to the historical dining information; receives the query characters input by the user on the query page; performs prefix matching on the query characters and each food entry, and displays the selected food entries with successful prefix matching in a display area in order of priority; and determines the target food entry and displays the nutritional ingredient details of the target food entry in response to the user's selection operation in the display area. By presetting a nutritional ingredient library that matches the actual meal, and prioritizing the entries in combination with the user's historical dining information, the user can more efficiently and accurately obtain the food ingredients of interest when querying nutritional ingredients.

[0104] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0105] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer electronic device (which can be a personal computer, a server, or a network electronic device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0106] Conditional language such as "can," "can," "might," or "may," among others, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that a particular embodiment can include (while other embodiments do not) a particular feature, element, or operation. Thus, such conditional language is also generally intended to imply that a feature, element, or operation is required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, or operations are included or will be performed in any particular embodiment.

[0107] What has been described herein in this specification and the accompanying drawings includes examples that can provide a method, device, medium and food safety platform for querying food ingredients. Of course, it is not possible to describe every conceivable combination of elements or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of the present specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in the present specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for the purpose of limitation.

Claims

1. A method for querying food ingredients, characterized in that: The steps include: Obtaining historical dining information of the user within a preset time period, where the historical dining information is manually input by the user after dining, or automatically extracted and uploaded based on the checkout voucher information after the user orders a meal; Prioritizing each food item in a preset nutritional component library according to the historical dining information; Receive the query characters entered by the user on the query page; Prefix matching is performed between the query character and each food entry, and the food entries to be selected with successful prefix matching are displayed in a display area in order of priority; In response to a selection operation by a user in the display area, determining a target food entry and displaying a nutritional component detail of the target food entry; After obtaining the historical dining information of the user within a preset time period, the method further includes: In response to the nutrition intake query instruction, acquiring a specified meal image; Performing dish recognition on the dining image based on the historical dining information to confirm dining data; Calculating the nutritional component intake of the meal image according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library; The step of performing dish recognition on the dining image based on the historical dining information and confirming the dining data includes: Obtaining a standard image of each dish in the historical dining information; matching the dining image with the standard image; Identify a target dish in the dining image and an image parameter of the target dish according to the matching result, wherein the image parameter is the area of ​​the dish; estimating the weight of the target dish according to the image parameters; Specifically, the standard image of each dish stores the standard weight and standard area. When estimating the weight of the dish, the dining image is sized based on a unified reference object, so that the dining image is consistent with the reference object size in the standard image, and then the dish area is extracted. Then, the weight of the target dish is estimated through the dish area, standard weight and standard area. The step of configuring the priority of each food item in the preset nutritional component library according to the historical dining information includes: Counting the dishes in the historical dining information, and obtaining a standard recipe for each dish, wherein the recipe records the ingredients of each dish, and calculating the number of times each dish and each ingredient were ordered; According to the number of times each dish is ordered and the number of times each ingredient is ordered, the priority of each dish and ingredient in the nutritional component library is configured accordingly; The step of performing prefix matching of the query character with each food entry and displaying the food entries for selection with successful prefix matching in the display area in order of priority includes: Prefix matching of food terms is performed in corresponding partitions according to the query characters, and the partitions are used to store food terms with a preset data structure; the preset data structure is a dictionary tree structure, and partition storage is performed according to the first character of each food term, and food terms with the same first character are stored in the same partition; Get the candidate food entries with successful prefix matching and their priorities; The food items to be selected are displayed in a display area in a descending order of priority.

2. The food ingredient query method according to claim 1, characterized in that: The step of calculating the nutritional component intake of the meal image according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library includes: Retrieving the nutritional component details of the target dish from the nutritional component library; The nutritional component intake of the meal image is calculated according to the nutritional component details and weight of the target dish.

3. A food ingredient query device, characterized in that: The device comprises: An acquisition module is used to acquire the user's historical dining information within a preset time period, where the historical dining information is manually input by the user after dining, or automatically extracted and uploaded based on the checkout voucher information after the user orders a meal; A configuration module, used for configuring the priority of each food item in the preset nutritional component library according to the historical dining information; A receiving module, used to receive the query characters input by the user on the query page; A matching and display module, used for performing prefix matching between the query characters and each food entry, and displaying the food entries for selection with successful prefix matching in a display area in order of priority; A detail display module, for determining a target food item and displaying the nutritional component details of the target food item in response to a selection operation of the user in the display area; After obtaining the historical dining information of the user within the preset time period, the method further includes: In response to the nutrition intake query instruction, acquiring a specified meal image; Based on the historical dining information, the meal image is subjected to dish recognition to confirm the dining data; Calculating the nutritional component intake of the meal image according to the meal data and the nutritional component details of the corresponding food entry in the nutritional component library; The step of performing dish recognition on the dining image based on the historical dining information and confirming the dining data includes: Obtaining a standard image of each dish in the historical dining information; matching the dining image with the standard image; Identify a target dish in the dining image and an image parameter of the target dish according to the matching result, wherein the image parameter is the area of ​​the dish; estimating the weight of the target dish according to the image parameters; Specifically, the standard weight and standard area are stored for the standard image of each dish. When estimating the weight of the dish, the dining image is sized based on a unified reference object so that the dining image is consistent with the reference object size in the standard image, and then the dish area is extracted. Then, the weight of the target dish is estimated through the dish area, standard weight and standard area. The step of configuring the priority of each food item in the preset nutritional component library according to the historical dining information includes: Counting the dishes in the historical dining information, and obtaining a standard recipe for each dish, wherein the recipe records the ingredients of each dish, and calculating the number of times each dish and each ingredient were ordered; According to the number of times each dish is ordered and the number of times each ingredient is ordered, the priority of each dish and ingredient in the nutritional component library is configured accordingly; The step of performing prefix matching of the query character with each food entry and displaying the food entries for selection with successful prefix matching in the display area in order of priority includes: Prefix matching of food terms is performed in corresponding partitions according to the query characters, and the partitions are used to store food terms with a preset data structure; the preset data structure is a dictionary tree structure, and partition storage is performed according to the first character of each food term, and food terms with the same first character are stored in the same partition; Get the candidate food entries with successful prefix matching and their priorities; The food items to be selected are displayed in a display area in a descending order of priority.

4. A food safety platform, characterized in that: The food safety platform includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the food ingredient query method according to any one of claims 1-2.

5. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the food ingredient query method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Real-time collection system and a real-time collection method for personal diet nutrition intake

    CN111401103A

  • Entry acquisition method and apparatus, and electronic device

    CN115525161A