Structured dialogue method, apparatus, device, medium and product for multi-round voice content conversion

By identifying and distinguishing the text to be optimized, the optimization instruction text, and the historical optimization text during multi-round speech content transformation, and assembling them into structured data in a fixed order and sending them to the language processing service, the problem of information confusion and poor consistency in multi-round speech content transformation is solved, thereby improving user intent understanding and text coherence.

CN122493855APending Publication Date: 2026-07-31BEIJING MIANBI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING MIANBI INTELLIGENT TECH CO LTD
Filing Date
2026-05-06
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, information organization is chaotic, semantic roles are unclear, and text consistency between multiple turns is poor during multi-turn speech content transformation, making it difficult for language processing services to accurately understand user intent and ensure text consistency.

Method used

The system generates text to be optimized by recognizing the speech text of the current round, generates corresponding optimization instruction text, and obtains historical optimization text up to the end of the previous round. The system then assembles the optimized text into structured data in a fixed order and splices it together in round order to form structured conversation data, which is then sent to the language processing service.

Benefits of technology

This achieves clear differentiation of content in each round, ensuring that the language processing service generates optimized text based on global information, avoiding inconsistencies in terminology and style, and improving instruction compliance and interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493855A_ABST
    Figure CN122493855A_ABST
Patent Text Reader

Abstract

This invention discloses a structured dialogue method, apparatus, device, medium, and product for multi-turn speech content transformation, relating to the field of artificial intelligence technology. The method includes: generating text to be optimized based on the speech text recognized in the current turn; generating corresponding instruction text based on the optimization instructions provided by the user in the current turn; and acquiring historical optimized text received from a language processing service up to the end of the previous turn; assembling the text to be optimized, the instruction text, and the historical optimized text into structured data for the current turn in a fixed order; and concatenating the structured data of the current turn and all previous turns in turn order to form structured conversation data; sending the structured conversation data to a language processing service, enabling the language processing service to generate optimized text for the current turn based on the structured conversation data, and receiving the optimized text for the current turn returned by the language processing service. This invention improves the accuracy of intent understanding and the coherence of multi-turn interactions in the language processing service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a structured dialogue method, apparatus, device, medium, and product with multi-turn speech content transformation. Background Technology

[0002] On computing devices, users often acquire natural language text through voice capture and then optimize the text using language processing services. In practice, users often need to gradually adjust the results through multiple rounds of interaction, such as first verbally reciting a draft, then adding constraints, correcting terminology, standardizing titles, or requesting a coherent rewrite of the entire text.

[0003] Common multi-turn dialogue implementations rely on generic chat application programming interfaces (APIs) or text completion interfaces. In a typical workflow, the client converts the user's speech into text via voice capture, and then sends this text along with historical messages (usually organized as a list of alternating messages between the user and assistant or as a concatenation of plain text) to the language processing server. The server then returns the corresponding optimized text for the current input based on a single prompt or a loosely structured multi-turn message history.

[0004] This approach has the following shortcomings: Historical messages are only organized based on the alternating roles of user and assistant, without clearly distinguishing between different semantic types of content, making it difficult for the server to accurately understand the user's true intentions in multiple rounds of interaction; there is no unified agreement on whether the text generated during multiple rounds is accumulated in its entirety or only incrementally modified, making it difficult to guarantee text consistency between different rounds; in addition, text that existed before the start of the session and newly collected content in each round are often mixed in the same character stream, lacking clear boundary distinctions, which brings difficulties to subsequent processing. Summary of the Invention

[0005] This invention provides a structured dialogue method, apparatus, device, medium, and product for multi-turn speech content transformation, in order to solve the technical problems of chaotic information organization, unclear semantic roles, and poor text consistency between multiple turns in the prior art during multi-turn speech content transformation.

[0006] According to one aspect of the present invention, a structured dialogue method for multi-turn speech content transformation is provided, the method comprising: Generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtain historical optimized text received from the language processing service up to the end of the previous round; The text to be optimized, the instruction text, and the historical optimized text are arranged in a fixed order to form the structured data of the current round. The structured data of the current round and all previous rounds are then concatenated in round order to form structured session data. The fixed order is that the text to be optimized, the instruction text, and the historical optimized text are arranged in sequence. The structured session data is sent to the language processing service, so that the language processing service generates the optimized text for the current round based on the structured session data, and receives the optimized text for the current round returned by the language processing service.

[0007] According to another aspect of the present invention, a structured dialogue apparatus for multi-turn speech content transformation is provided, the apparatus comprising: The text acquisition module is used to generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and acquire historical optimized text received from the language processing service up to the end of the previous round. The structured session data generation module is used to assemble the text to be optimized, the instruction text, and the historical optimized text into structured data for the current round in a fixed order, and to concatenate the structured data of the current round and all previous rounds in round order to form structured session data; wherein, the fixed order is to arrange the text to be optimized, the instruction text, and the historical optimized text in sequence; An optimized text receiving module is used to send the structured session data to the language processing service, so that the language processing service generates optimized text for the current round based on the structured session data, and receives the optimized text for the current round returned by the language processing service.

[0008] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of the present invention.

[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method described in any one of the present invention.

[0010] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the present invention.

[0011] The beneficial effects of this invention are as follows: Firstly, by generating the text to be optimized based on the speech text recognized in the current round, generating the corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtaining the historical optimization text received from the language processing service up to the end of the previous round, three types of information with different semantics—the original material to be optimized in this round, the user's verbal modification instructions, and the previously accumulated optimization results—are generated and independently carried. Thus, each round of structured conversation data sent to the language processing service explicitly distinguishes these three types of content. The language processing service no longer needs to infer boundaries from overlapping text, thereby accurately identifying user intent and improving instruction compliance and interaction efficiency.

[0012] Secondly, by "combining the text to be optimized, the instruction text, and the historical optimized text into structured data for the current round in a fixed order, and then concatenating the structured data from the current round and all previous rounds in round order to form structured conversation data," the complete cumulative optimized text up to the end of the previous round (i.e., the historical optimized text) and the new information from the current round are incorporated into the structured conversation data. This historical optimized text itself represents all the conclusions from previous rounds, rather than differences or patches, ensuring that the language processing service performs calculations based on the global full text when generating the optimized text for the current round. Therefore, the optimization result for each round is a cumulative full text, effectively avoiding inconsistencies in terminology and style caused by processing only incremental information, and ensuring text coherence across multiple rounds.

[0013] Thirdly, through the step of "sending structured conversation data to the language processing service," the sent structured conversation data consists only of the text to be optimized, the instruction text, and the historical optimized text, and does not contain any text that existed before the start of the conversation. If such text exists, it cannot be mixed into the round-organized data body and must be transmitted through a separate channel, thus forcibly separating the static base before the conversation from the dynamic increments within the round. As a result, the language processing service can clearly distinguish which part is the content to be collected iteratively round by round and which part is the initial text used as background reference, avoiding ambiguity of boundaries and semantic interference.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart of a structured dialogue method for multi-turn speech content transformation provided in Embodiment 1 of the present invention; Figure 2 A flowchart of another structured dialogue method for multi-turn speech content transformation provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of a structured dialogue device for multi-turn speech content transformation provided in Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device that implements the multi-turn speech content transformation structured dialogue method according to embodiments of the present invention. Detailed Implementation

[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0018] It should be noted that the terms "to be optimized," "historical optimization," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0019] Example 1 Figure 1This is a flowchart of a structured dialogue method for multi-turn speech content transformation provided in Embodiment 1 of the present invention. This embodiment is applicable to scenarios where the text to be optimized, the instruction text, and the historical optimized text in multi-turn interactions are organized into structured conversation data. This method can be executed by a structured dialogue device for multi-turn speech content transformation, which can be implemented in hardware and / or software, such as using a client. Figure 1 As shown, the method includes: S101. Generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtain the historical optimized text received from the language processing service up to the end of the previous round.

[0020] The current round refers to the interactive operation currently being performed during the multi-round voice content transformation process. Each round is numbered sequentially according to time to distinguish the interactive content and data ownership between different rounds. The current round is the benchmark for the client to construct the requested data, determining the source of the text to be optimized, the generation of the instruction text, and the selection range of historical optimization text.

[0021] The recognized speech-text refers to the original text content obtained after the user inputs the speech signal through audio acquisition devices such as microphones during this round of interaction, and is processed by automatic speech recognition technology. This text retains the original expression of the user's speech and may contain colloquial vocabulary, grammatical errors, or repetitive sentences, serving as the basic material for subsequent text optimization.

