Intelligent agent state control method and device, electronic equipment and storage medium

By using a state control method between the scene service agent and the host, multiple state switching and information interaction are achieved, which solves the problem of low efficiency in the collaborative processing of user service needs by multiple agents, and improves the user experience and the accuracy of collaborative processing.

CN122047291APending Publication Date: 2026-05-15RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2026-02-13
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, there are challenges in how multiple intelligent agents can coordinate to handle user service requests, resulting in low coordination efficiency and affecting user experience.

Method used

By using a state control method between the scenario service agent and the host, multiple state switching and information interaction are achieved to ensure timing consistency, including switching between idle, active, processing, and terminated states, thus ensuring collaborative processing between the agent and the host.

Benefits of technology

It improves the user experience in various service request scenarios, reduces the complexity of manual operations, and ensures the accuracy and consistency of information interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122047291A_ABST
    Figure CN122047291A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent agent state control method and device, electronic equipment and a storage medium, in the method, a scene service intelligent agent experiences a state switching process of an idle state, an active state, a processing state and an ending state in a process of obtaining and processing a scene service request message sent by a host end, so that the scene service request message is obtained and processed by the scene service intelligent agent; and the scene service agent is triggered to execute different actions in each state, and finally a scene service result message corresponding to the scene service request message is obtained. And after the scene service result message is sent to the host end, switching from an end state to an idle state. Moreover, the scene service agent has a process of performing information interaction with the host end, and the process also has a process of authorizing the scene service agent to control the state of the host end by the host end and controlling the state switching of the host end by the scene service agent. The scene service agent processes the scene service request message of the user through mutual cooperation with the host end, and the use experience of the user in the process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a method for controlling the state of an intelligent agent. This application also relates to a state control device, electronic device, and computer storage medium for an intelligent agent. Background Technology

[0002] With the rapid development of artificial intelligence technology, the application of intelligent agents is becoming increasingly widespread, providing convenient services to users. Current technologies may involve collaboration between multiple endpoints, including intelligent agents, to provide services to users. However, how these multiple endpoints can collaborate to fulfill users' service needs remains a technical problem that needs to be solved. Summary of the Invention

[0003] This application provides a state control method for intelligent agents to enable multiple intelligent agents to collaboratively process and fulfill user service requests. This application also provides a state control device, electronic device, and computer storage medium for intelligent agents.

[0004] The specific plan is as follows: In a first aspect, embodiments of this application provide a state control method for an intelligent agent, applied to a scene service intelligent agent providing scene services. The method includes: when the scene service intelligent agent is in an idle state, obtaining a scene service request message sent by a host terminal in a responsive state, wherein the host terminal is an intelligent agent providing information interaction services to a user, and the scene service request message represents the user's scene service needs; if the scene service intelligent agent does not have the authority to control the state of the host terminal before obtaining the scene service request message, the scene service request message further represents the host terminal authorizing the scene service intelligent agent to control the state of the host terminal; in response to obtaining the scene service request message, switching the state of the scene service intelligent agent from an idle state to an active state; when the scene service intelligent agent is in an active state, identifying the scene service intent corresponding to the scene service request message and obtaining scene service intent information; in response to obtaining the scene service intent information, switching the state of the scene service intelligent agent from an active state to a processing state; in the scene... When the scene service agent is in the processing state, it executes scene service processing logic according to the scene service intent information to obtain the scene service processing result corresponding to the scene service intent information; in response to obtaining the scene service processing result, it switches the state of the scene service agent from the processing state to the terminated state; when the scene service agent is in the terminated state, it sends a scene service result message obtained according to the scene service processing result to the host terminal, wherein, if it is necessary to obtain the user's reply information to the scene service result message, the scene service result message includes state control information for instructing the host terminal to switch the response state to the open microphone state after playing the scene service result message to the user, wherein, when the host terminal is in the open microphone state, it receives a first voice signal sent by the user to the host terminal, and the user's reply information to the scene service result message is obtained based on the first voice signal; in response to sending the scene service result message to the host terminal, it switches the state of the scene service agent from the terminated state to the idle state.

[0005] Secondly, embodiments of this application provide a state control device for an intelligent agent, comprising: a scene service request message acquisition unit, configured to acquire a scene service request message sent by a host terminal in a response state when the scene service intelligent agent is in an idle state, wherein the host terminal is an intelligent agent providing information interaction services to a user, and the scene service request message is used to represent the user's scene service needs; if the scene service intelligent agent does not have the authority to control the state of the host terminal before acquiring the scene service request message, the scene service request message is also used to represent that the host terminal authorizes the scene service intelligent agent to control the state of the host terminal; a first state switching unit, configured to switch the state of the scene service intelligent agent from an idle state to an active state in response to acquiring the scene service request message; a scene service intent information acquisition unit, configured to identify the scene service intent corresponding to the scene service request message and acquire scene service intent information when the scene service intelligent agent is in an active state; a second state switching unit, configured to switch the state of the scene service intelligent agent from an active state to a processing state in response to acquiring the scene service intent information; and a scene service processing result acquisition unit. The system comprises the following components: a first state unit, a third state switching unit, and a fourth state switching unit. The first state unit is configured to, when the scene service agent is in the processing state, execute scene service processing logic based on the scene service intent information to obtain a scene service processing result corresponding to the scene service intent information. The second state unit is configured to, in response to obtaining the scene service processing result, switch the state of the scene service agent from the processing state to the termination state. The third state switching unit is configured to, when the scene service agent is in the termination state, send a scene service result message obtained based on the scene service processing result to the host terminal. If it is necessary to obtain the user's response to the scene service result message, the scene service result message includes state control information instructing the host terminal to switch the response state to the mic-on state after playing the scene service result message to the user. The host terminal receives a first voice signal sent by the user to the host terminal when it is in the mic-on state, and the user's response to the scene service result message is obtained based on the first voice signal. The fourth state switching unit is configured to, in response to sending the scene service result message to the host terminal, switch the state of the scene service agent from the termination state to the idle state.

[0006] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to implement the method described in the first aspect.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium having stored thereon one or more computer instructions that are executed by a processor to implement the method described in the first aspect.

[0008] Compared with the prior art, this application has the following advantages: The intelligent agent state control method provided in this application embodiment allows the scene service intelligent agent to exist in multiple different states. Each state triggers the scene service intelligent agent to execute the corresponding action, which in turn triggers the scene service intelligent agent to switch states. Specifically, when the scene service intelligent agent is in the idle state, it is used to obtain a scene service request message sent by the host in the response state. Obtaining the scene service request message further triggers the scene service intelligent agent to switch from the idle state to the active state. This state triggers the scene service intelligent agent to identify the scene service intent corresponding to the scene service request message. Obtaining the scene service intent information further triggers the scene service intelligent agent to switch from the active state to the processing state. This state triggers the scene service intelligent agent to execute the scene service processing logic corresponding to the scene service intent information and obtain the scene service processing result. Obtaining the scene service processing result further triggers the scene service intelligent agent to switch from the processing state to the end state. This state triggers the scene service intelligent agent to send a scene service result message to the host. The scene service intelligent agent sending the scene service result message to the host further triggers the scene service intelligent agent to switch from the end state to the idle state, indicating that the current stage of the task has ended or the overall service process task has ended. Furthermore, the information interaction process between the scene service agent and the host terminal also triggers state changes on the host terminal. Specifically, when the scene service agent receives a scene service request message from the host terminal in a responding state, if the scene service agent did not have permission to control the state of the host terminal before receiving the scene service request message, then the scene service request message is also used to indicate that the host terminal authorizes the scene service agent to control the state of the host terminal. Afterwards, the scene service agent sends a scene service result message to the host terminal. If it needs to obtain user responses to the scene service result message, then the scene service result message includes instructions to the host terminal to switch from a responding state to an open state after playing the scene service result message to the user, and to record the user's responses to the scene service result message.

