Method, device, storage medium and electronic device for updating dish combination

By updating the version of the online dish combination and real-time update of candidate dish combinations, the problem of insufficient real-time update of dish combinations in the existing technology has been solved, and the accuracy of dish combination information and user experience have been improved.

CN110399381BActive Publication Date: 2025-02-18BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910533901.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-19
Publication Date
2025-02-18
Estimated Expiration
2039-06-19

AI Technical Summary

Technical Problem

In the prior art, the real-time update of online dish combinations is low, resulting in users that may choose a dish combination that has not been updated in time, which has actually failed, affecting users' ordering experience.

Method used

When receiving the menu information change message, it is stored in the preset database and the menu information change data table, and the menu combination is updated based on these data tables to generate a new version of the menu combination. When receiving the query request from the terminal, the candidate dish combination is determined and updated according to the target dish information change message, and the updated dish combination is finally recommended to the user.

Benefits of technology

It realizes timely updates of dish combinations, ensures the accuracy of the dishes and dish combination information found by users, improves the online service performance of dish combinations, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110399381B_ABST
    Figure CN110399381B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device, storage medium and electronic device for updating a dish combination, the method comprising: receiving a dish information change message and storing it in a preset database and a dish information change data table; updating the dish combination according to the dish information change data table, the dish information data table and the dish combination data table to obtain a new version of the dish combination; upon receiving a query request for a target dish sent by a terminal, determining a candidate dish combination containing the target dish from the new version of the dish combination; reading the target dish information change message from the preset database and updating the candidate dish combination; and recommending the updated candidate dish combination to the terminal. The present application can timely update the information of the dishes and / or dish combinations queried by the user in a targeted manner, ensure the accuracy of the information of the dishes and / or dish combinations queried by the user, and enhance the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method, device, storage medium and electronic device for updating a dish combination. Background Art

[0002] Nowadays, in order to facilitate users to order online and improve the user experience, some stores usually recommend some pre-matched dish combinations to users. For example, in order to provide users with more ordering options, store A on a food delivery app displays a variety of dish combinations suitable for lunch and dinner on the store homepage. Usually, the status of a dish combination is closely related to the status of each dish in the dish combination, and the status of each dish (for example, sales, price, inventory, etc.) changes in real time. When a dish is invalid (for example, insufficient inventory), multiple dish combinations containing the dish will be invalid. In the case where multiple dish combinations are invalid and have not been updated in time, it will seriously affect the user's ordering experience. For example, a dish combination is displayed as available for purchase, but when the user clicks on the dish combination to place an order, because the dish combination is actually invalid, the store owner can only inform the user that the dish combination cannot be purchased.

[0003] Therefore, it is very important to update the online dish combinations and show the effective dish combinations to the users. The solutions for updating the online dish combinations in the related art are low in real time performance, and the users may still choose the dish combinations that are not updated in time and are actually invalid. Summary of the invention

[0004] To solve the above problems, the present application provides a method, device, storage medium and electronic device for updating dish combinations.

[0005] A first aspect of an embodiment of the present application provides a method for updating a dish combination, the method comprising:

[0006] When receiving a dish information change message, storing the dish information change message in a preset database and a dish information change data table;

[0007] According to the dish information change data table, the dish information data table and the dish combination data table, the dish combination is updated to obtain a new version of the dish combination;

[0008] When receiving a query request for a target dish sent by a terminal, determining a candidate dish combination from the dish combination of the new version, wherein the candidate dish combination is a dish combination including the target dish;

[0009] Reading a target dish information change message from the preset database, wherein the target dish information change message is used to trigger an update of the candidate dish combination;

[0010] updating the candidate dish combination according to the read target dish information change message;

[0011] The updated candidate dish combination is recommended to the terminal.

[0012] Optionally, the dish information change message carries a timestamp; the method further includes:

[0013] Determine a version update time for performing a version update to obtain the new version of the dish combination;

[0014] Reading a target dish information change message from the preset database includes:

[0015] The target dish information change message with a time stamp after the version update time is read from the preset database in the order of the carried timestamps.

[0016] Optionally, according to the dish information change data table, the dish information data table and the dish combination data table, the dish combination is updated to obtain a new version of the dish combination, including:

[0017] According to the dish information change data table, the dish information data table is updated to obtain an updated dish information data table;

[0018] According to the dish combination data table and the updated dish information data table, the dish combination is updated to obtain a new version of the dish combination.

