Dialogue system, data processing method of dialogue system

By introducing a first-server and second-server separation architecture in the dialogue system and adopting a streaming transmission mechanism to output response information fragments in real time, the problem of untimely response when generating response information in large models is solved, and the system's response timeliness is improved.

CN116775827BActive Publication Date: 2026-07-10ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-06-09
Publication Date
2026-07-10

Smart Images

  • Figure CN116775827B_ABST
    Figure CN116775827B_ABST
Patent Text Reader

Abstract

The application provides a dialogue system and a data processing method of the dialogue system. In the dialogue system, a first server receives a user request sent by an end-side device, acquires input query information, and sends the query information to a second server. The second server generates reply content segments contained in reply information in sequence according to the query information, and transmits the generated reply content segments to the first server in real time. The first server outputs the reply content segments to the end-side device in real time, and outputs the generated reply content segments to the end-side device in real time while generating each reply content segment of the reply information. The generation speed of each reply content segment is relatively fast. The generated reply content segments are continuously output to the end-side device in the process of generating the reply information. The generated reply content segments can be output to the user in advance before the complete reply information is generated, so that the response time of the system is shortened, and the timeliness of the dialogue system response is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a dialogue system and a data processing method for the dialogue system. Background Technology

[0002] With the development of conversational artificial intelligence technology, dialogue systems have been widely applied in various fields such as communications, finance, education, and healthcare. Dialogue systems can generate responses based on pre-trained models and provide feedback to users based on the queries they provide.

[0003] With the continuous development of Natural Language Processing (NLP) technology, models have evolved from small, multi-parameter models in specific domains to large, multi-parameter models. Larger models have stronger generation capabilities and produce more accurate responses. However, as the number of model parameters increases, model performance decreases accordingly, and the time required to generate responses becomes longer. The delay between receiving a user request and returning a response can reach several seconds, resulting in untimely responses from the dialogue system. Summary of the Invention

[0004] This application provides a dialogue system and a data processing method for the dialogue system to solve the problem of untimely response to user requests in the dialogue system.

[0005] Firstly, this application provides a dialogue system, including:

[0006] The first server is used to receive user requests sent by the end-side device, obtain the input query information, and send the query information to the second server.

[0007] The second server is used to generate response content fragments contained in the response information in sequence according to the query information, and transmit the generated response content fragments to the first server in real time;

[0008] The first server is also used to receive the response content fragment and output the response content fragment to the end device in real time.

[0009] Secondly, this application provides a data processing method for a dialogue system, applied to a first server of the dialogue system, comprising:

[0010] Receive user requests sent by the receiving end device and obtain the input query information;

[0011] Send the query information to the second server;

[0012] The system receives a response fragment of the query information sent by the second server and sends the response fragment to the end device in real time.

[0013] Thirdly, this application provides a data processing method for a dialogue system, applied to a second server of the dialogue system, comprising:

[0014] Receive query information sent by the first server;

[0015] Based on the query information, the response content fragments contained in the response information are generated sequentially, and the generated response content fragments are transmitted to the first server in real time.

[0016] Fourthly, this application provides a data processing method for a dialogue system, applied to an end-side device, comprising:

[0017] Send a user request to the dialogue system, the user request containing user input information, the user input information being used to determine the query information;

[0018] Receive a response fragment from the dialogue system and output the response fragment in real time.

[0019] The dialogue system and data processing method provided in this application involve a first server receiving a user request from a terminal device, obtaining the input query information, and sending the query information to a second server. The second server sequentially generates response content fragments based on the query information and transmits the generated response content fragments to the first server in real time. The first server receives the response content fragments and outputs them to the terminal device in real time. This allows the algorithm service to transmit the generated response content fragments to the engineering system in real time while generating each response content fragment, and the engineering system to output the response content fragments to the terminal device in real time. The generation speed of each small response content fragment is relatively fast. By continuously outputting the generated response content fragments to the terminal device during the generation of the response information, the generated response content fragments can be output to the user in advance before the complete response information is generated, thereby greatly shortening the system response time and improving the timeliness of the dialogue system response. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0021] Figure 1 A schematic diagram illustrating the interaction mode between an engineering system and an algorithm service in a traditional dialogue system provided in this application;

[0022] Figure 2This application provides a diagram of a dialogue system architecture applicable to this application;

[0023] Figure 3 A flowchart illustrating a data processing method for a dialogue system provided in an exemplary embodiment of this application;

[0024] Figure 4 A flowchart of a data processing method for a dialogue system provided as another exemplary embodiment of this application;

[0025] Figure 5 A layered architecture for implementing the ability to stream response information in a dialogue system is provided as an exemplary embodiment of this application;

[0026] Figure 6 A schematic diagram of a dialogue flow based on asynchronous streaming provided for an exemplary embodiment of this application;

[0027] Figure 7 A flowchart illustrating a data processing method for a first server in a dialogue system provided in an exemplary embodiment of this application;

[0028] Figure 8 A flowchart illustrating a data processing method for a second server in a dialogue system provided in an exemplary embodiment of this application;

[0029] Figure 9 A flowchart illustrating a data processing method for a terminal device in a dialogue system provided in an exemplary embodiment of this application;

[0030] Figure 10 A schematic diagram of the structure of a first server provided in an exemplary embodiment of this application;

[0031] Figure 11 This is a schematic diagram of the structure of a second server provided for an exemplary embodiment of this application.

[0032] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0034] First, let me explain the terms used in this application:

[0035] Response Time (RT): In a dialog system, this refers to the time it takes for a user to receive a response after sending a request.

[0036] Streaming: A network transmission method in which data is transmitted continuously in segments without waiting for all data to be prepared before transmission. It is commonly used in audio and video transmission schemes. In this application, streaming refers to returning segments of response information generated by a large NLP model in a dialogue system to the dialogue system's engineering system. The engineering system continuously outputs response segments to the user.