[0009] In this process, when the scene service agent is in an idle state, it receives a scene service request message sent by the host. While processing this request message, the agent undergoes state transitions between idle, active, processing, and terminated states. It then receives the scene service result message corresponding to the request message, sends it to the host, and switches back to the idle state. The scene service agent switches between different states, and each state triggers different actions. Furthermore, the agent interacts with the host across these states, including granting the agent permission to control its own state and controlling state transitions. In other words, the scene service agent processes user scene service request messages through cooperation with the host. By setting state transition mechanisms, triggering conditions for actions in each state, and establishing information interaction mechanisms between the agent and the host, the timing consistency of information interaction between them is ensured. This enables the intelligent agent and the host to cooperate in handling various scenario service requests from users, thus improving the user experience during the process. Attached Figure Description

[0010] Figure 1 This is an application scenario diagram of the state control method for an intelligent agent provided in the embodiments of this application.

[0011] Figure 2 A flowchart of the state control method for an intelligent agent provided in the first embodiment of this application.

[0012] Figure 3 This is a first timing diagram for processing user scenario service requests through a scenario service agent, as provided in the first embodiment of this application.

[0013] Figure 4 This is a second timing diagram for processing user scenario service requests through a scenario service agent, as provided in the first embodiment of this application.

[0014] Figure 5 A schematic diagram of the first state change of the host and scene service intelligent agent provided in the first embodiment of this application.

[0015] Figure 6 A schematic diagram of the second state change of the scene service agent provided in the first embodiment of this application.

[0016] Figure 7 This is a third timing diagram of the host and scene service agent processing scene service requirements provided in the first embodiment of this application.

[0017] Figure 8 This is a schematic diagram of a state control device for an intelligent agent provided in the second embodiment of this application.

[0018] Figure 9 This is a schematic diagram of an electronic device provided in the third embodiment of this application. Detailed Implementation

[0019] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0020] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0021] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship. "Contains A, B and / or C" means containing any one, two, or three of A, B, and C.

[0022] It should be understood that in the embodiments of this application, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.

[0023] With the rapid development of artificial intelligence technology, the application of intelligent agents is becoming increasingly widespread, providing convenient services to users. Current technologies may involve collaboration between multiple endpoints, including intelligent agents, to provide services to users. However, how these multiple endpoints can collaborate to fulfill users' service needs remains a technical problem that needs to be solved.

[0024] Therefore, embodiments of this application provide a state control method for an intelligent agent to achieve collaborative interaction among multiple endpoints to fulfill user service requirements. This method can be applied to scene service intelligent agents that provide scene services.

[0025] To more clearly describe the state control method for intelligent agents provided in this application embodiment, the application scenarios of the state control method for intelligent agents provided in this application embodiment are first introduced. This method can be applied to the scenario service intelligent agent and the host terminal cooperating to handle specific scenario service needs of users. The scenario service intelligent agent can be an intelligent agent that provides specific scenario service needs to users. For example, the scenario service intelligent agent can be an intelligent agent of an instant e-commerce platform, which completes the service by calling corresponding tools according to the service needs proposed by the user.

[0026] This application proposes a scenario-based service agent that works in cooperation with a host terminal to fulfill user service requests. The host terminal may include host software and / or host hardware, such as a voice assistant or smart speaker. The host software can be deployed on the host hardware and / or a corresponding server, and can be a host agent. During voice interaction between the user and the host terminal, the user raises specific scenario-based service requests, such as ordering takeout, booking a hotel, booking movie tickets, or online shopping. Taking ordering takeout as an example, the scenario-based service agent cannot directly interact with the user via voice, and the host terminal itself cannot fulfill the user's takeout request. Therefore, the scenario-based service agent obtains the user's scenario-based service request through the host terminal and converts the processing result into voice broadcast to the user. Specifically, the scenario-based service agent obtains the scenario-based service request message sent by the host terminal through the following method: the user raises the service request through voice interaction with the host terminal; the host terminal determines the agent type corresponding to the user's specific service request based on the scenario domain.

[0027] Taking a food delivery agent as an example, with a smart speaker as the host, a user might request a milk tea via voice. The smart speaker recognizes this as a food delivery request. Therefore, the food delivery agent receives the user's voice information from the smart speaker, generates the food delivery service request, and orders the milk tea for the user, working collaboratively with the smart speaker to complete the order. The scene-service agent receives the user's voice signal through the smart speaker and performs specific scene-service processing. This reduces the complexity of manual operation for users during the ordering process and significantly improves the ease of use for specific user groups, allowing smart devices to meet their specific service needs.

[0028] In this system, the intelligent agent triggers different actions in different states. The scene service agent switches states based on messages sent from the host. After switching from the current state to the next, the scene service agent also performs the corresponding action in that state. The scene service agent then feeds back the result of the action to the host, which in turn prompts the host to send a state switch. By setting state switching mechanisms between various states, triggering conditions for actions in each state, and establishing information interaction mechanisms between the scene service agent and the host, the timing consistency of information interaction between them is ensured. This avoids state errors during information interaction, thus preventing incorrect information from being fed back to the user. Therefore, in specific scene service requirements, the need for users to manually operate intelligent devices is reduced, improving the user experience when using intelligent devices to fulfill service needs.

[0029] It should be noted that the application scenarios given above are merely examples. Those skilled in the art can apply the state control method for intelligent agents applied to the server side provided in the embodiments of this application to other scenarios according to actual needs. This application will not provide detailed examples of each scenario.

[0030] To facilitate understanding of the agent state control method provided in the embodiments of this application, the following is combined with... Figure 1 This application describes a method for controlling the state of an intelligent agent. The user interacts with the host terminal 11 via voice. For example, the user sends the voice signal "I want to order takeout." The host terminal 11 parses the user's voice signal, determines the relevant service scenario, and converts the user's voice signal into a text service request, which is then sent to the service scenario agent 12. The service scenario agent 12 processes the user's service scenario request and obtains the service scenario result information. Then, the service scenario agent 12 sends the service scenario result information back to the host terminal 11 and simultaneously stores a snapshot of the service scenario result in the context storage carrier 13. The service scenario agent then sends the service scenario result information back to the host terminal, which then announces it to the user via voice.

[0031] The following combination Figures 2 to 7 This application describes a state control method for an intelligent agent provided in the first embodiment. Figure 2 The flowchart of the state control method for an intelligent agent provided in the first embodiment of this application includes the following steps S101 to S108. Figure 3 This is a first timing diagram for processing user scenario service requests through a scenario service agent, as provided in the first embodiment of this application. Figure 4This is a second timing diagram for processing user scenario service requests through a scenario service agent, as provided in the first embodiment of this application.

[0032] Step S101: When the scene service agent is in an idle state, a scene service request message sent by the host in a response state is obtained. The host is an agent that provides information interaction services to the user. The scene service request message is used to represent the user's scene service needs. If the scene service agent does not have the authority to control the state of the host before obtaining the scene service request message, the scene service request message is also used to represent that the host authorizes the scene service agent to control the state of the host.

[0033] This step is used to obtain the scene service request message sent by the host when the scene service agent is in an idle state.

[0034] Information interaction between the user and the host device can be achieved through voice communication between the user and the smart speaker.

[0035] The scenario service request message can be the first scenario service request message obtained by the host based on the user's voice signal during the current interaction between the user and the host. In other words, there are no other scenario service request messages before the host obtains this scenario service request message during the current interaction.

[0036] In this process, the scene service agent receives the first scene service request message sent by the host. By default, the host delegates state control to the scene service agent, which then controls the host's state changes during the current interaction. The scenario where this scene service request message is the first scene service request message is as follows: Figure 3 S1~S2. S1: The user sends a voice signal to the host terminal 11: I want to order a spicy hot pot from store A. S2: The scene service agent 12 receives the request message (Request) initiated by the host terminal 11. The request message is the content after converting the voice signal sent by the user in S1 into text, and helps the user order a spicy hot pot from store A.

[0037] Furthermore, this scenario service request message can also be a non-first-time scenario service request message obtained by the host during the current interaction between the user and the host. The host then sends this non-first-time scenario service request message to the scenario service agent. For example, if the host 11 announces to the user, "We have provided you with three shops that offer mala tang (spicy hot pot), which one would you like to choose?" and the user replies, "I choose the first mala tang shop," then based on the user's reply, the scenario service agent 12 receives a request message from the host 11, which is text information indicating that the user has chosen the first mala tang shop. This message is a non-first-time scenario service request message submitted by the host and the user during the current interaction.