[0022] The text to be optimized refers to the original text generated directly from the recognized speech text, which has not yet been optimized by the language processing service. This text, as the core processing object of this round of optimization, carries the main content that the user hopes to have polished, rewritten, corrected, or styled in this round. In the context of multi-round interactions, the text to be optimized typically represents the incremental information from the user's new utterance in this round.

[0023] Optimization instructions are verbal descriptions provided by users during this interaction, instructing the language processing service on how to modify, constrain, or organize the text to be optimized. Optimization instructions can be expressed in natural language, such as "consistently use English abbreviations for technical terms," ​​"shorten to 300 words," or "make the tone more formal." Their core function is to clarify the user's specific needs for text transformation, rather than providing the text material to be optimized.

[0024] Instruction text refers to the text format generated based on optimization instructions, used to convey the user's modification intentions within structured data. This text is semantically equivalent to the optimization instructions, but undergoes necessary formatting (e.g., removing colloquial filler words and standardizing expression) to make it more suitable for parsing and execution by language processing services. The existence of instruction text allows the server to accurately distinguish between "what material the user said" and "how the user wants to modify that material."

[0025] "Up to the end of the previous round" refers to the moment when the interaction of the previous round was completed before the start of the current round. At this point, the language processing service has completed processing the request from the previous round and returned the corresponding optimization results to the client. This time boundary is used to define the complete scope of historical optimized text, ensuring that the client can obtain all the optimization conclusions that have been solidified up to the end of the previous round when constructing the structured data for the current round.

[0026] Language processing services refer to computational services capable of semantic-level understanding, generation, or transformation of text. Examples include text polishing, expansion, summarization, style transfer, and grammar correction services based on large language models. This service receives structured conversation data from clients, parses the text to be optimized, the instruction text, and the historical optimized text, performs semantic processing on the text to be optimized and the historical context according to the requirements of the instruction text, and returns the optimized text result. Language processing services can be deployed on cloud servers or run locally.

[0027] Historical optimized text refers to the complete cumulative text received and saved by the client from the language processing service up to the end of the previous round, after optimizing the content from all previous rounds. This text is not a difference or patch relative to earlier rounds, but rather a full-text snapshot containing all optimization conclusions from the first round to the previous round. When constructing the structured data for the current round, historical optimized text is included in the request as established optimization results. This allows the language processing service to reason based on the global history when generating the output for the current round, thereby maintaining terminological consistency and stylistic coherence, and supporting cross-paragraph reference resolution and structured editing.

[0028] In one implementation, the client continuously listens to the user's voice. When the end of voice input is detected (e.g., silence timeout or manual triggering), the client sends the collected voice data to the ASR engine and receives the returned recognized text. The client performs semantic analysis on the recognized text: if the recognized text contains explicit modification requirements (such as "change to," "add," "delete," etc.), the client treats it as an optimization instruction and generates corresponding instruction text; the remaining part is treated as text to be optimized. If the recognized text does not contain instruction words, the entire recognized text is treated as text to be optimized, and no instruction text is generated for the current round. Simultaneously, the client reads the optimization results received and saved from the language processing service up to the end of the previous round from local storage as historical optimized text (if it is the first round, the historical optimized text is empty).

[0029] For example, in the first round, the user utters "Development of Artificial Intelligence". The client generates the text to be optimized, "Development of Artificial Intelligence", with no instruction text and the historical optimized text is empty. In the second round, the user utters "Add medical images". The client generates the text to be optimized, "Development of Artificial Intelligence", with the instruction text "Add medical images", and reads the historical optimized text returned from the first round, "AI will develop in the fields of medicine and education", from storage.

[0030] In another implementation, the client continuously receives user speech streams and performs ASR recognition in real time. The client maintains an incremental buffer, determining the end of the current round whenever a semantic boundary (such as sentence-ending punctuation, obvious transition words, or preset instruction trigger words) is detected. At this point, the client analyzes the accumulated recognized text in the buffer: if the content contains instruction trigger words, the trigger words and their subsequent descriptions are extracted as optimized instructions, generating corresponding instruction text, with the remaining portion serving as text to be optimized; if not, all text is used as text to be optimized, and no instruction text is generated. Simultaneously, the client retrieves historical optimized text received and saved from the language processing service up to the end of the previous round from local storage.

[0031] For example, a user repeatedly says, "Write an article about climate change. Add agricultural impacts." After the first paragraph, the client generates the text to be optimized, "Write an article about climate change," with no instruction text and the historical optimized text is empty. In the second paragraph, the instruction trigger word "add" is detected, and the client generates the instruction text "Add agricultural impacts." The text to be optimized can be empty (or retain the context), and the client retrieves the historical optimized text returned from the first round, "Increased extreme weather, sea level rise," from storage.

[0032] S102. The text to be optimized, the instruction text, and the historical optimization text are combined into the structured data of the current round in a fixed order, and the structured data of the current round and all previous rounds are spliced ​​together in round order to form structured conversation data.

[0033] In this context, "fixed order" refers to the consistent order in which the text to be optimized, the instruction text, and the historical optimized text appear in a single round of structured data. In this embodiment, the fixed order is the sequential arrangement of the text to be optimized, the instruction text, and the historical optimized text. This fixed order ensures a shared understanding of the data structure between the client and the server. During parsing, the server can directly identify the semantic roles of each part based on this order, without requiring additional formatting tags or field names.

[0034] The structured data for the current round refers to the data unit formed by combining the text to be optimized, the instruction text (if any), and the historical optimization text, arranged in a fixed order, for the currently processed round of interaction. This structured data encapsulates the user input and historical optimization results of this round, representing the information that needs to be passed to the language processing service in this round of interaction. The structured data for each round exists independently and serves as the basic element for constructing a larger scope of structured conversation data.

[0035] "All previous rounds" refers to all interaction rounds completed before the current round. For example, if the current round is the third round, then "all previous rounds" includes the first and second rounds. When constructing structured session data, it is necessary to include all structured data from the current round and all previous rounds to ensure that the language processing service can obtain complete global historical information.

[0036] Round-by-round concatenation refers to linking structured data from different rounds sequentially according to their round numbers, from smallest to largest, to form a continuous sequence. No additional delimiters are inserted during the concatenation process (or only delimiters agreed upon by the protocol are used), and the structured data within each round maintains its original fixed order. The concatenated data retains the chronological relationship between historical and current rounds, allowing the server to trace back the input and output of any round.

[0037] Structured conversation data refers to a complete data volume formed by concatenating the structured data of the current round and all previous rounds in round-by-round order. This data volume contains all interaction information from the first round to the current round (the text to be optimized, the instruction text, and the historical optimization text for each round), and is represented in a uniform serialization format (such as tagged plain text or JSON). Structured conversation data is the request body sent by the client to the language processing service. After parsing this data, the server can obtain the complete multi-round dialogue context, thereby generating the current round's optimization text consistent with the global history.

[0038] In one implementation, the client maintains a round list in memory to store the structured data generated in each round in ascending order of round number. After preparing the text to be optimized, the instruction text (if any), and the historical optimized text for the current round, the client first assembles them into the structured data for that round in a fixed order (i.e., text to be optimized first, then instruction text, and finally historical optimized text). Then, the client appends this structured data for the current round to the end of the round list. Finally, the client iterates through the round list (from the first round to the current round), sequentially concatenating the structured data from each round into a complete string, which constitutes the structured session data.

[0039] For example, assume we are currently in the second round. The structured data from the first round is "[To be optimized: Artificial Intelligence][Instruction:][History: Empty]" (this is just an illustration; the actual format can be any convention). In the second round, the client generates the text to be optimized, "Machine Translation," the instruction text, "Add Example," and the historical optimization text, "AI in Healthcare and Education Development." The client assembles the second round of structured data in a fixed order: "[To be optimized: Machine Translation][Instruction: Add Example][History: AI in Healthcare and Education Development]." This is then appended to a list, resulting in the list [First Round Data, Second Round Data]. The client concatenates these into "First Round Data + Second Round Data" as the structured session data.

[0040] In another implementation, at the start of each round, the client holds a cumulative string that records the structured session data concatenated up to the end of the previous round (i.e., the sequential concatenation of all structured data from the first round to the previous round). After the client has prepared the text to be optimized, the instruction text (if any), and the historical optimization text for the current round, it temporarily assembles these three elements into the structured data for the current round in a fixed order (text to be optimized, instruction text, historical optimization text). Then, the client directly appends the structured data for the current round to the end of the cumulative string. After appending, the content of the cumulative string becomes the complete structured session data from the first round to the current round. The client directly uses this cumulative string as the structured session data for this request.