[0037] Large models: These are typically generated by pre-training on large-scale unlabeled data. Compared to traditional models, large models have more parameters.

[0038] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol.

[0039] Hypertext Transfer Protocol (HTTP) is a simple request-response protocol that typically runs on top of TCP. It specifies what messages a client might send to a server and what responses it might receive. An HTTP request is a message sent from the client to the server, and an HTTP response is a message sent from the server to the client.

[0040] HTTP persistent connection: Also known as HTTP keep-alive or HTTP connection reuse, it is a method that uses the same TCP connection to send and receive multiple HTTP requests / responses, instead of opening a new connection for each new request / response.

[0041] Typically, dialogue systems can be divided into an engineering system and an algorithm service. The algorithm service is responsible for generating response information based on given query information using a pre-trained model (such as a large model) and providing the response information to the engineering system. The engineering system is responsible for processing other than generating response information, including but not limited to classifying and rewriting query information, returning response information to the user, maintaining the dialogue context, and logging. The engineering system provides the algorithm service with given query information, which can be the query information entered by the user or a rewritten version of the user's input query information.

[0042] Figure 1 This is a schematic diagram illustrating the interaction pattern between the engineering system and the algorithm service in a traditional dialogue system. For example... Figure 1 As shown, the engineering system receives a query from a user and sends a request containing the query information to the algorithm service via a short HTTP connection. Upon receiving the request, the algorithm service generates a response to the query. After generating the complete response, the algorithm service returns the response to the engineering system. While the algorithm service is generating the response, the engineering system remains in a synchronous waiting state until it receives the response and outputs it to the user. In scenarios where the algorithm service generates response information based on large or even very large models, the slow speed of response generation results in a long delay in the engineering system's response time. A single user request may require waiting several seconds, leading to untimely responses.

[0043] To address the issue of untimely responses to user requests in dialogue systems, this application provides a dialogue system comprising a first server and a second server. The first server runs the engineering system of the dialogue system, responsible for processing tasks other than generating response information, including but not limited to classifying and rewriting query information, returning response information to the user, maintaining the dialogue context, and logging. The engineering system provides given query information to the algorithm service (this can be user-input query information or a rewritten version of user-input query information). The second server stores a pre-trained model (which can be a large or ultra-large model with many parameters) for generating response information and provides the algorithm service, specifically responsible for generating response information based on the given query information using the pre-trained model (such as a large model) and providing the response information to the engineering system.

[0044] The dialogue system provided in this application receives user requests sent by end-devices via a first server, obtains the input query information, and sends the query information to a second server. The second server then sequentially generates response content fragments based on the query information and transmits these fragments to the first server in real time. The first server receives the response content fragments and outputs them to the end-devices in real time. This allows the algorithm service to transmit the generated response content fragments to the engineering system in real time while generating each fragment, and the engineering system to output the fragments to the end-devices in real time. The generation speed of each small response content fragment is relatively fast, and the continuous output of generated fragments to the end-devices during the response information generation process allows for the output of generated response fragments to the user before the complete response information is generated, thereby significantly shortening the system's response time and improving the timeliness of the dialogue system's response.

[0045] Figure 2 This application provides a diagram of a dialogue system architecture applicable to it, such as... Figure 2 As shown, the system architecture includes user-side devices and a dialogue system, which includes a first server and a second server.

[0046] The endpoint device refers to the device used by the user, specifically a hardware device with network communication, computing, and information display capabilities, including but not limited to smartphones, tablets, desktop computers, IoT devices, and servers. For example, the user inputs a query through the interactive interface provided by the endpoint device, sending a user request to the dialogue system. The first server of the dialogue system receives the user request, obtains the user-input query, and sends the query to the second server. The second server sequentially generates response content fragments based on a pre-trained model and transmits these fragments to the first server in real time. The first server then sends the received response content fragments back to the endpoint device in real time. The endpoint device outputs the received response content fragments through the interactive interface, thus promptly displaying the response to the user. In this way, during the response generation process, the generated response fragments can be displayed to the user in a timely manner, shortening the user's waiting time for a response and resulting in a more timely response.

[0047] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0048] This application provides a dialogue system, including a first server and a second server. The first server is configured to receive user requests sent by a terminal device, obtain input query information, and send the query information to the second server. The second server is configured to sequentially generate response content fragments containing the response information based on the query information, and transmit the generated response content fragments to the first server in real time. The first server is also configured to receive response content fragments and output response content fragments to the terminal device in real time.

[0049] Figure 3 A flowchart of a data processing method for a dialogue system provided in an exemplary embodiment of this application is shown below. Figure 3 As shown, the processing flow of the dialogue system provided in this application is as follows:

[0050] Step S301: The end device sends a user request to the first server.

[0051] Among them, the end-side device is the device used by the user, which can be a hardware device with network communication function, computing function and information display function, including but not limited to smartphones, tablets, desktop computers, Internet of Things devices, servers, etc.

[0052] Users send user requests to the first server through their edge devices via visual interfaces, voice interactions, or other means. These user requests include user input information, which may include, but is not limited to, any of the following modalities: text, images, audio, and video.

[0053] Step S302: The first server receives the user request sent by the end-side device and obtains the input query information.

[0054] In this embodiment, the first server extracts user input information from the user request and determines query information based on the user input information. The query information is determined based on the user input information, and the type of user input information can differ depending on the dialogue scenario.

[0055] The first server, based on its configured data preprocessing logic, either uses the user's input as query information or converts the user's input into query information. The obtained query information can include, but is not limited to, multimodal information such as text, images, voice, and video.