[0019] Optionally, updating the dish information data table according to the dish information change data table includes:

[0020] Taking a first preset time as a period, periodically updating the dish information data table according to the dish information change data table;

[0021] According to the dish combination data table and the updated dish information data table, the dish combination is updated in version, including:

[0022] The dish combination is periodically updated based on the dish combination data table and the updated dish information data table with a second preset time period as a period, and the second preset time period is not less than the first preset time period.

[0023] Optionally, the preset database is an Hbase database, and the dish information change data table is a Hive table.

[0024] A second aspect of an embodiment of the present application provides a device for updating a dish combination, the device comprising:

[0025] A message storage module, used for storing the dish information change message into a preset database and a dish information change data table when receiving the dish information change message;

[0026] A version update module, used to update the version of the dish combination according to the dish information change data table, the dish information data table and the dish combination data table to obtain a new version of the dish combination;

[0027] A first determining module, configured to determine a candidate dish combination from the dish combination of the new version when receiving a query request for a target dish sent by a terminal, wherein the candidate dish combination is a dish combination including the target dish;

[0028] A reading module, used for reading a target dish information change message from the preset database, wherein the target dish information change message is used for triggering an update of the candidate dish combination;

[0029] An updating module, used for updating the candidate dish combination according to the read target dish information change message;

[0030] The recommendation module is used to recommend the updated candidate dish combination to the terminal.

[0031] Optionally, the device further comprises:

[0032] A second determining module is used to determine a version update time for performing a version update to obtain the new version of the dish combination;

[0033] The reading module comprises:

[0034] The reading submodule is used to read the target dish information change message with a timestamp after the version update time from the preset database in the order of the timestamps carried.

[0035] Optionally, the version update module includes:

[0036] A first version update module, used to update the dish information data table according to the dish information change data table to obtain an updated dish information data table;

[0037] The second version update module is used to update the version of the dish combination according to the dish combination data table and the updated dish information data table to obtain a new version of the dish combination.

[0038] Optionally, the first version update module includes:

[0039] A first version update submodule, configured to periodically update the dish information data table according to the dish information change data table with a first preset time period as a period;

[0040] The second version update module includes:

[0041] The second version update submodule is used to perform periodic version updates on the dish combination based on the dish combination data table and the updated dish information data table at a second preset time period, and the second preset time period is not less than the first preset time period.

[0042] Optionally, the preset database is an Hbase database, and the dish information change data table is a Hive table.

[0043] A third aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method described in the first aspect of the present application.

[0044] A fourth aspect of an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the steps of the method described in the first aspect of the present application.

[0045] In the embodiment of the present application, the dish combination index is updated by combining online updating and offline updating. During the online update, for the target dish queried by the user, all dish combinations containing the target dish are extracted from the dish combination index as candidate dish combinations, and then the target dish information change message that satisfies three conditions (for example: the three conditions in the above embodiment) after the update time of the current dish combination index is extracted from the preset database, and the candidate dish combination is updated, and then the updated candidate dish combination is returned to the user terminal for recommendation to the user, which can timely update the information of the dish and / or dish combination queried by the user, ensure that the information of the dish and / or dish combination queried by the user is accurate information, improve the online service performance of the dish combination, and enhance the user's use experience.

[0046] While performing online updates, the present application also adopts an offline update method, using the dish information change data table to store the dish information change messages sent by the merchant, and using the dish information change data table, the dish information data table and the dish combination data table to generate a backup dish combination index, and using the backup dish combination index to replace the current version of the dish combination index to complete the update of the dish combination index version. The offline update method reduces the amount of online updates (some dish information change messages corresponding to dishes that have not been queried by users are not used), reduces the pressure of online updates, and ensures the accuracy and timeliness of online updates. On the other hand, by generating a backup dish combination index, the update of all dishes and / or dish combinations is completed without delaying the current dish combination index from providing services to users, and has strong universality.

[0047] In addition, since there are multiple versions of the dish combination index corresponding to time, if the current dish combination index loses data, it can be quickly restored through the most recent version, which can effectively deal with various dish combination index failures, improve the dish combination index's ability to deal with risks, and has strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be 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 any creative labor.

[0049] Figure 1 is a schematic diagram of the interaction between the user terminal and the backend server provided in various embodiments of the present application;

[0050] Figure 2 is a flow chart of a method for updating a dish combination shown in an embodiment of the present application;

[0051] Figure 3 is a flow chart of a method for updating a dish combination shown in an embodiment of the present application;

