Dialogue information processing method and apparatus, device and medium
By requesting a batch transmission of text units from the server when the number of unpresented text units cached on the client reaches a certain condition, the problem of redundant data transmission in the text unit stream generated by the machine learning model is solved, achieving more efficient data transmission and a better user experience.
Patent Information
- Application Number
- PCT/CN2025/085166
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-25
- Filing Date
- 2025-03-26
- Publication Date
- 2026-01-02
AI Technical Summary
In existing technologies, text unit streams generated by machine learning models suffer from problems such as large amounts of redundant data transmission and high resource overhead during transmission, especially when generating text word by word and transmitting it in a streaming manner.
When the number of unpresented text units cached on the client reaches a certain amount, a batch transmission sequence of unsent text units is requested from the server. This leverages the server's high processing power to generate and cache multiple text units, reducing the number of network transmissions and redundant data.
It effectively reduces network resource consumption, improves data transmission efficiency, and ensures continuous display of text units and user experience.
Smart Images

Figure CN2025085166_02012026_PF_FP_ABST
Abstract
Description
Dialogue information processing methods, apparatus, equipment and media
[0001] This application claims priority to Chinese Patent Application No. 202410834061.1, filed on June 25, 2024, entitled "Dialogue Information Processing Method, Apparatus, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] Exemplary implementations of this disclosure generally relate to text cell management, and more particularly to methods, apparatus, devices, and computer-readable storage media for managing text cells in a stream of text cells. Background Technology
[0003] Machine learning technology has been widely used in various technical fields, and machine learning models can be used to handle various tasks for users in different applications and scenarios. Trained machine learning models can possess specific task-processing capabilities. For example, a trained language model can dynamically generate responses to user queries. Summary of the Invention
[0004] In a first aspect of this disclosure, a method for processing dialogue information is provided. In this method, a first text unit sequence is received at a first device from a second device. The first text unit sequence is at least a portion of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request. The first text unit sequence is written to a first buffer sequence at the first device. The text units in the first buffer sequence are presented at the first device. In response to determining that the number of unpresented text units in the first buffer sequence meets a predetermined condition, a bulk transmission request is sent to the second device to request the second device to transmit a second text unit sequence from the response to the first device.
[0005] In a second aspect of this disclosure, a dialogue information processing apparatus is provided. The apparatus includes: a receiving module configured to receive at a first device a first text unit sequence from a second device, the first text unit sequence being at least a portion of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request; a writing module configured to write the first text unit sequence to the first device's first cache sequence; a presentation module configured to present the text units in the first cache sequence at the first device; and a sending module configured to send a bulk transmission request to the second device in response to determining that the number of unpresented text units in the first cache sequence meets the predetermined condition, requesting the second device to transmit a second text unit sequence from the response to the first device.
[0006] In a third aspect of this disclosure, an electronic device is provided. The electronic device includes: at least one processor; and at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions causing the electronic device to perform the method according to a first aspect of this disclosure when executed by the at least one processor.
[0007] In a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, which, when executed by a processor, cause the processor to implement the method according to a first aspect of this disclosure.
[0008] In a fifth aspect of this disclosure, a computer program product is provided, including computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method according to a first aspect of this disclosure.
[0009] It should be understood that the content described in this content section is not intended to limit the key or essential features of the implementation of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] In the following detailed description, the above and other features, advantages, and aspects of the various implementations of this disclosure will become more apparent, taken in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0011] Figure 1 shows a block diagram of an application environment according to an exemplary implementation of the present disclosure;
[0012] Figure 2 shows a block diagram of dialogue information processing according to some implementations of this disclosure;
[0013] Figure 3 shows a block diagram of the cache sequence at various devices according to some implementations of this disclosure;
[0014] Figure 4 shows a block diagram of the data structure of a message according to some implementations of this disclosure;
[0015] Figure 5 shows a block diagram illustrating the interaction between a first device and a second device according to some implementations of this disclosure;
[0016] Figure 6 shows a flowchart of a dialogue information processing method according to some implementations of this disclosure;
[0017] Figure 7 shows a block diagram of a dialogue information processing apparatus according to some implementations of the present disclosure; and
[0018] Figure 8 shows a block diagram of a device capable of implementing various implementations of the present disclosure. Detailed Implementation
[0019] Implementations of this disclosure will now be described in more detail with reference to the accompanying drawings. While some implementations of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the implementations set forth herein. Rather, these implementations are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and implementations of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0020] In the description of the implementation methods disclosed herein, the term "comprising" and similar terms should be understood as open inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one implementation" or "the implementation" should be understood as "at least one implementation". The term "some implementations" should be understood as "at least some implementations". Other explicit and implicit definitions may also be included below. As used herein, the term "model" can represent the relationships between various data. For example, the aforementioned relationships can be obtained based on various currently known and / or future-developed technical solutions.
[0021] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0022] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and user authorization should be obtained.
[0023] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0024] As an optional but non-restrictive implementation, in response to a user's active request, a prompt message can be sent to the user, for example, via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose whether to "agree" or "disagree" to provide personal information to the electronic device.
[0025] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0026] The term "in response to" as used herein refers to a state in which a corresponding event occurs or a condition is satisfied. It will be understood that the timing of subsequent actions performed in response to such an event or condition is not necessarily strongly correlated with the time when the event occurs or the condition is met. For example, in some cases, subsequent actions may be performed immediately upon the occurrence of the event or the fulfillment of the condition; while in others, they may be performed some time after the occurrence of the event or the fulfillment of the condition.
[0027] Example Environment
[0028] Language models can dynamically generate responses to user queries. This response generation process is often word-for-word and streamed to the client device. The transmitted data includes not only the text units of the response but also supplementary data to aid transmission (e.g., response identifiers, user identifiers, text unit indexes, etc.), resulting in a large data transfer volume. Therefore, it is desirable to reduce redundant data transmission and transmit and present individual text units in the text unit stream more efficiently.
[0029] Referring to Figure 1, which describes an application environment according to some implementations of the present disclosure, Figure 1 shows a block diagram 100 of an application environment according to an exemplary implementation of the present disclosure. As shown in Figure 1, an application 112 can be deployed on a first device 110 (e.g., a client device), which can access a machine learning model 122 deployed on a second device 120 (e.g., a server device).
[0030] First device 110 may send request 114 to second device 120. Request 114 may be, for example, a prompt word, and machine learning model 122 may generate a response to request 114. It should be understood that the response is often generated word-for-word, that is, only one text unit is generated at a time. Then, second device 120 transmits each text unit to first device 110 one by one. For example, text units 124, ..., 126, etc., may be transmitted in the order of the text units in the response. It should be understood that the transmitted message includes not only the text units in the response but also additional data used to assist in the transmission (e.g., response identifier, user identifier, index of text unit, etc.). In this case, transmitting a single text unit at a time may result in a large data transmission volume. Therefore, it is desirable to manage the individual text units in the text unit stream in a more efficient manner.
[0031] Overview of text cell management
[0032] To at least partially address the shortcomings of the prior art, a dialogue information processing method is proposed according to an exemplary implementation of this disclosure. Referring to FIG2, which describes an outline of an exemplary implementation of this disclosure, FIG2 illustrates a dialogue information processing block diagram 200 according to some implementations of this disclosure. As shown in FIG2, a first text unit sequence 212 is received at a first device 110 from a second device 120. The first text unit sequence 212 is at least a portion of a response 210 to a query request. Here, the query request is sent by the first device 110 to the second device 120, and the response 210 is a stream of text units generated by the second device 120 in a streaming manner based on the query request.
[0033] It should be understood that response 210 may include one or more text units. Initially, response 210 may include only a single text unit. Over time, response 210 will include more text units. After receiving the first text unit sequence 212, the first device 110 may write the first text unit sequence 212 to the first cache sequence 220 at the first device 110. At this time, the text units in the first cache sequence are presented at the first device 110 (e.g., in the display area 230), for example, each text unit may be presented sequentially. Specifically, in the display area 230, each text unit in the first cache sequence 220 may be presented step-by-step according to the order of the text units in the first cache sequence 220. For example, the first text unit may be presented first, followed by the second text unit, and so on.
[0034] Furthermore, in response to determining that the number of unpresented text units in the first cache sequence 220 meets a predetermined condition, the first device 110 may send a bulk transmission request 240 to the second device 120 to request the second device to transmit the second text unit sequence in the response to the first device. It should be understood that the bulk transmission request 240 may trigger the transmission of the text unit sequence, and the second device 120 may send more than one text unit to the first device 110 in a bulk manner. Unlike sending only one text unit at a time, using the exemplary implementation of this disclosure, multiple text units can be sent to the first device 110 in a single message. This reduces the number of messages sent and decreases the additional resource overhead caused by additional data in each message during data transmission.
[0035] Detailed process of text unit management
[0036] Having described an outline of some implementations according to this disclosure, further information regarding text unit management is described below with reference to the accompanying drawings. For ease of description, the detailed process of text unit management will be described below using only a conversational application that invokes a language model as an example. Figure 3 shows a block diagram 300 of cache sequences at various devices according to some implementations of this disclosure. As shown in Figure 3, a conversational application 310 can be deployed at a first device 110 (e.g., a user's client device).
[0037] According to some implementations of this disclosure, a user of the conversational application 310 can input a user request within the conversational application 310. According to some implementations of this disclosure, the user request can be directly submitted to the language model 312 as a query request. Alternatively and / or additionally, the user request can be processed to generate corresponding prompt words, which can then be used as the query request. In this way, the query request can be determined in a more flexible manner, thereby making the generated response more in line with user expectations.
[0038] According to some implementations of this disclosure, a language model 312 can be deployed at a second device 120 (e.g., a server device). This language model 312 may be pre-trained and capable of generating corresponding responses based on query requests from the first device 110. A local cache region can be set up at the second device 120 to store a second cache sequence 320. This second cache sequence 320 may store at least one text unit from the response that has been generated but not yet sent to the first device 110. Furthermore, a local cache region can be set up at the first device 110 to store a first cache sequence 220, which stores at least one text unit received from the second device 120 but not yet presented.
[0039] Using the example implementation of this disclosure, language model 312 can continuously generate responses in a streaming manner, appending each text unit in the response to the end of the second buffer sequence 320. In this way, it is convenient to send multiple text units from the second buffer sequence 320 to the first device 110 when a bulk transmission request is received from the first device 110. At this time, each message can carry multiple text units, reducing the number of messages and thus reducing the additional overhead of each appended data in the message.
[0040] According to some implementations of this disclosure, the second device 120 can create messages based on various formats to send the generated text units to the first device. Specifically, the messages can be generated based on: the identifier of the first device, the identifier of the query request, the identifier of the response, the user identifier at the first device, at least one text unit in the second cache sequence of the second device, and the index of at least one text unit.
[0041] See Figure 4 for further details, which illustrates a block diagram 400 of a message data structure according to some implementations of this disclosure. As shown in Figure 4, an identifier 410 may, for example, represent an identifier of the currently generated response. This facilitates differentiation between responses, as the language model 312 may generate multiple responses based on multiple query requests. An index 412 may, for example, represent an index of at least one text unit in the second cache sequence 320 of the second device 120, which may represent, for example, a batch of at least one transmitted text unit. This facilitates the first device 110 in distinguishing the position of the received at least one text unit within the response based on this index.
[0042] User information 414 can represent a user identifier at the first device, thereby clearly indicating which user the current message will be sent to. Furthermore, content 416 can represent a sequence of at least one text unit to be transmitted. The individual text units in this sequence can be arranged in the order they were generated and sent to the first device as a text string.
[0043] It should be understood that the data structure in Figure 4 is merely illustrative, and alternatively and / or additionally, messages can be constructed based on other structures. For example, a message may include: an identifier of the first device 110 to distinguish the destination of the message; an identifier of a query request to distinguish which query request the current message is a response to; a sequence of text units; and an index to the sequence of text units, etc. Furthermore, the second device 120 may transmit a message generated according to a predetermined format to the first device 110, and the first device 110 may parse the received message according to the predetermined format to extract the sequence of text units to be presented (e.g., the first text unit sequence).
[0044] The second device 120 can generate a corresponding message using at least one text unit in the second buffer sequence as described above, and then send the message to the first device 110. For ease of management, text units that have already been sent to the first device 110 can be removed from the second buffer sequence.
[0045] Furthermore, the first device 110 can receive one or more text units from the response of the second device and store the received text units in the first buffer sequence 220. The conversational application 310 can continuously read each text unit from the first buffer sequence 220 in a streaming manner and present each text unit sequentially. Specifically, text units can be presented in a streaming manner in the conversational application. Furthermore, each text unit can be presented based on a predetermined presentation frequency (e.g., a first frequency).
[0046] According to some implementations of this disclosure, text units can be presented at a default frequency (e.g., 0.1 seconds per text unit); alternatively and / or additionally, users can set the presentation frequency based on their own reading speed. Using the example implementations of this disclosure, on the one hand, it can be ensured that excessive text changes during presentation will not cause users to experience dizziness or other discomfort; on the other hand, it can be ensured that the text presentation speed matches the user's reading speed.
[0047] According to some implementations of this disclosure, the first device 110 can continuously read individual text units from the first cache sequence 220. Further, the first device 110 can determine the number of unpresented text units in the first cache sequence. If this number meets a predetermined condition, it can request the second device to transmit the subsequent text unit sequence in the response to the first device. Here, the predetermined condition may include, for example, that the number of unpresented text units in the first cache sequence is zero, meaning that all text units at the first device have been presented, and subsequent text units need to be requested from the second device. Alternatively and / or additionally, the predetermined condition may include that the number of unpresented text units in the first cache sequence is less than a predetermined threshold, meaning that there will soon be a lack of text units to be presented at the first device, and therefore subsequent text units can be requested from the second device in advance.
[0048] According to some implementations of this disclosure, in response to determining that the number of unpresented text units in the first cache sequence meets a predetermined condition, a bulk transmission request is sent to the second device to request the second device to transmit the second text unit sequence in the response to the first device. To facilitate determining the number of unpresented text units, in response to determining that a text unit has been presented, a text unit is removed from the first cache sequence. At this time, the first cache sequence only includes unpresented text units, thus allowing the bulk transmission request to be sent to the second device based on whether the first cache sequence is empty or about to be empty.
[0049] Subsequently, the second device 120 may, in response to the bulk transmission request, send one or more text units that have been generated but not yet sent to the first device. It should be understood that the second device may invoke language model 312 to generate a response and store one or more text units that have not yet been sent to the first device 110 in the second buffer sequence 320. The second device may then generate a message as described above, thereby sending at least one text unit from the second buffer sequence to the first device.
[0050] It should be understood that each text unit in this response is generated at a predetermined generation frequency (e.g., a second frequency). In other words, each text unit in the first text unit sequence and the second text unit sequence is generated by the second device at a second frequency, which is higher than the first frequency. Generally, the second device has stronger processing capabilities and can therefore generate text units at a higher frequency, and multiple text units to be transmitted can be pre-buried at the second device.
[0051] Using the example implementation of this disclosure, the second device 120 can pre-generate multiple text units to be sent to the first device, and can send multiple text units to the first device 110 in batches. In this case, the first device 110 and the second device 120 can process the text units at their respective frequencies and operate independently and asynchronously. In this way, the network resource overhead of sending each text unit individually can be reduced while ensuring continuous display of responses at the first device 110.
[0052] Furthermore, the first device 110 can receive a second text unit sequence from the second device 120. Specifically, the first device 110 can receive a message from the second device 120 and extract the second text unit sequence from the message. Here, the second text unit sequence is generated by the second device after the first text unit sequence, and the second text unit sequence is stored in a second cache sequence at the second device. Subsequently, the first device 110 can update the first cache sequence using the second text unit sequence. At this time, the updated first cache sequence will include subsequent text units that have not been presented, and the first device 110 can present each text unit according to a predetermined presentation frequency.
[0053] According to some implementations of this disclosure, after updating the first cache sequence, the first device 110 can present the text units in the updated first cache sequence at the first device 110. Similar to the method described above, the first device 110 can continuously present each text unit in the first cache sequence at a first frequency. At this time, each text unit can be presented in the order of the text units in the updated first cache sequence. Subsequently, if it is found that the number of unpresented text units in the first cache sequence meets a predetermined condition, the second device 120 can be requested again for the subsequent text units in the response until all text units in the response have been obtained.
[0054] The various steps of dialogue information processing have been described. In the following, refer to FIG. 5 to describe the overall operation process. FIG. 5 shows a block diagram 500 of the interaction between a first device 110 and a second device 120 according to some implementations of the present disclosure. As shown in FIG. 5, the first device 110 may send a query request 510 to the second device 120. Assuming the query request is "Please provide the characters corresponding to Arabic numerals 0-10 respectively", at this time, the second device 120 will generate each text unit in the response at a second frequency (for example, 0.05 seconds per text unit), and the response may include: "zero one two three four five six seven eight nine ten", a total of 11 characters.
[0055] The second device 120 first generates "zero" and sends a message 512 to the first device 110. This message can be established in the format shown in FIG. 4, and the content is "zero". The first device 110 may receive 514 and display the character "zero". Since this character has been displayed, the local cache at the first device 110 is empty at this time, and the first device 110 may send a request 520 to the second device 120 to request subsequent characters.
[0056] When receiving the message 520, the second device 120 has generated "one" and sends a message 522 (the content of this message is "one") to the first device 110. The first device 110 may receive 524 and display the character "one". Since this character has been displayed, the local cache at the first device 110 is empty at this time, and the first device 110 may send a request 530 to the second device 120 to request subsequent characters.
[0057] When receiving the message 530, the second device 120 has generated the character "two" and sends a message 532 (the content of this message is "two") to the first device 110. The first device 110 may receive 534 and display the character "two". Since this character has been displayed, the local cache at the first device 110 is empty at this time, and the first device 110 may send a request 540 to the second device 120 to request subsequent characters.
[0058] When receiving the message 540, the second device 120 has generated the characters "three four" and sends a message 542 (the content of this message is "three four") to the first device 110. The first device 110 may receive 544 the characters "three four" and display "three". Subsequently, the first device 110 may display 546 "four". Since this character has been displayed, the local cache at the first device 110 is empty at this time, and a request 550 is sent to the second device 120 to request subsequent characters.
[0059] Upon receiving message 550, the second device 120 has generated the text "wǔ liù qī bā", and sent message 552 (the content of this message is "wǔ liù qī bā") to the first device 110. The first device 110 can receive the text "wǔ liù qī bā" at 554, and display "wǔ", "liù", "qī", "bā" respectively according to the first frequency. When the local cache at the first device 110 is empty, the first device 110 can send a request to the second device 120 to request subsequent text, and so on. It should be understood that although FIG. 5 shows an example of generating and displaying responses in Chinese, alternatively and / or additionally, text units in responses expressed in other natural languages (e.g., English, French, etc.) can be processed in a similar manner.
[0060] Using the example implementation of the present disclosure, due to the display frequency control at the client, the server generates answers faster than the client's presentation speed. As shown in FIG. 5, there is a time difference between when the server generates text units and when the client displays text units. Utilizing this time difference, the server does not need to transmit immediately after generating each text unit. Instead, it can transmit the generated text units in batches when the client has presented the cached content. In this way, the number of messages can be reduced, thereby reducing the additional network overhead caused by redundant data in the messages. According to some implementations of the present disclosure, a streaming protocol between the server and the client is provided, which can control the number of messages transmitted by the server according to the client's presentation effect. In the example of FIG. 5, the response includes 11 text units, and 11 messages need to be transmitted separately according to the prior art solution. However, only 6 messages need to be transmitted according to the implementation of the present disclosure.
[0061] Example process
[0062] FIG. 6 shows a flowchart of a dialogue information processing method 600 according to some implementations of the present disclosure. At block 610, a first sequence of text units from a second device is received at a first device, the first sequence of text units being at least a part of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request. At block 620, the first sequence of text units is written into a first cache sequence at the first device. At block 630, the text units in the first cache sequence are presented at the first device. At block 640, in response to determining that the number of un-presented text units in the first cache sequence satisfies a predetermined condition, a batch transfer request is sent to the second device to request the second device to transfer a second sequence of text units in the response to the first device.
[0063] According to some implementations of this disclosure, the method 600 further includes: receiving a second text unit sequence from a second device, the second text unit sequence being generated by the second device after a first text unit sequence, and the second text unit sequence being stored in a second cache sequence at the second device; and updating the first cache sequence using the second text unit sequence.
[0064] According to some implementations of this disclosure, the method 600 further includes: presenting text units in an updated first cache sequence at a first device.
[0065] According to some implementations of this disclosure, presenting a text unit at the first device includes: presenting the text unit at a first frequency.
[0066] According to some implementations of this disclosure, each text unit in the first text unit sequence and the second text unit sequence is generated by a second device at a second frequency, and the second frequency is higher than the first frequency.
[0067] According to some implementations of this disclosure, the method 600 further includes: removing the text unit from the first cache sequence in response to determining that the text unit has been presented.
[0068] According to some implementations of this disclosure, the method 600 includes a first text unit sequence in a message from a second device, the message being generated by the second device based on: an identifier of the first device, an identifier of a query request, an identifier of a response, a user identifier at the first device, at least one text unit in a second cache sequence of the second device, and an index of at least one text unit.
[0069] According to some implementations of this disclosure, the second buffer sequence includes at least one text unit in the response that has not yet been sent to the first device.
[0070] According to some implementations of this disclosure, the first device is a client device, the second device is a server device, the query request is a prompt word generated based on the user request, the response is generated by a language model deployed on the server device, and the presentation of text units on the first device includes: presenting text units in a streaming manner in a conversational application.
[0071] Example devices and equipment
[0072] Figure 7 shows a block diagram of a dialogue information processing apparatus 700 according to some implementations of the present disclosure. The apparatus 700 includes: a receiving module 710 configured to receive at a first device a first text unit sequence from a second device, the first text unit sequence being at least a portion of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request; a writing module 720 configured to write the first text unit sequence to a first cache sequence at the first device; a presentation module 730 configured to present the text units in the first cache sequence at the first device; and a sending module 740 configured to send a bulk transmission request to the second device in response to determining that the number of unpresented text units in the first cache sequence meets a predetermined condition, requesting the second device to transmit a second text unit sequence from the response to the first device.
[0073] According to some implementations of this disclosure, the receiving module is further configured to: receive a second text unit sequence from a second device, the second text unit sequence being generated by the second device after the first text unit sequence, and the second text unit sequence being stored in a second cache sequence at the second device; and the apparatus further includes: an updating module configured to update the first cache sequence using the second text unit sequence.
[0074] According to some implementations of this disclosure, the presentation module is further configured to: present text units in an updated first cache sequence at a first device.
[0075] According to some implementations of this disclosure, the presentation module is further configured to: present text units at a first frequency.
[0076] According to some implementations of this disclosure, each text unit in the first text unit sequence and the second text unit sequence is generated by a second device at a second frequency, and the second frequency is higher than the first frequency.
[0077] According to some implementations of this disclosure, the apparatus further includes: a removal module configured to remove a text unit from a first cache sequence in response to determining that a text unit has been rendered.
[0078] According to some implementations of this disclosure, a first text unit sequence is included in a message from a second device, the message being generated by the second device based on: an identifier of the first device, an identifier of a query request, an identifier of a response, a user identifier at the first device, at least one text unit in a second cache sequence of the second device, and an index of at least one text unit.
[0079] According to some implementations of this disclosure, the second buffer sequence includes at least one text unit in the response that has not yet been sent to the first device.
[0080] According to some implementations of this disclosure, the first device is a client device, the second device is a server device, the query request is a prompt word generated based on the user request, the response is generated by a language model deployed on the server device, and the presentation of text units on the first device includes: presenting text units in a streaming manner in a conversational application.
[0081] Figure 8 shows a block diagram of a device 800 capable of implementing various implementations of the present disclosure. It should be understood that the computing device 800 shown in Figure 8 is merely exemplary and should not constitute any limitation on the functionality and scope of the implementations described herein. The computing device 800 shown in Figure 8 can be used to implement the methods described above.
[0082] As shown in Figure 8, the computing device 800 is in the form of a general-purpose computing device. Components of the computing device 800 may include, but are not limited to, one or more processors or processing units 810, memory 820, storage devices 830, one or more communication units 840, one or more input devices 850, and one or more output devices 860. The processing unit 810 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 820. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of the computing device 800.
[0083] Computing device 800 typically includes multiple computer storage media. Such media can be any available media accessible to computing device 800, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 820 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 830 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data (e.g., training data for training) and can be accessed within computing device 800.
[0084] The computing device 800 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG8, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks may be provided. In these cases, each drive may be connected to a bus (not shown) via one or more data media interfaces. The memory 820 may include a computer program product 825 having one or more program modules configured to perform various methods or actions of various implementations of the present disclosure.
[0085] The communication unit 840 enables communication with other computing devices via a communication medium. Additionally, the components of the computing device 800 can function as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the computing device 800 can operate in a networked environment using logical connections to one or more other servers, networked personal computers (PCs), or another network node.
[0086] Input device 850 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 860 can be one or more output devices, such as a monitor, speaker, printer, etc. Computing device 800 can also communicate as needed with one or more external devices (not shown) via communication unit 840. These external devices, such as storage devices, display devices, etc., can communicate with one or more devices that enable user interaction with computing device 800, or with any device (e.g., network card, modem, etc.) that enables computing device 800 to communicate with one or more other computing devices. Such communication can be performed via input / output (I / O) interfaces (not shown).
[0087] According to exemplary implementations of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to exemplary implementations of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above. According to exemplary implementations of this disclosure, a computer program product is provided that stores a computer program thereon, which, when executed by a processor, implements the methods described above.
[0088] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should 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-readable program instructions.
[0089] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0090] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0092] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A method for processing dialogue information, comprising: A first text unit sequence is received at a first device from a second device, the first text unit sequence being at least a portion of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request; Write the first text unit sequence into the first buffer sequence at the first device; The text units in the first cache sequence are presented at the first device; as well as In response to determining that the number of unpresented text units in the first cache sequence meets a predetermined condition, a bulk transmission request is sent to the second device to request the second device to transmit the second text unit sequence in the response to the first device.
2. The method according to claim 1, further comprising: The second text unit sequence is received from the second device, the second text unit sequence being generated by the second device after the first text unit sequence, and the second text unit sequence is stored in a second buffer sequence at the second device; as well as The first cache sequence is updated using the second text unit sequence.
3. The method according to claim 1, further comprising: The updated text units from the first cache sequence are presented at the first device.
4. The method of claim 1, wherein presenting the text unit at the first device comprises: The text unit is presented at a first frequency.
5. The method of claim 4, wherein each text unit in the first text unit sequence and the second text unit sequence is generated by the second device at a second frequency, and the second frequency is higher than the first frequency.
6. The method of claim 1, further comprising: In response to determining that the text unit has been presented, the text unit is removed from the first cache sequence.
7. The method of claim 1, wherein the first text unit sequence is included in a message from the second device, the message being generated by the second device based on: an identifier of the first device, an identifier of the query request, an identifier of the response, a user identifier at the first device, at least one text unit in a second cache sequence of the second device, and an index of the at least one text unit.
8. The method of claim 7, wherein the second buffer sequence includes at least one text unit in the response that has not yet been sent to the first device.
9. The method of claim 1, wherein the first device is a client device, the second device is a server device, the query request is a prompt word generated based on a user request, the response is generated by a language model deployed on the server device, and presenting the text unit on the first device comprises: The text units are presented in a streaming manner in conversational applications.
10. A dialogue information processing device, comprising: A receiving module is configured to receive a first text unit sequence from a second device at a first device, the first text unit sequence being at least a portion of a response to a query request, the response being a stream of text units generated by the second device in a streaming manner based on the query request; The writing module is configured to write the first text unit sequence to a first buffer sequence at the first device; A presentation module is configured to present text units in the first cache sequence at the first device; as well as The sending module is configured to send a bulk transmission request to the second device in response to determining that the number of unpresented text units in the first cache sequence meets a predetermined condition, so as to request the second device to transmit the second text unit sequence in the response to the first device.
11. An electronic device, comprising: At least one processor; as well as At least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions causing the electronic device to perform the method according to any one of claims 1 to 9 when executed by the at least one processor.
12. A computer-readable storage medium having stored thereon computer-executable instructions, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 9.
13. A computer program product comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Flow control method and device
CN104869073A
Video stream frame data processing method and terminal
CN110149552A
Dialogue system and data processing method of dialogue system
CN116775827A
Queue buffer control device
JP1997282865A