[0056] For example, a user sends a query to the dialogue system by entering a question text through the interactive interface provided by the terminal device. The user request carries the question text. The first server of the dialogue system uses the question text as query information, and the second server generates the corresponding response text based on the question text.

[0057] For example, a user asks a question to a device (such as a smart speaker) via voice input. The input information sent by the device to the first server can be the user's voice input. The first server converts the user's voice input into text to obtain the query information. The second server generates the corresponding response text based on the query information.

[0058] For example, a user inputs a question text and uploads an image through the interactive interface provided by the client device, sending a user request to the dialogue system. The query information obtained by the first server includes the question text and the image. The second server generates a response text based on the question text and the image. This response text may include a description of the image.

[0059] Step S303: The first server sends query information to the second server.

[0060] In this embodiment, a bidirectional data transmission channel can be established between the first server and the second server. The first server sends query information to the second server through the uplink data transmission channel.

[0061] For example, the first server may send a request / message to the second server to obtain a response, the request / message carrying query information.

[0062] Step S304: The second server generates response content fragments contained in the response information in sequence according to the query information.

[0063] The second server receives the request / message sent by the first server and extracts the query information carried in it. The second server inputs the query information into a pre-trained model, which then generates a response.

[0064] In this embodiment, the pre-trained model used by the second server to generate the response information is a generative model with automatic sentence segmentation function. It generates each response content segment (sentence) that constitutes the response information in sequence. Adjacent response content segments are separated by punctuation marks. The response content segments are spliced ​​together to form a complete response information.

[0065] The pre-trained models used in different dialogue scenarios can be different, and can be generative natural language processing (NLP) models. In addition, the pre-trained models can be models with fewer parameters or large / ultra-large models with more parameters. They can be models that process single-modal data or multi-modal models, without specific limitations here.

[0066] Step S305: The second server transmits the generated response content fragment to the first server in real time.

[0067] As the second server continuously generates the various response content fragments contained in the response information, it transmits the generated response content fragments to the first server in real time through the downlink channel of bidirectional data transmission.

[0068] Step S306: The first server outputs response content fragments to the end device in real time.

[0069] The first server receives the response content fragments and outputs the response content fragments to the end device in real time.

[0070] Step S307: The end-side device outputs a response content fragment.

[0071] After receiving the response fragment, the first server promptly sends the response fragment to the end device without waiting for the complete response information. This allows the end device to output the generated response fragment in advance, achieving the effect of continuously generating response fragments and promptly outputting them to the user.

[0072] In this embodiment, a first server (running an engineering system) receives a user request from a terminal device, obtains the input query information, and sends the query information to a second server (running an algorithm service). The second server generates response content fragments in sequence based on the query information and transmits the generated response content fragments to the first server in real time. The first server receives the response content fragments and outputs them to the terminal device in real time. This allows the algorithm service to transmit the generated response content fragments to the engineering system in real time while generating each response content fragment, and the engineering system to output the response content fragments to the terminal device in real time. The generation speed of each small response content fragment is relatively fast. By continuously outputting the generated response content fragments to the terminal device during the generation of the response information, the generated response content fragments can be output to the user in advance before the complete response information is generated, thereby greatly shortening the system response time and improving the timeliness of the dialogue system response.

[0073] In one optional embodiment, after receiving a response content fragment, the first server stores the fragment in a local queue and retrieves it from the queue in a timely manner via an asynchronous consumption thread, then outputs it to the end device, achieving asynchronous processing of response content fragment reception and transmission. The second server continuously generates multiple response content fragments and transmits them to the first server in real time. The first server continuously receives the generated response content fragments and pushes them to the end device in real time. Thus, during the generation of multiple response content fragments, the already generated response content fragments are continuously output to the user, shortening the user's response delay and resulting in a more timely response.

[0074] Optionally, after receiving the response content fragment, the first server can perform a security check on the response content fragment to verify whether the received response content fragment meets the security check conditions. Response content fragments that do not meet the security check conditions will be discarded, and only response content fragments that meet the security check conditions will be output to the end device.

[0075] For example, the first server receives response content fragments transmitted by the second server through a first thread, and the second thread verifies whether the received response content fragments meet the security verification conditions, storing the qualified response content fragments in a local queue. A third thread retrieves the response content fragments from the local queue and sends them to the end device. This multi-threading approach achieves asynchronous processing of response content fragment reception, security verification, and outgoing transmission. Optionally, the reception and security verification of response content fragments can also be performed by the same thread; this is not specifically limited here.

[0076] The security verification conditions are used to ensure that the output response does not contain unhealthy information such as pornography or violence, or sensitive information that does not comply with regulations. Security verification conditions may include, but are not limited to, not containing non-compliant information from a specified database. Security verification conditions can be configured and adjusted according to the needs of specific dialogue scenarios; different dialogue scenarios can be configured with different security verification conditions, which are not specifically limited here.

[0077] Furthermore, after receiving the response content fragment, the first server executes post-processing logic based on the response content fragment. This post-processing logic includes at least one of the following: updating context information and logging. The post-processing logic executed by the first server may include one or more processing logics, which can be configured according to the needs of the actual dialogue scenario. The configured post-processing logic can differ in different dialogue scenarios.

[0078] Specifically, after a response fragment is sent to the end device via a third thread, post-processing logic is executed by the third thread, or by one or more other threads, to improve the efficiency of the third thread in transmitting the response fragment to the end device. Furthermore, for more complex post-processing logic, it can be executed independently by other threads; different post-processing logics can be executed by different threads; and multiple post-processing logics can be performed in parallel by multiple threads to improve the execution efficiency of the post-processing logic.

[0079] The implementation of updating context information is similar to that of updating the context of the existing dialogue system. The difference is that this embodiment additionally stores the context of each response content fragment, including but not limited to: the content of the response content fragment, the security verification result, and the reception start time.

