Session management method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202311588572.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-11-24
AI Technical Summary
[0046]本公开实施例提供的技术方案与现有技术相比具有如下优点:
Smart Images

Figure CN117609454B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information management, and in particular to session management methods, apparatus, devices and storage media. Background Technology
[0002] With the development of intelligent technologies, multi-turn conversations are widely used in fields such as smart homes and robot assistants. Humans often use short sentences and ellipses in communication; therefore, managing key information in successive turns of conversation has become crucial for providing users with better conversational services. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure provides a session management method, apparatus, device, and storage medium.
[0004] Firstly, this disclosure provides a session management method, including:
[0005] Retrieve the user's current session round in the target session;
[0006] Extract key information based on the current round of the session;
[0007] The preset global variables and / or session variables generated in the target session are updated based on the key information; wherein, the global variables are used to represent variables in multiple sessions.
[0008] In another embodiment of this disclosure, the extraction of key information based on the current round of the session includes:
[0009] Determine the round information of the current round session within the target session;
[0010] Record multiple nodes traversed from the first round of the target session to the current round of the session; wherein, the node is the question-and-answer session corresponding to each round in the target session;
[0011] The round information and the multiple nodes are identified as key information.
[0012] In another embodiment of this disclosure, the method further includes:
[0013] Get the edge that connects the two nodes in the question-and-answer session between the two rounds;
[0014] The aforementioned multiple edges are identified as key information.
[0015] In another embodiment of this disclosure, updating session variables in the target session based on the key information includes:
[0016] The session variables representing the session rounds are updated based on the round information;
[0017] The session variable representing the list of visited nodes is updated based on the multiple nodes and the multiple edges.
[0018] In another embodiment of this disclosure, when the current round of the session is an inquiry statement, the method further includes:
[0019] Based on the session variable representing the list of nodes passed through, trace back layer by layer at least one round of sessions that the current round of sessions has continued;
[0020] Based on the global variables and / or multiple session variables corresponding to the at least one round of the session, generate the response statement for the current round of the session.
[0021] In another embodiment of this disclosure, obtaining the user's current round of the target session includes:
[0022] Receive the latest original session from the user in the target session;
[0023] If the original session is determined to be an incomplete statement, search for matching session variables in previous rounds of historical sessions preceding the original session;
[0024] The original session is supplemented into a semantically complete current round session based on the found session variables.
[0025] In another embodiment of this disclosure, the key information includes: target objects and quantity information corresponding to the target objects; updating the session variables and / or preset global variables in the target session based on the key information includes:
[0026] Based on the target object and the quantity information corresponding to the target object, the session variable representing the target object is updated, and the object global variable is updated; wherein, the object global variable is a global variable representing all object information.
[0027] In another embodiment of this disclosure, the key information further includes: indicating the current management intent for storage or retrieval; updating the object global variable based on the target object and the quantity information corresponding to the target object includes:
[0028] Check whether the target object is contained in the global variables of the object;
[0029] If included, then based on the current management intent and the quantity information, the historical quantity information corresponding to the target object in the object global variable is updated;
[0030] If not included, the global variables of the object are updated based on the current management intent.
[0031] In another embodiment of this disclosure, updating the object global variable based on the current management intent includes:
[0032] If the current management intent is to access the target object, generate supplementary reminder information for the target object and add the supplementary reminder information for the target object to the object's global variable;
[0033] If the current management intent is to store the target object, add the target object and the quantity information to the object's global variable.
[0034] In another embodiment of this disclosure, where the target session is associated with refrigerator food management, the target object includes stored items.
[0035] In another embodiment of this disclosure, the extraction of key information based on the current round of the session includes:
[0036] Extract the word segments that match the preset slots from the current round of the session to obtain key information; wherein, the slots include at least: the name of the stored item, the management intent, and the quantity.
[0037] Secondly, this disclosure also provides a session management device, including:
[0038] The session acquisition module is used to acquire the user's current session round in the target session;
[0039] The key information extraction module is used to extract key information based on the current round of the session;
[0040] The variable update module is used to update preset global variables and / or session variables generated in the target session based on the key information; wherein, the global variables are used to represent variables in multiple sessions.
[0041] Thirdly, this disclosure also provides an electronic device, including:
[0042] processor;
[0043] Memory, used to store executable instructions;
[0044] The processor is used to read executable instructions from memory and execute the executable instructions to implement the session management method of the first aspect mentioned above.
[0045] Fourthly, this disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the session management method of the first aspect described above.
[0046] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0047] The session management method, apparatus, device, and storage medium disclosed in this embodiment include: firstly, acquiring the current round of a user's session in a target session; then, extracting key information based on the current round of the session; and finally, updating preset global variables and / or session variables generated in the target session according to the key information; wherein, the global variables are used to represent variables in multiple sessions. This technical solution updates session variables and global variables based on key information extracted from the current round of the session, which can fully utilize the key information to enhance the matching between session variables and global variables and the current round of the session. By updating session variables and global variables, the session variables and global variables acquire the ability to understand and remember the context of the target session, thereby facilitating the provision of better session services to users. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0049] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A flowchart illustrating a session management method provided in an embodiment of this disclosure;
[0051] Figure 2 A schematic diagram of a multi-turn conversation provided in an embodiment of this disclosure;
[0052] Figure 3 A schematic diagram of a conversation graph provided in an embodiment of this disclosure;
[0053] Figure 4 A schematic diagram of another multi-turn session provided in an embodiment of this disclosure;
[0054] Figure 5 A schematic diagram of another multi-turn session provided in an embodiment of this disclosure;
[0055] Figure 6This is a schematic diagram of the structure of a session management device provided in an embodiment of the present disclosure;
[0056] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0057] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0058] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0059] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0060] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0061] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0062] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0063] Figure 1 This is a flowchart illustrating a session management method provided in an embodiment of the present disclosure.
[0064] In some embodiments of this disclosure, Figure 1The method shown can be applied to conversation management devices in fields such as smart homes, robot assistants, and customer service. These conversation management devices can be, for example, controllers in smart home devices, but are not limited to this.
[0065] like Figure 1 As shown, the session management method may include the following steps.
[0066] S102. Obtain the current round of the user's session in the target session.
[0067] In multi-turn conversation scenarios, when a user initiates the first round of a human-computer interaction, that first round is obtained as the target conversation. As the human-computer interaction progresses, multiple rounds of conversation from the first round to the current round are used as the target conversation. In other words, the target conversation can include at least one round of conversation, and the conversation can consist of only a single statement, such as a user's question or request. It can be understood that in most cases, the target conversation includes multiple rounds of interactive question-and-answer sessions.
[0068] This embodiment can acquire the user's current round of conversation using sound acquisition devices such as microphones. In one example, the current round of conversation can be the user's original conversation directly acquired; due to human communication habits, the user's original conversation may be incomplete sentences in the form of short sentences or ellipsis.
[0069] Alternatively, in another example, considering that users dominate multi-turn conversations, the first turn of conversation is generally a semantically complete statement, while subsequent turns of conversation, due to everyday communication habits, may be incomplete statements such as short sentences and ellipses. The semantics of subsequent turns of conversation are based on the context of the conversation, exhibiting continuity and supplementation. Therefore, to supplement the missing information in incomplete statements, the current turn of conversation in this embodiment can be a complete conversation based on the previous turn of conversation, semantically supplemented from the user's original conversation. Of course, when the current turn of conversation is the first turn of conversation, semantic supplementation or other processing of that conversation is unnecessary.
[0070] S104. Extract key information based on the current round of the conversation.
[0071] In this embodiment, the key information may include the round information, nodes, and edges of the current round session in the target session, as well as word segmentation that represents the user's intent, such as the subject object, time, location, and behavior in the current round session.
[0072] In one specific approach, starting from when the user initiates the first round of the session, the number of rounds of the sessions already conducted in the target session can be recorded to determine the round information of the current round of the session in the target session; and, multiple nodes traversed from the first round of the session in the target session to the current round of the session can be recorded; wherein, each node is a question-and-answer session corresponding to each round in the target session; and the round information and multiple nodes are identified as key information.
[0073] The nodes mentioned above are described as follows. If the current round of the conversation is initiated by either the user or the chatbot, but no response has been received, the current round of the conversation is considered a single statement that has not completed a full conversation round. Conversely, if the current round of the conversation is a complete question-and-answer session between the user and the chatbot, the current round of the conversation can be recorded as a node. It can be understood that, referring to the current round of the conversation, a target conversation that has gone through multiple rounds can include multiple nodes, each node corresponding to the two conversational statements (one question and one answer) in each round of the conversation. The above round information and multiple nodes are identified as key information.
[0074] In another specific approach, the edges connecting the two nodes in the question-and-answer session across two rounds are obtained; multiple edges are then identified as key information. In a multi-round conversation scenario, there is continuity between different rounds of conversation, which can be reflected in the order of the rounds between conversations and / or the expressive intent between conversations.
[0075] Based on the above embodiments, refer to Figure 2 The target session shown and Figure 3 The conversation graph shown represents round information, with rounds numbered 1, 2, ... 5. Each round corresponds to a question-and-answer session as a node, resulting in five nodes (nodes 1 to 5) in the conversation graph. Figure 2 The curves between sessions represent the continuation relationships between two rounds of sessions: the second round of sessions continues the first round, the third round continues the second round, the fourth round continues the first round, and the fifth round continues the fourth round. Based on these continuation relationships, edges are established between every two nodes with a continuation relationship, forming a pattern like... Figure 3 The diagram shows a session graph including nodes and edges. Nodes 1, 2, and 3 are connected sequentially by edges, as are nodes 1, 4, and 5. The edges between nodes are also identified as key information. The nodes and edges in the session graph allow recording which nodes and edges the target session has traversed from the beginning to the present, facilitating session backtracking.
[0076] In another specific approach, key information representing the user's intent, such as the subject, quantity, time, location, and actions, can be extracted from the current round of the conversation by word segmentation combined with sentence structure.
[0077] S106. Update the preset global variables and / or session variables generated in the target session based on the key information. The global variables are used to represent variables across multiple sessions.
[0078] In this embodiment, session variables are generated after the target session begins and cleared after the target session ends. Session variables are only used in the target session.
[0079] Global variables can be used across multiple sessions. These sessions can be any session applicable to any scenario, or a subset of sessions applicable to a specific scenario. To enhance the adaptability of session management to different application scenarios, such as storage management and the use of smart home appliances, and to improve the targeting and professionalism of session management, this implementation allows setting up global sessions that conform to specific application scenarios. For example, for the application scenario of managing food in a refrigerator, global variables matching this scenario can generally include variables representing information about the stored items in the refrigerator, such as the name, quantity, status (e.g., cut, opened), remaining shelf life, nutritional components, type, and suitable population. These global variables include both pre-set variables and variables updated based on key information.
[0080] It is understandable that key information such as round information, nodes, and edges in the current round of the session is related to session variables but not to global variables; key information representing user intent in the current round of the session may be related to both session variables and global variables. Based on this, session variables and / or global variables in the target session are updated according to the key information.
[0081] For example, the current session is "A: The pineapple is in the fridge. B: Okay." The key information indicating the user's intent includes: pineapple and fridge. Based on these keywords, the session variables are updated as follows: "Ingredients" = pineapple, "Destination" = fridge. In this case, the keywords do not involve quantity in the global variables, so there is no need to update the global variables. Suppose the current session is "A: One pineapple is in the fridge. B: Okay.", which includes key information about quantity. Based on this, in addition to the above session variables, both the session variables and the global variables related to quantity need to be updated simultaneously: "Quantity" = one.
[0082] The session management method provided in this embodiment includes: obtaining the user's current session round in a target session; extracting key information based on the current session round; and updating preset global variables and / or session variables generated in the target session according to the key information; wherein, global variables are used to represent variables in multiple sessions. This technical solution updates session variables and global variables based on key information extracted from the current session round, which can fully utilize the key information to enhance the matching between session variables and global variables and the current session round. By updating session variables and global variables, they acquire the ability to understand and remember the context of the target session, thereby facilitating the provision of better session services to users.
[0083] To facilitate understanding, some examples of updating session variables in a target session based on key information are provided here.
[0084] In this embodiment, the session variable representing the session round is updated based on the round information; the session variable representing the list of visited nodes is updated based on multiple nodes and multiple edges.
[0085] The session variable 'n', representing the session round, indicates which round the current session is in, combined with... Figure 2 and Figure 3 The current session round is the fifth round, so the session variable is updated to n=5. For each node, node 5 is updated based on the question-and-answer session in the fifth round, generating a node 5 with a semantically complete question-and-answer session: "A: Which has a higher sugar content, pineapple or watermelon? B: Watermelon." Based on the rounds and expressive intent between sessions, it can be determined that the fifth round session continues from the fourth round session, so an edge connecting node 5 and node 4 is updated. Based on the above nodes and edges, the session variable "list of nodes past" representing the list of nodes visited is updated from the original: "list of nodes past" = node 1→ node 2→ node 3, node 1→ node 4, to the current: "list of nodes past" = node 1→ node 2→ node 3, node 1→ node 4→ node 5.
[0086] The session variables described above, representing the list of nodes visited, can be used for session backtracking. In some embodiments, session backtracking can be used to find the nodes and edges visited in the current session, to complete incomplete statements into complete statements, and to perform question-and-answer sessions, etc.
[0087] In one embodiment, obtaining the user's current round of conversation in the target session may include: receiving the user's latest original conversation in the target session; if it is determined that the original conversation is an incomplete statement, searching for matching conversation variables in the previous multiple rounds of historical conversations of the original conversation; and supplementing the original conversation into a semantically complete current round of conversation based on the found conversation variables.
[0088] In implementation, the first step is to identify whether the original session is a semantically complete statement. For example, a completeness recognition model can be trained based on semantically complete and semantically incomplete samples; this model is then used to determine whether the original session is a semantically complete statement. If not, the original session is determined to be an incomplete statement.
[0089] Then, the matching session variables in the previous multiple rounds of historical sessions are found in the following way: based on the edges between nodes, at least one target historical session that the original session continued in the multiple rounds of historical sessions is traced back layer by layer; and the session variables that match the original session are found in the target historical sessions.
[0090] More specifically, based on the edges between nodes, the backtracking path of the original session is determined through layer-by-layer backtracking in multiple rounds of historical sessions. The backtracking path is a path composed of edges connecting nodes. At least one session along the backtracking path is identified as the target historical session. Session variables in each target historical session are searched from front to back along the backtracking path. Session variables that are continuative and complementary to the intent expressed in the original session are selected as the final multiple session variables that match the original session.
[0091] Following the above Figure 2 and Figure 3 In the example, by backtracking layer by layer, the target historical conversations that continue from the original conversation "Who has a higher sugar content?" include the historical conversations of the fourth round and the first round. Following the backtracking path, the conversation variables found in the first round of historical conversations include "diabetes" and "pineapple"; the conversation variable found in the fourth round of historical conversations includes "watermelon". Based on this, the conversation variables found in the historical conversations preceding the original conversation include: "diabetes", "pineapple", and "watermelon". Among these multiple conversation variables, "pineapple" and "watermelon" are both conversation variables that match the original conversation, while the conversation variable "refrigerator" does not have continuity or complementarity with the refrigeration intention expressed in the original conversation; the two do not match, therefore the conversation variable "refrigerator" can be ignored.
[0092] This embodiment can supplement the found session variables into the original session with incomplete semantic expression to obtain the current session with complete semantics. That is, the omitted "the two" in the original session is supplemented with "watermelon and pineapple", and the current round session with complete semantics after the supplement is "Which has higher sugar content, watermelon or pineapple?"
[0093] Based on the above embodiments, another example of supplementing an incomplete statement into a complete statement is provided here, such as... Figure 4 As shown.
[0094] Retrieve the user's original conversation from the latest round (i.e., the fourth round) in a multi-round conversation: "All put in the freezer." By tracing back layer by layer, the target historical conversations that this original conversation continues include the historical conversations from the third, second, and first rounds. Following the backtracking path, the conversation variables found in the first round of historical conversations include "pineapple" and "refrigerator." The conversation variable found in the second round of historical conversations includes "milk"; simultaneously, the second round of historical conversations inherits from the first round of historical conversations, therefore, the conversation variables at this time include "pineapple," "milk," and "refrigerator." And so on, the conversation variables found in the historical conversations from multiple rounds prior to the original conversation include "pineapple," "milk," "cabbage," and "refrigerator." All of these conversation variables are conversation variables that match the original conversation.
[0095] Furthermore, assuming the third round of historical conversation is "There's still cabbage, and cabbage is suitable for making soup," the resulting conversation variables would include "cabbage" and "make soup." Since the conversation variable "make soup" does not have continuity or complementarity with the refrigeration intention expressed in the original conversation, and the two do not match, the conversation variable "make soup" can be ignored.
[0096] Based on the conversation variables that match the original conversation in the multi-round historical conversations, the original conversation with incomplete semantic expression is supplemented into the current round conversation with complete semantic expression. That is, "all put in the refrigerator" is supplemented into the semantically complete "pineapple, milk and cabbage are all put in the refrigerator".
[0097] It is understandable that, using the above method, each semantically incomplete session can be supplemented into a complete session, for example... Figure 4 Examples of the second and third rounds are not described here.
[0098] In one embodiment, when the current round of the session is an inquiry statement, the method may further include: tracing back at least one round of sessions that the current round of the session continues through, based on a session variable representing a list of passed nodes; and generating a response statement for the current round of the session based on a global variable and / or multiple session variables corresponding to at least one round of the session.
[0099] Reference Figure 3In the example, based on the session variable representing the list of nodes past: "list of nodes past" = node1→node2→node3, node1→node4→node5, the process traces back layer by layer to the fifth round of sessions, including the fourth round of sessions corresponding to node4 and the first round of sessions corresponding to node1. When replying to the fifth round of sessions, the process first completes the semantically complete current round of sessions, "Which has a higher sugar content, watermelon or pineapple?", based on the session variables from the fourth and first round of sessions that the fifth round of sessions continues from. Then, the reply is generated.
[0100] In such Figure 5 In another specific example, the current round of the session is the following query, "What about watermelon?", from the third round. Based on the session variables representing the list of nodes visited: node 1, edge 1, node 2, edge 2, node 3, the second and first rounds of the session that the current round continues are traced back layer by layer. The multiple session variables corresponding to the second and first rounds include at least: diabetes, pineapple, and sugar content. Based on these session variables, the query "What about watermelon?" can be supplemented into complete statements with different intentions, such as: "Can diabetics eat watermelon?" or "How high is the sugar content of watermelon?". That is, the same query may represent different intentions. In this case, a response statement guiding the query intention can be generated: "Do you want to ask if diabetics can eat watermelon, or do you want to ask how high the sugar content of watermelon is?", or a multi-intention response statement can be generated, that is, responding to each query intention of the query statement, such as: "The sugar content of watermelon is 200 grams per kilogram; diabetics should eat less watermelon."
[0101] Based on the above examples, we can also combine global variables to generate response statements for the current round of the conversation. Assuming there is a pre-defined global variable representing the benefits of watermelon, we can generate response statements describing the benefits of watermelon based on this global variable.
[0102] In this embodiment, the key information may further include: the target object and the quantity information corresponding to the target object; updating the session variables and / or preset global variables in the target session based on the key information, including:
[0103] Based on the target object and the quantity information corresponding to the target object, the session variables representing the target object are updated, as are the global variables representing the object; whereby the global variables represent global variables representing all object information.
[0104] In daily life and industrial production, the management of target objects such as people and objects is quite common. Based on this, this embodiment combines session management with target object management, using key information in the target session to update session variables and / or global variables to achieve target object management. For example, in the case where the target session is associated with refrigerator food management, the target object includes stored items.
[0105] With the development of computer technology, human-computer interaction services are beginning to be provided to users in storage equipment such as refrigerators and wine cabinets. This embodiment can manage the stored items in the storage equipment through human-computer interaction. Specifically, after obtaining the user's current session, key information in the current session is extracted, and session variables and / or global variables representing information such as the name, type, quantity, expiration date, and storage status of the stored items are updated based on the key information, thereby realizing the management of the stored items.
[0106] Based on the above embodiments, this paper provides a method for extracting key information based on the current round of the conversation, including: extracting word segments that match preset slots from the current round of the conversation to obtain key information. In this embodiment, multiple slots are preset for extracting different key information. These slots may include, but are not limited to: name of stored item, management intent (e.g., storage, retrieval), quantity, shelf life, storage location (e.g., the crisper compartment or freezer compartment of a refrigerator), status, and usage method.
[0107] In implementation, the current session can be segmented to obtain multiple segments. The target slots matching the segments are identified based on their semantic information, and then the segments are assigned to those slots. Taking the current session "half a watermelon was placed to keep it fresh" as an example, the extracted segments could include: "place," "half," "watermelon," and "keep fresh." By identifying the semantics of the segments, the segment "place" is determined to represent the intention to store, thus matching the segment "place" with the management intention slot. "Place" is then assigned to the management intention slot, resulting in the current management intention indicating storage. Similarly, other segments are processed one by one, yielding the following key information: the current management intention to store, the name of the stored item is watermelon, the current quantity is half, the status is cut open, and the storage location is the refrigerator's crisper drawer.
[0108] After extracting key information from the current round of the session, update the session variables and / or object global variables about the storage based on the key information.
[0109] In this embodiment, the global object variable includes information about all stored items currently in the refrigerator, such as the name, quantity, shelf life, status, and notes of the stored items. Quantity is generally of greater interest to the user; therefore, this embodiment can prioritize updating the preset global object information based on the quantity information of the target object.
[0110] For example, when storing a target object in a refrigerator, the total number of target objects can be increased in the global object information based on the quantity information; when removing a target object from the refrigerator, the total number of target objects can be decreased in the global object information based on the quantity information.
[0111] Understandably, if other key information such as state, shelf life, and usage method are extracted from the current session, the global information of the object can also be updated based on the aforementioned key information.
[0112] This embodiment can display the updated global object information on the refrigerator's display screen. Alternatively, the updated global object information can be sent to the user's mobile phone or other terminal device for display. By displaying global object information, this embodiment allows users to conveniently view and understand the specific status of the items stored in the refrigerator at any time.
[0113] Based on the above embodiments, the key information may further include: an indication of the current management intent for storage or retrieval. Accordingly, this embodiment provides a method for updating global variables of an object based on the target object and its corresponding quantity information, as shown below.
[0114] Check if the target object is contained in the object's global variables; specifically, check if the target object's name is contained in the object's global variables.
[0115] If it is included, it means the target object is already included. In this case, the historical quantity information corresponding to the target object in the object's global variable can be updated based on the current management intent and quantity information.
[0116] If the current management intent is storage, increase the historical quantity of the target object in the global variable of the object based on the quantity information.
[0117] If the current management intent is to retrieve, the historical quantity of the target object in the object's global variable is reduced based on the quantity information. It's understood that all target objects may actually be retrieved, in which case the retrieved quantity will equal the historical quantity in the object's global variable. Therefore, the quantity of the target object in the object's global variable can be updated to 0, or the target object and its related information can be deleted from the object's global variable.
[0118] If the object's global variable does not contain the name of the target object, then the object's global variable will be updated based on the current management intent.
[0119] In some embodiments, when the current management intent is to retrieve a target object, supplementary reminder information for the target object is generated and added to the object's global variable. In some scenarios, when a user wants to retrieve a target object, they may first ask if the target object is in the refrigerator; therefore, if it is determined through the session that the object's global variable does not contain the target object, supplementary reminder information for the target object can be generated and added to the object's global variable, thereby reminding the user which items need to be replenished.
[0120] In other embodiments, when the current management intent is to store target objects, the target object and quantity information are added to the object global variable. If the object global variable does not contain the target object, but the user wants to store the target object, then the target object and its quantity information can be added to the object global variable.
[0121] The above embodiment, which combines session management and target object management, first obtains the user's current session; then, it extracts key information such as the target object, quantity information, and current management intent from the current session; finally, it updates the preset global object variables based on the target object and key information. The global object variables represent information about all stored items in the refrigerator, allowing users to access complete information about its contents without opening the refrigerator. This solution, after obtaining the current session, uses the extracted key information such as the target object and its quantity to update the global object variables. This effectively meets the user's need for real-time updates of storage information even when the contents of the refrigerator change. Moreover, for users, managing storage items only requires initiating a session, making this method very user-friendly and generally applicable to most users.
[0122] Figure 6 This is a schematic diagram of the structure of a session management device provided in an embodiment of the present disclosure.
[0123] In some embodiments of this disclosure, Figure 6 The device shown can be applied to session management devices such as refrigerators. The session management device can be, for example, a controller, but is not limited to this.
[0124] like Figure 6 As shown, the session management device 200 may include:
[0125] Session acquisition module 210 is used to acquire the current round of the user's session in the target session;
[0126] The key information extraction module 220 is used to extract key information based on the current round of the session;
[0127] The variable update module 230 is used to update preset global variables and / or session variables generated in the target session according to the key information; wherein, the global variables are used to represent variables in multiple sessions.
[0128] In one embodiment, the key information extraction module 220 is further configured to:
[0129] Determine the round information of the current round session within the target session;
[0130] Record multiple nodes traversed from the first round of the target session to the current round of the session; wherein, the node is the question-and-answer session corresponding to each round in the target session;
[0131] The round information and the multiple nodes are identified as key information.
[0132] In one embodiment, the key information extraction module 220 is further configured to:
[0133] Get the edge that connects the two nodes in the question-and-answer session between the two rounds;
[0134] The aforementioned multiple edges are identified as key information.
[0135] In one embodiment, the variable update module 230 is further configured to:
[0136] The session variables representing the session rounds are updated based on the round information;
[0137] The session variable representing the list of visited nodes is updated based on the multiple nodes and the multiple edges.
[0138] In one embodiment, when the current round of the session is an inquiry statement, the apparatus further includes a response module, which is used to:
[0139] Based on the session variable representing the list of nodes passed through, trace back layer by layer at least one round of sessions that the current round of sessions has continued;
[0140] Based on the global variables and / or multiple session variables corresponding to the at least one round of the session, generate the response statement for the current round of the session.
[0141] In one embodiment, the session acquisition module 210 is further configured to:
[0142] Receive the latest original session from the user in the target session;
[0143] If the original session is determined to be an incomplete statement, search for matching session variables in previous rounds of historical sessions preceding the original session;
[0144] The original session is supplemented into a semantically complete current round session based on the found session variables.
[0145] In one embodiment, the key information includes: the target object and the quantity information corresponding to the target object; the variable update module 230 is further used for:
[0146] Based on the target object and the quantity information corresponding to the target object, the session variable representing the target object is updated, and the object global variable is updated; wherein, the object global variable is a global variable representing all object information.
[0147] In one embodiment, the key information further includes: an indication of the current management intent for storage or retrieval; the variable update module 230 is also used for:
[0148] Check whether the target object is contained in the global variables of the object;
[0149] If included, then based on the current management intent and the quantity information, the historical quantity information corresponding to the target object in the object global variable is updated;
[0150] If not included, the global variables of the object are updated based on the current management intent.
[0151] In one embodiment, the variable update module 230 is further configured to:
[0152] If the current management intent is to access the target object, generate supplementary reminder information for the target object and add the supplementary reminder information for the target object to the object's global variable;
[0153] If the current management intent is to store the target object, add the target object and the quantity information to the object's global variable.
[0154] In one embodiment, where the target session is associated with refrigerator food management, the target object includes stored items.
[0155] In one embodiment, the key information extraction module 220 is further configured to:
[0156] Extract the word segments that match the preset slots from the current round of the session to obtain key information; wherein, the slots include at least: the name of the stored item, the management intent, and the quantity.
[0157] It should be noted that, Figure 6 The session management device 200 shown can execute each step in any of the above method embodiments and achieve each process and effect in any of the above method embodiments, which will not be elaborated here.
[0158] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 7 As shown, the electronic device may include a processor 301 and a memory 302 storing computer program instructions.
[0159] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0160] Memory 302 may include a large-capacity storage for information or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway device. In a particular embodiment, memory 302 is a non-volatile solid-state memory. In a particular embodiment, memory 302 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (Electrically Programmable ROM, EPROM), an electrically erasable programmable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0161] The processor 301 can perform the steps in any of the above method embodiments by reading and executing the computer program instructions stored in the memory 302.
[0162] In one example, the electronic device may also include a transceiver 303 and a bus 304. Wherein, as... Figure 7As shown, the processor 301, memory 302 and transceiver 303 are connected via bus 304 and communicate with each other.
[0163] Bus 304 may include hardware, software, or both. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 304 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.
[0164] This disclosure also provides a computer-readable storage medium that can store a computer program, which, when executed by a processor, enables the processor to implement the session management method provided in this disclosure.
[0165] The aforementioned storage medium may, for example, include a memory 302 containing computer program instructions, which can be executed by the processor 301 of the detection device to complete the session management method provided in this embodiment. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), compact disc-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device.
[0166] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A session management method, characterized in that, include: Retrieve the user's current session round in the target session; Extract key information based on the current round of the session; The preset global variables and / or session variables generated in the target session are updated based on the key information; wherein, the global variables are used to represent variables in multiple sessions; Based on the current round of the session, key information is extracted, including: Determine the round information of the current round session within the target session; Record multiple nodes traversed from the first round of the target session to the current round of the session; wherein, the node is the question-and-answer session corresponding to each round in the target session; The round information and the multiple nodes are identified as key information.
2. The method according to claim 1, characterized in that, The method further includes: Get the edge that connects the two nodes in the question-and-answer session between the two rounds; Multiple edges are identified as key information.
3. The method according to claim 2, characterized in that, Update the session variables in the target session based on the key information, including: The session variables representing the session rounds are updated based on the round information; The session variable representing the list of visited nodes is updated based on the multiple nodes and the multiple edges.
4. The method according to claim 3, characterized in that, When the current round of the session is a query statement, the method further includes: Based on the session variable representing the list of nodes passed through, trace back layer by layer at least one round of sessions that the current round of sessions has continued; Based on the global variables and / or multiple session variables corresponding to the at least one round of the session, generate the response statement for the current round of the session.
5. The method according to claim 1, characterized in that, The step of obtaining the user's current session round in the target session includes: Receive the latest original session from the user in the target session; If the original session is determined to be an incomplete statement, search for matching session variables in previous rounds of historical sessions preceding the original session; The original session is supplemented into a semantically complete current round session based on the found session variables.
6. The method according to claim 1, characterized in that, The key information includes: the target object and the quantity information corresponding to the target object; updating the session variables and / or preset global variables in the target session based on the key information includes: Based on the target object and the quantity information corresponding to the target object, the session variable representing the target object is updated, and the object global variable is updated; wherein, the object global variable is a global variable representing all object information.
7. The method according to claim 6, characterized in that, The key information also includes: indicating the current management intent for storage or retrieval; the step of updating the global variable of the object based on the target object and the quantity information corresponding to the target object includes: Check whether the target object is contained in the global variables of the object; If included, then based on the current management intent and the quantity information, the historical quantity information corresponding to the target object in the object global variable is updated; If not included, the global variables of the object are updated based on the current management intent.
8. The method according to claim 7, characterized in that, The step of updating the global variables of the object based on the current management intent includes: If the current management intent is to access the target object, generate supplementary reminder information for the target object and add the supplementary reminder information for the target object to the object's global variable; If the current management intent is to store the target object, add the target object and the quantity information to the object's global variable.
9. The method according to claim 6, characterized in that, In the case where the target session is associated with refrigerator food management, the target object includes stored items.
10. The method according to claim 1 or 6, characterized in that, The extraction of key information based on the current round of the session includes: Extract the word segments that match the preset slots from the current round of the session to obtain key information; wherein, the slots include at least: the name of the stored item, the management intent, and the quantity.
11. A session management device, characterized in that, include: The session acquisition module is used to acquire the user's current session round in the target session; The key information extraction module is used to extract key information based on the current round of the session; The variable update module is used to update preset global variables and / or session variables generated in the target session based on the key information; wherein, the global variables are used to represent variables in multiple sessions; The key information extraction module is also used for: Determine the round information of the current round session within the target session; Record multiple nodes traversed from the first round of the target session to the current round of the session; wherein, the node is the question-and-answer session corresponding to each round in the target session; The round information and the multiple nodes are identified as key information.
12. An electronic device, characterized in that, include: processor; Memory, used to store executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the session management method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, causes the processor to implement the session management method according to any one of claims 1-10.
Citation Information
Patent Citations
Response method in man-machine conversation, conversation system and storage medium
CN111737411A
Dialogue system, method and device, electronic equipment and computer readable storage medium
CN113761138A
