Method and related device for implementing voice interactive meal ordering
By using session identifiers to establish and manage caches in the ordering server, the problems of information discontinuity and inconsistency in voice interactive ordering are solved, and the continuity and consistency of voice interactive ordering is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN201810202817.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-03-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2038-03-12
AI Technical Summary
The problem of discontinuous meal ordering steps and inconsistent interactive information in voice interaction scenarios leads to poor user experience.
By receiving the user's voice interaction request in the ordering server, using the session identifier to establish a cache, and extracting the cached information in each interaction under the same session for logical processing and storage, ensuring the information continuity and consistency, thereby generating an order.
It realizes the continuity and consistency of information during the meal ordering process in voice interaction, improves user experience, simplifies the ordering process, and reduces operational steps.
Smart Images

Figure CN108510355B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer applications, and in particular to a method for implementing voice interactive meal ordering and a related device. Background Art
[0002] In order to facilitate customers to order food and improve the efficiency of ordering food, people have made many useful attempts. In addition to traditional telephone ordering, ordering food through ordering websites has emerged. With the development of smart phones and mobile Internet, mobile application (Application, APP) ordering has emerged. At present, more than 90% of users use mobile APP to order takeout and check the status of takeout orders. However, the ordering method of mobile APP requires users to pause what they are currently doing, select restaurants and dishes on the APP, check the order status, complete the order and query, which is inconvenient and time-consuming. For ordering food through voice interaction, users only need to interact with a few words to complete the order. Users do not need to pause what they are doing, which brings convenience to users.
[0003] Using a mobile phone to order food on a graphical user interface (GUI) means that the user adds food from a restaurant to the shopping cart on the interface, and then settles and pays. In this way, the order is placed. In this process, each interface click event of the user sends a request to the front-end server, and the front-end server sends a corresponding request to the ordering server. The ordering server processes the data storage server and returns the data to the front-end server. Finally, the front-end server presents the purchase information on the interface, thus completing the order. For ordering food in voice interaction mode, each user interaction sends a request to the electronic device. The electronic device collects the user's voice information and then sends a request to the voice processing server. After the voice processing server recognizes the voice information, it sends an order request to the ordering server, thus completing the order. In the graphical user interface ordering mode, the continuity and consistency of the ordering interaction are mainly completed by the front-end server presenting the relevant interface, but the continuity and consistency of the voice interaction ordering interaction are difficult to solve. Summary of the invention
[0004] In view of this, an object of an embodiment of the present invention is to provide a method and a related device for implementing voice interaction ordering, so as to solve the problems of discontinuous ordering steps and inconsistent interaction information in a voice interaction scenario.
[0005] An embodiment of the present invention provides a method for implementing voice interactive meal ordering, which is applied to a meal ordering server, and the method comprises: receiving a meal ordering request, the meal ordering request comprising a user identifier, a session identifier, an intent slot value, and a status identifier representing whether the session is a new session; when the status identifier represents that the session is a new session, establishing a cache according to the session identifier, and adding basic information to the cache; when the status identifier represents that the session is not a new session, first taking out the cache information corresponding to the session identifier, performing logical processing using the cache information to obtain relevant information, and storing the relevant information in the cache corresponding to the session identifier.
[0006] An embodiment of the present invention also provides a device for implementing voice interactive ordering, which is applied to a food ordering server, and the device includes: a receiving unit, which is used to receive an ordering request, and the ordering request includes a user identifier, a session identifier, an intent slot value, and a status identifier representing whether the session is a new session; a cache establishment unit, which is used to establish a cache based on the session identifier when the status identifier represents that the session is a new session, and add basic information to the cache; when the status identifier represents that the session is not a new session, first retrieve the cache information corresponding to the session identifier, and use the cache information to perform logical processing to obtain relevant information, and store the relevant information in the cache corresponding to the session identifier.
[0007] An embodiment of the present invention also provides a computer device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for implementing voice interactive ordering.
[0008] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for implementing voice interactive ordering as described above.
[0009] Compared with the prior art, the implementation method and related device of voice interactive ordering provided by the embodiment of the present invention are applied to the ordering server. The ordering server can communicate with the electronic device through the voice server. The user initiates voice through the electronic device, and the voice server recognizes the voice and intention, and sends an ordering request to the ordering server. The ordering server receives the ordering request, and establishes a cache based on the session identifier in the ordering request, and adds basic information such as the user identifier to the cache; in each subsequent interaction under the same session, the cache information is first taken out, and then the relevant information obtained by processing the cache information is stored in the cache of the session identifier, so that when an order needs to be generated, the order is directly generated according to the relevant information in the cache. In this way, multiple interactions in a session are associated, the continuity and consistency of multiple interaction information are achieved, and the order is completed, that is, ordering by voice interaction is realized.
[0010] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A schematic diagram of the interaction between a food ordering server, a voice server and an electronic device provided in an embodiment of the present invention.
[0013] Figure 2 A schematic diagram of signaling interaction among a food ordering server, a voice server, and an electronic device provided in the first embodiment of the present invention.
[0014] Figure 3 A method for implementing voice interactive meal ordering provided in the first embodiment of the present invention.
[0015] Figure 4 A method for implementing voice interactive meal ordering provided in the second embodiment of the present invention.
[0016] Figure 5 A schematic diagram of the structure of a computer device provided in the third embodiment of the present invention.
[0017] Figure 6 This is a module diagram of an implementation apparatus for voice interactive meal ordering provided in the third embodiment of the present invention.
[0018] Icons: 10-ordering server; 20-electronic device; 30-voice server; 40-computer device; 101-processor; 102-memory; 103-bus; 104-communication interface; 200-implementation device for voice interactive ordering; 201-receiving unit; 202-cache establishment unit; 203-time configuration unit; 204-clearing unit; 205-end prompt unit. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0020] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0021] Please refer to Figure 1 , is a schematic diagram of the interaction between the ordering server 10, the voice server 30 and the electronic device 20 provided in an embodiment of the present invention. The ordering server 10 can perform voice interaction with one or more electronic devices 20 through the voice server 30. One or more electronic devices 20 send voices to the voice server 30. The voice server 30 recognizes and parses the voices sent by the electronic devices 20 and sends them to the ordering server 10. The ordering server 10 processes the request of the voice server 30 and returns the result to the voice server 30. The voice server 30 feeds back the information to the electronic device 20, which plays it to the user, thereby providing the user with an ordering function based on voice interaction.
[0022] In this embodiment, the electronic device 20 can be an intelligent voice device such as an intelligent speaker and an intelligent helmet, or a smart mobile device with voice input / output function such as a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc. The electronic device 20 can collect information through a microphone and transmit the collected voice information to the voice server 30. The operating system of the electronic device 20 can be, but not limited to, an Android system, an IOS (iPhone operating system) system, a Windows phone system, a Windows system, etc. The ordering server 10 is used to provide ordering services and store information during the user's ordering process. The ordering server 10 can be, but not limited to, a network server, a database server, a cloud server, etc. The voice server 30 can be a server with voice recognition function.
[0023] In the embodiment of the present invention, the electronic device 20 collects voice information through a microphone and transmits the collected voice information to the voice server 30. After the voice server 30 recognizes the voice sent by the electronic device 20, it sends the recognized information to the ordering server 10, thereby establishing data communication between the electronic device 20, the voice server 30 and the ordering server 10. The voice server 30 also sends a unique session identifier for an ordering event to the ordering server 10, wherein an ordering event can also be called a session, and a session refers to a process in which an electronic device 20 communicates with the ordering server 10 using the voice server 30, such as the entire information interaction process from starting to order to voice selection or confirmation of a restaurant or food, and then to the completion of the order. In order to enable the ordering server 10 to store multiple pieces of interactive information of a session, it is convenient to generate orders based on multiple interactive information, which is described in detail below.
[0024] First embodiment
[0025] Please refer to Figure 2 , is a schematic diagram of signaling interaction between the ordering server 10, the voice server 30 and the electronic device 20 provided in the first embodiment of the present invention. This embodiment shows that the electronic device 20 and the ordering server 10 interact twice to complete the ordering. Of course, in other specific implementations, there are also situations of more times of interaction, and the method and principle of the signaling interaction process are the same as those in this embodiment.
[0026] Specifically, the user first speaks to the electronic device 20 to input the first user voice, and the electronic device 20 can send the first user voice to the voice server 30. The first user voice contains a wake-up word to wake up the application stored in the voice server 30 (such as Ele.me, Baidu Takeout).
[0027] After receiving the first user voice in audio form, the voice server 30 recognizes the first user voice to obtain voice information in text form, and then performs intent recognition on the voice information according to the grammatical rules pre-set on the voice server 30 to obtain intent information, which can reflect the user's intention to order food. The first user voice can wake up the application stored in the voice server 30 through a voice with a wake-up word, which can be a wake-up with intent or without intent, but must be accompanied by a wake-up word in order to wake up a certain application. For example, the first user voice without intent can be "Open Ele.me / Baidu Waimai", and the first user voice with intent can be "I want to eat fish-flavored pork shreds from Ele.me / Baidu Waimai", and its intent information is "I want to eat" and "fish-flavored pork shreds", and the wake-up word is "Ele.me / Baidu Waimai". After the voice server 30 recognizes the wake-up word "Ele.me / Baidu Waimai", it sends a request to the "Ele.me / Baidu Waimai" application, and the specific program steps are as follows.
[0028] The voice server 30 recognizes the first user voice in audio form sent by the electronic device 20 as voice information in text form, and then performs intent recognition on the voice information in text form according to the grammar rules preset by the user, and the recognized information is called the intent slot value, for example, it can be represented by slots. The information recognized in the first user voice includes the first intent slot value.
[0029] When the electronic device 20 sends a voice to the voice server 30, it can send a user identifier (such as user_id). The voice server 30 also configures a session identifier (such as session_id) and a state identifier. Each session has a unique session identifier, which is all the interactive information of the user in a meal ordering event. For example, Figure 2The interaction between the electronic device 20, the voice server 30 and the ordering server 10 is a session. The unique session identifier can be determined in the following way: when the electronic device 20 sends a voice to the voice server 30, it also sends a user identifier (user_id). When the voice server 30 is awakened, it will generate a session_id for the ordering information. When the session is not over, as long as the user voice sent by the electronic device 20 corresponding to the user_id is received, the same session_id will be added to the ordering information obtained by parsing the user voice. In this embodiment, the state identifier is is_new=true or is_new=false. When the program corresponding to the voice server 30 is awakened, is_new=true. It can also be understood that when a new session_id is created, is_new=true is configured; when the session is not over, when the user voice sent by the electronic device 20 corresponding to the user_id is received, is_new=false.
[0030] The voice server 30 sends a first order request to the order server 10, and the first order request includes a user identifier, a first intent slot value, a session identifier, and a state identifier. In this embodiment, the state identifier in the first order request is is_new=true, that is, the session identifier is a new session identifier, and the order server 10 will establish a new session for the session identifier. This will be described in detail later and will not be repeated here.
[0031] After receiving the first order request, the order server 10 can call the corresponding interface according to the first intent slot value and generate order prompt information; if the order request sent by the voice server 30 does not contain the intent slot value, it will generate order prompt information prompting the user to send the restaurant name, food name, etc. with the order intention, so as to prompt the user to express the order intention, such as "I want to eat chicken steak".
[0032] For example, if the first user's voice is "Please help me place another order from Ele.me / Baidu Takeaway", the recognized intent information is "Please place another order", and the corresponding ordering intention is to place another order; if the first user's voice is "I want to eat the *** of Ele.me / Baidu Takeaway", the recognized intent information is "I want to eat", and the corresponding ordering intention is to order according to the *** specified by the user; if the first user's voice is "My Ele.me / Baidu Takeaway high-frequency ***", the recognized intent information is "high frequency", and the corresponding ordering intention is to order according to the user's historical ordering frequency of ***; if the first user's voice is "Please help me place a random order from Ele.me / Baidu Takeaway", the recognized intent information is "random", and the corresponding ordering intention is to place a random order; if the first user's voice is "What are people nearby eating", the recognized intent information is "nearby", and the corresponding ordering intention is to order according to the ordering frequency of nearby users.
[0033] The ordering server 10 pre-stores the correspondence between the intent slot value and the ordering intent, parses the key in the intent slot value slots, and matches it with the corresponding branch.
[0034] The first order request contains an intent slot value, and the order server 10 may generate the order prompt information in the following manner:
[0035] When the intent slot value is determined to be "another order", the corresponding search method is to find the user's most recent order. The ordering server 10 will first call the historical order interface of EOS (Eleme Order System) to obtain all the user's historical orders, and then find an order closest to the current time according to the historical orders, or find an order closest to the current time and whose order time is in the ordering time period of the current time according to the historical orders, and generate ordering prompt information based on the order. Further, the ordering prompt information is sent to the voice server 30. For example, 24 hours a day can be divided into multiple ordering time periods. Assuming that the current time is 12 noon, the ordering time period is between 12 noon and 1 noon. The user orders food in the morning of the same day, order A, and the user also orders food at 12:30 noon the previous day, order B. When the user wants to place another order, the ordering server 10 can find the order closest to 12 noon on the same day, that is, order A, or find the order closest to the current time and whose order time is in the ordering time period (12 noon-1 noon) of the current time, that is, order B.
[0036] When the intent slot value is determined to be "I want to eat ***", the corresponding search method is to search for ***. For example, the user inputs the voice of "I want to eat McDonald's" through the electronic device 20, and the ordering server 10 will call the relevant search interface to search for restaurants that meet the conditions, and select the top-ranked restaurants according to the restaurant recommendation strategy (for example, the distance between the restaurant and the user) and generate an ordering prompt voice, which is played by the electronic device 20 to the user for the user to choose the recommended restaurant. For another example, the user inputs the voice of "I want to eat cold dishes" through the electronic device 20, and the ordering server 10 fuzzy matches "I want to eat". The ordering server 10 uses "cold dishes" as a keyword to call the keyword search interface, search for restaurants with "cold dishes", and select the top-ranked restaurants according to the restaurant recommendation strategy to generate ordering prompt information.
[0037] When the intent slot value is determined to be "My High-Frequency Restaurant", the corresponding search method is to search for restaurants according to the frequency of the user's ordering of restaurants. The ordering server 10 will call the big data interface, search for the top few restaurants with the most dining times in the user's historical orders stored in the ordering server 10, and generate an ordering reminder voice. Further, for each restaurant, the top dishes can be selected according to the dish recommendation strategy, and the corresponding ordering reminder voice can be generated according to the searched restaurant and the selected dishes. For example, the user inputs "What is my high-frequency restaurant" through the electronic device 20, and the ordering server 10 voice server 30 fuzzy matches "My High-Frequency Restaurant". The ordering server 10 will call the big data interface according to the user's id, identify the user according to the user's id, and search for the top few restaurants with the highest dining frequency in the stored historical orders of the user and generate ordering reminder information. For each restaurant, the ordering server 10 can also select the top dishes according to the dish recommendation strategy and generate corresponding ordering reminder information. The user ID may be the ID of the electronic device 20 or the ID of a user who logs into the application through the electronic device 20 .
[0038] When the "random order" intention is determined by the intent slot value, the corresponding search method is to search for restaurants according to the price. The ordering server 10 first triggers the voice server 30 to send the voice of "What is the price range you accept?" to the electronic device 20. After the user enters the voice of the price range he accepts through the electronic device 20, the ordering server 10 will call the search homepage list interface, taking the price as the main factor and other auxiliary factors (such as the distance between the restaurant and the user), select the top restaurants. For each restaurant, the ordering server 10 can also select the top dishes according to the dish recommendation strategy, and generate ordering prompt information according to the selected restaurant and the corresponding dishes. For example, the user enters "Please randomly order" through the electronic device 20, and the ordering server 10 first triggers the ordering server 10 voice server 30 to return the voice of "What is the price range you accept" to the electronic device 20. The user enters "between 20 and 30 yuan" through the electronic device 20 voice. The ordering server 10 selects the top restaurants according to the price and the distance between the restaurant and the user (it can also be based on the restaurant's rating, etc.). For each restaurant, the ordering server 10 can also select the top ranked dishes according to the dish recommendation strategy, and further recommend the restaurant and dish information by playing an ordering prompt voice to the user through the electronic device 20.
[0039] When the intent of "what people nearby eat" is determined by the intent slot value, the corresponding search method is to search according to the ordering frequency of nearby users. The ordering server 10 will call the corresponding interface to find the top restaurants with the highest ordering frequency within a certain range (such as locating the user's current location, with the user's current location as the center and a radius of 1 kilometer). For each restaurant, the ordering server 10 can also find the top dishes with the highest ordering frequency from all dishes, and generate corresponding ordering reminder information based on the searched restaurants and dishes.
[0040] If the order request does not contain an intent slot value, the order server 10 may directly return order prompt information, which mainly includes broadcast information and a status indicator indicating whether the session has ended. The broadcast information at this time may be "You can say I want to eat chicken steak", "What do you need to eat", "Which restaurant's dishes do you need to eat", etc.
[0041] The voice server 30 converts the ordering reminder information into an ordering reminder voice, sends it to the electronic device 20, and determines whether the session is ended. If the session is ended, the session end identifier is_end=true, and the voice server 30 deletes the session related data; otherwise, during multiple interactions, the session identifier sent by the voice server 30 remains unchanged.
[0042] After receiving the ordering prompt voice, the electronic device 20 reads it out, and the user provides information feedback based on the restaurant name, dish name, category, price, etc. contained in the ordering prompt voice, and inputs the second user voice to the electronic device 20 through voice input to further order food. The electronic device 20 sends the second user voice to the voice server 30, and the second user voice may include the restaurant information and dish information selected or confirmed by the user from the ordering prompt voice.
[0043] After receiving the second user voice sent by the electronic device 20, the voice server 30 identifies the second user voice to obtain the second ordering information. The second ordering information may include the restaurant food information selected by the user, or may include the restaurant food information confirmed or changed by the user. Because the session has not ended, the session end identifier is_end=false in the information returned for the first time. When the voice server 30 parses the session end identifier in the returned information as is_end=false, all data information generated by the session will be retained, including session_id. The voice server 30 can check whether there is a previously created session_id in the second user voice. In this embodiment, since the session_id has been created when the first user voice is received, and the second user voice and the first user voice belong to two interactive information of a session, after parsing the second user voice to obtain the second ordering information, the second ordering information is configured with the same session_id as the first ordering information. Correspondingly, its status identifier is_new is false.
[0044] The voice server 30 sends a second order request to the order server 10, and the second order request includes a user identifier, a second intent slot value, session_id, and is_new=false. The order server 10 searches for the cache that has been created after receiving the first order request according to the session_id, and stores the relevant information processed by the retrieved relevant cache information into the cache, that is, adds it to the value with session_id as the key. The relevant information includes restaurant information, food information, food quantity, specifications, etc.
[0045] In other specific implementations, more voice interactions may be included, and the electronic device 20 may also send the third user voice, the fourth user voice, and the Nth user voice until the session ends. In a session, each time an interaction is added, the ordering server 10 will retrieve the information in the cache, process the retrieved information, and store the processed information in the value with session_id as the key, so as to place an order.
[0046] The ordering server 10 will feedback a session end identifier to the voice server 30 each time, and the session end identifier indicates whether the entire session is over. When the session ends, the ordering server 10 will feedback the session end identifier to the voice server 30 as is_end=true. The voice server 30 converts the order end information into an order end voice and sends it to the electronic device 20. The electronic device 20 reads the order end voice. The order end voice can be "I have helped you complete the order, please wait patiently, welcome to buy next time", "You have canceled the payment", "You have not set up password-free payment", "You have not logged in, please log in to the Dingdong app", "You have not reached the restaurant's starting price, and the shopping cart has been cancelled for you. Welcome to buy next time", "The order has been cancelled for you, welcome to buy again", "I think you have successfully paid, order details can be viewed on the Ele.me app, please wait patiently", etc. After the voice server 30 parses is_end as true, it deletes the relevant data corresponding to the session tag so that when the system is woken up again, the session_id can be regenerated.
[0047] On the one hand, the ordering server 10 processes the intent slot value to call the corresponding interface to generate ordering prompt information, and feeds it back to the user to realize voice interaction; on the other hand, it also stores the necessary order information generated during each interaction process into a cache with session_id as the key and json or dict variable as the value to facilitate ordering.
[0048] Please refer to Figure 3 , is a method for implementing voice interactive meal ordering provided by the first embodiment of the present invention. The method for implementing voice interactive meal ordering in the embodiment of the present invention is applied to a meal ordering server 10 that provides meal ordering services, and the method for implementing voice interactive meal ordering includes:
[0049] Step S11, receiving a meal order request.
[0050] The order request includes a user ID, a session ID, an intent slot value, and a state ID. In this embodiment, the session ID can be represented by session_id, and the state ID can be is_new=true or is_new=false. The intent slot value is obtained by the voice server 30 recognizing the voice of the electronic device 20 and recognizing the voice information in text form according to the semantic rules. For example, if the user voice is "I want to eat fish-flavored pork shreds from Ele.me / Baidu Takeaway", the intent slot value slots is {
[0051] "want_eat":"I want to eat",
[0052] "keyword":"Fish-flavored Shredded Pork",
[0053] "focus":"eleme",
[0054] "bizname":"Ele.me"
[0055] }.
[0056] If the state flag is_new=true, it means that session_id A is a new session identifier configured for the session, and step S121 is executed; if the state flag is is_new=false, it means that session_id B is not a new session identifier, and step S122 is executed.
[0057] Step S121, establishing a cache according to the session identifier, and adding basic information to the cache.
[0058] Use session identifier session_id A as key and Json or Dict variable as Value to create Redis cache. The basic information includes the user ID, latitude and longitude, mobile phone number, Ele.me account, successful login ID, etc.
[0059] Step S122: Add the relevant information corresponding to the session that is not a new session to the cache corresponding to the session.
[0060] Because is_new in the interactive request is false, session_id B is not a new session identifier, so Redis stores a cache with session_id B as the key. According to session identifier session_id B, the key / value program structure of the cache is found, and the relevant information is stored in the corresponding Value, such as adding the restaurant name, dish name, dish quantity, and specifications selected by the user to the cache.
[0061] Second embodiment
[0062] Please refer to Figure 4 , is a method for implementing voice interactive meal ordering provided by the second embodiment of the present invention. The method for implementing voice interactive meal ordering in the embodiment of the present invention is applied to a meal ordering server 10 that provides meal ordering services. The difference between the method for implementing voice interactive meal ordering in this embodiment and the first embodiment is that it further includes:
[0063] Step S13: Send an end mark to the voice server 30.
[0064] When the session ends, the end mark sent to the voice server 30 is the mark is_end=true. In this embodiment, when the ordering information received by the ordering server 10 includes any one of: canceling the order, correctly entering the payment password, canceling the payment, paying without a password, the user not logging in, or not reaching the restaurant's minimum delivery price but stopping the purchase, the ordering server 10 determines that the session has ended, and then sends the end mark is_end=true to the voice server 30. The voice server 30 parses is_end=true and deletes the relevant data corresponding to the session mark so that when the user wakes up the application again, a new session_id is assigned to the session.
[0065] In addition, when the session ends, the return information of the ordering server 10 to the voice server 30 may be "The order has been completed for you, please wait patiently, welcome to shop next time", "You have canceled the payment", "You have not set up password-free payment", "You have not logged in, please log in to the Dingdong app", "You have not reached the restaurant's minimum delivery price, the shopping cart has been canceled for you, welcome to shop next time", "The order has been canceled for you, welcome to shop again", "We think you have successfully paid, the order details can be viewed in the Ele.me app, please wait patiently", etc.
[0066] Step S14, starting from the establishment of the cache, after the expiration time, the cached data is deleted.
[0067] When each cache is established, the method further includes the following steps: when establishing the cache, configuring an expiration time for the cache.
[0068] Specifically, the information cached on the ordering server 10 for each session has a time of being established, and a reasonable expiration time can be set when each cache is established, such as 3*60 seconds, 5*60 seconds, 10*60 seconds, etc. When the expiration time passes, the cached data will be automatically deleted, thus reducing the pressure on the redis server, which is a sub-server under the ordering server 10. Preferably, the expiration time is 5*60 seconds.
[0069] During each interaction, the ordering server 10 will process the interaction information and store the relevant information in the cache, such as storing the necessary order information in the cache. At the same time, the corresponding information will be taken from the cache for information processing and feedback. For example, when the user says "confirm the restaurant" or selects a restaurant, the ordering server 10 will store the restaurant ID in the cache, and obtain the restaurant's dish information based on the restaurant ID, and provide dish information feedback for the user to select dishes. Because it is necessary to determine whether the price of the selected food has reached the restaurant's starting price in the following relief, the restaurant's starting price information needs to be stored in the cache here. When the user says "confirm the food" or selects a food, if the food has no specifications and attributes, the food quantity prompt information is returned. If there are specifications and attributes, the attribute and specification prompt information is returned. Similarly, the quantity, specification, and attribute information of the food are stored in the cache. When placing an order, the corresponding data information is taken out from the cache. For example, session ID session_id = 123456, value = {}, when the application is called up, the corresponding user information will be stored in value, and a cache will be created, and the expiration time will be set, such as cache_client.set(session_id, value, 5*60). When the user confirms restaurant 24, value['restaurant_id'] = 24, value['delivery_price'] = 20. The restaurant id is needed later, that is, it is obtained from the cache, and the method is value = cache_client.get(123 456), obtain the restaurant's food list according to the restaurant id, and generate feedback information. When the user confirms the food or selects a food, store food_id and food_name in the cache, that is, value['food_id'] = 789, value['food_name'] = 'hahaha', and then perform cache_client.set(session_id, value, 5*60). The storage of food quantity, specifications, and attribute information is the same, so that the location address, delivery address, food_id, quantity and other information required for placing an order are available.
[0070] Third embodiment
[0071] Please refer to Figure 5 , is a schematic diagram of the structure of a computer device 40 provided in the third embodiment of the present invention. In this embodiment, the computer device 40 is a meal ordering server 10, and the computer device 40 includes a processor 101, a memory 102, a bus 103 and a communication interface 104, wherein the processor 101, the communication interface 104 and the memory 102 are connected via the bus 103; the processor 101 is used to execute an executable module stored in the memory 102, such as a computer program.
[0072] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 104 (which may be wired or wireless).
[0073] The bus 103 may be an ISA bus, a PCI bus, or an EISA bus, etc. Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0074] The memory 102 is used to store programs, such as Figure 6 The implementation device 200 of voice interactive ordering is shown. The implementation device 200 of voice interactive ordering includes at least one software function module that can be stored in the memory 102 in the form of software or firmware or fixed in the operating system (OS) of the computer device 40. After receiving the execution instruction, the processor 101 executes the program to implement the implementation method of voice interactive ordering disclosed in the above embodiment of the present invention.
[0075] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 101 or the instructions in the form of software. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the above method in combination with its hardware.
[0076] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 101, the method for implementing voice interactive ordering disclosed in the above embodiment is implemented.
[0077] Please refer to Figure 6, which is a module diagram of a device 200 for implementing voice interaction ordering provided in a third embodiment of the present invention. The device 200 for implementing voice interaction ordering includes a receiving unit 201, a cache establishing unit 202, a time configuration unit 203, a clearing unit 204, and an end prompting unit 205.
[0078] The receiving unit 201 is used to receive a meal ordering request, wherein the meal ordering request includes a user identifier, a session identifier, an intent slot value, and a status identifier indicating whether the session is a new session. Figure 2 The first order request and the second order request in.
[0079] In the embodiment of the present invention, the receiving unit 201 may execute step S11.
[0080] The cache establishing unit 202 is used to establish a cache according to the session identifier and add basic information to the cache when the state identifier indicates that the session is a new session; when the state identifier indicates that the session is not a new session, first retrieve the cache information corresponding to the session identifier, perform logical processing using the cache information to obtain relevant information, and store the relevant information in the cache corresponding to the session identifier.
[0081] In the embodiment of the present invention, the cache establishing unit 202 may execute step S121 and step S122.
[0082] The time configuration unit 203 is used to configure an expiration time for the cache when the cache is established, that is, an expiration time is set for the cache established in each interaction process, and the past time set each time is the same.
[0083] The clearing unit 204 is used to delete the cached data after the expiration time has passed since the cache was established. After the expiration time has passed, the generated cached data will be cleared, which reduces the data storage performance of the redis server and improves the response speed of the service.
[0084] In this embodiment, the clearing unit 204 may execute step S14.
[0085] The end prompt unit 205 is used to return the information including the session end identifier to the voice server that sent the order request. When the session ends, the end identifier sent to the voice server 30 is is_end=true. When the voice server 30 parses the information, it will clear the session data so that when the application is woken up again, a new session is established and a new session_id is assigned.
[0086] In this embodiment, the end prompt unit 205 may execute step S13.
[0087] In summary, the implementation method and related device of voice interactive ordering provided by the embodiment of the present invention are applied to the ordering server. The ordering server can communicate with the electronic device through the voice server. The user can initiate voice through the electronic device, and the voice server and the ordering server can realize interactive ordering by voice. The user initiates voice through the electronic device, and the voice server recognizes the voice and intention, and sends an ordering request to the ordering server. The ordering server receives the ordering request, and establishes a cache according to the session identifier in the ordering request, and adds basic information such as the user identifier to the cache; in each subsequent interaction under the same session, the cache information is first taken out, and then the relevant information obtained by processing the cache information is stored in the cache of the session identifier, so that when an order needs to be generated, the order is directly generated according to the relevant information in the cache. In this way, multiple interactions in a session are associated, the continuity and consistency of multiple interactive information are achieved, and the order is completed, that is, the ordering of voice interaction is realized. A reasonable expiration time can also be set, starting from the establishment of the cache. After the expiration time, the ordering server removes the cache data to reduce the cache file.
[0088] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0090] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. 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 "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0092] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for implementing voice interactive meal ordering, applied to a meal ordering server, characterized in that: The implementation method includes: Receive a meal ordering request, the meal ordering request including a user identifier, a session identifier, an intent slot value, and a status identifier indicating whether the session is a new session; When the state identifier indicates that the session is a new session, a cache is established according to the session identifier, and basic information is added to the cache; When the state identifier indicates that the session is not a new session, firstly retrieve the cache information corresponding to the session identifier, perform logical processing using the cache information to obtain relevant information, and store the relevant information in the cache corresponding to the session identifier to implement storage of multiple pieces of interaction information for a session; Generate an order based on the relevant information in the cache; The implementation method further includes: When establishing a cache, configuring an expiration time for the cache; Starting from the creation of the cache, after the expiration time has passed, the cached data is deleted.
2. The method for implementing voice interactive meal ordering according to claim 1, characterized in that: The implementation method also includes: The information returned to the voice server that sent the order request includes a session end identifier.
3. The method for implementing voice interactive meal ordering according to claim 2, characterized in that: When the received order information is any one of order cancellation, correct entry of payment password, payment cancellation, no password-free payment, user not logged in, or the restaurant's minimum delivery price has not been reached but the purchase is stopped, the session ends and the session end flag sent to the voice server is_end=true.
4. The method for implementing voice interactive meal ordering according to any one of claims 1 to 3, characterized in that: The state flag includes: Is_new=True or Is_new=False, and the implementation method includes: If the state identifier is Is_new=True, a cache is established; if the state identifier is Is_new=False, the cache information corresponding to the session identifier is first retrieved, and the cache information is used to perform logical processing to obtain relevant information, and the relevant information is stored in the cache corresponding to the session identifier; The basic information includes the user ID, longitude and latitude, and mobile phone number, and the relevant information includes restaurant information, food information, food quantity, and specifications.
5. The method for implementing voice interactive meal ordering according to claim 4, characterized in that: The implementation method further includes: reading relevant information from the cache, adding an order ID to the relevant information, and generating an order.
6. A device for implementing voice interactive meal ordering, applied to a meal ordering server, characterized in that: The device comprises: A receiving unit, configured to receive a meal ordering request, wherein the meal ordering request includes a user identifier, a session identifier, an intent slot value, and a status identifier indicating whether the session is a new session; a cache establishing unit, configured to establish a cache according to the session identifier and add basic information to the cache when the state identifier indicates that the session is a new session; and to first retrieve cache information corresponding to the session identifier and perform logical processing using the cache information to obtain relevant information, and store the relevant information in the cache corresponding to the session identifier, so as to store multiple pieces of interactive information of a session; The device is also used to generate an order based on the relevant information in the cache; Wherein, the device further comprises: A time configuration unit, used to configure an expiration time for the cache when establishing the cache; The clearing unit deletes the cached data after the expiration time has passed since the cache was established.
7. A computer device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Order cancellation method and device based on multiple rounds of voice interaction
CN107705173A
Meal ordering method and relevant device based on voice interaction
CN107578320A
Dialogue processing equipment, method and recording medium
CN1306271A
Perpetual communication session: portability / reusability across applications, networks and devices
US20150221007A1