[0080] The logging implementation is similar to that in existing dialogue systems. The difference lies in that, unlike existing technologies that only log the entire response information (such as a question-and-answer pair of query and response), this embodiment additionally records log information for response content fragments, including but not limited to: the algorithm duration of the response content fragment and the security verification result. The algorithm duration of the response content fragment refers to the time taken to obtain the response content fragment from the algorithm service of the second server, which can be the time elapsed from receiving the previous response content fragment to receiving this response content fragment. The algorithm duration of each response content fragment can be calculated based on the start time of sending the query information to the first server and the reception time of each response content fragment.

[0081] In one optional embodiment, a long connection is established between the first server and the second server to realize bidirectional data transmission between the first server and the second server. The first server sends query information to the second server through the long connection, and the second server transmits the generated response content fragments to the first server in real time through the long connection to realize the streaming transmission of the response content fragments.

[0082] Figure 4 A flowchart of the data processing method for the dialogue system provided in the embodiments of this application is shown below. Figure 4 As shown, the specific implementation steps of the dialogue system based on long-connection streaming are as follows:

[0083] Step S401: The end device sends a user request to the first server, which includes query information input by the user.

[0084] Among them, the end-side device is the device used by the user, which can be a hardware device with network communication function, computing function and information display function, including but not limited to smartphones, tablets, desktop computers, Internet of Things devices, servers, etc.

[0085] Users send user requests to the first server through their edge devices via visual interfaces, voice interactions, or other means. These user requests include user input information, which may include, but is not limited to, any of the following modalities: text, images, audio, and video.

[0086] Step S402: The first server receives the user request sent by the end-side device and obtains the input query information.

[0087] In this embodiment, the first server extracts user input information from the user request and determines query information based on the user input information. The query information is determined based on the user input information, and the type of user input information can differ depending on the dialogue scenario.

[0088] The first server, based on its configured data preprocessing logic, either uses the user's input as query information or converts the user's input into query information. The obtained query information can include, but is not limited to, multimodal information such as text, images, voice, and video.

[0089] For example, a user sends a query to the dialogue system by entering a question text through the interactive interface provided by the terminal device. The user request carries the question text. The first server of the dialogue system uses the question text as query information, and the second server generates the corresponding response text based on the question text.

[0090] For example, a user asks a question to a device via voice input. The input information sent by the device to the first server can be the user's voice input. The first server converts the user's voice input into text to obtain the query information. The second server generates the corresponding response text based on the query information.

[0091] For example, a user inputs a question text and uploads an image through the interactive interface provided by the client device, sending a user request to the dialogue system. The query information obtained by the first server includes the question text and the image. The second server generates a response text based on the question text and the image. This response text may include a description of the image.

[0092] In one optional embodiment, the dialogue system supports multi-turn dialogue, and the first server can also rewrite the query information based on the context information of the multi-turn dialogue. The rewriting of the query information specifically includes, but is not limited to, dissolving the referential types of descriptions in the query information, such as personal pronouns, demonstrative pronouns, ellipsis, and part-whole references.

[0093] Optionally, in some application scenarios, a dialogue system can include multiple different skills (functional modules), each corresponding to different application domains and requirements. The processing logic executed by the dialogue system differs for each skill. Some skills require the use of pre-trained models to generate response information. Other skills use search results as response information, meaning they do not require the use of pre-trained models. For different skills that require the use of pre-trained models to generate response information, the pre-trained models used can be different.

[0094] For example, a dialogue system can include skills such as playing music, telling stories, casual conversation, answering encyclopedic questions, and providing product information. For skills like playing music, telling stories, image search, and video search, the dialogue system searches for relevant resources, such as audio data, images, and videos, based on information provided by the user and outputs the found resources; no pre-trained model from a second server is needed. For skills like casual conversation, answering encyclopedic questions, and providing product information, it may be necessary to generate response information based on a pre-trained model, requiring the first server to obtain the response information from the second server. Different pre-trained models are used to generate response information for casual conversation and product information.

[0095] In this embodiment, after the first server obtains the query information input by the user, it can also classify the query information to determine the skill (functional module) corresponding to the query information, and execute the corresponding processing logic according to the classification result.

[0096] Step S403: The first server obtains a long connection with the second server.

[0097] In this embodiment, a long connection is established between the first server and the second server to realize bidirectional data transmission between them, enabling the second server to continuously stream data to the first server.

[0098] For example, a long connection is established between the first server and the second server. This can be achieved by establishing a persistent HTTP connection, a WebSocket connection, or other long connection methods. No specific limitations are made here.

[0099] In one optional implementation, the long-lived connection acquired by the first server and the second server is only valid for the current user request. After the response data for this user request is transmitted, the long-lived connection is released. After acquiring the long-lived connection with the second server, the first server binds the long-lived connection to the user request. The first server releases the long-lived connection after receiving the last fragment of the response information.

[0100] In another optional implementation, the long-lived connection between the first server and the second server remains valid throughout the current session. After the response data for the current user request is transmitted, the long-lived connection can continue to be used to transmit subsequent user requests and response data within the same session. The long-lived connection is released after the current session ends. After acquiring the long-lived connection with the second server, the first server binds the long-lived connection to the session corresponding to the user request. The first server releases the long-lived connection after determining that the session corresponding to the user request has ended. In this implementation, the first server and the second server can maintain a single long-lived connection throughout a single session, avoiding the time overhead of frequently establishing and releasing long-lived connections, and further improving the timeliness and overall performance of the dialogue system.

[0101] In one optional embodiment, the first server may establish a connection pool, in which a preset number of long-lived connections with the second server are initially established, and at least a preset number of long-lived connections in the connection pool are kept in a connected state. The preset number can be set and adjusted according to the needs of the actual dialogue scenario; for example, the preset number can be set to 10, but this is not specifically limited here.