[0041] For example, after the first round, the accumulated string is "First Round Structured Data". In the second round, the client generates the text to be optimized, "Machine Translation", the instruction text, "Add Examples", and the historical optimization text, "AI in Healthcare and Education Development". These are arranged in a fixed order: "To be optimized: Machine Translation | Instruction: Add Examples | History: AI in Healthcare and Education Development" (illustrated using separators). The client appends this string to the end of the accumulated string, resulting in the new accumulated string: "First Round Structured Data + Second Round Structured Data". This is the updated structured session data.

[0042] In this embodiment, the text to be optimized, the instruction text, and the historical optimized text in the structured data are arranged sequentially. Specifically, the text to be optimized is placed first, so that the language processing service can obtain the core spoken material of the user's current turn when parsing the structured conversation data; the instruction text is placed second, so that the language processing service can immediately obtain the user's modification requirements for the material after understanding the core material; and the historical optimized text is placed last, as a supplementary historical context.

[0043] This sequential design aligns with the cognitive logic of natural language processing: "first understand the main content, then receive modification instructions, and finally refer to historical conclusions." This facilitates the language processing service's accurate understanding of user intent during multi-turn interactions, improving the coherence and consistency of the generated results. Simultaneously, this sequence allows the language processing service to parse the semantic content of each part sequentially without relying on additional field names or tags, reducing parsing complexity and improving the efficiency of streaming processing.

[0044] S103. The structured conversation data is sent to the language processing service so that the language processing service generates the optimized text for the current round based on the structured conversation data, and receives the optimized text for the current round returned by the language processing service.

[0045] The optimized text for the current round refers to the optimized result text returned to the client by the language processing service after semantic understanding and text generation processing based on the structured conversation data sent by the client. This text is generated jointly based on the text to be optimized in the current round, the instruction text for the current round (if any), and the historical optimized text up to the end of the previous round. The optimized text for the current round is the final output content that the client can use to display, store, or use as the historical optimized text for the next round after the completion of this round of interaction.

[0046] In one implementation, the client establishes a Hypertext Transfer Protocol (HTTP) connection with the language processing service and declares acceptance of streaming responses in the request header. The client sends structured session data as the request body to the language processing service. Upon receiving the request, the language processing service begins generating optimized text for the current round and returns the text fragments one by one in a streaming manner. The client listens for server push events and appends each received fragment to a buffer; when it receives an end signal, the client assembles the complete content in the buffer into optimized text for the current round.

[0047] For example, the client sends structured session data to a language processing service, which returns streaming fragments: "Today", "Weather", "Sunny". The client receives and concatenates these fragments sequentially to obtain the optimized text for the current round: "Today's weather is sunny".

[0048] In another implementation, the client and the language processing service pre-establish a long-lived web socket connection. The client encapsulates structured session data into a single web socket message and sends it to the language processing service. During processing, the language processing service pushes various fragments of optimized text to the client in real time via the same web socket connection as multiple messages. Upon receiving each message, the client parses the text fragment and concatenates it into a buffer. When it receives a completion message, the client uses the complete content in the buffer as the optimized text for the current round.

[0049] For example, the client sends structured session data via a web socket. The language processing service returns three messages: the first is "climate change", the second is "causing", and the third is "sea level rise". The client concatenates these messages to obtain the optimized text for the current round: "Climate change causes sea level rise".

[0050] The beneficial effects of the embodiments of the present invention are as follows: Firstly, by generating the text to be optimized based on the speech text recognized in the current round, generating the corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtaining the historical optimization text received from the language processing service up to the end of the previous round, three types of information with different semantics—the original material to be optimized in this round, the user's verbal modification instructions, and the previously accumulated optimization results—are generated and independently carried. Thus, each round of structured conversation data sent to the language processing service explicitly distinguishes these three types of content. The language processing service no longer needs to infer boundaries from overlapping text, thereby accurately identifying user intent and improving instruction compliance and interaction efficiency.

[0051] Secondly, by "combining the text to be optimized, the instruction text, and the historical optimized text into structured data for the current round in a fixed order, and then concatenating the structured data from the current round and all previous rounds in round order to form structured conversation data," the complete cumulative optimized text up to the end of the previous round (i.e., the historical optimized text) and the new information from the current round are incorporated into the structured conversation data. This historical optimized text itself represents all the conclusions from previous rounds, rather than differences or patches, ensuring that the language processing service performs calculations based on the global full text when generating the optimized text for the current round. Therefore, the optimization result for each round is a cumulative full text, effectively avoiding inconsistencies in terminology and style caused by processing only incremental information, and ensuring text coherence across multiple rounds.

[0052] Thirdly, through the step of "sending structured conversation data to the language processing service," the sent structured conversation data consists only of the text to be optimized, the instruction text, and the historical optimized text, and does not contain any text that existed before the start of the conversation. If such text exists, it cannot be mixed into the round-organized data body and must be transmitted through a separate channel, thus forcibly separating the static base before the conversation from the dynamic increments within the round. As a result, the language processing service can clearly distinguish which part is the content to be collected iteratively round by round and which part is the initial text used as background reference, avoiding ambiguity of boundaries and semantic interference.

[0053] The applicant discovered that in existing multi-turn dialogue schemes based on a general chat interface, historical messages are transmitted as alternating lists of user and assistant roles or as plain text concatenations, without explicitly recording the complete cumulative optimized text up to the end of the previous turn at the protocol layer. When a user makes a referential request in the current turn involving content from previous turns, such as "align the second paragraph with the conclusion," the language processing service lacks a reliable global view because the protocol does not carry the complete preceding context and turn boundaries, making it unable to accurately understand the object the user is referring to and its contextual relationships. Specifically, the historical records received by the server lack complete cumulative optimized text from the first turn to the previous turn, resulting in decreased quality of referential resolution and structural editing when processing referential instructions such as cross-paragraph structural adjustments and unified modifications of multiple sentences, easily leading to offsetting of modification positions or semantic contradictions.

[0054] To address this deficiency, in this embodiment, the historical optimized text can optionally be the complete cumulative optimized text up to the end of the previous round. The complete cumulative optimized text includes a full-text cumulative snapshot of all optimized texts from the first round to the previous round.

[0055] In one implementation, before the start of a multi-round session, the client initializes an array to store the complete cumulative optimized text received in each round in ascending order of round number. In the first round of interaction, the client combines the text to be optimized generated from the speech text recognized in the current round with user-provided optimization instructions (if any) into structured data. Since there is no historical optimized text up to the end of the previous round, this field is empty. After processing, the language processing service returns the optimized text for the current round. The client stores this optimized text as the complete cumulative optimized text for the first round in the array and records the corresponding round number as 1.

[0056] At the start of the second round, the client generates text to be optimized based on the speech text recognized in the current round, generates corresponding instruction text based on the optimization instructions provided by the user in the current round, and then reads the optimized text with round number 1 from the array as the historical optimized text received from the language processing service up to the end of the previous round. This historical optimized text is the full-text cumulative snapshot from the first round to the first round. The client assembles the structured data for the second round in the order of the text to be optimized, the instruction text, and the historical optimized text, and concatenates it with the structured data from the first round before sending it to the language processing service. In each subsequent round, the client reads the optimized text stored in the previous round from the array as the historical optimized text, thus ensuring that the language processing service always transmits a full-text cumulative snapshot containing the conclusions of all previous rounds.

[0057] For example, in the first round: the user states "the development of artificial intelligence". The client returns the optimized text "the development of AI in the fields of healthcare and education", which is stored as the complete cumulative optimized text for round 1.

[0058] Round 2: User verbally states "refine education and add online learning." The client reads the optimized text from Round 1 as historical optimized text, and the language processing service returns "AI development in the fields of healthcare and education (online learning)" based on the accumulated content of this full text.

[0059] Round 3: User verbal description of "further impact on employment". The client reads the optimized text from Round 2, and the server returns "AI is developing in the fields of healthcare and education (online learning) and has a profound impact on employment".

[0060] The advantages of this optional embodiment are as follows: By limiting the historical optimization text to a cumulative snapshot of all optimized texts from the first round to the previous round, the structured session data sent to the language processing service in each round includes complete optimization conclusions from all previous rounds. This allows the language processing service to have a globally consistent contextual view when handling user referential requests involving content from previous rounds (such as "align the second paragraph with the conclusion" or "unify the above terms"). It can accurately resolve the object the user is referring to and its position in the full text, thus avoiding referential resolution errors, positional shifts, or semantic contradictions caused by only transmitting fragments or difference updates. This solves the technical problem of difficult cross-paragraph referential resolution caused by the lack of a globally cumulative context in existing technologies.