[0038] For example Figure 4 S17 to S18. S17: The user sends a voice signal to the host 11: "I have no other needs, let's exit." S18: The scene service agent 12 receives an Exit Request message from the host 11, indicating that the user has no other needs and is exiting the scene service. This scene service request message is not the first scene service request message made by the host during the current interaction with the user, indicating that the user's current scene service process has been completed and the scene service agent has exited.

[0039] It should be noted that when users interact with the host, the host obtains the service request message for this scenario in the following manner, and the host undergoes the following state switching process during this process: When the host terminal is in a mute state, it receives a wake-up message from the user to wake it up. In response to receiving the wake-up message, the host terminal switches its state from mute to on. While in on, the host terminal receives a second voice signal from the user. Upon receiving the second voice signal, the host terminal switches its state from on to responsive. While in responsive, the host terminal identifies the agent category intent corresponding to the second voice signal, obtains agent category intent information, and if the agent category intent information indicates that the scene service agent is providing scene services to the user, then it obtains the scene service request message based on the user's scene service request information, which is obtained from the second voice signal.

[0040] Please combine Figure 5The host terminal's state is described in three states: microphone on (51), microphone off (52), and response state (53) within the microphone off (52). Specifically, the host terminal 11 being in microphone on (51) means that the host terminal 11 has turned on its microphone to record the user's voice signals. For example, the user's voice signals might include: "Hey A," "I want to order takeout," "Order me the first spicy hot pot place," "Confirm payment for this order," or "No other requests, please exit."

[0041] The host terminal 11 being in the mute state 52 means that the host terminal 11 has turned off its microphone and is no longer recording the user's voice signals. If the host terminal is not currently performing any service processing, it will not perform any work while in the mute state. If the host terminal is currently in the process of collaboratively processing scene service requests with the scene service agent, then the mute state 52 also contains a response state 53, indicating that the host terminal 11 can interact with the scene service agent 12. A detailed description of the response state will be provided in subsequent steps.

[0042] Among them, the microphone-on state of the host terminal 11 has higher priority than the microphone-off state and the response state. That is, if the host terminal is currently in the microphone-off state, if it receives a wake-up word from the user to wake up the host terminal, the host terminal will switch from the microphone-off state to the microphone-on state. For example, if the wake-up word issued by the user is "Xiao A", the host terminal will switch from the microphone-off state to the microphone-on state.

[0043] During the collaborative processing of user scene service requests by the host terminal 11 and the scene service intelligent agent 12, both the host terminal 11 and the scene service intelligent agent 12 have different states at different stages, and different states trigger the intelligent agents to execute different actions. Furthermore, the actions executed by the host terminal 11 and the scene service intelligent agent 12 in different states have a cooperative and mutually influential effect. Specifically, this can be combined with... Figure 6 and Figure 7 The description describes how the host 11 and the scene service agent 12 trigger different execution actions through state switching, thereby providing specific scene services to users through voice interaction between the host and the user, improving the convenience for users to obtain scene services.

[0044] When host terminal 11 is in a muted state, it receives the user's voice prompt word S1101 "Xiao A," which wakes host terminal 11 from the muted state to the open state, and replies to the user S1102 "I'm here." Then, it receives the user's second voice signal S1103 "Order Kung Pao Chicken for my parents," and host terminal 11 switches from the open state to the responsive state. In the responsive state, host terminal 11 triggers S1104: Scene Service Domain Analysis, which involves performing agent type intent analysis on the user's second voice signal to determine the scene service domain that can handle the user's second voice signal. If it is determined that scene service agent 12 is providing scene services to the user, a scene service request message is generated based on the second voice signal and sent to scene service agent 12, i.e., executing S1105: "Order Kung Pao Chicken for my parents," which is a scene service request message sent by host terminal 11 in the responsive state to scene service agent 12 in the idle state.

[0045] When the scene service agent 12 is in an idle state, it switches from an idle state to an active state after receiving a scene service request message sent by the host 11.

[0046] When the scene service agent 12 is active, it triggers the scene service agent 11 to perform an action corresponding to the intent type of the scene server request message. Furthermore, the scene service agent 12 sends a feedback message to the host 11, i.e., S1106: reply "Processing," indicating a polling of the streaming processing request. Upon receiving this reply, the host 11 broadcasts the information to the user via voice, i.e., S1107: reply: "Processing."

[0047] When the scene service agent 12 is in an active state, it sends a request S1201 to the large model 14, requesting the large model to analyze the intent and task invocation. Specifically, the large model 14 analyzes the intent type corresponding to the scene service request message, the task processing flow, and the tools required. After recognizing the intent through the large model, the scene service agent 12 switches from the active state to the processing state. In the processing state, the scene service agent 12 executes the scene service processing logic based on the scene service intent information corresponding to the scene service request message, and obtains the scene service result message.

[0048] After the scene service agent 12 sends feedback information S1106 to the host 11, the host 11 starts the polling process, i.e., S1108: Start polling. At this time, the state of the host 11 changes from the non-polling state of the response state to the polling state.

[0049] When the host terminal 11 is in a polling state in a response state, it triggers the host terminal 11 to send a polling message to the scene service agent 12 (S1109: polling) to obtain the result message of the scene service agent 12 executing the scene service processing logic. During this process, the scene service agent 12 can receive the polling message sent by the host terminal 11 at a preset interval (e.g., 300ms), or it can send the polling message based on the user's immediate inquiry.

[0050] During the execution of scene service processing logic in the processing state, if the scene service processing result data is obtained, a snapshot of the scene service processing result data will be stored in the context storage carrier 13. In the processing state, upon receiving a polling request from the host 11, the scene service agent 12 will first retrieve cached data from the context storage carrier 13, which is the context information previously generated by the scene service agent 12 in the overall scene service process corresponding to the user's scene service request. Here, S1202 is executed: Retrieve cached data. Afterwards, the scene service agent 12 provides the obtained context information and other data to the large model, and the large model analyzes the data to obtain the results. That is, S1203 is executed: Retrieve the output data of the large model.

[0051] If the context storage carrier 13 already stores the scene service result message corresponding to the current scene service processing request, then the response message sent by the scene service agent 12 to the host 11 is the scene service result message required by the user, i.e., S1110: Reply to the user with the corresponding content. If the context storage carrier 13 does not store the scene service result message corresponding to the current scene service processing request, i.e., the scene service result message has not yet been generated, and the interval between the current polling request sent by the host 11 to the scene service agent 12 and the previous polling request is longer than the preset polling interval length threshold (e.g., 300ms), then the response message sent by the scene service agent 12 to the host 11 is "Processing" and empty content, i.e., S1111: "Processing", S1112: Empty content.

[0052] The host terminal 11 receives the reply message from the scene service agent 12 and reads the reply content to the user via voice, i.e., executes S1113: reply content. The reply content is at least one of the reply content types S1110 and S1111 mentioned above.

[0053] After receiving the scene service result message in the processing state, the scene service agent 12 indicates that the task has obtained a result, and then switches from the processing state to the task completion state. In the task completion state, the scene service agent 12 is triggered to execute S1114: synchronize the task completion status and request to close polling. That is, it sends a message to the host 11 requesting that the current task has ended and polling be closed.

[0054] After receiving the message, host 11 switches its state from the polling state to the non-polling state.

[0055] The state of the scene service agent 12 changes from the task completed state to the idle state.

[0056] The above describes the process by which the scene service agent 12, after receiving a scene service request message from the host 11, undergoes state switching between idle, active, processing, and terminated states during the processing of this request message. It obtains the scene service result message corresponding to the request message, sends it to the host, and then switches from the terminated state to the idle state. The scene service agent switches between these different states, and each state triggers different actions. Furthermore, the scene service agent interacts with the host in various states, including granting the scene service agent permission to control its own state, and controlling the host's state switching between polling and non-polling states (mute, on, and responding). By setting the scene service agent's state switching process and using the results of different actions in different states to further influence the host's state switching process, the timing consistency of information interaction between the scene service agent and the host is ensured. This enables the intelligent agent and the host to cooperate in handling various scenario service requests from users, thus improving the user experience during the process.