[0102] In this step, if all long-lived connections in the connection pool are occupied, the first server can establish a new long-lived connection with the second server as the long-lived connection used in this operation. If there are unoccupied long-lived connections in the connection pool, the first server can select one from the pool as the long-lived connection used in this operation. This saves the time overhead of establishing long-lived connections and can further improve the timeliness of the dialogue system's response and overall performance.

[0103] Furthermore, the second server can be implemented using a distributed cluster containing multiple service nodes. The pre-trained model is deployed on each service node in the distributed cluster. The distributed cluster improves the efficiency of the pre-trained model in generating response information, thereby enhancing the timeliness of the dialogue system's response. The long-lived connection between the first and second servers is a long-lived connection between the first server and one of the service nodes in the second server.

[0104] When selecting a long connection from the connection pool, the first server can select a long connection with a lower load on the connected service nodes based on the load of each long connection in the connection pool. This will make the load of the service nodes in the second server more balanced, which will help improve the overall performance and response time of the dialogue system.

[0105] When establishing a long connection with the second server, the first server can establish a long connection with the less loaded service node in the second server based on the load of each service node in the second server. This makes the load of the service nodes in the second server balanced, which is beneficial to improving the overall performance and response time of the dialogue system.

[0106] Furthermore, the first server can be implemented using a distributed cluster containing multiple nodes. This distributed cluster increases the user concurrency of the dialogue system, thereby improving its processing efficiency and timeliness. In this embodiment, once a long connection is established, it connects a fixed node in both the first and second servers. Fragments of local user requests / session responses are transmitted from the second server to the fixed first node in the first server via the same long connection. This first node handles context updates and log recording for this request / session, maintaining the consistency and uniformity of context information and logs.

[0107] Step S404: The first server sends query information to the second server through a long connection.

[0108] The first server sends query information to the second server through a long-lived connection's uplink channel.

[0109] For example, the first server may send a request / message to the second server to obtain a response, the request / message carrying query information.

[0110] Step S405: The second server generates response content fragments contained in the response information in sequence according to the query information.

[0111] The second server receives the request / message sent by the first server and extracts the query information carried in it. The second server inputs the query information into a pre-trained model, which then generates a response.

[0112] In this embodiment, the pre-trained model used by the second server to generate the response information is a generative model with automatic sentence segmentation function. It generates each response content segment (sentence) that constitutes the response information in sequence. Adjacent response content segments are separated by punctuation marks. The response content segments are spliced ​​together to form a complete response information.

[0113] The pre-trained models used in different dialogue scenarios can be different, and can be generative natural language processing (NLP) models. In addition, the pre-trained models can be models with fewer parameters or large / ultra-large models with more parameters. They can be models that process single-modal data or multi-modal models, without specific limitations here.

[0114] Step S406: The second server transmits the generated response content fragment to the first server in real time via a long connection.

[0115] As the second server continuously generates the various response content fragments contained in the response information, it transmits the generated response content fragments to the first server in real time through the downlink channel of the long connection.

[0116] Step S407: The first server outputs response content fragments to the end device in real time.

[0117] The first server receives response content fragments through the downlink channel of the long connection and outputs response content fragments to the end device in real time.

[0118] Optionally, data transmission between the first server and the end-side device can be performed via a short HTTP connection.

[0119] Optionally, a long-lived connection, such as an HTTP persistent connection or a WebSocket connection, can be established between the first server and the end-side device to achieve data transmission between the first server and the end-side device.

[0120] The long-lived connection established between the end device and the first server can be bound to a user request and is only valid for that request, or it can be bound to a session and is valid within that session. The specific implementation method is similar to that of establishing a long-lived connection between the first server and the second server, and will not be elaborated here.

[0121] Step S408: The end-side device outputs a fragment of the response content.

[0122] After receiving the response fragment, the first server promptly sends the response fragment to the end device without waiting for the complete response information. This allows the end device to output the generated response fragment in advance, achieving the effect of continuously generating response fragments and promptly outputting them to the user.

[0123] In this embodiment, the first server and the second server achieve bidirectional real-time communication through a long connection. The first server can push query information to the second server through the uplink channel of the long connection, and the second server can actively push the generated response content fragments to the first server in real time through the downlink channel of the long connection, realizing the streaming transmission of the response content fragments and ensuring that the user can receive a response in a short time. Furthermore, maintaining the long connection for a long time reduces the network overhead of establishing and disconnecting each connection, which can greatly shorten the response time of the dialogue system and improve the timeliness of the dialogue system's response.

[0124] For example, Figure 5 This embodiment provides a capability layering architecture for implementing the streaming transmission of response information in a dialogue system. This capability layering architecture is the capability architecture of the first server in the dialogue system. For example... Figure 5 As shown, the architecture is divided into modules based on the different capabilities (functions) implemented, such as client, asynchronous information processing, information consumption, post-processing of information, and context information.

[0125] The client module provides request- and session-based client capabilities, responsible for maintaining the data transmission channel with the algorithm service server and handling the entire lifecycle of transmitted messages. Specifically, message lifecycle handling includes: handling events such as connection establishment, connection termination, message reception, and message exceptions; heartbeat detection on the second server; and connection pool maintenance. Connection pool maintenance includes, but is not limited to: connection pooling, connection keep-alive, connection occupancy and release, and load balancing. Connection pooling includes, but is not limited to, initializing a preset number of long connections in the connection pool. Connection keep-alive refers to maintaining a certain number of active connections in the connection pool. Connection occupancy includes, but is not limited to: recording the status of long connections and binding long connections to user requests / sessions. Connection release refers to releasing long connections after a user request / session ends, either by disconnecting the long connection or returning it to the connection pool (restoring it to an unoccupied state). Load balancing refers to managing the long connections between the first and second servers to achieve load balancing among the service nodes on the second server based on the load of the long connections.