[0052] Figure 4 is a flow chart of a method for updating a version of a dish combination shown in an embodiment of the present application;

[0053] Figure 5 is a flow chart of another method for updating a dish combination shown in an embodiment of the present application;

[0054] Figure 6 is a schematic diagram of a device for updating a dish combination according to an embodiment;

[0055] Figure 7 is a schematic diagram of an electronic device according to an embodiment. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0057] Figure 1 Schematic diagram of the interaction between the user terminal and the backend server provided in each embodiment of the present application. Figure 1 , the backend server communicates with one or more user terminals (for example: Figure 1 The user terminal 1 to the user terminal n) in the communication connection are communicated to realize communication interaction. The background server can be a network server, a database server, etc. The user terminal can be a personal computer (PC), a tablet computer, a smart phone, etc.

[0058] Figure 2 This is a flow chart of a method for updating a dish combination shown in an embodiment of the present application, which is applied to Figure 1 The backend server in . Figure 2 The method for updating the dish combination in this application includes the following steps:

[0059] Step S11: When a dish information change message is received, the dish information change message is stored in a preset database and a dish information change data table.

[0060] In this embodiment, a message processing module is provided in the background server, and the merchant is located on the user terminal side that communicates and interacts with the background server. The user terminal is installed with a terminal application software (for example: takeaway APP) that provides a dish combination for the user. The user sends a dish information change message to the message processing module of the background server through the terminal application software, and the message processing module is responsible for storing the received dish information change message in the preset database and the dish information change data table respectively.

[0061] The dish information change message is used to change one or more dishes. The changed content can be: the name of the dish, the price of the dish, the picture of the dish, the inventory of the dish, etc.

[0062] The preset database is used to update the dish combination online, and the dish information change data table is used to update the dish combination offline. In various embodiments of the present application, the update of the dish combination includes online update and offline update. The online update refers to updating the dish combination that the user is using (for example, the dish combination that the user is browsing or clicking), and the offline update refers to updating all the dish combinations that can provide services to the user within a preset time.

[0063] Step S12: According to the dish information change data table, the dish information data table and the dish combination data table, the dish combination is updated to obtain a new version of the dish combination.

[0064] In this embodiment, the backend server is provided with a dish combination index in order to better manage the index of dish combinations that can provide services to users online. The dish combination index includes all dish combinations that can provide services to users. Updating the dish combination also updates the dish combination index. In the subsequent embodiments of this application, unless otherwise specified, updating the dish combination means: updating the dish combination index.

[0065] There may be multiple versions of the dish combination index depending on the time period in which it is effective. Effective means that services are being provided to users. In this embodiment, at any time, there is only one version of the dish combination index that is effective. For example, the version corresponding to the dish combination index that takes effect on October 1 (from 00:00-24:00) is "October 1", and the version corresponding to the dish combination index that takes effect on October 2 (from 00:00-24:00) is "October 2". The version of "October 2" is an updated version relative to the version of "October 1". The effective time period of the "October 1st" version is October 1st (from 00:00-24:00), and it is invalid during other time periods. The effective time period of the "October 2nd" version is October 2nd (from 00:00-24:00), and it is invalid during other time periods. Replacing the "October 1st" version with the "October 2nd" version is a version update, and the dish combination index that is currently in effect is the dish combination index of the current version.

[0066] The dish information data table stores the basic information of each dish, such as name, price, picture, inventory, etc. The dish combination data table stores the information of each dish combination, that is, the rules for generating each dish combination, for example, dish combination 1 includes: dish A and dish B, and dish combination 2 includes: dish A, dish B and dish C.

[0067] Specifically, step S12 includes:

[0068] Generate a backup dish combination index using the dish information change data table, the previous version of the dish information data table, and the dish combination data table;

[0069] Use the backed-up dish combination index as the effective dish combination index to replace the previous version of the dish combination index.

[0070] In this embodiment, each version of the dish combination index corresponds to a version of the dish information data table. The dish information change data table can be used to update the previous version of the dish information data table, for example, to modify the image, modify the price, or modify the inventory, etc. On the basis of the updated dish information data table, multiple dish combinations can be regenerated according to the rules for generating each dish combination in the dish combination data table, and compiled into a new dish combination index as a backup dish combination index. Each time the version of the dish combination index is updated, it is only necessary to replace the current version of the dish combination index with the backup dish combination index and use it as the re-validated dish combination index.