[0057] Step S102: In response to receiving the scene service request message, switch the state of the scene service agent from idle state to active state.

[0058] This step describes the state transition process of the scene service agent after receiving a scene service request message, switching from an idle state to an active state. For example, Figure 3 S3 in the context refers to state evolution: idle state -> active state. The trigger condition for this state evolution is that the scene service agent receives a request message initiated by the host. For example, Figure 4 S19: State evolution: Idle state -> Active state. The trigger condition for its state evolution is that the scene service agent obtains the S18: Initiate request initiated by the host.

[0059] Step S103: When the scene service agent is in an active state, identify the scene service intent corresponding to the scene service request message and obtain scene service intent information.

[0060] This step indicates that the scene service agent performs an action to identify the scene service intent when it is in an active state. For example, Figure 3In step S3, after switching the scene service agent's state from idle to active, the scene service agent continues to execute S4: intent recognition. Or, for example, Figure 4 S21 in the context: Intent recognition.

[0061] The specific process of execution intent recognition is related to whether the scenario service request message is the first scenario service request message, as described in the following analysis: The first scenario is that the scenario service request message is the first scenario service request message in the overall scenario service process. In this overall scenario service process, the scenario service agent has not yet generated the intent recognition results and subsequent execution results corresponding to other scenario service request messages, so there is no other contextual information in this overall scenario service process. For example Figure 3 As shown, the user sends the voice signal "I want to order a spicy hot pot from store A". The host terminal 11 generates the first scene service request message based on the voice signal and sends it to the scene service agent 12.

[0062] In response to a user's scenario-based service request, the scenario-based service agent 12 needs to execute multiple sub-tasks to obtain the final service result. For example, the first sub-task is to search for stores; the second sub-task is to add the target service object replied by the user to the shopping cart; the third sub-task is to generate order information from the target service object information added by the user to the shopping cart; the fourth sub-task is to execute the payment process for the order information; and the fifth sub-task is to receive a message from the user indicating that there are no other needs and exit the service. The above first to fifth sub-tasks form the overall scenario-based service process required to respond to the user's scenario-based service request.

[0063] in, Figure 3 The sequence diagram is the sequence diagram of the interaction between the host terminal 11 and the scene service agent 12 during the execution of the first subtask in the overall process of this scene service, in response to the scene service request raised by the user. In this case, the scene service agent executes as follows: Figure 3 S4, namely, identifying the intent of the scene service based on the scene service request message.

[0064] The second scenario involves a scenario service request message that is not the first one. This means that before obtaining the first scenario service request message, the scenario service agent 12 has already processed the intent recognition and processing procedures corresponding to other scenario service request messages, obtained the processing results, and stored a snapshot of the processing results in the context storage carrier 13. The non-first scenario service request message can be the second, third, fourth, or fifth subtask in the example above. Before each of these subtasks, at least one scenario service agent has already completed a subtask; therefore, the scenario service agent has already generated a snapshot of the processing results corresponding to that subtask. In this case, when the scenario service agent is in an active state performing intent recognition, it combines the context information and the scenario service request message to perform intent recognition. The specific execution steps are as follows: Figure 4 S20 and S21. S20: Read the required content from the context, wherein the context storage carrier 13 stores snapshot information of the processing results of other scene service request messages corresponding to the scene service agent before the current scene request message. S21: Intent recognition.

[0065] This explanation uses the scenario service request message corresponding to the second subtask as an example, where the non-scenario service request message is used. The prerequisite is that in the first subtask, the scenario service agent 12, while in processing mode, has already executed the scenario service processing logic corresponding to the search service and stored the obtained search service processing result in the context storage carrier 13. Furthermore, the scenario service agent 12 returns a third feedback message to the host 11: "We found the following 3 shops A that offer Mala Tang (spicy hot pot). Which one would you like to order?" The host 11 converts the third feedback message into speech and broadcasts it to the user.

[0066] Based on this, if the user's further voice signal is "Please order the spicy hot pot from the second shop A," then the host terminal 11 converts the voice signal into text and sends it to the scene service agent 12. The scene service agent 12 receives the scene service request message of the second subtask, "Add the spicy hot pot from the second shop A to the user's shopping cart." After the scene service agent 12 transitions from an idle state to an active state, when performing the intent recognition step, it can combine the context information stored in the first subtask and the scene service request message in the second subtask to perform intent recognition. Specific execution steps and... Figure 4 S20 and S21 are similar.

[0067] The above are the two ways in which the scene service agent 12 performs intent recognition processing when it is in an active state.

[0068] In addition, when the scene service agent is in an active state, a first feedback message is sent to the host to indicate that the scene service agent has received the scene service request message.

[0069] The first feedback message indicates that the scene service agent has received the scene service request message sent by the host and that the scene service agent is active. For example... Figure 3 The S5 feedback message "Okay, received" in the example, for example Figure 4 The feedback message from S22 is "Okay, received".

[0070] To determine whether the first feedback message requires a user's response, the scene service agent incorporates different state control information within it. Specifically, it determines whether a user's response to the first feedback message is needed. If so, it includes state control information in the first feedback message instructing the host to switch from a response state to an on-mic state after playing the first feedback message to the user. Otherwise, it either does not include this information, or it maintains a response state after playing the first feedback message to the user.

[0071] The first scenario: The first feedback message is one that requires a response from the user.

[0072] If the first feedback message requires a user reply, the scene service agent 12 sets a first type of state control information in the first feedback message to control the state switching of the host terminal 11. This information instructs the host terminal 11 to switch its state from a responding state to an on-microphone state after broadcasting the first feedback message to the user, so as to collect the user's reply to the first feedback message. For example, "Speech" is an identifier indicating a request for the host terminal 11 to turn on its microphone. If the first feedback message requires a user reply, for example, if the first feedback message is "We found the following 3 shops A that serve Mala Tang, which one would you like to order?", then it needs to obtain the user's reply to this feedback message. Therefore, the "Speech" state control information is set in this first feedback message.

[0073] The second scenario: The first feedback message is one that does not require a response from the user.

[0074] If the first feedback message does not require a user's response, then the first type of state control information does not need to be set in the first feedback message. Alternatively, a second type of state control information can be set in the first feedback message to instruct the host terminal 11 to maintain a responsive state after broadcasting the first feedback message to the user. For example, the first feedback message returned by the scene service agent 12 to the host terminal 11 is as follows: Figure 3S5 in the code: Okay, received. Then, host 11 executes S6: Voice broadcast (quick feedback), which converts the feedback message into voice information and broadcasts it to the user. For example, Figure 4 The feedback message in step S22.

[0075] In the second scenario, the first feedback message indicates that the scene service agent is in an active state, instructing the host to allow the issuance of polling messages. After sending the first feedback message to the host, a polling message sent by the host is obtained, which queries the scene service agent for processing progress information of the scene service request message. It is determined whether there is any processing progress information that has not been sent to the host. If so, a polling response message including the processing progress information that has not been sent to the host is sent to the host in response to the polling message. The scene service result message indicates that the scene service agent is in a terminated state, instructing the host to stop issuing polling messages.

[0076] It should be noted that when the scene service agent is in an active state, it can send a first feedback message to the host to instruct the host to poll for the processing results of the intent recognition and to announce the processing progress information of the scene service request message to the user via voice.

[0077] like Figure 5 In the process, when the host is in the non-polling state of response state 53, it sends a scene service request message to the scene service agent in the idle state, such as... Figure 3 S2. When the host is in the polling state of response state 53, it sends polling messages to the scene service agent at intervals to inquire about the processing progress of the scene service request message. During this process, the scene service agent can be in the active state or the processing state until the scene service agent is in the terminated state, at which point the host switches from the polling state of response state to the non-polling state.

[0078] Step S104: In response to obtaining the scene service intent information, switch the state of the scene service agent from active state to processing state.