[0126] Information is processed asynchronously. Based on the configuration of the application processing logic, the processing logic is executed on the information (including reply content fragments) received from the second server, including but not limited to security verification of the reply content fragments and storage in a local queue.

[0127] Information consumption involves consuming information (including fragments of response content) from the local queue, which means retrieving information (including fragments of response content) from the local queue.

[0128] Information post-processing involves assembling corresponding asynchronous execution chains based on different post-processing logics, and asynchronously executing the post-processing logic, including but not limited to: outputting response content fragments, updating the context, and recording logs.

[0129] Context information additionally stores the context of the streaming data (response content fragments) during the streaming process. For each response content fragment, it stores the streaming content, security check results, reception start time, etc. Context information includes, but is not limited to, information related to queues, requests, logs, etc.

[0130] The first server is based on Figure 5 The layered capability architecture shown enables streaming transmission of response content fragments between the algorithm service and the second server. This allows the algorithm service to transmit the generated response content fragments to the engineering system in real time while generating each response content fragment, and the engineering system to output the response content fragments to the end device in real time. The generation speed of each small response content fragment is relatively fast. During the process of generating the response information, the generated response content fragments are continuously output to the end device. The generated response content fragments can be output to the user in advance before the complete response information is generated, thereby greatly shortening the system response time and improving the timeliness of the dialogue system response.

[0131] For example, Figure 6 This is a schematic diagram of the dialogue flow based on asynchronous streaming provided in this embodiment. Figure 6 As shown, for a received user request, the dialogue system categorizes and / or rewrites the query information through the first server (engineering system) to obtain the final query information. For cases where the second server (algorithm service) needs to generate response information using a large model, the first server triggers the establishment of a streaming transmission channel. The first server triggers an asynchronous thread (the first thread, acting as a WebSocket client) to establish a long connection with the second server (acting as a WebSocket server) via WebSocket. After the long connection is successfully established, the first server sends the query information to the second server through the uplink channel of the long connection. The second server receives the query information, generates response content fragments sequentially, and streams these response content fragments to the first server through the downlink channel of the long connection. The first server receives the response content fragments transmitted through the downlink channel through the first thread; the second thread performs security checks on the response content fragments and stores the response content fragments that meet the security check conditions in a queue. The third thread retrieves the response content fragments from the queue and executes post-processing logic, which includes, but is not limited to, callback output, context update, and logging.

[0132] It should be noted that, Figure 6 The dialogue process shown is based on asynchronous streaming transmission. Taking the establishment of a WebSocket connection as an example, the first server (engineering system) establishes a long connection with the second server (algorithm service) through WebSocket. By leveraging the full-duplex capability of WebSocket, the response content fragments generated by the second server (algorithm service) are streamed out, which improves the response timeliness of the dialogue system while ensuring the response generation capability of the second server (algorithm service). Figure 6 The dashed arrow between the first server and the second server indicates that streaming is performed via a long connection. Figure 6 The following example illustrates the sequential execution of three post-processing steps: callback output, context update, and logging. No specific restrictions are placed on the execution order or the post-processing steps themselves.

[0133] In one optional embodiment, the first server and the second server can transmit data via a message queue (MessageQueue, MQ). The second server encapsulates the generated response content fragment into a response message through the message queue and transmits the response message to the first server.

[0134] In one optional embodiment, the first server provides a request callback interface, and the second server transmits the generated response content fragment to the first server by calling the request callback interface. The callback interface provided by the first server can be an HTTP interface, a High-Speed ​​Service Framework (HSF) interface, etc., and the second server continuously transmits the response content fragment to the first server by calling the callback interface multiple times. For example, each time a response content fragment is generated, the second server calls the callback interface once to transmit the response content fragment to the first server.

[0135] Figure 7 This is a flowchart illustrating a data processing method for a dialogue system provided as an exemplary embodiment of this application. The method execution entity in this embodiment is the first server described in the preceding embodiments. Figure 7 As shown, the specific steps of this method are as follows:

[0136] Step S701: Receive the user request sent by the receiving end device and obtain the input query information.

[0137] This step is similar to the specific implementation of steps S302 and S402 mentioned above. Please refer to the relevant content of the aforementioned embodiments for details, which will not be repeated here.

[0138] Step S702: Send query information to the second server.

[0139] The specific implementation of this step is similar to that of step S303 described above. For example, it can be implemented using a long connection-based approach as described in steps S403-S404. The first server establishes a long connection with the second server. Through the long connection, query information is sent to the second server. For details, please refer to the relevant content of the aforementioned embodiments, which will not be repeated here.

[0140] Alternatively, the first server can send query information to the second server through message brokers, HTTP requests, or other means. For details, please refer to the relevant content in the aforementioned embodiments, which will not be repeated here.

[0141] Step S703: Receive the response content fragment of the query information sent by the second server, and send the response content fragment to the end device in real time.

[0142] The specific implementation of this step is similar to that of the aforementioned steps S306 and S407. Please refer to the relevant content of the aforementioned embodiments for details, which will not be repeated here.

[0143] In this embodiment, data transmission between the first server and the second server can be achieved through long connections, message middleware, request / callback interfaces, etc. For details, please refer to the relevant content of the foregoing embodiments, which will not be repeated here.

[0144] Figure 8 A flowchart illustrating a data processing method for a dialogue system provided as another exemplary embodiment of this application. The method execution entity in this embodiment is the second server from the aforementioned embodiments. Figure 8 As shown, the specific steps of this method are as follows:

[0145] Step S801: Receive query information sent by the first server.