[0061] Optionally, the rounds in the structured session data are arranged in ascending order of round number, and the text to be optimized, the instruction text, and the historical optimization text within each round are arranged in a fixed order.

[0062] The round number refers to a unique identifier assigned to each round in a multi-round interaction, typically starting from 1 and incrementing. The round number is used to distinguish structured data from different rounds, so that the client can determine the order of each round when piecing them together, and also facilitates the server in tracing the content of each round when processing and logging.

[0063] Ascending order arrangement: This refers to placing the structured data from each round in ascending order of round number when concatenating structured conversation data (i.e., round 1, round 2, round 3, etc.). This ascending order ensures the historical temporality, allowing the language processing service to understand the interaction process in the actual chronological order of events, thus maintaining contextual consistency.

[0064] In one implementation, the client stores a corresponding round number in memory for each round and records this number when generating the structured data for the current round. When structured session data needs to be concatenated, the client first retrieves the structured data for the current round and all previous rounds, extracting them one by one in ascending order of round number. For each round, the client then arranges the three parts within that round in a fixed order: the text to be optimized, the instruction text, and the historical optimized text. After sequentially concatenating the arrangement results of all rounds, structured session data that satisfies the condition of increasing round numbers and a fixed internal order is obtained.

[0065] For example, assume two rounds of interaction have been completed. The first round, numbered 1, has the following structured data order: text to be optimized A, instruction text (empty), and historical optimization text (empty). The second round, numbered 2, has the following structured data order: text to be optimized B, instruction text C, and historical optimization text D. The client retrieves data from round 1 in ascending order, then from round 2, and concatenates them to obtain the structured session data: "(round 1: A + empty + empty) + (round 2: B + C + D)", where each round has a fixed internal order.

[0066] The advantages of this optional embodiment are as follows: Firstly, in the structured conversation data, each round is arranged in ascending order of round number, and the text to be optimized, the instruction text, and the historical optimization text within each round are arranged in a fixed order. This means that the language processing service does not need to additionally identify the round boundaries or the order of internal fields during parsing, and can directly read them in the agreed order, reducing parsing judgment logic and lowering parsing complexity and error probability.

[0067] Secondly, the data is arranged in ascending order of round numbers to ensure that all structured data from the first round to the current round is arranged in the chronological order of their occurrence. When processing the current round, the language processing service can clearly understand the sequential relationship between each round, avoiding semantic understanding errors caused by disordered order and ensuring the correct temporal sequence of multi-round interactions.

[0068] Thirdly, after generating the structured data for the current round, the client only needs to append it to the end of the pre-assembled historical data to form the updated structured session data, without needing to rearrange or adjust the order of the historical data. This incremental concatenation method reduces client memory operations and data copying overhead, improving client operating efficiency.

[0069] Optionally, the language processing service is a text optimization service based on a large language model.

[0070] Among them, large language models refer to neural network models trained on massive amounts of text data, with a large number of parameters (usually billions or more), which can understand and generate natural language text and have the capabilities of context understanding, semantic reasoning, text generation, and instruction following.

[0071] Text optimization services refer to functional modules built upon large language models that provide semantic-level processing for input text. These services can automatically adjust the text to be optimized based on user-provided optimization instructions (such as polishing, error correction, rewriting, style transfer, expansion, and summarization), and return optimized results that match the user's intent. Text optimization services are typically provided externally via application programming interfaces (APIs).

[0072] The advantages of this optional embodiment are as follows: By employing a text optimization service based on a large language model, the structured conversation data sent by the client can be fully understood by the large language model. The large language model possesses powerful context learning and instruction following capabilities, accurately parsing the text to be optimized, instruction text, and historical optimization text in the structured conversation data. It then generates semantically coherent and stylistically consistent optimized text for the current round based on multi-turn historical information. Compared to traditional rule-based or small-model-based optimization methods, this improves terminology consistency and intent understanding accuracy in multi-turn interactions, while reducing reliance on manually written rules or style templates, enhancing the system's generalization ability and applicable scenarios. The client does not need to concern itself with the internal implementation details of the service; it only needs to organize the structured conversation data according to the prescribed format to obtain high-quality optimization results, reducing the development complexity of the client.

[0073] Optionally, after retrieving the historical optimized text received from the language processing service up to the end of the previous round, the process may also include: Determine whether the historical optimized text is the complete accumulated optimized text up to the end of the previous round; if so, use the historical optimized text as part of the structured data of the current round; if not, combine and reconstruct the historical optimized text with the optimized text in the structured data of the previous round and all previous rounds in round order to generate the complete accumulated optimized text as the corrected text, and use the corrected text as part of the structured data of the current round.

[0074] The fully accumulated optimized text refers to the complete text returned by the language processing service from the first round of multi-round interaction to the end of a certain round, containing the optimization results of all rounds prior to that round. This text is not an increment or patch relative to the previous round, but a self-contained full-text snapshot that can serve as a complete contextual reference in subsequent rounds.

[0075] Content splicing and merging reconstruction refers to the process where, when the historical optimized text is not a complete cumulative optimized text (e.g., only difference updates have been received), the client needs to concatenate the historical optimized text with the optimized text from the structured data of the previous round and all rounds prior, according to the chronological order of the rounds. During the concatenation process, potential overlaps or conflicts (e.g., duplicate modifications at the same location) need to be eliminated, and the modifications from different rounds need to be consistently integrated to ultimately generate a complete, uninterrupted, and consistent cumulative optimized text.

[0076] Corrected text refers to the standardized, complete, cumulative optimized text generated through content splicing, merging, and reconstruction operations. This text replaces the original incomplete historical optimized text and serves as a component of the structured data for the current round. The introduction of corrected text ensures that regardless of whether the language processing service returns complete cumulative content or differential content, the client can provide complete optimized text in a uniform format to subsequent rounds.

[0077] In one implementation, after retrieving the historical optimized text received from the language processing service up to the end of the previous round, the client first determines whether the historical optimized text is a complete, cumulative optimized text. The client can determine this by checking whether the historical optimized text contains all the content expected in the previous round (e.g., comparing text length or specific integrity markers). If yes, the client directly incorporates the historical optimized text as part of the current round's structured data. If no, the client retrieves the optimized text from the structured data of the previous round and all preceding rounds from local storage, sequentially reading the optimized text content of each round in ascending order of round number. The client concatenates these texts one by one, performing deduplication, conflict merging, and other merging and reconstruction operations during the concatenation process, ultimately generating a complete, cumulative optimized text as the corrected text. Then, the client incorporates this corrected text as part of the current round's structured data, replacing the original incomplete historical optimized text.

[0078] The advantages of this optional embodiment are as follows: Firstly, by determining whether the historical optimized text is a complete cumulative version, and if not, reconstructing and merging it to generate corrected text, the structured data of the current round is ensured to always contain the complete global optimization history. When processing the current round, the language processing service no longer relies on external states or additional communication; it can directly understand the entire preceding text based on the complete cumulative text, thus improving the stability and reliability of multi-round interactions.

[0079] Secondly, the client automatically converts incomplete data into standardized, complete, cumulatively optimized text through internal judgment and reconstruction mechanisms, thereby shielding the differences in language processing service implementation. Regardless of the output strategy adopted by the language processing service, the client can provide a consistent data format to subsequent rounds, enhancing the system's compatibility and scalability.

[0080] Thirdly, when the language processing service returns incomplete optimization results due to network issues or internal errors, the client can still obtain a logically complete corrected text by merging and reconstructing it with historical data. This fault-tolerance mechanism avoids disrupting the coherence of the entire multi-turn session due to a single abnormal output, thus improving the system's robustness.

[0081] Example 2 Figure 2 This is a flowchart of another structured dialogue method for multi-turn speech content transformation provided in Embodiment 2 of the present invention. It further optimizes and expands the above technical solution and can be combined with the various optional implementation methods described above. For example... Figure 2 As shown, the method includes: S201. Generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtain the historical optimized text received from the language processing service up to the end of the previous round.

[0082] S202. Arrange the text to be optimized, the instruction text, and the historical optimization text into structured data for the current round in a fixed order.

[0083] S203. For each round of structured data, obtain the text to be optimized, the instruction text, and the historical optimization text; add corresponding tags to the obtained text to be optimized, the instruction text, and the historical optimization text according to a predetermined format.