[0079] This step is used to switch the state of the scene service agent from active to processing after obtaining the scene service intent information in step S102. For example... Figure 3 S7 in the context: State Evolution: Active State -> Processing State. When the scene service agent is in the processing state, it is triggered to execute the scene service processing logic based on the obtained scene service intent information. The scene service processing logic is related to the specific sub-tasks in the overall scene service process corresponding to the scene service request message.

[0080] Step S105: When the scene service agent is in the processing state, the scene service processing logic is executed according to the scene service intent information to obtain the scene service processing result corresponding to the scene service intent information.

[0081] This step is used to execute the scene service processing logic and obtain the scene service result when the scene service agent is in the processing state.

[0082] When the scene service agent is in the processing state, it performs the following steps: executes the scene service processing logic and sends a feedback message to the host.

[0083] The execution of scenario service processing logic is related to specific sub-tasks within the overall scenario service processing flow. For example, if the first sub-task is "searching for stores," then the execution of scenario service processing logic would be the execution of search processing logic, such as... Figure 3 S8 in the context: Executes the search logic. For example, if it's the fifth subtask, and the user indicates no further needs and exits the service, then the scene service agent executes the scene service processing logic as follows: Figure 4 S24 in the code: Perform session cleanup & determine endpoint.

[0084] Specifically, sending a feedback message to the host terminal involves sending a second feedback message to the host terminal to indicate that scene service processing logic is being executed in response to the scene service request message.

[0085] Specifically, the presence or absence of state control information in the second feedback message to control the host's state switching is determined based on whether a user response to the second feedback message is required. If so, state control information is included in the second feedback message to instruct the host to switch from a responsive state to an on-mic state after playing the second feedback message to the user. Otherwise, no such state control information is included in the second feedback message, or the second feedback message may contain state control information instructing the host to maintain a responsive state after playing the second feedback message to the user.

[0086] The third scenario: The second feedback message is one that requires a response from the user.

[0087] If the second feedback message requires a user response, the scene service agent 12 also includes a first type of state control information in the second feedback message to control the state switching of the host terminal 11. This information instructs the host terminal 11 to switch its state from a responsive state to an on-screen state after broadcasting the second feedback message to the user, so as to collect the user's response to the second feedback message. The first type of state control information can be the Speech described above.

[0088] For example, when the scene service agent 12 is in the processing state, it executes the scene service processing logic based on the scene service intent information (search for stores) corresponding to the scene service request message sent by the host 11. If there is still unclear information during this process, the scene service agent can send a second feedback message to the host to inquire about further information from the user regarding the scene service request message. In order to record the user's reply message, the host needs to switch its state from the response state to the open state.

[0089] For example, a user sends a scenario service request message: "I want to order Mala Tang from store A." The host identifies this as a food delivery request and sends the generated scenario service request message (order Mala Tang from store A for the user) to the scenario service agent. After recognizing the scenario service intent, the scenario service agent, during the execution of the scenario service processing logic, also needs to further consult the user regarding the flavor, portion size, etc. In this case, while the scenario service agent 12 is in the processing state, the second feedback message sent is a request for the user's reply, such as "mildly spicy" or "small portion." In this case, the second feedback message contains the first type of state control information. Figure 5 When the service agent 12 is in the processing state, it sends a second feedback message (i.e., sends a further query message) to the host 11 and instructs the host to switch from the response state to the open state.

[0090] The fourth scenario: The second feedback message is one that does not require a response from the user.

[0091] If the second feedback message does not require a user response, the scene service agent 12 does not need to set the first type of state control information in the second feedback message. Alternatively, it can set the second type of state control information in the second feedback message to instruct the host terminal 11 to maintain a responsive state after broadcasting the second feedback message to the user. For example, if the first subtask is searching for stores, the scene service processing logic is executed when the scene service agent is in the processing state. The second feedback message sent by the scene service agent 12 to the host terminal 11, for example... Figure 3 S9 in the context: Searching for nearby store A for you. Then, host 11 executes S10: Voice announcement (status awareness).

[0092] The scene service agent 12 executes the scene service processing logic and, after obtaining the specific scene service result, performs the result assembly step, namely S11: result assembly. Specifically, it assembles the scene service result information obtained in the subtask, for example, assembling the search results to obtain the wording information used to reply to the user.

[0093] In the fourth scenario, after receiving the second feedback message, the host will remain in a responsive state. Therefore, the scene service agent is in a processing state and can still receive polling messages from the host until it receives the scene service result message and sends a feedback message to the host to instruct it to stop sending polling messages. At this point, the host switches from the polling state in the responsive state to a non-polling state. It can also switch from the polling state in the responsive state to a muted state or an enabled state.

[0094] It should be noted that when the scene service agent is in the processing state, it can send a second feedback message to the host to instruct the host to broadcast the processing progress information corresponding to the scene service request message to the user via voice.

[0095] In addition, the scene service agent executes scene service processing logic to obtain scene service processing results corresponding to the scene service intent information. Specifically, this may include: determining whether the overall scene service process for the scene service request message needs to end based on the scene service intent information; if it is determined that the overall scene service process does not need to end, obtaining scene service processing logic corresponding to the scene service intent information, executing the scene service processing logic, and obtaining scene service processing results corresponding to the scene service intent information; otherwise, obtaining scene service overall process end logic, executing the scene service overall process end logic, and obtaining the scene service overall process end logic execution result.

[0096] The execution scenario service processing logic here can be specifically divided into two categories: The first type of scenario service processing logic: If the overall scenario service process for a scenario service request message does not need to end, it means that the scenario service intent information is any subtask before the last subtask in the overall scenario service process, such as at least one of the first to fourth subtasks mentioned above. Therefore, executing the scenario service processing logic means executing the scenario service processing logic corresponding to the scenario service intent information in that subtask, and obtaining the scenario service processing result corresponding to the scenario service intent information.

[0097] For example, the first subtask is to search for stores, that is... Figure 3The subtask shown has the following context service intent information: searching for stores, executing context service processing logic (e.g., S8: executing search logic), and obtaining context service processing results (e.g., for the mala tang from 3 stores A searched by the user).

[0098] For example, the second subtask is to add the target service object replied by the user to the shopping cart. For instance, the user replied: "Add the spicy hot pot from store A (the second one) to the shopping cart." Therefore, the scenario service intent information is "add to shopping cart," the executed scenario service processing logic is to execute the processing logic of adding the spicy hot pot from store A (the second one) to the shopping cart, and the obtained scenario service processing result is that the spicy hot pot from store A (the second one) has been successfully added to the shopping cart.

[0099] The second type of scenario service processing logic: When the overall scenario service process for a scenario service request message needs to end, it indicates that the scenario service intent information represents the user's intention to end the process and exit the service. In this case, the scenario service processing logic is the overall scenario service process termination logic (e.g., ...). Figure 4 S24 in the process: Perform session cleanup & determine the endpoint), and obtain the execution result of the overall process end logic of the scenario service.

[0100] Step S106: In response to obtaining the scene service processing result, switch the state of the scene service agent from the processing state to the termination state.

[0101] This step involves the scene service agent, after obtaining the scene service processing result, switching its state from the processing state to the terminated state. The terminated state is divided into two types based on whether the overall scene service process corresponding to the scene service request message needs to be terminated. Specifically, if it is determined that the overall scene service process does not need to be terminated, the scene service agent's state is switched from the processing state to the task terminated state; otherwise, the scene service agent's state is switched from the processing state to the overall scene service process terminated state.

[0102] The first type of termination state: If the overall process of the scene service does not need to end, it means that the scene service processing result obtained here is the scene service processing result obtained at the end of the subtask process. Therefore, the termination state here is the task termination state corresponding to this subtask. For example... Figure 3 S12 shown: State evolution: Processing state -> Task completion state.

[0103] If it is the first type of termination state: the state of the scene service agent is switched from the processing state to the task termination state, and the snapshot information of the scene service processing result is stored in the session context storage carrier established for the scene service request message. The snapshot information of the scene service processing result is used to identify the scene service intent corresponding to the next scene service request message sent by the host in the response state in the overall scene service process when the scene service agent is in the next active state in the overall scene service process.