[0071] Step S13: upon receiving a query request for a target dish sent by the terminal, determining a candidate dish combination from the new version of the dish combination, wherein the candidate dish combination is a dish combination including the target dish.

[0072] When a user initiates a query request for a dish on a user terminal, the dish is used as the target dish, and all dish combinations containing the target dish are determined from the new version of the dish combination index, and these dish combinations are used as candidate dish combinations. For example, a user enters a dish A and clicks query. After receiving the query request, the backend server extracts all dish combinations containing dish A from the new version of the dish combination index and uses all these dish combinations containing dish A as candidate dish combinations.

[0073] In the present application, there are many ways to determine candidate dish combinations. For example, when the user inputs a store instead of a specific dish, all dish combinations recommended to the user by the store can be used as candidate dish combinations. Another example is when the user neither inputs a specific dish nor a specific store, but searches for multiple stores and dishes according to search conditions (for example, praise, distance, etc.), all dish combinations recommended to the user by the store clicked by the user can be used as candidate dish combinations, or all dish combinations related to the dish clicked by the user can be used as candidate dish combinations, or all dish combinations of all stores on the page displaying the search results can be used as candidate dish combinations. The specific method of determining candidate dish combinations can be flexibly selected according to actual conditions, and the present application does not impose specific restrictions on this.

[0074] Step S14: reading a target dish information change message from the preset database, wherein the target dish information change message is used to trigger an update of the candidate dish combination.

[0075] In this embodiment, in order to ensure that the dish combination viewed by the user is the dish combination updated in real time, each dish information change message carries at least two types of information, including: a timestamp and the dish it targets, and the timestamp is the moment when the store initiates the dish information change. In order to better store multiple dish information change messages carrying timestamps, the preset database at least has the storage performance of being able to store multiple dish information change messages in the order of timestamps, so as to extract the dish information change messages carrying timestamps after any timestamp. In one embodiment, the preset database can be an Hbase database. The Hbase database can store the received dish information change messages in the order of timestamps, and can facilitate other functional modules in the background server to easily retrieve the dish information change messages after any timestamp.

[0076] Figure 3 1 is a flow chart of a method for updating a dish combination according to an embodiment of the present application. Figure 3 Specifically, the method for updating the dish combination in the present application also includes the following steps:

[0077] Step S21: Determine the version update time for performing version update to obtain the new version of the dish combination.

[0078] Step S22: Read the target dish information change message from the preset database.

[0079] The version update time is: the time when the current effective version replaces the previous version. For example, the dish combination index with version "October 2" replaces the dish combination index with version "October 1" at 0:00 on October 2, then the version update time of the dish combination index with version "October 2" is 0:00 on October 2.

[0080] Among them, step S22 can be: reading the target dish information change message with a time stamp after the version update time from the preset database in the order of the carried timestamps.

[0081] Specifically, after determining the version update time, the change messages that meet the requirements are read from the preset database. The change messages that meet the requirements meet at least three conditions, including: the timestamp carried is after the version update time; the targeted dishes belong to the candidate dish combination; and have not been used to update the dishes. Then use this part of the change messages that meet the requirements as the target dish information change messages. For example: the current time is 12:00 on October 2, and the version of the effective dish combination index is "October 2", then the target dish information change message should be: all change messages that carry timestamps between 00:00 on October 2 and 12:00 on October 2, and the targeted dishes belong to the candidate dish combination.

[0082] Step S15: updating the candidate dish combination according to the read target dish information change message.

[0083] Specifically, for each dish in the candidate dish combination, the corresponding change message is obtained from the target dish information change message in the order of timestamps and updated until all dishes in the candidate dish combination are updated.

[0084] Step S16: recommending the updated candidate dish combination to the terminal.

[0085] The updated candidate dish combination is returned to the currently effective dish combination index for user use.

[0086] In one implementation, the backend server is a backend server of a food delivery APP, the user terminal is a user terminal on which the food delivery APP is installed, and the merchant sends a dish information change message to the backend server of the food delivery APP through the food delivery APP on the user terminal.

[0087] Assume that store A has 5 dish combinations for dish A, namely dish combination 1, dish combination 2, dish combination 3, dish combination 4 and dish combination 5. The merchant of the store sends a dish information change message of dish A to the backend server of the food delivery app through the food delivery app at 10:00 on October 2. For example, the dish information change message of dish A is to change the inventory of dish A to 0. At 16:00 on October 2, the merchant sends a dish information change message of dish B to the backend server of the food delivery app. For example, the dish information change message of dish B is to modify the picture of dish B.