[0084] The predefined format refers to the naming rules and writing style of tags agreed upon in advance between the client and the server. For example, plain text tags with square brackets, such as [Text to be optimized], [Instruction text], [Historical optimization text], or other parsable fixed symbols. The predefined format ensures that the structured session data serialized by the client can be accurately parsed by the server without additional negotiation.

[0085] A tag is a unique identifier attached to each type of text (text to be optimized, instruction text, and historical optimization text). The tag includes the round number and the semantic category of the identified text. The tag itself does not participate in text optimization; it serves only as a boundary or classification criterion during parsing.

[0086] Semantic category refers to the semantic role that text plays in the current round. In this embodiment, there are three semantic categories: text to be optimized, instruction text, and historical optimization text. The division of semantic categories enables the language processing service to distinguish text content from different sources and purposes.

[0087] S204. The structured data after adding tags to each round are concatenated in the order of round number to form a plain text sequence with tags as structured session data.

[0088] The tagged plain text sequence refers to the entire string formed by adding corresponding tags to the text to be optimized, the instruction text, and the historical optimization text for each round, and then concatenating them in round number order. This sequence is in plain text form, does not rely on binary format or additional metadata, but retains structural information through tagging, so it can be read manually or automatically parsed by the server.

[0089] In one implementation, after constructing the structured data for each round, the client adds corresponding tags to each piece of text (text to be optimized, instruction text, and historical optimization text) within the current round. Specifically, the client first obtains the round number of the current round (e.g., the first round is numbered 1, and the second round is numbered 2). For the text to be optimized, the client generates a tag containing the round number and the semantic category "to be optimized," such as [1-to be optimized]; for the instruction text, it generates [1-instruction]; and for the historical optimization text, it generates [1-history]. The instruction text may be empty, in which case the tag may be omitted or remain empty. The client concatenates all the tagged text in round order, and also concatenates different rounds in ascending order of round number. Within the same round, the order of the text to be optimized, instruction text, and historical optimization text remains as described above. For example, in the first round: the round number is 1. The text to be optimized is "artificial intelligence development," the instruction text is empty, and the historical optimization text is empty. After adding tags, the client obtains: [1-To be optimized] Artificial intelligence development [1-Instruction][1-History]. Second round: Round number 2. The text to be optimized is "Add Medical," the instruction text is "Change 'development' to 'progress'," and the historical optimization text is the optimized text returned from the first round, "AI development in the medical field." After adding tags, the client obtains: [2-To be optimized] Add Medical [2-Instruction] Change 'development' to 'progress' [2-History] AI development in the medical field. The client concatenates the tagged sequences from the first and second rounds in round order to form structured session data: [1-To be optimized] Artificial intelligence development [1-Instruction][1-History][2-To be optimized] Add Medical [2-Instruction] Change 'development' to 'progress' [2-History] AI development in the medical field.

[0090] The advantages of this optional embodiment are as follows: By adding tags containing round numbers and semantic categories to the text to be optimized, the instruction text, and the historical optimized text for each round, the language processing service can directly identify the round and semantic role of each text segment by tag when parsing structured conversation data, without relying on external pattern matching or additional field descriptions. This self-describing serialization format reduces the parsing complexity on the server side and enhances cross-version compatibility of the protocol. Furthermore, because the round number is explicitly recorded in the tag, even if network transmission is out of order or partially retransmitted, the server can still reorder or verify the data using the round number, improving communication robustness. In addition, the tagged plain text sequence facilitates manual reading and log auditing; developers can directly view the tag content to locate problems in multi-round interactions, improving debugging efficiency.

[0091] Optionally, tagged plain text sequences constitute multi-turn session records that can be audited and replayed in turn-numbered order.

[0092] Multi-turn conversation recording refers to the persistent storage of tagged plain text sequences transmitted between the client and the language processing service during multiple rounds of voice content transformation interactions, forming a complete historical information and creating a traceable and parsable conversation archive. This record includes the round number of each round, the semantic category of each text, and its content, preserving the temporal integrity and structural consistency of the interaction process. It can be used for subsequent playback, debugging, compliance auditing, or model analysis.

[0093] In one implementation, after each structured session data construction is completed, the client simultaneously writes the structured session data (i.e., a sequence of plain text with tags) to local persistent storage (e.g., log files, databases, or system audit logs). The write operation includes the current timestamp and session identifier to distinguish different sessions. When auditing or replay is required, the client reads the stored file, parses out the text to be optimized, the instruction text, and the historical optimization text for each round, along with their corresponding tags, in round-numbered order, and can choose to resend it to the language processing service to reproduce the optimization process at that time, or simply display it to developers for problem localization.

[0094] The advantages of this optional embodiment are as follows: By persistently storing tagged plain text sequences as multi-turn conversation records, the multi-turn interaction process becomes auditable and replayable. Developers can trace the complete input and output of each interaction sequentially based on the turn number, facilitating the identification of errors in multi-turn speech content transformation (such as failed referential parsing or deviations in optimization results). Furthermore, the record format is non-proprietary plain text, independent of specific operating environments, enhancing the system's debuggability and maintainability. In addition, for scenarios requiring compliance review (such as in the medical and legal fields), the complete conversation records can serve as valid proof of the interaction process, meeting regulatory requirements.

[0095] S205. Establish a communication connection with the language processing service; send structured session data as a request parameter to the language processing service; receive the optimized text of the current round returned by the language processing service in streaming or non-streaming mode.

[0096] The communication connection refers to the network transmission channel established between the client and the language processing service for bidirectional data exchange. Common forms of communication connections include those based on Transmission Control Protocol (TCP), Hypertext Transfer Protocol (HTTP), and WebSocket connections. Establishing a communication connection is a prerequisite for sending data and receiving responses.

[0097] Request parameters refer to the data content conforming to the service interface specification that the client attaches when sending a request to the language processing service. In this embodiment, the request parameters are structured session data. The server processes these parameters and returns the corresponding optimized text.

[0098] Streaming refers to a transmission method where the language processing service, while generating optimized text, does not wait for the entire content to be generated, but instead sends the generated text segments to the client piece by piece. The client can receive and process these segments in real time without waiting for the complete result.

[0099] Non-streaming refers to a transmission method where the language processing service returns the entire result to the client all at once after generating all the optimized text. After sending a request, the client needs to wait for the server to complete all processing before receiving the complete optimized text for the current round.

[0100] In one implementation, the client first selects a suitable communication protocol based on the network environment and the requirements of the language processing service, and establishes a communication connection with the language processing service. After the connection is established, the client encapsulates the structured session data into request parameters that conform to the service interface requirements (e.g., placed in the request body or as message data). The client then sends these request parameters to the language processing service through the established connection. Subsequently, the client handles two cases based on the server's response method: If the server uses streaming, the client continuously listens for data blocks on the connection, and immediately appends each received segment to the internal buffer until the end marker is received. Then, the complete content in the buffer is used as the optimized text for the current round.

[0101] If the server uses non-streaming transmission, the client waits for a one-time response, and after receiving the complete response, it directly uses it as the optimized text for the current round.

[0102] Finally, the client can decide whether to close the communication connection based on the actual scenario, such as maintaining a long connection for subsequent rounds or releasing resources in a timely manner.

[0103] For example, after establishing a web socket connection with the language processing service, the client sends structured session data as a text message. The server returns streaming fragments: "Today", "Weather", "Sunny". The client receives and concatenates these fragments sequentially to obtain the optimized text "Today's weather is sunny". If the server uses a non-streaming method, the client receives the complete text "Today's weather is sunny" all at once.

[0104] The advantages of this optional embodiment are as follows: Firstly, it supports both streaming and non-streaming transmission modes, allowing clients to choose or adapt different response modes based on their actual needs (such as real-time requirements, network bandwidth, and service capabilities). Streaming transmission allows users to see the results as they are generated, reducing the perceived waiting time; non-streaming transmission simplifies client processing logic and is suitable for short texts or low-latency scenarios.

[0105] Secondly, regardless of the transmission method used by the server, the client only needs to send the structured session data as a request parameter through the established communication connection, without needing to write differentiated parameter construction logic for different response modes. This unified encapsulation method reduces the implementation complexity of the client and facilitates switching between different transmission modes.