[0146] Step S802: Generate response content fragments contained in the response information according to the query information, and transmit the generated response content fragments to the first server in real time.

[0147] The specific implementation of this step is similar to that of steps S304-S305 described above. For example, the generated response content fragment is transmitted to the first server in real time. Specifically, this can be achieved using a long connection as described in step S406. The generated response content fragment is transmitted to the first server in real time through a long connection established with the first server. For details, please refer to the relevant content in the aforementioned embodiments, which will not be repeated here.

[0148] In addition, the second server can transmit the generated response content fragments to the first server in real time, which can also be achieved through message middleware, calling callback interfaces, etc. For details, please refer to the relevant content of the aforementioned embodiments, which will not be repeated here.

[0149] In this embodiment, data transmission between the first server and the second server can be achieved through long connections, message middleware, request / callback interfaces, etc. For details, please refer to the relevant content of the foregoing embodiments, which will not be repeated here.

[0150] Figure 9 A flowchart illustrating a data processing method for a dialogue system provided as another exemplary embodiment of this application. The method execution entity in this embodiment is the end-side device as described in the preceding embodiments. Figure 9 As shown, the specific steps of this method are as follows:

[0151] Step S901: Send a user request to the dialogue system. The user request includes user input information, which is used to determine the query information.

[0152] End-side devices are devices used by users, specifically hardware devices with network communication, computing, and information display functions, including but not limited to smartphones, tablets, desktop computers, IoT devices, and servers.

[0153] Users send user requests to the first server through their edge devices via visual interfaces, voice interactions, or other means. These user requests include user input information, which may include, but is not limited to, any of the following modalities: text, images, audio, and video.

[0154] The first server extracts user input information from the user request and determines query information based on the user input information. The query information is determined based on the user input information, and the type of user input information can differ depending on the dialogue scenario. The implementation method of the first server determining the query information based on the user input information is described in steps S302 and S402 of the aforementioned embodiments, and will not be repeated here.

[0155] Step S902: Receive the response fragment of the query information sent by the dialogue system and output the response fragment in real time.

[0156] In this embodiment, the dialogue system sends response content fragments to the end device in a timely manner through the first server. Without waiting for the complete response information, the end device outputs the received response content fragments to the user in real time. This allows for the output of generated response content fragments in advance, achieving the effect of continuously generating response content fragments and outputting them to the user in a timely manner.

[0157] Optionally, data transmission between the dialogue system (first server) and the end-side device can be conducted via HTTP short connections.

[0158] Optionally, a long-lived connection, such as an HTTP persistent connection or a WebSocket connection, can be established between the dialogue system (first server) and the client device. By using a long-lived connection to achieve data transmission between the first server and the client device, the latency for users to receive responses can be further shortened, and the timeliness and performance of the dialogue system can be improved.

[0159] The long-lived connection established between the end device and the first server can be bound to a user request and is only valid for that request, or it can be bound to a session and is valid within that session. The specific implementation method is similar to that of establishing a long-lived connection between the first server and the second server, and will not be elaborated here.

[0160] Figure 10 This is a schematic diagram of the structure of the first server provided in an embodiment of this application. Figure 10 As shown, the first server includes a memory 1001 and a processor 1002. The memory 1001 stores computer-executed instructions and can be configured to store various other data to support operations on the first server. The processor 1002 is communicatively connected to the memory 1001 and executes the computer-executed instructions stored in the memory 1001 to implement the technical solution executed by the first server in any of the above method embodiments. Its specific functions and the technical effects it can achieve are similar and will not be repeated here. Figure 10 The example shown uses a cloud-based server as the first server. However, the first server can also be a local server. This embodiment does not impose any specific limitations.

[0161] Optional, such as Figure 10 As shown, the first server also includes other components such as a firewall 1003, a load balancer 1004, a communication component 1005, and a power supply component 1006. Figure 10 The diagram only shows a portion of the components and does not imply that the first server only includes... Figure 10 The components shown.

[0162] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the technical solution executed by the first server in any of the above embodiments. The specific functions and technical effects to be achieved are not described here.

[0163] This application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of the first server can read the computer program from the readable storage medium. The at least one processor executes the computer program to cause the first server to perform the technical solution of the first server in any of the above embodiments. The specific functions and the technical effects that can be achieved are not described here.

[0164] This application provides a chip, including a processing module and a communication interface. The processing module is capable of executing the technical solution of the first server in the aforementioned method embodiments. Optionally, the chip further includes a storage module (e.g., a memory), which stores instructions. The processing module executes the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solution of the first server in any of the aforementioned embodiments.

[0165] Figure 11 This is a schematic diagram of the structure of the second server provided in an embodiment of this application. Figure 11 As shown, the second server includes a memory 1101 and a processor 1102. The memory 1101 stores computer-executed instructions and can be configured to store various other data to support operations on the second server. The processor 1102 is communicatively connected to the memory 1101 and executes the computer-executed instructions stored in the memory 1101 to implement the technical solution executed by the second server in any of the above embodiments. Its specific functions and the technical effects it can achieve are similar and will not be described again here. Figure 11 The example shown uses a cloud-based server as the second server. However, the second server can also be a local server, and this embodiment does not impose any specific limitations.

[0166] Optional, such as Figure 11 As shown, the second server also includes other components such as a firewall 1103, a load balancer 1104, a communication component 1105, and a power supply component 1106. Figure 11 The diagram only shows some components and does not mean that the second server only includes... Figure 11 The components shown.

[0167] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the technical solution executed by the second server in any of the above embodiments. The specific functions and technical effects to be achieved are not described here.

[0168] This application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of the second server can read the computer program from the readable storage medium. The at least one processor executes the computer program to cause the second server to perform the solution provided by the second server in any of the above embodiments. The specific functions and technical effects that can be achieved are not described here.