[0088] After receiving the change message of dish A and the change message of dish B, the message processing module in the background server stores the change message of dish A and the change message of dish B in the preset database, and stores the change message of dish A and the change message of dish B in the dish information change data table. The change message of dish A and the change message of dish B in the preset database can be used to update the dish combination index with the version of "October 2" online, as follows:

[0089] When the user enters dish A on the food delivery APP, the backend server performs the following steps in sequence: the first step is to extract all dish combinations containing dish A from the dish combination index, namely dish combination 1, dish combination 2, dish combination 3, dish combination 4 and dish combination 5, and determine these dish combinations as candidate dish combinations; the second step is to determine the update time of the dish combination index with the version of "October 2", for example, 00:00 on October 2, and extract from the preset database the dish information change message that meets the following three conditions at the same time (1. The timestamp carried is after 00:00 on October 2; 2. The dish targeted is dish A; 3. , dish information change messages that have not been used to update dish A) and use the dish information change messages that meet the above three conditions as target dish information change messages; the third step is to use the target dish information change messages obtained in the second step to update dish A. After dish A is updated, the update of the five candidate dish combinations is completed. In this step, assuming that the only update information for dish A that meets the three conditions is the change message sent by the merchant of store A at 10:00 on October 2 to change the inventory of dish A to 0, then the background server uses the change message to change the current inventory of dish A to 0. After the above three steps, since dish A has actually expired, the above five dish combinations containing dish A have all expired, and the background server will no longer return these five invalid candidate dish combinations to the user for use.

[0090] As for dish B, if no user queries dish B through the food delivery app, the backend server will not make an online update for dish B for the time being, but will update dish B through offline updates. The purpose of offline updates is to use the dish information change data table to complete the update of the version of the dish combination index. For example, on October 2, merchants from N stores sent multiple dish information change messages to the backend server through the food delivery app. Some of these dish information change messages have been updated online when the user queries through the preset database, while the other part can only be updated offline through the dish information change data table to reduce the update amount during online updates. The backend server updates the dish information data table using the dish information change messages sent by merchants from all N stores stored in the dish information change data table, and then uses the updated dish information data table and dish combination data table to generate a backup dish combination index. The backup dish combination index is the dish combination index that takes effect on October 3, that is, its version is "October 3".

[0091] In the embodiment of the present application, the dish combination index is updated by combining online updating and offline updating. During the online update, for the target dish queried by the user, all dish combinations containing the target dish are extracted from the dish combination index as candidate dish combinations, and then the target dish information change message that satisfies three conditions (for example: the three conditions in the above embodiment) after the update time of the current dish combination index is extracted from the preset database, and the target dish is updated to complete the update of the candidate dish combination, and then the updated candidate dish combination is returned to the user terminal for recommendation to the user, which can timely update the information of the dish and / or dish combination queried by the user, ensure that the information of the dish and / or dish combination queried by the user is accurate information, improve the online service performance of the dish combination, and enhance the user's use experience.

[0092] While performing online updates, the present application also adopts an offline update method, using the dish information change data table to store the dish information change messages sent by the merchant, and using the dish information change data table, the dish information data table and the dish combination data table to generate a backup dish combination index, and using the backup dish combination index to replace the current version of the dish combination index to complete the update of the dish combination index version. On the one hand, the amount of online updates is reduced (some dish information change messages corresponding to dishes that have not been queried by users are not used), reducing the pressure of online updates and ensuring the accuracy and timeliness of online updates. On the other hand, by generating a backup dish combination index, the update of all dishes and / or dish combinations is completed without delaying the current dish combination index from providing services to users, which has strong universality.

[0093] In addition, since there are multiple versions of the dish combination index corresponding to time, if the current dish combination index loses data, it can be quickly restored through the most recent version, which can effectively deal with various dish combination index failures, improve the dish combination index's ability to deal with risks, and has strong practicality.

[0094] Figure 4 1 is a flow chart of a method for updating a version of a dish combination shown in an embodiment of the present application. Figure 4 , step S12 comprises the following steps:

[0095] Step S121: updating the dish information data table according to the dish information change data table to obtain an updated dish information data table.

[0096] In this embodiment, each version of the dish combination index corresponds to a dish information data table. Since there are multiple versions of the dish information data table, there are multiple versions of the dish combination index. The version of the dish information data table is obtained by time division. For example, when the unit is day, in theory, the backend server will receive a large number of dish information change messages sent by merchants every day, so each day corresponds to a dish information data table.