[0104] Snapshot information of the scene service processing results is stored in the session context storage medium, such as... Figure 3 S13: Execute the search results, that is, the scene service agent 12 stores the snapshot information of the search results in the session context storage carrier 13.

[0105] In the overall process of scene service, the scene service processing result of any subtask before the last subtask is stored in the session context storage carrier. It can be used to identify the scene service intent information corresponding to the subtask when processing the next subtask in the overall process of scene service.

[0106] For example, identifying scene service intent information in the second subtask can be achieved by combining snapshot information of the scene service processing results corresponding to the first subtask and scene service request messages of the second subtask.

[0107] The second type of termination state: This occurs when the overall scenario service process needs to end, indicating that the scenario service request message for the user has completed all task stages within the overall scenario service process. In this case, the termination state represents the end of the overall scenario service process. For example... Figure 4 S25 shown: State evolution: Processing state -> End of overall process state.

[0108] Step S107: When the scene service agent is in the terminated state, a scene service result message obtained according to the scene service processing result is sent to the host. If it is necessary to obtain the user's reply information to the scene service result message, the scene service result message includes state control information for instructing the host to switch the response state to the microphone-on state after playing the scene service result message to the user. When the host is in the microphone-on state, it receives a first voice signal sent by the user to the host. The user's reply information to the scene service result message is obtained based on the first voice signal.

[0109] This step is used to send a scene service result message to the host when the scene service agent is in the terminated state. The type of indication in the scene service result message differs depending on whether the terminated state is the task terminated state or the overall scene service process terminated state, as detailed below.

[0110] The first method: If the termination state is determined to be the task termination state, then the scene service result message is the scene service result message corresponding to this subtask, such as... Figure 3 The scene service agent sends a third feedback message, S14, to the host: "We found three Mala Tang restaurants for you. Which one would you like to order?" This is the scene service result message obtained from the first subtask in the overall scene service process. The first subtask is to search for restaurants and, after sending the scene service result message to the user, needs to obtain the user's response to the scene service result message. Therefore, the scene service result message sent by the scene service agent to the host includes a third type of state control information, which instructs the host to switch its state from the responding state to the open state after playing the scene service result message to the user.

[0111] After receiving the third feedback message from the scene service agent, the host converts the third feedback message into a voice message and broadcasts it to the user. For example... Figure 3 S16 in the middle: Voice broadcast (guides the next step).

[0112] After the host finishes playing the voice message, it switches from the responding state to the microphone-on state to record the first voice signal sent by the user to the host. The host then generates a response message based on this first voice signal for the scene service result message. This response message can serve as the scene service request message sent by the host to the scene service agent in the next adjacent subtask corresponding to this subtask. For example, if the task is... Figure 3 The first subtask shown, Figure 3 In the first subtask (searching for a store), S2 represents the scenario service request message sent by the host to the scenario service agent, which is to search for store A. The response message generated by the host based on the first voice signal can be used by the scenario service agent in the second subtask (adding the target service object replied by the user to the shopping cart) to obtain the scenario service request message sent by the host.

[0113] In addition, such as Figure 5 In the context of a scenario service agent 12, when the task is completed, a query is sent to the host 11. Specifically, the scenario service result message also includes a request to the user to end the task corresponding to the subtask. Therefore, the host 11 switches from the responding state to the open state. The recorded user response to the scenario service result message can also include the user's reply to the task end request message corresponding to the subtask, such as confirming the end of the task.

[0114] The above describes the process of the scene service result message when the scene service agent is in the task completion state.

[0115] The following describes the scene service result message when the scene service agent is in the final state of the overall scene service process: The second approach is to determine that the end state is the end state of the overall process of the scene service, that is, to determine that the overall process of the scene service needs to be ended. Then, state control information is set in the scene service result message to instruct the host to switch the response state to the mute state after playing the scene service result message to the user.

[0116] For the scenario service process ending state, the scenario service result message is the scenario service result message corresponding to the end of the scenario service process, such as... Figure 4 S26 in the example: Okay, enjoy your meal, goodbye. This is the scenario service result message obtained from the last subtask in the overall scenario service process, and there's no need to obtain the user's response information corresponding to the content of this scenario service result message. Therefore, the scenario service result message sent by the scenario service agent to the host contains a fourth type of state control information, used to instruct the host to switch its state from the responding state to the mute state after playing the scenario service result message to the user. This fourth type of state control information can be a state control flag; for example, "mute" (mute sound) indicates a request for the host to stop sending polling messages to the scenario service agent and switch to the mute state, meaning it doesn't need to send polling messages to the host or record the user's voice signal.

[0117] In the second scenario, where it is determined that the overall process of the scenario service needs to end, the scenario service result message indicates that the scenario service agent will return the state control authority of the host to the host.

[0118] The overall process of the scenario service needs to end. Therefore, the scenario service agent sends the scenario service result message to the host. By default, the scenario service agent transfers the state control authority of the host to the host, and the scenario service agent no longer needs to control the state change process of the host.

[0119] The above describes the process of the scene service result message when the scene service agent is in the end state of the overall scene service process.

[0120] In addition, such as Figure 5When the scene service agent 12 is in the end state of the overall scene service process, it sends a query to the host 11. Specifically, the scene service result message also includes a query to ask the user whether to end the overall scene service process. Therefore, the host 11 switches from the responding state to the open state. The recorded user response to the scene service result message can also include the user's reply information to the request to end the overall scene service process, such as confirming the end of the overall scene service process.

[0121] Step S108: In response to sending the scene service result message to the host, switch the state of the scene service agent from the terminated state to the idle state.

[0122] This step is used to switch the state of the scene service agent from the terminated state to the idle state after the scene service agent sends the scene service result message to the host. Figure 3 S15 in the context: State evolution: Task completed state -> Idle state, or, as... Figure 4 S27 in the context: The overall process of the scenario service ends and then enters an idle state. Afterwards, the host also executes... Figure 4 S28: Execute hardware mute; S29: The host plays a voice message to the user: End of conversation.

[0123] The above describes the state changes of the scene service agent and the host when the scene service agent collaborates with the host to process the user's scene service request message, as well as the actions performed by the scene service agent and the host in different states.

[0124] Furthermore, the host terminal in this embodiment also includes the following state switching process: The priority of the three host states is as follows: The host states include on-mic, mute, and responsive, with on-mic having higher priority than mute and responsive. If the host is currently in responsive or mute state and receives a wake-up message from the user, the host state switches to on-mic. Specifically, after the host terminal authorizes the scene service agent to control the state of the host terminal, and the host terminal is in a responsive state, if it receives a wake-up message from the user to wake up the host terminal, then in response to receiving the wake-up message, the host terminal switches its state from a mute state to an on-mic state to receive the third voice signal sent by the user to the host terminal; in response to receiving the third voice signal sent by the user to the host terminal, the host terminal switches its state from an on-mic state to a responsive state; when the host terminal is in a responsive state, it identifies the agent category intent corresponding to the third voice signal, obtains agent category intent information, and if the agent category intent information indicates that the scene service agent is providing scene services to the user, then it obtains a new scene service request message based on the user's new scene service demand information, which is obtained based on the third voice signal; the host terminal sends the new scene service request message to the scene service agent.

[0125] The user sends a wake-up message to wake up the host device. After the host device is in a microphone-on state, it records the second voice signal sent by the user (such as...). Figure 3 After S1: "I want to order Mala Tang from Shop A," the host switches from the open microphone state to the responsive state. While in the responsive state, after recognizing the agent category intent information corresponding to the user's second voice signal as the service agent for that scenario, the first scenario service request message (such as...) is sent... Figure 3 If the S2 (Request Message) is sent to the scene service agent, the host end is authorized by default to control the state of the scene service agent, and the host end is in a responsive state. This indicates that the host end interacts with the scene service agent in the responsive state and no longer receives user voice information.