[0169] This application provides a chip, including a processing module and a communication interface. The processing module is capable of executing the technical solution of the second server in the aforementioned method embodiments. Optionally, the chip further includes a storage module (e.g., a memory), which stores instructions. The processing module executes the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solution of the second server in any of the aforementioned embodiments.

[0170] This application provides an end-side device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the technical solution executed by the end-side device in any of the foregoing embodiments.

[0171] The aforementioned storage can be object storage (OSS).

[0172] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0173] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as mobile hotspots (WiFi), second-generation (2G), third-generation (3G), fourth-generation (4G) / Long Term Evolution (LTE), fifth-generation (5G), or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0174] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0175] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, read-only optical disc storage (CD-ROM), optical storage, etc.) containing computer-usable program code.

[0176] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0177] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0178] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0179] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0180] Memory may include non-persistent storage in computer-readable media, such as 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.

[0181] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0182] It should be noted that the user information (including but not limited to user device information, user attribute 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 relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0183] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The sequence numbers are merely used to distinguish different operations, and the sequence number itself does not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types. "Multiple" means two or more, unless otherwise explicitly specified.

[0184] 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 relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0185] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0186] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A dialogue system, characterized in that, include: The first server is used to receive user requests sent by the end-side device, obtain the input query information, and send the query information to the second server. The second server is used to sequentially generate response content fragments contained in the response information according to the query information, and transmit the generated response content fragments to the first server in real time according to the streaming transmission method, wherein the streaming transmission is to transmit the response content fragments contained in the response information to the first server segment by segment. The first server is also used to receive the response content fragment and output the response content fragment to the end device in real time; The first server receives the response content fragment and sends the response content fragment to the end device, including: The first server receives the response content fragment through the first thread; The second thread checks whether the received response content fragments meet the security verification conditions, and stores the response content fragments that meet the security verification conditions into the local queue. A third thread retrieves a response content fragment from the local queue and sends the response content fragment to the end device.

2. The system according to claim 1, characterized in that, The first server sends the query information to the second server, including: The first server establishes a long-lived connection with the second server; The first server sends the query information to the second server through the long connection; The second server transmits the generated response content fragments to the first server in real time through the long connection.

3. The system according to claim 2, characterized in that, After the first server obtains a long-lived connection with the second server, the process further includes: The first server binds the long connection to the user request; After the first server receives the last fragment of the reply information, it releases the long connection.

4. The system according to claim 2, characterized in that, After the first server obtains a long-lived connection with the second server, the process further includes: The first server binds the long connection to the session corresponding to the user request; The first server releases the long connection after determining that the session corresponding to the user request has ended.

5. The system according to claim 2, characterized in that, The second server comprises multiple service nodes, and the long-lived connection between the first server and the second server is a long-lived connection between the first server and one of the service nodes of the second server. The first server acquires a long-lived connection with the second server, including: The first server selects a long connection from the connection pool based on the load of the service nodes connected to each long connection in the connection pool.

6. The system according to claim 1, characterized in that, The second server transmits the generated response content fragments to the first server in real time using a streaming method, including: The second server generates a response message containing the response content fragment and sends the response message to the first server through a message middleware.

7. The system according to claim 1, characterized in that, The second server transmits the generated response content fragments to the first server in real time using a streaming method, including: The second server transmits the generated response content fragment to the first server in real time by calling the request callback interface provided by the first server.

8. The system according to claim 1, characterized in that, After the first server receives the response content fragment, it also includes: The first server executes post-processing logic based on the response content fragment, and the post-processing logic includes at least one of the following: updating context information and recording logs.

9. A data processing method for a dialogue system, characterized in that, The first server used in the dialogue system includes: Receive user requests sent by the receiving end device and obtain the input query information; Send the query information to the second server; The system receives a response content fragment of the query information sent by the second server in a streaming manner, and sends the response content fragment to the end device in real time. The streaming means transmitting the response content fragments contained in the response information generated according to the query information to the first server segment by segment. The step of receiving a response fragment of the query information sent by the second server in a streaming manner, and sending the response fragment to the end device in real time, includes: The response content fragment is received through the first thread; The second thread checks whether the received response content fragments meet the security verification conditions, and stores the response content fragments that meet the security verification conditions into the local queue. A third thread retrieves a response content fragment from the local queue and sends the response content fragment to the end device.

10. The method according to claim 9, characterized in that, Sending the query information to the second server includes: Establish a long-lived connection with the second server; The query information is sent to the second server via the long connection.

11. A data processing method for a dialogue system, characterized in that, The second server used in the dialogue system includes: Receive query information sent by the first server; The response information is generated sequentially based on the query information, and the generated response content fragments are transmitted to the first server in real time through the first thread in a streaming mode. This allows the first server to send the response content fragments to the end device through the third thread when the second thread verifies that the response content fragments meet the security verification conditions. The streaming mode involves transmitting the response content fragments contained in the response information to the first server segment by segment.

12. The method according to claim 11, characterized in that, The step of transmitting the generated response content fragment to the first server in real time includes: The generated response content fragments are transmitted to the first server in real time through a long connection established with the first server.

13. A data processing method for a dialogue system, characterized in that, Applied to end-side devices, including: Send a user request to the dialogue system, the user request containing user input information, the user input information being used to determine the query information; The third thread receives the response content fragments of the query information sent by the first server of the dialogue system, and outputs the response content fragments in real time. The response content fragments are generated by the second server in the dialogue system and transmitted to the first server in real time through the first thread in a streaming mode. The first server sends the response content fragments after verifying that the response content fragments meet the security check conditions through the second thread. The streaming transmission is to transmit the response content fragments contained in the response information generated according to the query information to the first server segment by segment.