[0097] Each version of the dish information data table is updated based on the previous version of the dish information data table using the dish information change data table. For example, based on the dish information data table corresponding to September 30, the backend server uses all the dish information change messages received on October 1 in the dish information change data table to update, and the dish information data table corresponding to October 1 can be obtained. Similarly, based on the dish information data table corresponding to October 1, all the dish information change messages received on October 2 in the dish information change data table are used to update, and the dish information data table corresponding to October 2 can be obtained.

[0098] Step S122: According to the dish combination data table and the updated dish information data table, the dish combination is updated to obtain a new version of the dish combination.

[0099] In this embodiment, the version of the dish combination index is also divided according to time, and the basis for its division is the same as the basis for the division of the version of the dish information data table. For example, when the version of the dish information data table is divided by day, the version of the dish combination should also be divided by day. One version of the dish information data table generally corresponds to one version of the dish combination.

[0100] The dish combination data table is a rule for generating dish combinations, which can be designed manually or calculated by an algorithm. The various embodiments of the present application do not impose specific restrictions on the generation method of the dish combination data table. The dish combination data table can also have multiple versions, and there can be multiple bases for version division, for example: one basis is arbitrary division, that is, arbitrarily combining all the dishes of a store; one basis is division according to season, that is, combining all the dishes of a store according to the characteristics of the season (for example, in summer, combining dishes with strong flavors with drinks with light flavors). The various embodiments of the present application do not impose specific restrictions on the division method of the dish combination data table version.

[0101] After obtaining the updated dish information data table, a backup dish combination index can be generated using the rules for generating dish combinations in the dish combination data table. The backup dish combination index has the attribute of "backup", and the dish combination index with the "backup" attribute is invalid. Only when the backup dish combination index is updated to the valid dish combination index, can the backup dish combination index be used as the dish combination index for providing services to users.

[0102] Optionally, step S121 may specifically be: periodically updating the dish information data table according to the dish information change data table with a first preset time length as a period.

[0103] In this embodiment, the background server may update the dish information data table according to a preset cycle. For example, when the version of the dish combination index is divided in days, the background server may divide a day into multiple time periods, and obtain dish information change messages from the dish information change data table in each time period to update the dish information data table. For example, on October 2, the background server may use the time (October 2 00:00) when the dish combination index with the version of "October 2" is updated as the starting point, and 6 hours as the first preset time, and obtain dish information change messages from the dish information change data table every 6 hours to update the dish information data table. Specifically, from 00:00 on October 2 to 06:00 on October 2, based on the version of the dish information data table corresponding to October 1, obtain the dish information change messages from 00:00 on October 2 to 06:00 on October 2. All dish information change messages received between 00:00 and 06:00 on October 2 are updated to obtain a first backup dish combination index; during 00:00 on October 2 and 06:00 on October 2, based on the first backup dish combination index, all dish information change messages received between 06:00 and 12:00 on October 2 are updated to obtain a second backup dish combination index; and so on, until all dish information change messages received on October 2 are used to update the dish information data table, and the fourth backup dish combination index finally obtained is used as the backup dish combination index.

[0104] The duration of the first preset period can be flexibly set according to actual needs. For example, when the version of the dish combination index is divided into days, the first preset duration can be set to 12 hours, 24 hours, etc. The various embodiments of the present application do not impose specific restrictions on the duration of the first preset period.

[0105] Optionally, step S122 may specifically be: performing periodic version updates on the dish combination according to the dish combination data table and the updated dish information data table with a second preset time period as a period, and the second preset time period is not less than the first preset time period.

[0106] In this embodiment, the periodic version update of the dish combination means: periodically replacing the current dish combination index with the backup dish combination index. For example, assuming that the second preset time is 24 hours and the version update time is 00:00, then at 00:00 on October 2 or 24:00 on October 1, the version update means: replacing the dish combination index with the version of "October 1" with the backup dish combination index generated on October 1. After the replacement, the backup dish combination index no longer has the original "backup" attribute, but can provide services to users on October 2, that is, it is effective on October 2, and the replaced dish combination index with the version of "October 1" no longer provides services to users.

[0107] The purpose of setting the second preset time length to be longer than the first preset time length is to ensure that the updated backup dish combination index is updated using all dish information change messages, that is, there are no dish information change messages that are not used, thereby ensuring the accuracy of the information in the backup dish combination index and / or the effective dish combination index after the version update.