[0126] Regardless of the specific progress of information interaction between the scene service agent and the host during the above process, if the user sends a wake-up message to wake up the host again, because the on-mic state has a higher priority than the off-mic state and the response state, the host's state will switch from the off-mic state to the higher on-mic state to receive the third voice signal newly sent by the user, namely, the execution and... Figure 3Similar to step S1 shown, the content of the third voice signal sent by the user differs from that in S1. For example, the third voice signal might be "I want to order milk tea from shop B." Afterward, the microphone state is switched to the response state, and the agent category intent corresponding to the third voice signal is identified. Furthermore, if the agent category intent information indicates that the service agent for this scenario is providing scenario services to the user, the host re-executes the process of generating a new scenario service request message based on the third voice signal, and then executes the corresponding steps. Figure 3 Similar to step S2 shown, the specific content of the scene service request message sent by the host to the scene service agent differs from that in S2. For example, the new scene service request message is "Please help the user search for milk tea from store B".

[0127] The above describes the process by which the host identifies the agent category corresponding to the user's third voice signal and processes the agent that serves the scenario.

[0128] The following describes the processing procedure when the host identifies the agent category corresponding to the user's third voice signal and intends to serve an agent in a different scenario than the agent in the current scenario.

[0129] If the host identifies the user's third voice signal as belonging to an agent category other than the current scene service agent, it sends a state control handover request message to the scene service agent requesting the agent to return the host's state control authority to the host. Based on the new scene service requirement information, it obtains a scene service request message intended for sending to the other scene service agent. If the host receives a state control handover response message from the scene service agent in response to the state control handover request message, it sends a scene service request message intended for sending to the other scene service agent. This scene service request message indicates that the host authorizes the scene service agent to control the host's state.

[0130] Let's take the scenario service agent as scenario A and other scenario service agents as scenario B as an example.

[0131] Among them, scenario service agent A is the intelligent agent used to provide users with food delivery scenario services, that is, the scenario intelligent agent described in steps S101 to S108. Scenario service intelligent agent B is the intelligent agent used to provide users with hotel booking scenario services.

[0132] When the host identifies the user's third voice signal as belonging to scenario service agent B, it means that the scenario service type required by the user's third voice signal has changed from the food delivery scenario corresponding to the second voice signal to the hotel scenario. Therefore, it is necessary to revoke the state control authority of scenario service agent A over the host and transfer the state control authority of the host to scenario service agent B. Specifically, the host sends a new scenario service request message generated based on the third voice signal to scenario service agent B. This new scenario service request message indicates that the host has authorized scenario service agent B to control the state of the host.

[0133] During this process, the scenario service agent before the change (continuing to use scenario service agent A as an example) performs the following processing: After receiving the state control permission handover request message, the scene service agent generates the state control permission handover response message and determines whether the current state of the scene service agent is the scene service overall process end state. If the current state of the scene service agent is not the scene service overall process end state, the current state of the scene service agent is switched to the scene service overall process end state. When the scene service agent is in the scene service overall process end state, it sends the state control permission handover response message to the host.

[0134] The new scene service request message corresponding to the third voice signal sent by the user does not belong to the processing of scene service agent A. Therefore, scene service agent A does not need to control the state switching process on the host side, and scene service agent A no longer needs to process the scene service request message corresponding to the second voice signal. Therefore, scene service agent A first determines whether its current state is the end state of the overall scene service process. If not, it switches the current state to the end state of the overall scene service process; if so, it sends the generated state control permission handover response message to the host side.

[0135] Furthermore, in the process of identifying the scene service intent corresponding to the scene service request message in step S103 of the scene service agent in this embodiment, there is still a situation where the scene service request message sent by the host cannot be identified. Specifically, as follows: when the scene service agent is in an active state, if the scene service intent corresponding to the scene service request message cannot be identified, or if it is determined from the scene service intent information that the scene service agent is not the agent that processes the scene service request message, then the state of the scene service agent is switched from the active state to the abnormal state; when the scene service intent information is in an abnormal state, a message indicating that the state control authority of the host is returned to the host is generated; the message indicating that the state control authority is returned is sent to the host; in response to sending the message indicating that the state control authority is returned to the host, the state of the scene service agent is switched from the abnormal state to the idle state.

[0136] The transition of a scene service agent from an active state to an abnormal state typically involves at least one of the following: the inability to identify the scene service intent corresponding to the scene service request message; or the identification of the scene service intent indicating that the scene service request message was not processed by the scene service agent. Therefore, when in an abnormal state, the scene service agent no longer controls the host's state changes, proactively relinquishes state control to the host, and switches its state from the abnormal state to the idle state.

[0137] Furthermore, the scene service agent in this embodiment may also experience abnormal situations in the following states: when the scene service agent is in any of the active, processing, or terminated states, if an exception code indicating an exception is obtained, the state of the scene service agent is switched from any of the active, processing, or terminated states to the abnormal state; when the scene service agent is in the abnormal state, exception handling is performed according to the exception code; in response to obtaining the result of exception handling completion, state control information is sent to the host to indicate that the state of the host is switched from the responsive state to the mute state; in response to sending state control information to the host to indicate that the state of the host is switched from the responsive state to the mute state, the state of the scene service agent is switched from the abnormal state to the idle state.

[0138] Please refer to Figure 6This diagram illustrates the state transition of the scene service agent to an abnormal state according to an embodiment of this application. When an abnormal situation occurs in any of the scene service agent's current states (active, processing, or terminated), the current state is switched to the abnormal state. In the abnormal state, exception handling is performed according to the exception code. After the exception state handling is complete, the host is instructed to switch its state from the responding state to the muted state, meaning that the current process no longer needs to poll the scene service agent to obtain the scene service processing progress. Simultaneously, the scene service agent's state is switched from the abnormal state to the idle state.

[0139] Second Embodiment Based on the first embodiment, Figure 8A state control device 800 for an intelligent agent provided in the second embodiment of this application includes: a scene service request message acquisition unit 801, configured to acquire a scene service request message sent by a host terminal in a response state when the scene service intelligent agent is in an idle state, wherein the host terminal is an intelligent agent providing information interaction services to a user, and the scene service request message is used to represent the user's scene service needs; if the scene service intelligent agent does not have the authority to control the state of the host terminal before acquiring the scene service request message, the scene service request message is also used to represent that the host terminal authorizes the scene service intelligent agent to control the state of the host terminal; a first state switching unit 802, configured to switch the state of the scene service intelligent agent from an idle state to an active state in response to acquiring the scene service request message; a scene service intent information acquisition unit 803, configured to identify the scene service intent corresponding to the scene service request message and acquire scene service intent information when the scene service intelligent agent is in an active state; a second state switching unit 804, configured to switch the state of the scene service intelligent agent from an active state to a processing state in response to acquiring the scene service intent information; and a scene service processing result acquisition unit 805. Unit 805 is used to execute scene service processing logic according to the scene service intent information when the scene service agent is in the processing state, and obtain the scene service processing result corresponding to the scene service intent information; third state switching unit 806 is used to switch the state of the scene service agent from the processing state to the end state in response to obtaining the scene service processing result; sending unit 807 is used to send a scene service result message obtained according to the scene service processing result to the host terminal when the scene service agent is in the end state, wherein, if it is necessary to obtain the user's reply information to the scene service result message, the scene service result message includes state control information for instructing the host terminal to switch the response state to the microphone-on state after playing the scene service result message to the user, wherein, when the host terminal is in the microphone-on state, it receives the first voice signal sent by the user to the host terminal, and the user's reply information to the scene service result message is obtained based on the first voice signal; fourth state switching unit 808 is used to switch the state of the scene service agent from the end state to the idle state in response to sending the scene service result message to the host terminal.

[0140] Third Embodiment Corresponding to the method of the first embodiment of this application, the third embodiment of this application also provides an electronic device. This electronic device includes: a processor; and a memory for storing a computer program. After the electronic device is powered on and the processor runs the computer program, it executes the method of the first embodiment. Figure 9 As shown, Figure 9This is a schematic diagram of an electronic device provided in the third embodiment of this application. The electronic device specifically includes: at least one processor 901, at least one communication interface 902, at least one memory 903, and at least one communication bus 904. Optionally, the communication interface 902 can be an interface of a communication module, such as the interface of a GSM module. The processor 901 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The memory 903 may include high-speed RAM and may also include non-volatile memory, such as at least one disk storage device. The memory 903 stores a program, and the processor 901 calls the program stored in the memory 903 to execute the method of the first embodiment of the present invention.

