A data processing method and electronic device
Patent Information
- Application Number
- CN202610908183.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-10-27
AI Technical Summary
受各类内容推送时序不可控、标记语言(Markdown)解析渲染存在异步时差的影响,传统渲染方案存在明显缺陷
[0012]本公开提供的技术方案与现有技术相比具有如下优点:
Smart Images

Figure CN122986165A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a data processing method and an electronic device. Background Technology
[0002] AI dialogue systems commonly employ Server-Sent Events (SSE) streaming to achieve real-time output of agent responses. The terminal needs to render various types of streaming content, such as deep thinking text, main text, and structured cards, segment by segment. Traditional rendering solutions have significant drawbacks due to the uncontrollable timing of various content pushes and the asynchronous time difference in Markdown parsing and rendering. Lock-free rendering easily leads to overlapping and disordered content of different types, simple queue solutions are inefficient, and full-scale caching rendering completely loses the real-time streaming output effect. Existing technologies cannot simultaneously ensure the orderliness, real-time nature, and stability of content rendering, frequently resulting in overlapping content refreshes and repeated batch operations on the Document Object Model (DOM), ultimately causing page lag, unresponsiveness, and other problems, severely impacting the user's dialogue interaction experience. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure provides a data processing method and an electronic device.
[0004] In a first aspect, this disclosure provides an electronic device, comprising: a communicator configured to: in response to an input operation, send input information corresponding to the input operation to a server; receive a server push event carrying the processing result of the input information sent by the server; and a controller configured to: when the first streaming text and the pre-end flag of the streaming paragraph carried in the server push event are invalid, send the first streaming text into a page rendering channel for rendering and lock the page rendering channel; wherein the text type corresponding to the first streaming text includes either a deep thinking text fragment or a regular text fragment; when the page rendering channel is locked, store all received server push events in a cache queue; when the rendering of the first streaming text is completed, unlock the page rendering channel and retrieve target data from the cache queue; wherein the target data includes appended text corresponding to the first streaming text, or newly added text other than the first streaming text, wherein the text type of the appended text is consistent with the text type of the first streaming text, and the text type of the newly added text is inconsistent with the text type of the first streaming text.
[0005] Secondly, this disclosure provides a data processing method, comprising: responding to an input operation by sending input information corresponding to the input operation to a server; receiving a server push event carrying the processing result of the input information sent by the server; when the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, sending the first streaming text into the page rendering channel for rendering and locking the page rendering channel; wherein, the text type corresponding to the first streaming text includes either a deep thinking text fragment or a regular text fragment; when the page rendering channel is locked, storing all received server push events into a cache queue; when the rendering of the first streaming text is completed, unlocking the page rendering channel and retrieving target data from the cache queue; wherein, the target data includes appended text corresponding to the first streaming text, or newly added text other than the first streaming text, wherein the text type of the appended text is consistent with the text type of the first streaming text, and the text type of the newly added text is inconsistent with the text type of the first streaming text.
[0006] Thirdly, this disclosure provides a computer-readable storage medium, comprising: storing a computer program on the computer-readable storage medium, the computer program being executed by a controller using a data processing method as provided in any of the second aspects.
[0007] Fourthly, this disclosure provides a computer program product comprising a computer program that, when run on a computer, causes the computer to perform a data processing method as provided in any of the second aspects.
[0008] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on the first computer-readable storage medium. The first computer-readable storage medium may be packaged together with the controller of the electronic device, or it may be packaged separately from the controller of the electronic device; this disclosure does not impose any limitations on this.
[0009] The descriptions of the second, third, and fourth aspects in this disclosure can be referenced to the detailed description of the first aspect; and the beneficial effects described in the second, third, and fourth aspects can be referenced to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0010] In this disclosure, the names of the aforementioned electronic devices do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear under other names. As long as the functions of each device or functional module are similar to those of this disclosure, they fall within the scope of this disclosure and its equivalents.
[0011] These or other aspects of this disclosure will become more readily apparent in the following description.
[0012] The technical solution provided in this disclosure has the following advantages compared with the prior art: The electronic device provided in this disclosure, when a server push event carries first streaming text and the pre-end flag of the streaming paragraph is invalid, sends the first streaming text into the page rendering channel for rendering and locks the page rendering channel. During the page rendering channel lock period, all received server push events are stored in a cache queue. After the first streaming text is rendered, the page rendering channel is unlocked, and then appended text of the same type as the first streaming text and newly added text of different types are retrieved from the cache queue and rendered in a time-sharing manner. This avoids the problem of cross-contamination and disorder of multiple types of content caused by unlocked rendering. It not only retains the streaming real-time output effect of server push events, but also avoids the concentrated operation of the Document Object Model (DOM) caused by batch reading of cached data at one time, which alleviates page interaction lag. At the same time, it eliminates the time sequence disorder defect caused by the asynchronous time difference of Markdown parsing and rendering, and takes into account the orderliness of multi-type content rendering, the real-time streaming output, and the stability of page rendering. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0014] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 One of the schematic flowcharts of the data processing method provided in this disclosure embodiment; Figure 2 A second schematic flowchart illustrating the data processing method provided in this embodiment of the disclosure; Figure 3 The third schematic flowchart of the data processing method provided in the embodiments of this disclosure; Figure 4 A fourth schematic flowchart illustrating the data processing method provided in this embodiment of the disclosure; Figure 5 Fifth schematic flowchart of the data processing method provided in the embodiments of this disclosure; Figure 6 A flowchart illustrating the data processing method provided in this embodiment of the disclosure is shown in Figure 6. Figure 7 Seventh schematic flowchart of the data processing method provided in the embodiments of this disclosure; Figure 8Eighth schematic flowchart of the data processing method provided in the embodiments of this disclosure; Figure 9 A schematic diagram of the resulting electronic device provided in the embodiments of this disclosure; Figure 10 This is a schematic diagram of a chip system provided in an embodiment of this disclosure. Detailed Implementation
[0016] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0017] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0018] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0019] In some examples, the electronic devices provided in this disclosure include two types: one is a mobile terminal (such as a mobile phone) with a preset application installed, and the other is a computer terminal that can display a question-and-answer interactive interface that supports input operations.
[0020] In the following embodiments, a mobile phone is used as the execution subject for the data processing method provided in the embodiments of this disclosure to illustrate the method of the present application.
[0021] This application provides a data processing method, such as... Figure 1 As shown, the data processing method may include S11-S15.
[0022] S11. In response to an input operation, send the input information corresponding to the input operation to the server.
[0023] This invention provides a terminal streaming rendering control system adapted for intelligent question-and-answer interaction. It can be applied to terminal devices such as mobile phones and computers, and is used to perform orderly, stable, and error-proof rendering and display of streaming question-and-answer data returned by a server. The server possesses two question-and-answer response capabilities: deep thinking response capability and search query response capability. The terminal does not need to be aware of the server's internal computational logic; it only performs state management, content splicing, cache scheduling, and layered rendering on the streaming event data pushed by the server, realizing a fully visualized interactive intelligent question-and-answer process.
[0024] In some examples, sending the input information corresponding to the input operation to the server in response to an input operation can be implemented in a variety of ways, as follows: Users install a pre-installed application on their mobile phones and then bind it to a target home appliance (such as a refrigerator). The refrigerator can then be viewed on the device page of the pre-installed application. Users can then select the refrigerator on the device page to enter the device control page. This device control page includes at least one device control control and a Q&A control. When users need to query the refrigerator's historical information or usage records, they can select the Q&A control to enter the Q&A interactive interface. Afterwards, users input information in the Q&A interactive interface, and the mobile phone responds by sending the corresponding input information to the server.
[0025] Alternatively, users can install a pre-installed application on their phones. Then, on the device page of this application, they can select a virtual device control. After selecting the virtual device control, they can choose a virtual home appliance (such as an air conditioner) to simulate and bind it. The air conditioner will then appear on the device page of the pre-installed application. Users can then select the air conditioner on the device page to enter the device control page. This device control page includes at least one device control control and a Q&A control. When users need to query the air conditioner's historical information or usage records, they can select the Q&A control to enter the Q&A interaction interface. Then, they can input information in the Q&A interaction interface, and the phone will respond by sending the corresponding input information to the server. In both scenarios, the input triggering logic and information sending logic of the Q&A control are the same; only the type of device bound differs.
[0026] Alternatively, users can access a question-and-answer interactive interface on a computer terminal that supports input operations, and perform input operations on the input controls on the interface. In this case, the computer terminal responds to the input operation and sends the corresponding input information to the server.
[0027] In some examples, the aforementioned question-and-answer interaction interface can be a front-end AI dialogue page, comprising four core functional modules: the Message state machine module (Message class), the MessageContent model (MessageContent class), the MessagePair management module (MessagePair class), and the rendering layer components MessageItem / AgentAnswer / AIDeepContentItem. The MessagePair module encapsulates user messages and AI response messages into a question-and-answer pair structure, completes the initial state configuration of the AI message, and initiates an SSE streaming request. The Message state machine module (Message class) manages the entire lifecycle of a single AI response message, implementing message state definition and state transition, content array maintenance, content locking, cache queue management, and cache data consumption merging optimization. The MessageContent model, as the basic unit of the message content array, defines the type, content data, end marker, and separator marker for a single segment of content. The rendering layer components MessageItem, AgentAnswer, and AIDeepContentItem perform categorized rendering based on the current state of the message state machine and the message content array, and after the rendering operation is completed, they send a rendering completion signal back to the message state machine module via a callback function.
[0028] In some examples, an independent state machine is maintained for each AI response message through the Message state machine module instance. Five working states are preset: LOADING, DEEP_THINKING, ING, END, and ABORT. The meanings of each state are as follows: LOADING indicates the message has been created and the SSE request has been initiated but AI response data has not yet been received; DEEP_THINKING indicates the deep thinking state, which is only enabled when the deep thinking function is activated, representing that the AI is performing deep inference calculations; ING indicates the output state, representing that the AI is pushing response content such as the main text and supplementary information; END indicates the normal completion state, representing that all AI response content has been pushed; and ABORT indicates the aborted state, representing that the AI response process has been actively interrupted by the user or forcibly terminated due to network or service abnormalities.
[0029] In some examples, the complete state machine transition logic is as follows: When creating a MessagePair message pair and generating an AI response message instance, the initial state is configured according to the deepSeek switch parameter. When deepSeek is 1, the initial state is DEEP_THINKING; when deepSeek is 0, the initial state is LOADING. When deepSeek equals 1, an empty MessageContent item of type MARKDOWN_DEEP with isEnd=0 is pre-inserted into the message content array during the message creation phase for subsequent continuous addition of deep thinking and reasoning content. When the front-end AI dialogue page receives the first MSG event or APPENDIX event, the message state is switched from LOADING or DEEP_THINKING to ING. When the END event is received, the message state is switched from ING to END. When the ERROR event is received or the user clicks the stop button, the message is directly switched to ABORT. After the message state transitions to END or ABORT, the global flag isStop is set to true, and all SSE event data that arrives thereafter is discarded and no further parsing and rendering processing is performed.
[0030] In some examples, the `content` property of a single AI response message stores an array of several `MessageContent` objects. Each `MessageContent` object contains four types of fields: `type`, `content`, `isEnd`, and `needBeforeSplit`. `type` is a string used to distinguish the content type, including Markdown body text, MarkdownDeep deep thinking, appendix supplementary information, and end marker. `content` is a string or a structured object; text content stores Markdown strings, while supplementary information stores structured data. `isEnd` is a numeric marker: 0 indicates that the content segment is continuously updating, 1 indicates that the content segment has been output, and -1 indicates that the segment has been forcibly closed. `needBeforeSplit` is a numeric marker: 0 indicates that no separator line needs to be displayed before the content segment, and 1 indicates that a separator line needs to be rendered before the content segment.
[0031] S12, Receive a server push event from the server that carries the processing results of the input information.
[0032] In some examples, when a user selects the Deep Thinking control in the Q&A interface to activate the Deep Thinking feature, the phone executes the following interaction flow: The phone creates a MessagePair object and determines that the deepSeek flag is 1 (deep thinking branch is enabled). Before receiving a push event from the server, it displays the message "Deep thinking in progress..." on the Q&A interface and pre-inserts an empty MARKDOWN_DEEP content item. The phone continuously listens for push events from the server. If it receives a push event of type REASONING, it appends the thinking content to the pre-inserted MARKDOWN_DEEP content item.
[0033] When the phone receives a push event of type MSG (Message) from the server, the interface switches to the "Outputting" state. When an MSG event is received, the text content is appended. If an APPENDIX supplementary card push event is received simultaneously, the supplementary card data is stored in the cache queue while the interface is locked. After the front-end intelligent agent AI dialogue page finishes rendering and triggers the callback, the lock is released and the supplementary card data in the cache queue is consumed.
[0034] The subsequent session cleanup is handled in two branches: If the phone receives a session termination event (END or CLOSE) from the server, the interface displays a "Normal End" message; the phone closes all unrendered content, clears all cache queues, and displays the operation bar. If the phone receives an ERROR event, or the user manually clicks the stop control on the Q&A interaction interface, the interface displays a "Stopped" message. The phone distinguishes the reason for the stoppage by using the isUserAbort flag: when the flag is true, it means that the user has stopped the service actively, and "Stopped" is displayed; when the flag is false, it means that the service has encountered an error, and "Error" is displayed. In both scenarios, the entire cache queue is cleared and the global session stop flag is set.
[0035] Correspondingly, if the user has not enabled the DeepSeek function, the deepSeek flag is 0. After the phone creates a MessagePair message object, it directly displays "Searching..." to load the text. After receiving the MSG server push event, it also switches to the "Outputting" state. The subsequent processing logic for adding text, caching supplementary cards, and ending / abnormally terminating the session is completely consistent with the DeepSeek branch.
[0036] For example, when a user enables the Deep Thinking feature, the initial message state is DEEP_THINKING, and the terminal interface displays a "Deep Thinking..." waiting message. An empty MARKDOWN_DEEP content item is pre-inserted to receive the server's Deep Thinking streaming content. When the user does not enable the Deep Thinking feature, the initial message state is LOADING, and the terminal displays a loading waiting state. When the terminal receives the first main text event or supplementary information event from the server, the message state switches to ING (outputting), and the interface displays a "Outputting" message. When the terminal receives an END or CLOSE session termination event, the message state transitions to END (normal termination); when an ERROR event is received or the user manually clicks the stop control, the message state transitions to ABORT (aborted). After the message enters the END or ABORT final state, the terminal enables a global session stop flag, and all subsequent push event data is directly discarded and no longer processed.
[0037] S13. When the first-stream text and the pre-end flag of the streaming paragraph carried in the server push event are invalid, the first-stream text is sent to the page rendering channel for rendering, and the page rendering channel is locked. The text type corresponding to the first-stream text includes either a deep thinking text fragment or a main text fragment.
[0038] S14. When the page rendering channel is locked, store all received server push events in the cache queue.
[0039] S15. When the first stream of text rendering is complete, unlock the page rendering channel and retrieve the target data from the cache queue. The target data includes appended text corresponding to the first stream of text, or newly added text other than the first stream of text. The text type of the appended text is the same as the text type of the first stream of text, while the text type of the newly added text is different from the text type of the first stream of text.
[0040] In some examples, while continuously receiving SSE streaming events, the phone automatically distinguishes between content appending mode and new segment creation mode. If there is an unfinished end content item, the new data has the same type as the end content, the current content is not finished, and the new data has no premature end marker, then the new streaming text is directly appended to the end of the current content; otherwise, the current content segment is closed, a new content unit is created and added to the content array, and the rendering markers are updated. At the same time, the phone performs dedicated conversion logic for special auxiliary information, converting auxiliary text subtypes into one-time static main text content with separators, extracting and displaying recommendation-type auxiliary data, and discarding redundant original data to optimize the page display effect.
[0041] To address issues such as content corruption, jitter, and data loss caused by concurrent streaming rendering, the phone employs a core rendering channel locking and cache queue mechanism. When the phone detects a dynamic streaming rendering scenario, such as Deep Thinking or Main Text, without an early termination flag, it sets the rendering channel locking flag to true, entering a locked state. During the locking period, all newly added SSE event data is no longer directly rendered but is instead stored in a cache queue for orderly temporary storage, preventing conflicts from multi-threaded concurrent rendering.
[0042] The mobile phone uses the Document Object Model (DOM) rendering completion callback as the timing benchmark, precisely triggering the cache consumption process through step S142. When the page rendering channel completes the parsing of all document object models and view drawing corresponding to the current first-stream text, and triggers the rendering completion callback, the mobile phone accurately determines that the first-stream text rendering is complete, immediately unlocks the page rendering channel, and reads the target data from the cache queue. The target data includes the appended text and newly added text to be consumed in the queue. This mechanism uses the actual rendering completion status of the front-end AI dialogue page as the unlocking basis, avoiding content interleaving and disorder caused by logic preceding view rendering, and providing a precise timing foundation for subsequent cache merging and serial rendering.
[0043] The phone employs a "merge first, then render sequentially" optimization strategy for cached queue data, achieving standardized output of cached content through steps S150 and S151. After the first stream of text rendering is completed and the channel is unlocked, the phone executes S150: traversing the cache queue, merging consecutive, similar, and appendable fragmented text into a single complete piece of content, reducing page jitter caused by frequent small-segment rendering. The merged content is then sent to the rendering channel for rendering, and the page rendering channel is locked again. After any group of merged content has been rendered, the phone repeatedly executes S151: unlocking the rendering channel again, retrieving and merging the next group of consecutive, similar cached content, sending it to the rendering channel for rendering, and relocking it, repeating this process until the entire cache queue is consumed. Through this sequential merging rendering mechanism, it strictly ensures that only a single group of content is rendered at any given time, completely resolving issues such as disordered streaming segment rendering order, content fragmentation, and interface flickering.
[0044] To address the specific scenarios where segmented network address pushes can lead to broken links and incomplete display, the phone is configured with delayed splicing and rendering logic. When the first stream of text consists of segmented network address fragments and the corresponding pre-end flag of the stream segment is invalid, the phone actively locks the rendering channel and pauses rendering to prevent incomplete links from being displayed. The phone continuously reads appended text from the cache queue, splicing incomplete network address fragments segment by segment until a complete network address with a valid format and complete structure is formed. Only then is the entire network address sent to the rendering channel for rendering, balancing the real-time streaming output of ordinary text with the requirement for complete rendering of special link content.
[0045] The phone also achieves a smooth transition between old and new content in paragraph ending scenarios through step S18. During the process of rendering cached appended text segment by segment, if the pre-end flag of the streaming paragraph corresponding to the currently rendered appended text is valid, indicating that there is no further content to follow in the current paragraph of the same type, the phone immediately unlocks the rendering channel and reads the newly added text from the cache queue, entering the rendering process for the next type of content. This mechanism accurately identifies paragraph boundaries, avoiding rendering gaps caused by forcibly switching content before the paragraph ends, and achieving a seamless transition between appended content ending and new content continuation.
[0046] This embodiment sets three content end markers (0, 1, and -1) to adapt to the full rendering boundary, corresponding to content in progress, normal end, and forced termination, respectively. The forced termination state is used as a fallback for handling critical scenarios in streaming rendering. It can drive the rendering layer to ignore safety boundary checks, output all buffered content at once, and wait for the rendering completion callback to automatically return to the normal termination state before performing unlocking and cache consumption operations, ensuring the strictness of the rendering timing.
[0047] When the phone receives an END or CLOSE session termination event, it executes unified termination logic: updates the message status to END, iterates through the content array to close all unfinished content items, automatically fills blank scenarios with fallback text, clears the cache queue, resets the consumption index, and closes SSE requests. If an ERROR event is received or the user actively clicks the stop control, the message status is set to ABORT, all cached data is cleared, a global session stop flag is enabled, and user-initiated termination and service exceptions are distinguished, displaying "Stopped" and "Error" prompts respectively, thus achieving a complete session loop.
[0048] At the rendering collaboration level, the mobile phone achieves precise matching between content type and rendering components: in-depth thinking content corresponds to a dedicated in-depth thinking component, supporting collapse and expansion as well as time-consuming display; the main text content corresponds to the main text rendering component, compatible with streaming dynamic rendering and static rendering; and the supplementary structured information corresponds to the card component, enabling diversified display. After all components are rendered, they are synchronized to the state machine via callback, ultimately forming a full-link mobile streaming rendering system of "state machine state control - content segmentation determination - rendering channel locking - caching of the same type - serial sequential rendering - paragraph boundary switching - conversation closing fallback".
[0049] The data processing method provided in this disclosure relies on the server's deep thinking and search capabilities as its two basic response capabilities. Through a complete set of self-developed streaming rendering control mechanisms for mobile phones, it solves the defects of traditional intelligent question-and-answer streaming output, such as stuttering, content disorder, broken links, paragraph breaks, missing blank bottom lines, and no abnormal prompts. It greatly improves the stability, regularity, and user experience of the intelligent question-and-answer interactive interface.
[0050] As described above, the data processing method provided in this embodiment, upon receiving a server push event carrying first streaming text and with the streaming paragraph pre-end flag being invalid, sends the first streaming text into the page rendering channel for rendering and locks the page rendering channel. While the page rendering channel is locked, all subsequently received server push events are stored in a cache queue until the first streaming text is rendered and the page rendering channel is unlocked. Then, appended text of the same type as the first streaming text or newly added text of a different type is retrieved from the cache queue as target data and rendered sequentially. The locking and isolation mechanism of the page rendering channel avoids cross-contamination caused by simultaneous rendering of multiple types of content, fully preserves the streaming real-time output effect of the server push event, avoids the problem of concentrated DOM operations caused by one-time rendering after full caching, and also avoids the timing disorder caused by asynchronous Markdown parsing and rendering. It takes into account the orderliness of rendering multiple types of content, the real-time nature of streaming output, and the stability of page rendering, and solves the defects of page interaction lag and poor interactive experience in the prior art.
[0051] In some feasible examples, combining Figure 1 ,like Figure 2 As shown, the above S13 can be implemented by the following S130.
[0052] S130. When the global session stop flag is detected to be invalid, and the first streaming text and streaming paragraph pre-end flag carried by the server push event are invalid, the first streaming text is sent to the page rendering channel for rendering, and the page rendering channel is locked.
[0053] As described above, the data processing method provided in this embodiment first detects the state of the global session stop flag. Only when the global session stop flag is invalid, the server push event carries the first streaming text, and the streaming paragraph pre-end flag is invalid, is the first streaming text sent to the page rendering channel for rendering and the page rendering channel locked. When the page rendering channel is locked, all subsequent received server push events are stored in the cache queue until the first streaming text is rendered and the page rendering channel is unlocked. Then, appended text of the same type as the first streaming text or newly added text of a different type are obtained from the cache queue as target data and rendered sequentially. By intercepting invalid data streams in advance with the global session stop flag and combining it with the page rendering channel locking isolation mechanism, invalid data after session termination is avoided from interfering with rendering, and cross-interference caused by simultaneous rendering of multiple types of content is prevented. The real-time streaming output effect of the server push event is fully preserved, and the problem of concentrated DOM operations caused by one-time rendering after full caching is avoided. At the same time, the timing disorder caused by the asynchronous time difference of Markdown parsing and rendering is avoided. The method takes into account the orderliness of rendering of multiple types of content, the real-time streaming output, and the stability of page rendering, and solves the defects of page interaction lag and poor interactive experience in the prior art.
[0054] In some feasible examples, combining Figure 2 ,like Figure 3 As shown, the data processing method provided in this embodiment further includes S16.
[0055] S16. When the global session stop flag is detected to be valid, discard the currently received server push events.
[0056] As described above, the data processing method provided in this embodiment first detects the state of the global session stop flag. Only when the global session stop flag is invalid, the server push event carries the first streaming text, and the streaming paragraph pre-end flag is invalid, is the first streaming text sent to the page rendering channel for rendering and the page rendering channel locked. If the global session stop flag is detected to be valid, the currently received server push event is discarded. When the page rendering channel is locked, all subsequently received server push events are stored in the cache queue until the first streaming text is rendered and the page rendering channel is unlocked. Then, appended events of the same type as the first streaming text are retrieved from the cache queue. New texts of different types or with different content are rendered sequentially as target data. By intercepting invalid data streams after session termination through a global session stop flag and using a page rendering channel locking and isolation mechanism, invalid data is prevented from continuously occupying rendering resources, and cross-contamination caused by simultaneous rendering of multiple types of content is prevented. The streaming real-time output effect of server-pushed events is fully preserved, and the problem of concentrated DOM operations caused by one-time rendering after full caching is avoided. At the same time, the timing disorder caused by asynchronous Markdown parsing and rendering is avoided. The system takes into account the orderly rendering of multiple types of content, real-time streaming output, and page rendering stability, and solves the defects of existing technologies such as page interaction lag and poor user experience.
[0057] In some feasible examples, combining Figure 1 ,like Figure 4 As shown, the data processing method provided in this embodiment further includes S17.
[0058] S17. Respond to a session termination command or a server push event that terminates the session, discard and clear all data in the cache queue, and enable the global session stop flag.
[0059] As described above, the data processing method provided in this embodiment first detects the status of the global session stop flag. If the global session stop flag is detected as valid, the currently received server push event is discarded. Only when the global session stop flag is invalid, the server push event carries the first streaming text, and the streaming paragraph pre-end flag is invalid, is the first streaming text sent to the page rendering channel for rendering and the page rendering channel locked. When the page rendering channel is locked, all subsequently received server push events are stored in a cache queue until the first streaming text is rendered and the page rendering channel is unlocked. Then, appended text of the same type as the first streaming text or newly added text of a different type is retrieved from the cache queue as target data and rendered sequentially. At the same time, a session termination command or a termination-type server is responded to. Push events clear all data in the cache queue and set the global session stop flag to active. By intercepting invalid data streams after session termination before the global session stop flag is set, uniformly clearing cached data and blocking new data processing when the session terminates, and combining with the page rendering channel locking and isolation mechanism, this approach avoids invalid data continuously occupying rendering resources and cached redundant data accumulation. It also prevents cross-contamination caused by simultaneous rendering of multiple types of content, fully preserving the streaming real-time output effect of server push events. This approach avoids the problem of concentrated DOM operations caused by one-time rendering after full caching, while also mitigating the timing disorder caused by asynchronous Markdown parsing and rendering. It balances the orderliness of rendering multiple types of content, the real-time nature of streaming output, and the stability of page rendering, solving the shortcomings of existing technologies such as page interaction lag and poor user experience.
[0060] In some feasible examples, combining Figure 1 ,like Figure 5 As shown, the above S13 can be specifically implemented through the following S131 and S132.
[0061] S131. When the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, and the first streaming text is the main text fragment corresponding to the segmented network address, lock the page rendering channel and pause rendering.
[0062] S132. Retrieve at least one appended text from the cache queue until at least one appended text is concatenated with the first streaming text to form a complete network address, then send the concatenated text into the page rendering channel for rendering.
[0063] In some examples, for scenarios where streaming text contains segmented network addresses, resulting in broken links and display errors due to address split rendering, the phone is configured with a network address integrity verification and delayed rendering mechanism. The specific execution process is as follows: The phone continuously parses the SSE push events sent by the server. If it detects that the pre-end flag of the streaming segment corresponding to the first streaming text carried by the current push event is invalid, and the first streaming text is a text fragment corresponding to a segmented network address, the page rendering channel is immediately locked and the current rendering process is paused. This prevents incomplete segmented network address text from being directly rendered to the page, avoiding abnormal display of incomplete links. After locking the rendering channel, the phone continuously reads at least one cached appended text fragment from the preset contentCache cache queue, continuously searching and splicing the continuation text in the cache queue until the obtained appended text is completely spliced with the current first streaming text to form a complete network address with a valid format and complete content. After obtaining the complete network address text, the phone releases the temporary rendering lock and sends the spliced complete network address text into the page rendering channel for compliant rendering and display, ensuring the integrity and availability of streaming content of network addresses. This mechanism is nested and adapted to the original content locking and cache queue consumption logic of the mobile phone. It performs delayed splicing rendering only for special scenarios of segmented network addresses, without affecting the normal real-time streaming output of ordinary streaming text. It not only preserves the real-time streaming rendering of regular Q&A content, but also solves the rendering failure and display disorder problems caused by segmented network address push.
[0064] As described above, the data processing method provided in this embodiment, for the first streaming text belonging to segmented network addresses sent by the server push event, locks the page rendering channel and pauses rendering when the pre-end flag of the streaming segment is invalid. It retrieves at least one appended text from the cache queue until the retrieved appended text is concatenated with the first streaming text to form a complete network address. Then, the concatenated whole text is sent to the page rendering channel for unified rendering. This effectively avoids the defects of network address splitting and incomplete page content display in the SSE streaming segmented push scenario. At the same time, relying on the page rendering channel locking mechanism, it blocks the synchronous rendering of different types of streaming content, avoids content crossover and disorder caused by multiple types of text being pushed, reduces frequent page refreshes caused by multiple independent DOM parsing and drawing of scattered segmented text, reduces rendering resource consumption, and alleviates the timing disorder problem caused by the asynchronous parsing time difference of Markdown. While retaining the real-time streaming output effect of the server push event, it improves the integrity of the dialogue content display and the stability of page rendering operation.
[0065] In some feasible examples, combining Figure 1 ,like Figure 6 As shown, the above S14 can be implemented in the following S140.
[0066] S140. When the page rendering channel is locked, if the second streaming text and the pre-end flag of the streaming paragraph carried by the newly received server push event are invalid, and the text type of the second streaming text is the same as that of the first streaming text, set the second streaming text as append text and store it in the cache queue.
[0067] As can be seen from the above, the data processing method provided in this embodiment, when the page rendering channel is locked, marks newly received second streaming text with an invalid pre-end flag and a text type consistent with the first streaming text as append text and stores it in the cache queue. Streaming content of the same type is separately categorized and cached, which can distinguish target data with different purposes in the cache queue, avoid mixed storage of various streaming data causing rendering and reading sequence disorder, prevent page errors caused by synchronous rendering of multiple types of content, achieve orderly reading and step-by-step rendering of append text of the same type after unlocking, reduce page lag caused by one-time batch DOM operations, alleviate display disorder caused by asynchronous time difference in Markdown parsing and rendering, and take into account both the real-time output effect of server push events and the orderly rendering of multiple types of content.
[0068] In some feasible examples, combining Figure 1 ,like Figure 7 As shown, the above S14 can be specifically implemented through the following S141.
[0069] S141. When the page rendering channel is locked, if the second streaming text and the pre-end flag of the streaming paragraph carried by the newly received server push event are invalid, and the text type of the second streaming text is inconsistent with that of the first streaming text, the second streaming text is set as a new text and stored in the cache queue.
[0070] As can be seen from the above, the data processing method provided in this embodiment, when the page rendering channel is locked, marks newly received second-stream text with an invalid pre-end flag and a text type inconsistent with the first-stream text as newly created text and stores it in the cache queue. It independently classifies and caches different types of streaming content, realizes partitioned storage of appended text and newly created text in the cache queue, avoids interference from different types of streaming data to the subsequent reading and rendering order, prevents multiple types of content from being pushed in parallel and causing page display errors, facilitates the orderly processing of various target data in a time-sharing manner after unlocking, avoids page lag caused by a batch of DOM operations at once, improves the timing disorder problem caused by the asynchronous time difference of Markdown parsing and rendering, and improves the orderliness of rendering multiple types of content and page running stability while retaining the real-time output characteristics of server push events.
[0071] In some feasible examples, combining Figure 1 ,like Figure 8As shown, the above S14 can be specifically implemented through the following S142.
[0072] S142. When the rendering completion callback of all document object model parsing and view drawing is completed in the page rendering channel, determine that the first streaming text rendering is complete, unlock the page rendering channel, and retrieve the target data from the cache queue.
[0073] In some examples, the mobile phone can implement the channel unlocking and cache retrieval logic after the streaming text rendering is completed through step S142. Specifically, the mobile phone monitors the rendering status of the page rendering channel in real time. When the page rendering channel completes all document object model parsing and page view drawing actions corresponding to the current first streaming text and triggers the rendering completion callback, the mobile phone determines that the current first streaming text has been completely rendered. Under this premise, the mobile phone automatically releases the locked state of the page rendering channel, ends the current single-segment exclusive rendering lock restriction, and actively reads the corresponding target data from the contentCache cache queue. The target data includes the continuous appended text of the same type to be consumed in the cache queue and the newly added text to be rendered. This step relies on the real DOM rendering completion callback of the front-end intelligent agent AI dialogue page as the unlocking criterion, rather than simply relying on the completion of data reception to determine the end of rendering. This can accurately ensure that the page view display and the program logic state are completely synchronized, avoiding problems such as premature cache consumption and content interleaving caused by the rendering lag of the front-end intelligent agent AI dialogue page and the logic preceding the rendering. Meanwhile, this step serves as a prerequisite for the aforementioned cache merging and serial rendering processes, providing a precise timing basis for subsequent processes such as continuous appending text merging and rendering, paragraph pre-end switching to add new text, etc., ensuring that the entire streaming rendering mechanism is time-sensitive and executed in an orderly manner.
[0074] As described above, the data processing method provided in this embodiment uses the rendering completion callback triggered after all document object model parsing and view drawing of the page rendering channel is completed as the determination criterion. It confirms that the first streaming text rendering is completed before unlocking the page rendering channel and reading the target data in the cache queue. This method abandons the method of relying on server-side push markers to determine the end of rendering, accurately eliminates the asynchronous time difference in Markdown parsing and rendering, and avoids premature unlocking that could cause rendering errors due to the interleaving of multiple types of content. At the same time, it ensures that cached data is processed only after a single piece of text has been completely rendered, preventing page interaction lag caused by concentrated batch DOM operations. While maintaining the real-time streaming output of server-pushed events, it improves the accuracy of the rendering sequence of multiple types of content and the stability of page operation.
[0075] In some feasible examples, the target data includes appended text; combined with Figure 1 ,like Figure 9 As shown, the above S15 can be implemented by the following S150 and S151.
[0076] S150. When the first stream of text rendering is completed, unlock the page rendering channel, read the appended text from the cache queue in sequence, send the read appended text into the page rendering channel for rendering, and lock the page rendering channel again.
[0077] S151. After any appended text is rendered, unlock the page rendering channel, continue reading the next appended text in the cache queue, send the next appended text into the page rendering channel for rendering, and lock the page rendering channel again.
[0078] In some examples, the target data includes appended text in the cache queue. Based on the process logic, the phone is configured with an ordered, cyclical rendering mechanism of "merging first, then rendering sequentially" for the segmented appended text in the cache queue. Steps S150 and S151 achieve the regularized output of the cached text. Specifically, after the first stream of text is rendered, the phone executes logic S150: automatically unlocking the page rendering channel, prioritizing the traversal of the contentCache cache queue, and merging multiple consecutive appended texts of the same content type that can be appended. This merges multiple fragmented appended texts of the same type into a single complete text to be rendered, thus avoiding page jitter and content fragmentation caused by frequent small-segment rendering. After merging consecutive content of the same type, the phone sends the merged appended text into the page rendering channel for rendering. Once a single combined content is rendered, the page rendering channel is immediately locked again to prevent multiple cached texts from concurrently competing for the rendering channel and causing content corruption. Furthermore, after any group of merged appended text has been rendered, the phone continues to execute the S151 loop logic: immediately unlocking the page rendering channel, retrieving and merging the remaining next group of consecutive appended text of the same type in the cache queue, sending the processed next group of content into the page rendering channel for rendering, and then locking the rendering channel again. The phone uses a loop-serial mechanism of "rendering complete - unlocking - merging consecutive cached content of the same type - batch rendering - relocking" to consume all cached appended text in successive groups until all appended text in the cache queue has been rendered. This rendering method not only strictly controls the rendering channel to process only a single group of text at a time, but also greatly reduces the number of rendering operations and ensures the integrity of the streaming content segments through a pre-processing mechanism for merging consecutive content of the same type. It completely avoids the problems of content overlap, disordered order, content fragmentation, and frequent flickering caused by concurrent rendering of multiple streaming appended text segments, ensuring the accuracy of the output order and the regularity of the display of segmented streaming text. As described above, the data processing method provided in this embodiment reads appended text from the cache queue sequentially after the first stream of text rendering is completed and the page rendering channel is unlocked. Each appended text is sent to the page rendering channel for rendering and then immediately relocked until all appended text has been processed. By using a batch processing mode of locking and rendering each appended text one by one, the concentrated operation of the batch document object model caused by rendering multiple appended texts in the cache at once is avoided, reducing the page rendering load and alleviating interaction lag. At the same time, the exclusive isolation effect of the page rendering channel is maintained to prevent interference from other streaming data, avoid display errors caused by synchronous rendering of multiple types of content, and weaken the timing disorder caused by the asynchronous time difference of Markdown parsing and rendering. While retaining the server push event streaming real-time output capability, it ensures that the rendering order of appended text of the same type is regular, improving the smoothness of page rendering and display stability.
[0079] In some feasible examples, the target data also includes additional text; combined with Figure 9,like Figure 10 As shown, the data processing method provided in this embodiment of the disclosure further includes S18.
[0080] S18. When the pre-end flag of the streaming paragraph in the server push event corresponding to any appended text is valid and the rendering of any appended text is completed, unlock the page rendering channel and retrieve the new text from the cache queue.
[0081] In some examples, the target data processed by the mobile phone includes not only appended text in the cache queue but also newly added text continuously pushed by the server. Referring to the corresponding flowchart, based on the serial rendering of cached appended text, the mobile phone implements the logic for continuous rendering of newly added text in a pre-end scenario through step S18. The specific execution flow is as follows: During the process of sequentially merging and rendering consecutive appended text of the same type in the cache queue, the mobile phone verifies in real time the server push event parameters corresponding to any appended text that has already been rendered. If the pre-end flag of the streaming paragraph of the appended text is determined to be valid, indicating that the current paragraph's appended streaming content has been fully pushed and there are no subsequent fragments of the same type, the mobile phone immediately unlocks the page rendering channel and actively reads the newly added text to be processed from the cache queue. The newly added text is a completely new streaming content fragment that differs from the aforementioned appended text. It can correspond to new types of main text content, in-depth thinking content, or supplementary information content. After unlocking the rendering channel, the mobile phone directly retrieves the newly added text that is ranked first in the cache queue as the data source for the next stage of rendering. This logic is precisely adapted to the boundary scenarios of streaming paragraph endings. It only switches to read new text when the content of a single paragraph is fully rendered and the paragraph pre-end marker is in effect. This avoids rendering gaps caused by forcibly switching content in an incomplete paragraph. At the same time, it connects with the cache consumption mechanism of "merging first and then rendering serially" mentioned earlier, realizing seamless linkage between the regular rendering of appended text, paragraph ending judgment, and continuous reading of new text, ensuring the orderliness and integrity of the alternating output of multiple paragraphs and types of streaming text.
[0082] As can be seen from the above, the data processing method provided in this embodiment of the present disclosure, after determining that the pre-end flag of the streaming segment of the server push event corresponding to the appended text is valid and the rendering of a single appended text is completed, unlocks the page rendering channel and retrieves the new text from the cache queue for rendering. This realizes the layered processing logic of switching to render different types of new text only after the complete rendering of the same type of appended text is completed, strictly distinguishes the rendering sequence of different types of streaming text, and completely avoids page display disorder caused by the interleaving rendering of different types of streaming content. By using the segmented and typed orderly rendering method, it avoids the problem of batch DOM concentrated operation caused by the superposition rendering of multiple types of text, eliminates the timing disorder caused by the asynchronous rendering time difference of Markdown, and further improves the rendering regularity and page interaction stability of multi-type streaming question and answer content while ensuring the streaming output characteristics of server push events.
[0083] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0084] This application embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing unit. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0085] An embodiment of this application provides a schematic diagram of the structure of an electronic device, including a communicator 101 and a controller 102.
[0086] The communicator 101 is configured to: send input information corresponding to the input operation to the server in response to the input operation; and receive server push events carrying the processing results of the input information sent by the server.
[0087] Controller 102 is configured to: when the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, send the first streaming text into the page rendering channel for rendering and lock the page rendering channel; wherein, the text type corresponding to the first streaming text includes either a deep thinking text fragment or a regular text fragment; while the page rendering channel is locked, store all received server push events in a cache queue; when the first streaming text is rendered, unlock the page rendering channel and retrieve the target data from the cache queue; wherein, the target data includes appended text corresponding to the first streaming text, or newly added text other than the first streaming text, wherein the text type of the appended text is consistent with the text type of the first streaming text, and the text type of the newly added text is inconsistent with the text type of the first streaming text.
[0088] In some implementable examples, when controller 102 executes the following steps: when the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, it sends the first streaming text into the page rendering channel for rendering and locks the page rendering channel.
[0089] In some implementable examples, controller 102 is also configured to discard currently received server push events when a global session stop flag is detected to be valid.
[0090] In some implementable examples, controller 102 is also configured to: in response to a session termination command or a termination-type server push event, discard and clear all data in the cache queue and enable the global session stop flag.
[0091] In some implementable examples, controller 102, when executing the following steps: when the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, sends the first streaming text into the page rendering channel for rendering and locks the page rendering channel, is further configured to: when the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, and the first streaming text is a text fragment corresponding to a segmented network address, lock the page rendering channel and pause rendering; retrieve at least one appended text from the cache queue, and when at least one appended text is concatenated with the first streaming text to form a complete network address, send the concatenated text into the page rendering channel for rendering.
[0092] In some implementable examples, when controller 102 stores all received server push events to the cache queue while the page rendering channel is locked, it is further configured to: if the second streaming text and the streaming paragraph pre-end flag carried by a newly received server push event are invalid, and the text type of the second streaming text is consistent with that of the first streaming text, set the second streaming text as append text and store it in the cache queue.
[0093] In some implementable examples, when controller 102 stores all received server push events to the cache queue while the page rendering channel is locked, it is further configured to: if the second streaming text and the streaming paragraph pre-end flag carried by a newly received server push event are invalid, and the text type of the second streaming text is inconsistent with the first streaming text, the second streaming text is set as a new text and stored in the cache queue.
[0094] In some feasible examples, the target data includes appended text; when the controller 102 unlocks the page rendering channel and retrieves the target data from the cache queue after the first streaming text rendering is completed, it is further configured to: unlock the page rendering channel after the first streaming text rendering is completed, and sequentially read the appended text from the cache queue, send the read appended text into the page rendering channel for rendering, and then lock the page rendering channel again; after any appended text is rendered, unlock the page rendering channel, continue reading the next appended text in the cache queue, send the next appended text into the page rendering channel for rendering, and then lock the page rendering channel again.
[0095] In some feasible examples, the target data also includes newly added text; controller 102 is also configured to: unlock the page rendering channel and retrieve the newly added text from the cache queue when the streaming paragraph pre-end flag in the server push event corresponding to any appended text is valid and rendering of any appended text is complete.
[0096] In some implementable examples, when controller 102 executes the process of unlocking the page rendering pipeline and retrieving target data from the cache queue upon completion of the first streaming text rendering, it is further configured to: determine the completion of the first streaming text rendering, unlock the page rendering pipeline, and retrieve target data from the cache queue when the rendering completion callback of all document object model parsing and view drawing in the page rendering pipeline is completed.
[0097] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and their functions will not be repeated here.
[0098] Of course, the electronic devices provided in this application embodiment include, but are not limited to, the modules described above. For example, the electronic device may also include a memory 103. The memory 103 can be used to store the program code of the electronic device, and can also be used to store data generated by the electronic device during operation, such as data in write requests.
[0099] This application also provides a chip system that can be applied to the electronic devices described in the foregoing embodiments. The chip system includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 can be the processor in the aforementioned electronic device. The processor 1501 and the interface circuit 1502 can be interconnected via a circuit. The processor 1501 can receive and execute computer instructions from the memory of the aforementioned electronic device through the interface circuit 1502. When the computer instructions are executed by the processor 1501, the electronic device can perform the various steps performed by the electronic device in the foregoing embodiments. Of course, the chip system may also include other discrete devices, and this application does not specifically limit this.
[0100] This application also provides a computer-readable storage medium for storing computer instructions for operating the aforementioned electronic device.
[0101] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An electronic device, characterized in that, include: The communicator is configured to send input information corresponding to an input operation to the server in response to the input operation. Receive a server push event from the server carrying the processing result of the input information; The controller is configured as follows: When the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, the first streaming text is sent to the page rendering channel for rendering, and the page rendering channel is locked; wherein, the text type corresponding to the first streaming text includes either deep thinking text fragments or regular text fragments. When the page rendering channel is locked, all received server push events are stored in the cache queue; when the first streaming text rendering is completed, the page rendering channel is unlocked, and target data is obtained from the cache queue; wherein, the target data includes appended text corresponding to the first streaming text, or newly added text other than the first streaming text, the text type of the appended text is consistent with the text type of the first streaming text, and the text type of the newly added text is inconsistent with the text type of the first streaming text.
2. The electronic device according to claim 1, characterized in that, When the controller executes the following steps: when the first streaming text and the pre-end flag of the streaming paragraph carried in the server push event are invalid, it sends the first streaming text into the page rendering channel for rendering and locks the page rendering channel, it is further configured as follows: When the global session stop flag is detected to be invalid, and the first streaming text and the streaming paragraph pre-end flag carried by the server push event are invalid, the first streaming text is sent to the page rendering channel for rendering, and the page rendering channel is locked.
3. The electronic device according to claim 2, characterized in that, The controller is also configured to: When the global session stop flag is detected to be valid, the currently received server push events are discarded.
4. The electronic device according to claim 1, characterized in that, The controller is also configured to: In response to a session termination command or a server push event that terminates the session, discard and clear all data in the cache queue and enable the global session stop flag.
5. The electronic device according to claim 1, characterized in that, The controller, when executing the action of sending the first streaming text into the page rendering channel for rendering and locking the page rendering channel when the first streaming text and the streaming paragraph pre-end flag carried by the server push event are invalid, is further configured to: When the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, and the first streaming text is a text fragment corresponding to a segmented network address, the page rendering channel is locked and rendering is paused. At least one of the appended texts is retrieved from the cache queue, and when the at least one appended text is concatenated with the first streaming text to form a complete network address, the concatenated text is sent to the page rendering channel for rendering.
6. The electronic device according to claim 1, characterized in that, When the controller stores all received server push events to the cache queue while the page rendering channel is locked, it is further configured to: When the page rendering channel is locked, if the second streaming text and the pre-end flag of the streaming paragraph carried by the newly received server push event are invalid, and the text type of the second streaming text is consistent with the first streaming text, the second streaming text is set as append text and stored in the cache queue.
7. The electronic device according to claim 1, characterized in that, When the page rendering channel is locked, the controller is further configured to store all received server push events to the cache queue as follows: When the page rendering channel is locked, if the second streaming text and the pre-end flag of the streaming paragraph carried by the newly received server push event are invalid, and the text type of the second streaming text is inconsistent with the first streaming text, the second streaming text is set as a new text and stored in the cache queue.
8. The electronic device according to claim 1, characterized in that, The target data includes the appended text; When the first streaming text rendering is completed, the controller unlocks the page rendering channel and retrieves the target data from the cache queue, and is further configured to: When the first streaming text rendering is completed, the page rendering channel is unlocked, and appended text is read from the cache queue in sequence. The read appended text is sent to the page rendering channel for rendering, and the page rendering channel is locked again. After any appended text is rendered, the page rendering channel is unlocked, the next appended text in the cache queue is read, the next appended text is sent to the page rendering channel for rendering, and the page rendering channel is locked again.
9. The electronic device according to claim 8, characterized in that, The target data also includes newly added text; The controller is also configured to: When the pre-end flag of the streaming paragraph in the server push event corresponding to any appended text is valid, and the rendering of any appended text is completed, the page rendering channel is unlocked, and the new text is retrieved from the cache queue.
10. A data processing method, characterized in that, include: In response to an input operation, send the input information corresponding to the input operation to the server; Receive a server push event from the server carrying the processing result of the input information; When the first streaming text and the pre-end flag of the streaming paragraph carried by the server push event are invalid, the first streaming text is sent to the page rendering channel for rendering, and the page rendering channel is locked; wherein, the text type corresponding to the first streaming text includes either deep thinking text fragments or regular text fragments. When the page rendering channel is locked, all received server push events are stored in the cache queue; when the first streaming text rendering is completed, the page rendering channel is unlocked, and target data is obtained from the cache queue; wherein, the target data includes appended text corresponding to the first streaming text, or newly added text other than the first streaming text, the text type of the appended text is consistent with the text type of the first streaming text, and the text type of the newly added text is inconsistent with the text type of the first streaming text.