[0106] The applicant discovered that in the existing solution, when a user does not specify additional transformation rules in a given round, the system does not embed standard rules (such as removing filler words or correcting grammatical errors) in the request. Due to the lack of explicit placement of default instruction text, there is no unified default behavior agreed upon between the client and the language processing service, resulting in inconsistent optimization results for the same user across rounds within the same session, leading to a drifting user experience. Specifically, if a user only verbally describes the text to be optimized in a round without providing optimization instructions, the system cannot provide a clear optimization basis to the language processing service. The server can only rely on its own internal default rules, and the default rules differ between different services or versions, making the behavior in each round unpredictable and hindering users from obtaining a stable and consistent multi-round optimization experience.

[0107] To address this deficiency, this embodiment may optionally include: If the user does not provide optimization instructions in the current round, a default instruction text is generated; the text to be optimized, the default instruction text, and the historical optimization text are combined in a fixed order to form the structured data for the current round.

[0108] In this context, "no optimization instructions provided" means that in the current round, the user's dictated content does not contain any requests for text optimization. For example, the user only dictated the main text to be optimized without providing guidance such as "change to a more formal tone" or "add examples." In this case, the client cannot extract explicit optimization instructions from the dictated content, thus requiring the default mechanism to be enabled.

[0109] The default instruction text refers to a standardized instruction text automatically generated by the client when the user does not provide optimization instructions. This text serves to replace missing user instructions and guide the language processing service in optimizing the text. The default instruction text provides preset standard text transformation rules.

[0110] Standard text transformation rules refer to a set of predefined text optimization strategies applicable to general scenarios. These rules do not depend on specific user instructions but are built-in default behaviors on the client or server. Standard text transformation rules can include: correcting grammatical errors, removing duplicate and filler words, adjusting punctuation, standardizing terminology style, and simplifying long sentences. These rules serve as a safety net, ensuring that the model can still output optimized results of a certain quality when the user has not explicitly specified the direction of modification.

[0111] In one implementation, after completing the speech recognition for the current round and generating the text to be optimized, the client first checks whether the user provided optimization instructions in this round. The client can use natural language understanding technology to analyze and identify whether the text contains typical instruction words (such as "change to", "add", "delete", "adjust", "polish", etc.) or obvious sentence structures (such as "change...to...", etc.). If no instruction features are detected, it is determined that the user did not provide optimization instructions for the current round.

[0112] At this point, the client reads a set of preset standard text transformation rules from its local configuration or server-side preset rules, and converts these rules into natural language descriptions as default instruction text. Subsequently, the client combines the text to be optimized, the generated default instruction text, and the acquired historical optimized text into structured data for the current round, according to the fixed order described above.

[0113] For example, in the current round, the user states, "Artificial intelligence has great potential for future development." Analysis reveals that this sentence lacks instruction words such as "change to" or "add," indicating that no optimization instructions were provided. The client generates a default instruction text: "Please correct the text's grammar, remove filler words, and maintain the original meaning." Simultaneously, it retrieves historical optimized text (e.g., "AI in medical field" returned in the previous round). The client then constructs structured data in a fixed order: [Text to be optimized] "Artificial intelligence has great potential for future development" [Instruction text] "Please correct the text's grammar, remove filler words, and maintain the original meaning" [Historical optimized text] "AI in medical field," for subsequent processing.

[0114] In another implementation, the default directive text is not an internal component of the structured data for a specific round, but rather appears as an independent global preamble before the structured data for all rounds. Specifically, when generating structured session data, the client first inserts the default directive text and its corresponding identifier (e.g., [Default Directive]) at the very beginning of the serialization body, and then sequentially concatenates the structured data for the first round, the second round, and so on, up to the current round. The default directive text is independent of the text to be optimized, the directive text, and the historical optimized text for each round, and is not written into the structured data for any round.

[0115] The advantage of this approach is that the default rules are declared once in the header of the structured session data. The language processing service can pre-read the default instructions during parsing and apply them throughout the multi-turn session, without having to repeatedly receive the same default rules in each turn. Furthermore, the independent position of the global preamble makes the semantic boundary between the default rules and the turn data clear, facilitating log auditing and rule version management.

[0116] The advantages of this optional embodiment are as follows: By following the steps of "generating a default instruction text if the user does not provide optimization instructions in the current round; and assembling the text to be optimized, the default instruction text, and historical optimization texts into the structured data for the current round in a fixed order," the client proactively generates a default instruction text containing preset standard text transformation rules in rounds where the user does not provide optimization instructions. This default instruction text is then incorporated into the structured data as a replacement for the instruction text in the current round. Therefore, each request sent to the language processing service in each round contains clear optimization criteria, ensuring that the language processing service obtains uniform and predictable transformation rules regardless of whether the user provides specific instructions.

[0117] This design addresses the inconsistency in behavior between rounds caused by the lack of explicit default rules in existing technologies. Specifically, in existing solutions, when no user commands are provided, the language processing service relies solely on its internal default behavior. Differences in rules between different services or versions lead to style drift and quality fluctuations in optimization results across rounds within the same session. This solution proactively injects default command text on the client side, explicitly passing optimization rules to the language processing service. This ensures that all rounds (especially those without commands) use the same standard transformation rules (e.g., grammar correction, de-colloquialization), thereby eliminating the uncertainty of server-side default rules and significantly improving the consistency of optimization results and the stability of the user experience across multiple rounds of interaction.

[0118] Meanwhile, since the default instruction text and the user-provided optimized instructions occupy the same position in the structured data (i.e., both are the second component), the parsing logic of the language processing service does not need to distinguish the source of the instruction, which simplifies the processing flow on the server side and makes it easy for users to override the default behavior with specific instructions when needed, thus balancing flexibility and consistency.

[0119] Optional, also includes: Detect whether there is selected text before the start of a multi-round conversation; if so, extract the selected text as an independent context parameter; send the independent context parameter and structured conversation data together to the language processing service, so that the language processing service can use the independent context parameter as background text or the initial base to be rewritten, and generate the optimized text for the current round in combination with the structured conversation data.

[0120] The selected text refers to a piece of text that the user actively selects in the target application (such as a document editor, browser input box, instant messaging window, etc.) before the start of a multi-round conversation, through mouse dragging, keyboard shortcuts, or touch operations. For example, the user may want to rewrite, expand, or polish a certain piece of text.

[0121] Independent context parameters are parameters that are transmitted alongside structured session data and are independent of the round-based protocol. These parameters carry the selected text and are not written into any round of the structured session data. The existence of independent context parameters clearly separates the static pre-session data from the dynamic round-based data within the session at the transport layer.

[0122] Background text refers to the language processing service treating independent contextual parameters as supplementary reference information, without requiring the optimization result to be generated based on this text. Background text is used to provide additional context or knowledge to help the server better understand the user's intent, but the main body of the optimization result is still determined by the structured conversation data.

[0123] The initial base to be rewritten refers to the text on which the language processing service treats the independent context parameters as the direct object of this optimization. In other words, the optimization result should be modified, expanded, or refined based on this text. At this point, the text to be optimized in the structured conversation data may only provide incremental instructions or supplementary information, while the main content consists of the independent context parameters.

[0124] In one implementation, before the start of a multi-round session, the client first checks if there is any text already selected by the user in the current application. The client can obtain the selection content through accessibility interfaces provided by the operating system (such as clipboard listeners, selection detection APIs) or the application's built-in selection notification mechanism. If selected text is detected, the client copies it into memory and encapsulates it as a separate context parameter. This separate context parameter is not mixed with the structured data generated in subsequent rounds, but is treated as a separate field alongside the structured session data.

[0125] Once the user begins multiple rounds of interaction, the client generates structured data for the current round and concatenates it into structured session data. Subsequently, when the client sends a request to the language processing service, it includes the structured session data as the main request body, along with independent context parameters as additional parameters (e.g., placed in the HTTP request header, a separate form field, or a peer field of a JSON object).

[0126] Upon receiving a request, the language processing service interprets the independent context parameter as either background text or the initial base to be rewritten, depending on the server's specific configuration. If interpreted as background text, the server uses it only as supplementary context, and the optimization result is still primarily based on the text to be optimized in the structured session data. If interpreted as the initial base to be rewritten, the server uses this independent context parameter as the main operation object, combining the instruction text and historical optimized text in the structured session data for rewriting.

[0127] For example, a user selects the text "The company's revenue grew by 20% in 2023, mainly due to its new product line" in a document. This then initiates multiple rounds of voice interaction. In the first round, the user utters "Change 'the company' to 'our company'." The client generates structured session data (the text to be optimized is empty, the instruction text is "Change 'the company' to 'our company'", and the historical optimized text is empty), while simultaneously extracting the selected text as an independent context parameter. The client sends both to the language processing service. The server uses the independent context parameter as the initial base for rewriting, combining it with the instruction text to generate the optimized text for the current round: "Our company's revenue grew by 20% in 2023, mainly due to its new product line." The advantages of this optional embodiment are as follows: Firstly, by sending the detected selected text as an independent context parameter along with the structured session data to the language processing service, instead of mixing it into the round data, this decoupling avoids the ambiguity of boundaries and semantic interference caused by mixing the selected text with the round content, making it easier for the language processing service to process them separately.