[0108] In an embodiment of the present application, the second preset time period can also be flexibly set according to actual needs. For example, the second preset time period can be set to 2 days, 4 days, one week, one month, etc. Generally, the shorter the second preset time period is set, the more real-time and accuracy of the information in the effective dish combination index can be guaranteed.

[0109] Optionally, in various embodiments of the present application, the preset database may be an Hbase database, and the dish information change data table may be a Hive table. The Hbase database may store the received dish information change messages in the order of timestamps, and may facilitate other functional modules in the background server to conveniently retrieve dish information change messages after any timestamp. The present application may also use other devices that already exist in the prior art, or that may appear with the development of science and technology, having the same or similar functions as the Hbase database of the present application to replace the Hbase database to realize the storage of dish information change messages. Similarly, the present application may also use other database pairs or data tables with storage functions to replace the Hive table to realize the storage of dish information change messages.

[0110] Figure 5 FIG. 1 is a flowchart of another method for updating a dish combination according to an embodiment of the present application. Figure 5, the message processing module receives the dish information change message from the user terminal, and stores the dish information change message into the Hbase database and the dish information change Hive table at the same time, wherein the dish information change message in the Hbase database is used to perform online updates on the candidate dish combinations triggered by the user; the dish information change message in the dish information change Hive table is used to generate a backup dish combination index in combination with the dish information data Hive table and the dish combination data Hive table, so as to update the version of the dish combination index and realize offline updates on the candidate dish combinations that have not been triggered by the user. This embodiment utilizes the dish information change message to realize online verification and offline inspection of the dish combination, reduces the steps of online verification through offline inspection, reduces the pressure of online verification, and performs validity verification on the candidate dish combinations triggered by the user in real time through online inspection, to ensure that the dish combinations recommended to the user by the user terminal are all valid dish combinations, thereby improving the online service performance of the dish combination.

[0111] Based on the same inventive concept, an embodiment of the present application provides a device for updating a dish combination. Figure 6 is a schematic diagram of a device for updating a dish combination according to an embodiment. Figure 6 , the device 600 comprises:

[0112] The message storage module 601 is used to store the dish information change message into a preset database and a dish information change data table when receiving the dish information change message;

[0113] A version update module 602 is used to update the version of the dish combination according to the dish information change data table, the dish information data table and the dish combination data table to obtain a new version of the dish combination;

[0114] A first determining module 603 is configured to determine a candidate dish combination from the dish combination of the new version when receiving a query request for a target dish sent by a terminal, wherein the candidate dish combination is a dish combination including the target dish;

[0115] A reading module 604 is used to read a target dish information change message from the preset database, wherein the target dish information change message is used to trigger an update of the candidate dish combination;

[0116] An updating module 605 is used to update the candidate dish combination according to the read target dish information change message;

[0117] The recommendation module 606 is used to recommend the updated candidate dish combination to the terminal.

[0118] Optionally, the apparatus 600 further includes:

[0119] A second determining module is used to determine a version update time for performing a version update to obtain the new version of the dish combination;

[0120] The reading module comprises:

[0121] The reading submodule is used to read the target dish information change message with a timestamp after the version update time from the preset database in the order of the timestamps carried.

[0122] Optionally, the version update module 602 includes:

[0123] A first version update module, used to update the dish information data table according to the dish information change data table to obtain an updated dish information data table;

[0124] The second version update module is used to update the version of the dish combination according to the dish combination data table and the updated dish information data table to obtain a new version of the dish combination.

[0125] Optionally, the first version update module includes:

[0126] A first version update submodule, configured to periodically update the dish information data table according to the dish information change data table with a first preset time period as a period;

[0127] The second version update module includes:

[0128] The second version update submodule is used to perform periodic version updates on the dish combination based on the dish combination data table and the updated dish information data table at a second preset time period, and the second preset time period is not less than the first preset time period.

[0129] Optionally, the preset database is an Hbase database, and the dish information change data table is a Hive table.

[0130] Based on the same inventive concept, another embodiment of the present application provides an electronic device, such as Figure 7 shown. Figure 7 It is a schematic diagram of an electronic device according to an embodiment, the electronic device includes a memory 702, a processor 701 and a computer program stored in the memory and executable on the processor, and the processor, when executed, implements the steps of the method described in any of the above embodiments of the present application.

[0131] Based on the same inventive concept, another embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the method described in any of the above embodiments of the present application are implemented.