[0141] Fourth embodiment The fourth embodiment of this application also provides a computer storage medium storing a computer program, which is executed by a processor to perform the method of the first embodiment of the present invention.

[0142] The above-described device embodiments, electronic device embodiments, and storage medium embodiments correspond to the above-described method embodiments; please refer to the method embodiments for details. Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media. 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media. Information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include non-transitory computer-readable media, such as modulated data signals and carrier waves. 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

Claims

1. A method for state control of an intelligent agent, characterized in that, The method, applied to a scene service agent that provides scene services, includes: When the scene service agent is in an idle state, it receives a scene service request message sent by the host in a response state. The host is an agent that provides information interaction services to the user. The scene service request message is used to represent the user's scene service needs. If the scene service agent does not have the authority to control the state of the host before receiving the scene service request message, the scene service request message is also used to represent that the host authorizes the scene service agent to control the state of the host. In response to receiving the scene service request message, the state of the scene service agent is switched from idle state to active state; When the scene service agent is in an active state, the scene service intent corresponding to the scene service request message is identified, and scene service intent information is obtained. In response to obtaining the scene service intent information, the state of the scene service agent is switched from active state to processing state; When the scene service agent is in the processing state, it executes the scene service processing logic according to the scene service intent information to obtain the scene service processing result corresponding to the scene service intent information. In response to obtaining the processing result of the scene service, the state of the scene service agent is switched from the processing state to the termination state; When the scene service agent is in the terminated state, it sends a scene service result message obtained based on the scene service processing result to the host. If it is necessary to obtain the user's response information to the scene service result message, the scene service result message includes state control information for instructing the host to switch the response state to the on-mic state after playing the scene service result message to the user. When the host is in the on-mic state, it receives a first voice signal sent by the user to the host. The user's response information to the scene service result message is obtained based on the first voice signal. In response to sending the scene service result message to the host, the state of the scene service agent is switched from the terminated state to the idle state.

2. The method according to claim 1, characterized in that, Also includes: When the scene service agent is in an active state, a first feedback message is sent to the host to indicate that the scene service agent has received the scene service request message; Alternatively, when the scene service agent is in the processing state, a second feedback message is sent to the host to indicate that scene service processing logic is being executed in response to the scene service request message.

3. The method according to claim 2, characterized in that, Also includes: Determine whether it is necessary to obtain the user's response information to the first feedback message. If so, set state control information in the first feedback message to instruct the host to switch the response state to the microphone-on state after playing the first feedback message to the user. Otherwise, do not set state control information in the first feedback message to instruct the host to switch the response state to the microphone-on state after playing the first feedback message to the user, or set state control information in the first feedback message to instruct the host to maintain the response state after playing the first feedback message to the user. Alternatively, determine whether it is necessary to obtain the user's response information to the second feedback message. If so, set state control information in the second feedback message to instruct the host to switch the response state to the microphone-on state after playing the second feedback message to the user. Otherwise, do not set state control information in the second feedback message to instruct the host to switch the response state to the microphone-on state after playing the second feedback message to the user, or set state control information in the second feedback message to instruct the host to maintain the response state after playing the second feedback message to the user.

4. The method according to claim 1, characterized in that, The step of executing scenario service processing logic according to the scenario service intent information to obtain a scenario service processing result corresponding to the scenario service intent information includes: determining whether the overall scenario service process for the scenario service request message needs to end according to the scenario service intent information; if it is determined that the overall scenario service process does not need to end, obtaining scenario service processing logic corresponding to the scenario service intent information, executing the scenario service processing logic, and obtaining a scenario service processing result corresponding to the scenario service intent information; otherwise, obtaining scenario service overall process end logic, executing the scenario service overall process end logic, and obtaining the scenario service overall process end logic execution result. The step of switching the state of the scene service agent from the processing state to the termination state includes: if it is determined that the overall process of the scene service does not need to be terminated, then the state of the scene service agent is switched from the processing state to the task termination state; otherwise, the state of the scene service agent is switched from the processing state to the overall process termination state of the scene service.

5. The method according to claim 1, characterized in that, After the host terminal authorizes the scene service agent to control the state of the host terminal, and the host terminal is in the response state, if it receives the wake-up information sent by the user to wake up the host terminal, then in response to receiving the wake-up information, the host terminal switches the state from the mute state to the on state to receive the third voice signal sent by the user to the host terminal. In response to receiving a third voice signal from the user, the host terminal switches its state from the microphone-on state to the response state. When the host is in a response state, it identifies the agent category intent corresponding to the third voice signal and obtains agent category intent information. If the agent category intent information is used to indicate that the scene service agent provides scene services to the user, then a new scene service request message is obtained according to the user's new scene service demand information. The new scene service demand information is obtained based on the third voice signal. The host sends the new scene service request message to the scene service agent.

6. The method according to claim 2, characterized in that, The first feedback message is used to indicate that the scene service agent is in an active state, so as to instruct the host to allow the issuance of polling messages; After sending the first feedback message to the host, a polling message sent by the host is obtained. The polling message is used to query the processing progress information of the scene service agent for the scene service request message. Determine whether there is any processing progress information that has not been sent to the host. If so, send a polling response message to the host that includes the processing progress information that has not been sent to the host in response to the polling message. The scenario service result message is used to indicate that the scenario service agent is in a terminated state, so as to instruct the host to stop sending polling messages.

7. The method according to claim 1, characterized in that, Also includes: When the scene service agent is in an active state, if it is unable to identify the scene service intent corresponding to the scene service request message or if it is determined from the scene service intent information that the scene service agent is not the agent that processes the scene service request message, then the state of the scene service agent is switched from the active state to the abnormal state. When the scenario service intent information is in an abnormal state, a message is generated to indicate that the status control authority of the host is being returned to the host. Send the status control permission proactively relinquished message to the host terminal; In response to sending a message to the host terminal to actively relinquish the state control authority, the state of the scene service agent is switched from the abnormal state to the idle state.

8. A state control device for an intelligent agent, characterized in that, include: The scene service request message acquisition unit is used to acquire a scene service request message sent by the host in the response state when the scene service agent is in the idle state. The host is an agent that provides information interaction services to the user. The scene service request message is used to represent the user's scene service needs. If the scene service agent does not have the authority to control the state of the host before acquiring the scene service request message, the scene service request message is also used to represent that the host authorizes the scene service agent to control the state of the host. The first state switching unit is used to switch the state of the scene service agent from idle state to active state in response to receiving the scene service request message; The scene service intent information acquisition unit is used to identify the scene service intent corresponding to the scene service request message and obtain scene service intent information when the scene service agent is in an active state. The second state switching unit is used to switch the state of the scene service agent from active state to processing state in response to obtaining the scene service intent information; The scene service processing result acquisition unit is used to execute scene service processing logic according to the scene service intent information when the scene service agent is in the processing state, and obtain the scene service processing result corresponding to the scene service intent information. The third state switching unit is used to switch the state of the scene service agent from the processing state to the termination state in response to obtaining the scene service processing result. The sending unit is configured to send a scene service result message obtained based on the scene service processing result to the host terminal when the scene service agent is in the terminated state. If it is necessary to obtain the user's response information to the scene service result message, the scene service result message includes state control information instructing the host terminal to switch from a response state to an on-mic state after playing the scene service result message to the user. When the host terminal is in the on-mic state, it receives a first voice signal sent by the user to the host terminal, and the user's response information to the scene service result message is obtained based on the first voice signal. The fourth state switching unit is used to switch the state of the scene service agent from the terminated state to the idle state in response to sending the scene service result message to the host.

9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store one or more computer instructions; The processor is used to execute one or more computer instructions to implement the method described in any one of the technical solutions of claims 1-7.

10. A computer-readable storage medium storing one or more computer instructions thereon, characterized in that, The instruction is executed by the processor to implement the method described in any one of the technical solutions as claimed in claims 1-7.