[0128] Secondly, the independent contextual parameters can be interpreted by the language processing service as background text or the initial base to be rewritten, and the server can choose different processing strategies according to the specific scenario. In scenarios requiring a complete rewrite, they can be used as the initial base to be rewritten, and the optimized text in the current round is mainly generated based on this text; in scenarios where only the context needs to be referenced, they can be used as background text without affecting the main optimization direction. This flexibility expands the scope of application of the present invention.

[0129] Thirdly, the text actively selected by the user before the session usually represents the core content they are currently interested in. By passing the selected text as an independent context parameter, the language processing service can use more accurate material as the starting point for optimization, avoiding the redundant operation of the user having to re-speak the entire selected text in the first round, reducing the user's input burden and improving interaction efficiency.

[0130] Optionally, after receiving the optimized text for the current round returned by the language processing service, the following may also be included: Store the optimized text of the current round as historical optimized text; at the beginning of the next round, call the stored historical optimized text as the historical optimized text received up to the end of the previous round, and use it to construct the structured data for the next round.

[0131] In one implementation, after receiving the optimized text for the current round from the language processing service, the client first saves the optimized text for the current round to local persistent storage and explicitly marks its corresponding round number. When the next round begins, after generating the text to be optimized based on the speech text recognized in the current round and generating the corresponding instruction text based on the optimization instructions provided by the user in the current round, the client needs to retrieve the historical optimized text received from the language processing service up to the end of the previous round. At this time, the client searches for the record with the round number one minus the current round in local storage, reads the optimized text stored therein, and uses it as the historical optimized text received up to the end of the previous round. Subsequently, the client uses this historical optimized text, in a fixed order, to form the structured data for the current round along with the text to be optimized and the instruction text (if any), and continues with subsequent steps.

[0132] For example, in the first round, the client receives the optimized text "Today's weather is sunny" returned by the language processing service for the current round. The client stores this as historical optimized text and associates it with round number 1. At the start of the second round, the client generates the text to be optimized, "Tomorrow's weather," generates the instruction text "Maintain style consistency," and then calls the stored historical optimized text "Today's weather is sunny" from round 1 as the historical optimized text received up to the end of the previous round, to construct the structured data for the second round.

[0133] The advantages of this optional embodiment are as follows: Firstly, by storing the received optimization text of the current round as historical optimization text and recalling this stored historical optimization text at the start of the next round, the optimization results of each round can automatically become the input context for subsequent rounds. This recursive accumulation mechanism ensures the continuous transmission of optimization results in multiple rounds of interaction, eliminating the need for users to repeatedly verbally recite the results of previous rounds in subsequent rounds.

[0134] Secondly, since the historical optimized text is the original result returned directly from the language processing service and stored, rather than content generated or spliced ​​by the client, its content accurately reflects the final output of the server in the previous round. In subsequent calls, this avoids deviations that might be introduced by local client corrections or format conversions, ensuring that the historical optimized text passed to the language processing service is completely consistent with the server output, thus improving the reliability of multi-round interactions.

[0135] This embodiment also provides four alternative solutions as technical supplements: Alternative Solution 1: Use differential updates instead of full-text accumulation for historical optimized text.

[0136] In the main approach, the historical optimized text in the structured data for each round is the complete cumulative optimized text up to the end of the previous round. Alternatively, the client can receive differential updates relative to the previous round (e.g., a sequence of edit operations containing only modified fragments or a unified difference format) from the language processing service as the historical optimized text. In this case, after receiving the differential optimized text for the current round, the client needs to merge and reconstruct it with the historical optimized text from the structured data of the previous round to generate the complete cumulative optimized text for subsequent rounds.

[0137] This alternative reduces the amount of data transmitted per transaction and lowers bandwidth usage; however, the merging logic is more complex, potentially leading to merging conflicts. Furthermore, if the language processing service does not reference the complete preceding text when generating the difference, it may affect the overall coherence between multiple rounds. For scenarios requiring strong consistency in drafting, the full-text cumulative snapshot of the main solution is preferred; this alternative is suitable for situations with limited bandwidth or where a reliable collaborative editing environment is already in place.

[0138] Alternative Option 2: Use structured data formats instead of plain text sequences with labels.

[0139] In the primary approach, structured session data is presented as a plain text sequence with tags (e.g., [text to be optimized]...). Alternatively, clients can use structured encoding formats such as JSON (JavaScript Object Notation), ProtoBuf, or message packets to carry structured session data. Specifically, the client can organize the data from each round into an array, where each element is an object. Each object contains a round number, a text to be optimized field, a command text field, a historical optimization text field, and a default command text field (if any). The client then sends this structured data as a request parameter to the language processing service.

[0140] This alternative solution offers advantages such as strong typing, easy validation, and convenient internationalization and field expansion; however, it requires maintaining data schema version management and depends on a corresponding parsing library, making debugging less intuitive than with plain text. The tagged plain text sequence in the main solution is semantically equivalent to JSON, and can be interchanged or coexisted depending on the product's technology stack (e.g., using JSON internally and converting it to a tagged plain text sequence when exporting externally).

[0141] Alternative Option 3: Different ways of placing instruction text within rounds.

[0142] In the main scheme, the structured data for the current round is arranged in a fixed order: text to be optimized, instruction text, and historical optimization text. As an alternative, the following variations can be used: Pre-optimization: This type places the instruction text before the text to be optimized, i.e., the order is instruction text, text to be optimized, and historical optimization text. This variant is suitable for users who expect to "declare the modification rules first, then verbally state the main text." The server prioritizes obtaining the instructions during parsing and then processes the materials.

[0143] Embedded type: Instead of setting a separate instruction text field, the optimization instruction is embedded at the beginning of the text string to be optimized using a special delimiter (e.g., " / / instruction:"). The client merges the instruction and the text to be optimized into a single string before serialization, and the server splits them back into two logical fields during parsing. This variant reduces the number of fields in structured data but increases the risk of parsing ambiguity.

[0144] First-round instruction only: Instruction text is only generated in the first round of interaction. From the second round onwards, only the text to be optimized and the historical optimization text are generated, and no instruction text is generated. This variant reduces branching decisions in multi-round interactions and is suitable for scenarios where the optimization goal does not change after the first round, but flexibility is reduced.

[0145] The independent tag segments in the main scheme (i.e., fixed order and separate segments for instruction text) are most conducive to semantic role separation and log auditing, and are the recommended approach.

[0146] Alternative Option 4: Triggering and Overriding Strategy for Default Command Text.

[0147] In the main approach, when the user does not provide optimization instructions, the client generates default instruction text and incorporates it into the structured data of the current round in a fixed order. As an alternative, the following strategies can be adopted: Server-side hardcoding: The client does not generate default instruction text; instead, the language processing server has a built-in set of standard text transformation rules. When sending a request, the client only carries the text to be optimized and the previously optimized text. If the server detects a missing instruction text, it automatically applies the internal default rules. This approach reduces request length, but the rule versions between the client and server are prone to drift, leading to inconsistent processing behavior from the same client at different times.

[0148] Initial delivery, reuse in subsequent rounds: The default instruction text is included only in the structured data of the first round of interaction. In subsequent rounds, the client omits the default instruction text field, and the server continues to use the default rules received in the first round. This approach reduces request redundancy in subsequent rounds, but requires both parties to explicitly agree on the inheritance rules, and users cannot temporarily change the default behavior in intermediate rounds.

[0149] User profile overriding: The client allows users to customize default command text through configuration files or a settings interface. When generating default command text, the client prioritizes reading user-configured content; if no user configuration is provided, system-preset rules are used. This approach improves flexibility and personalization but increases the complexity of user configuration management.

[0150] The explicit default instruction text in the main scheme (i.e., generated and sent on demand each round) is superior in behavioral traceability and consistency experiments (A / B testing) and is recommended as the preferred implementation.