[0132] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0133] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0134] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0138] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0139] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0140] The above is a detailed introduction to a method, device, storage medium and electronic device for updating a dish combination provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for updating a dish combination, characterized in that: The method comprises: When receiving a dish information change message, storing the dish information change message in a preset database and a dish information change data table; Generate a backup dish combination index according to the dish information change data table, the dish information data table and the dish combination data table, and use the backup dish combination index as the effective dish combination index to replace the dish combination index of the previous version; and the query request further includes extracting all dish combinations containing the target dish queried by the user from the dish combination index as candidate dish combinations when updating online, and then extracting target dish information change messages that meet the conditions after the update time of the current dish combination index from the preset database, and updating the dish combination to obtain a new version of the dish combination; When receiving a query request for a target dish sent by a terminal, determining a candidate dish combination from the dish combination of the new version, wherein the candidate dish combination is a dish combination including the target dish; Reading a target dish information change message from the preset database, wherein the target dish information change message is used to trigger an update of the candidate dish combination; updating the candidate dish combination according to the read target dish information change message; The updated candidate dish combination is recommended to the terminal.

2. The method according to claim 1, characterized in that The dish information change message carries a timestamp; the method further includes: Determine a version update time for performing a version update to obtain the new version of the dish combination; Reading a target dish information change message from the preset database includes: The target dish information change message with a time stamp after the version update time is read from the preset database in the order of the carried timestamps.

3. The method according to claim 1, characterized in that According to the dish information change data table, the dish information data table and the dish combination data table, the dish combination is updated to obtain a new version of the dish combination, including: According to the dish information change data table, the dish information data table is updated to obtain an updated dish information data table; According to the dish combination data table and the updated dish information data table, the dish combination is updated to obtain a new version of the dish combination.

4. The method according to claim 3, characterized in that According to the dish information change data table, the dish information data table is updated, including: Taking a first preset time as a period, periodically updating the dish information data table according to the dish information change data table; According to the dish combination data table and the updated dish information data table, the dish combination is updated, including: The dish combination is periodically updated based on the dish combination data table and the updated dish information data table with a second preset time period as a period, and the second preset time period is not less than the first preset time period.

5. The method according to any one of claims 1 to 4, characterized in that: The preset database is an Hbase database, and the dish information change data table is a Hive table.

6. A device for updating a dish combination, characterized in that: The device comprises: A message storage module, used for storing the dish information change message into a preset database and a dish information change data table when receiving the dish information change message; A version update module, for generating a backup dish combination index according to the dish information change data table, the dish information data table and the dish combination data table, and using the backup dish combination index as the effective dish combination index to replace the dish combination index of the previous version; and the query request further includes when updating online, extracting all dish combinations containing the target dish from the dish combination index for the target dish queried by the user as candidate dish combinations, and then extracting target dish information change messages that meet the conditions after the update time of the current dish combination index from a preset database, performing version update on the dish combination, and obtaining a new version of the dish combination; A first determining module, configured to determine a candidate dish combination from the dish combination of the new version when receiving a query request for a target dish sent by a terminal, wherein the candidate dish combination is a dish combination including the target dish; A reading module, used for reading a target dish information change message from the preset database, wherein the target dish information change message is used for triggering an update of the candidate dish combination; An updating module, used for updating the candidate dish combination according to the read target dish information change message; The recommendation module is used to recommend the updated candidate dish combination to the terminal.

7. The device according to claim 6, characterized in that The device also includes: A second determining module is used to determine a version update time for performing a version update to obtain the new version of the dish combination; The reading module comprises: The reading submodule is used to read the target dish information change message with a timestamp after the version update time from the preset database in the order of the timestamps carried.

8. The device according to claim 6, characterized in that The version update module includes: A first version update module, used to update the dish information data table according to the dish information change data table to obtain an updated dish information data table; The second version update module is used to update the version of the dish combination according to the dish combination data table and the updated dish information data table to obtain a new version of the dish combination.

9. The device according to claim 8, characterized in that The first version update module includes: A first version update submodule, configured to periodically update the dish information data table according to the dish information change data table with a first preset time period as a period; The second version update module includes: The second version update submodule is used to perform periodic version updates on the dish combination based on the dish combination data table and the updated dish information data table at a second preset time period, and the second preset time period is not less than the first preset time period.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in any one of the methods according to claims 1 to 5 are implemented.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When executed, the processor implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Page resource management method and device

    CN104915357A

  • Product code analysis system and product code analysis program

    CN105229640A