[0151] Example 3 Figure 3 This is a schematic diagram of a structured dialogue device for multi-turn speech content transformation provided in Embodiment 3 of the present invention. It is applicable to scenarios where the text to be optimized, the instruction text, and the historical optimized text in multi-turn interactions are organized into structured conversation data, such as... Figure 3 As shown, the device includes: The text acquisition module 31 is used to generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and acquire historical optimized text received from the language processing service up to the end of the previous round. The structured session data generation module 32 is used to assemble the text to be optimized, the instruction text, and the historical optimized text into structured data for the current round in a fixed order, and to concatenate the structured data of the current round and all previous rounds in round order to form structured session data; wherein, the fixed order is to arrange the text to be optimized, the instruction text, and the historical optimized text in sequence; The optimized text receiving module 33 is used to send the structured session data to the language processing service, so that the language processing service generates the optimized text for the current round based on the structured session data, and receives the optimized text for the current round returned by the language processing service.

[0152] Optionally, the historical optimized text is the complete cumulative optimized text up to the end of the previous round, and the complete cumulative optimized text includes a full-text cumulative snapshot of all optimized texts from the first round to the previous round.

[0153] Optionally, the structured session data generation module 32 is specifically used for: For each round of structured data, the text to be optimized, the instruction text, and the historical optimized text are obtained respectively. According to a predetermined format, corresponding tags are added to the obtained text to be optimized, the instruction text, and the historical optimized text; wherein, the tag includes the round number of the round to which it belongs and the semantic category corresponding to the identified text; The structured data with added tags for each round are concatenated in round number order to form a plain text sequence with tags, which is used as the structured session data.

[0154] Optionally, tagged plain text sequences constitute multi-turn session records that can be audited and replayed in turn-numbered order.

[0155] Optionally, the rounds in the structured session data are arranged in ascending order of round number, and the text to be optimized, the instruction text, and the historical optimization text within each round are arranged in the fixed order.

[0156] Optionally, the language processing service is a text optimization service based on a large language model; The optimized text receiving module 33 is specifically used for: Establish a communication connection with the language processing service; The structured session data is sent as a request parameter to the language processing service; The optimized text receiving module 33 is further configured to: Receive the optimized text for the current round returned by the language processing service in either streaming or non-streaming mode.

[0157] Optionally, the device further includes a corrected text generation module, specifically used for: Determine whether the historical optimized text is the complete cumulative optimized text up to the end of the previous round; If so, the historical optimized text will be included as part of the current round's structured data; If not, the historical optimized text and the optimized text in the structured data of the previous round and all previous rounds are spliced ​​and merged in round order to reconstruct the complete accumulated optimized text as the corrected text, and the corrected text is used as a component of the structured data of the current round.

[0158] Optionally, the device further includes a default instruction text generation module, specifically used for: If the user in the current round does not provide the optimization instructions, a default instruction text will be generated; According to the fixed order, the text to be optimized, the default instruction text, and the historical optimized text are combined to form the structured data for the current round; The default instruction text is used to provide preset standard text transformation rules.

[0159] Optionally, the device further includes an independent context parameter extraction module, specifically used for: Detect whether there is selected text before the start of a multi-round conversation; If it exists, the selected text will be extracted as an independent context parameter; The independent context parameters are sent together with the structured session data to the language processing service, so that the language processing service uses the independent context parameters as background text or the initial base to be rewritten, and generates the optimized text for the current round in combination with the structured session data; wherein, the independent context parameters are not written into any round of the structured session data.

[0160] Optionally, the device further includes a historical optimized text update module, specifically used for: Store the optimized text of the current round as historical optimized text; At the start of the next round, the stored historical optimized text is used as the historical optimized text received up to the end of the previous round to construct the structured data for the next round.

[0161] The structured dialogue device with multi-turn speech content transformation provided in this embodiment of the invention can execute the structured dialogue method with multi-turn speech content transformation provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0162] According to embodiments of this disclosure, embodiments of the present invention also provide an electronic device, a readable storage medium, and a computer program product.

[0163] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0164] like Figure 4As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0165] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0166] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as structured dialogue methods involving multi-turn speech content transformation.

[0167] In some embodiments, the multi-turn speech content transformation structured dialogue method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the multi-turn speech content transformation structured dialogue method described above can be performed. Alternatively, in other embodiments, processor 41 can be configured to perform the multi-turn speech content transformation structured dialogue method by any other suitable means (e.g., by means of firmware).

[0168] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0170] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0172] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0173] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.

[0174] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0175] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method of structured dialogue for multi-turn speech content transformation, characterized in that, include: Generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and obtain historical optimized text received from the language processing service up to the end of the previous round; The text to be optimized, the instruction text, and the historical optimized text are arranged in a fixed order to form the structured data of the current round. The structured data of the current round and all previous rounds are then concatenated in round order to form structured session data. The fixed order is that the text to be optimized, the instruction text, and the historical optimized text are arranged in sequence. The structured session data is sent to the language processing service, so that the language processing service generates the optimized text for the current round based on the structured session data, and receives the optimized text for the current round returned by the language processing service.

2. The method of claim 1, wherein, The historical optimized text is the complete cumulative optimized text up to the end of the previous round. The complete cumulative optimized text contains a full-text cumulative snapshot of all optimized texts from the first round to the previous round.

3. The method of claim 1, wherein, The step of concatenating the structured data of the current round and all previous rounds in round order to form structured session data includes: For each round of structured data, the text to be optimized, the instruction text, and the historical optimized text are obtained respectively. According to a predetermined format, corresponding tags are added to the obtained text to be optimized, the instruction text, and the historical optimized text; wherein, the tag includes the round number of the round to which it belongs and the semantic category corresponding to the identified text; the structured data after adding tags to each round are concatenated in the order of the round number to form a plain text sequence with tags as the structured session data.

4. The method according to claim 3, characterized in that, The tagged plain text sequence constitutes a multi-round conversation record that can be audited and replayed in the order of the round numbers.

5. The method according to claim 1, characterized in that, In the structured session data, each round is arranged in ascending order of round number, and within each round, the text to be optimized, the instruction text, and the historical optimization text are arranged in a fixed order.

6. The method according to claim 1, characterized in that, The language processing service is a text optimization service based on a large language model; Sending the structured session data to the language processing service includes: Establish a communication connection with the language processing service; The structured session data is sent as a request parameter to the language processing service; The step of receiving the optimized text for the current round returned by the language processing service includes: Receive the optimized text for the current round returned by the language processing service in either streaming or non-streaming mode.

7. The method according to claim 1, further comprising, after obtaining the historical optimized text received from the language processing service up to the end of the previous round: Determine whether the historical optimized text is the complete cumulative optimized text up to the end of the previous round; If so, the historical optimized text will be included as part of the current round's structured data; If not, the historical optimized text and the optimized text in the structured data of the previous round and all previous rounds are spliced ​​and merged in round order to reconstruct the complete accumulated optimized text as the corrected text, and the corrected text is used as a component of the structured data of the current round.

8. The method according to claim 1, characterized in that, Also includes: If the user in the current round does not provide the optimization instructions, a default instruction text will be generated; According to the fixed order, the text to be optimized, the default instruction text, and the historical optimized text are combined to form the structured data for the current round; The default instruction text is used to provide preset standard text transformation rules.

9. The method according to claim 1, characterized in that, Also includes: Detect whether there is selected text before the start of a multi-round conversation; If it exists, the selected text will be extracted as an independent context parameter; The independent context parameters are sent together with the structured session data to the language processing service, so that the language processing service uses the independent context parameters as background text or the initial base to be rewritten, and generates the optimized text for the current round in combination with the structured session data; wherein, the independent context parameters are not written into any round of the structured session data.

10. The method according to claim 1, further comprising, after receiving the optimized text for the current round returned by the language processing service: Store the optimized text of the current round as historical optimized text; At the start of the next round, the stored historical optimized text is used as the historical optimized text received up to the end of the previous round to construct the structured data for the next round.

11. A structured dialogue device for multi-turn speech content transformation, characterized in that, The device includes: The text acquisition module is used to generate text to be optimized based on the speech text recognized in the current round, generate corresponding instruction text based on the optimization instructions provided by the user in the current round, and acquire historical optimized text received from the language processing service up to the end of the previous round. The structured session data generation module is used to combine the text to be optimized, the instruction text, and the historical optimized text into structured data for the current round in a fixed order, and to concatenate the structured data of the current round and all previous rounds in round order to form structured session data; wherein, the fixed order is to arrange the text to be optimized, the instruction text, and the historical optimized text in sequence; An optimized text receiving module is used to send the structured session data to the language processing service, so that the language processing service generates optimized text for the current round based on the structured session data, and receives the optimized text for the current round returned by the language processing service.

12. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to perform the method of any one of claims 1-10.

14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-10.