An agent plug-in streaming rendering method and system

CN122884580APending Publication Date: 2026-10-09CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610929303.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-25
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]然而,现有的智能体实现方案中,直接采用独立入口与单一渲染方式,并未构建统一的插件化扩展架构与多模态流式分发框架,由此可能会导致业务系统权限与智能体权限体系难以融合、已有业务能力无法高效转化为智能体可调用的通用接口,以及不同子系统间智能化场景的快速迭代与集成受阻

Benefits of technology

通过候选评分调度机制,多个插件可同时对同一消息进行prepare竞争,引擎按评分自动选择最优渲染方案,实现运行时动态选择最佳渲染策略;通过StreamProcessor统一解析SSE事件并按contentType自动分发到对应插件,实现文本、图表、图片的并行流式展示,用户无需等待全部数据返回即可看到部分内容;通过实时检测think block标签将推理过程与正式回答分离展示,支持折叠/展开交互,提升用户对AI推理过程的理解和信任度;通过多维度记忆体系和向量化召回,实现用户个性化对话和知识沉淀。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884580A_ABST
    Figure CN122884580A_ABST
Patent Text Reader

Abstract

The application discloses an intelligent agent plug-in streaming rendering method and system, and relates to the technical field of artificial intelligence and front-end rendering, wherein the method comprises the following steps: a core engine maintains a plug-in registration center, receives a server streaming message, identifies a content identifier, matches a corresponding rendering plug-in, and generates a bubble candidate list with priority. The plug-in supporting streaming is incrementally rendered in the message receiving process through an isolated container, and a resource management handle is generated; the plug-in not supporting streaming is rendered at one time after the message receiving is completed, and a component state is updated through an event bus notification. The application realizes plug-in streaming rendering of multi-modal content, significantly improves the system expansibility and real-time interaction experience, and guarantees the safety of remote loading through a multi-layer safety mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and front-end rendering technology, and in particular to a plug-in-based streaming rendering method and system for intelligent agents. Background Technology

[0002] As the core driving force of the new generation of information technology, artificial intelligence is profoundly transforming user interaction paradigms and driving the evolution from traditional search engines and multi-app matrices to unified intelligent portals. Against this backdrop, AI intelligent assistants have seen initial applications in customer service, office work, and education. Among the related technologies, the collaborative operation of large language models, front-end rendering engines, and streaming communication protocols has constructed an interactive system that enables real-time retrieval, real-time generation, and real-time display.

[0003] However, existing intelligent agent implementations directly employ independent entry points and a single rendering method, failing to construct a unified plug-in extension architecture and a multimodal streaming distribution framework. This may lead to difficulties in integrating business system permissions with intelligent agent permission systems, the inability to efficiently transform existing business capabilities into general interfaces that intelligent agents can call, and hinder the rapid iteration and integration of intelligent scenarios across different subsystems. Furthermore, existing solutions are insufficient in terms of security regarding remotely dynamically loading plug-in scripts, lacking a comprehensive, end-to-end defense system from transmission, loading, execution to rendering, thus impacting the real-time performance, scalability, and security of a unified interactive experience in enterprise-level scenarios. Summary of the Invention

[0004] The main objective of this invention is to provide a plug-in-based streaming rendering method for intelligent agents.

[0005] Another objective of this invention is to provide a pluggable streaming rendering apparatus for intelligent agents.

[0006] The third objective of this invention is to provide an electronic device.

[0007] The fourth objective of this invention is to provide a non-transitory computer-readable storage medium.

[0008] To achieve the above objectives, a first aspect of the present invention proposes a pluggable streaming rendering method for intelligent agents, comprising: S1 maintains a plugin registry center through the core engine, where the plugin registry center stores the content type, rendering priority, and streaming processing capability identifier declared by each plugin. S2 receives streaming messages pushed by the server, parses the streaming messages to identify content type tags, matches the corresponding rendering plugins from the plugin registry based on the content type tags, and generates a candidate list of bubbles containing rendering priorities. S3, for rendering plugins that support streaming, performs incremental rendering through an isolated container while receiving streaming messages, and generates rendering handles for updating and destroying rendering resources. S4, for rendering plugins that do not support streaming, performs a one-time rendering through an isolated container after receiving streaming messages, and notifies relevant components to update their status through the event bus.

[0009] Optionally, a plugin registry can be maintained through the core engine, including: The intelligent agent core engine is initialized, and a plugin registry center is created. The plugin registry center maintains a mapping table between plugin types and rendering functions. Built-in plugins and remote plugins are registered through the plugin registry center. Each plugin declares its supported content types, rendering priorities, and streaming processing capabilities.

[0010] Optionally, you can register built-in plugins and remote plugins through the plugin registry center, including: Define a unified plugin interface, which includes content type, priority, streaming capability identifier, rendering method, and destruction method; Plugins are divided into two types: ordinary plugins and streaming plugins. Ordinary plugins process one-time data, produce bubble candidates through the preparation method, and render them all at once in the main rendering method. Streaming plugins process streaming data, create candidates through the stream candidate creation method, process streaming events through the stream processing method, and continuously update the rendering in the main rendering method through the render handle update method.

[0011] Optionally, receive streaming messages pushed by the server, parse the streaming messages to identify content type tags, match the corresponding rendering plugins from the plugin registry based on the content type tags, and generate a candidate list of bubbles containing rendering priorities, including: Read binary data chunk by chunk from the SSE connection using the default readable stream reader, decode it into text using a text decoder; split SSE event blocks by double newline characters, parse event and data fields; parse the data into JSON objects, and extract the status, content type, and thought markers from the message data; The core engine calls the preparation methods of all registered plugins in parallel. Each plugin returns zero to N bubble candidate objects based on the message content. Each bubble candidate carries a plugin identifier, key, score, and rendering data. After collecting all candidates, the engine sorts them in descending order of score and renders the top K high-scoring candidates.

[0012] Optionally, for rendering plugins that support streaming, incremental rendering is performed through an isolated container during the receipt of streaming messages, and rendering handles are generated for updating and destroying rendering resources, including: Based on content type, streaming events are distributed to the corresponding streaming plugins. For text types, the token processing method of the streaming processor is called; for image types, the image processing method of the streaming processor is called; and for chart types, the chart processing method of the streaming processor is called. The core engine creates bubble candidates for each streaming plugin by creating a streaming candidate method. When the streaming ends or the component is unloaded, the method to destroy the render handle is called to release DOM resources and remove event listeners to prevent memory leaks.

[0013] Optionally, a one-time rendering can be performed using an isolated container, and relevant components can be notified of state updates via an event bus, including: The isolation container is a Shadow DOM isolation container. By creating a Shadow DOM isolation container for each bubble candidate, the rendering result is restricted to inside the Shadow Root to achieve CSS style isolation. The Shadow Root is passed to the plugin's main rendering method through the main host interface. The plugin returns a rendering handle object, which contains an update interface for content updates and a destruction interface for resource destruction.

[0014] To achieve the above objectives, a second aspect of the present invention provides an intelligent agent plug-in streaming rendering apparatus, comprising: The maintenance module is used to maintain the plugin registry center through the core engine. The plugin registry center stores the content type, rendering priority and streaming capability identifier declared by each plugin. The parsing module is used to receive streaming messages pushed by the server, parse the streaming messages to identify content type tags, match the corresponding rendering plugins from the plugin registry based on the content type tags, and generate a candidate list of bubbles containing rendering priorities. The rendering module is used to perform incremental rendering through an isolated container while receiving streaming messages for rendering plugins that support streaming processing, and to generate rendering handles for updating and destroying rendering resources. The update module is used to perform a one-time rendering through an isolated container after receiving streaming messages for rendering plugins that do not support streaming, and to notify relevant components to update their status through the event bus.

[0015] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0016] To achieve the above objectives, a third aspect of this application provides an electronic device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, for implementing the intelligent agent plug-in streaming rendering method as described in the first aspect embodiment.

[0017] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the intelligent agent plug-in streaming rendering method as described in the first aspect embodiment.

[0018] The embodiments of the present invention have the following beneficial effects: Through a candidate scoring scheduling mechanism, multiple plugins can simultaneously compete to prepare for the same message. The engine automatically selects the optimal rendering scheme based on the score, achieving dynamic selection of the best rendering strategy at runtime. Through StreamProcessor, SSE events are uniformly parsed and automatically distributed to the corresponding plugins according to contentType, enabling parallel streaming display of text, charts, and images. Users can see part of the content without waiting for all data to be returned. By detecting think block tags in real time, the reasoning process is separated from the formal answer and displayed separately, supporting folding / expanding interaction, which improves users' understanding and trust in the AI ​​reasoning process. Through a multi-dimensional memory system and vectorized recall, personalized dialogue and knowledge accumulation for users are achieved. Attached Figure Description

[0019] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart of a pluggable streaming rendering method for intelligent agents provided in an embodiment of the present invention; Figure 2 This is an overall architecture diagram of an intelligent agent plug-in streaming rendering system provided in an embodiment of the present invention; Figure 3 A four-layer security architecture diagram provided for embodiments of the present invention; Figure 4 This is a timing diagram of streaming message processing provided in an embodiment of the present invention; Figure 5 This is a structural diagram of a pluggable streaming rendering device for intelligent agents provided in an embodiment of the present invention. Detailed Implementation

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0021] 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.

[0022] The following description, with reference to the accompanying drawings, describes the intelligent agent plug-in streaming rendering method and apparatus according to embodiments of the present invention.

[0023] Example 1 This invention provides a pluggable streaming rendering method for intelligent agents, such as... Figure 1 As shown, the method includes the following steps: S1 maintains a plugin registry center through the core engine, where the plugin registry center stores the content type, rendering priority, and streaming processing capability identifier declared by each plugin.

[0024] To address the issues of inconsistent interfaces, lack of lifecycle management, and insufficient security protection for remote plugins in traditional rendering plugins, this application unifies the basic plugin interface, distinguishes between streaming and regular plugins, establishes a plugin registration center, and constructs a four-layer end-to-end remote plugin security loading system.

[0025] In this embodiment, the application first initializes the agent core engine AgentCore, and instantiates an independent plugin registry center in the engine memory. The plugin registry center maintains a mapping table that corresponds one-to-one with the plugin type, the corresponding content rendering function, and the plugin's basic attributes, providing a fast retrieval basis for subsequent message distribution and plugin matching.

[0026] In this application embodiment, a globally unified standardized plugin interface BasePlugin is defined. BasePlugin has five core basic attributes: contentType (content type), priority (rendering priority), isStreamable (streaming capability identifier), render (basic rendering method), and destroy (resource destruction method). All plugins are required to implement this basic interface to ensure the uniformity of plugin calling logic.

[0027] In this embodiment, two types of functionally differentiated plugins are derived from BasePlugin: NormalPlugin (a general plugin) and StreamablePlugin (a streaming plugin). These two types of plugins are adapted to two business scenarios: one-time static data and real-time incremental streaming data, respectively. In this embodiment, NormalPlugin is designed for static dialogue data returned in one complete cycle. It has a built-in prepare method and renderMain (the main rendering method). At runtime, it generates standardized BubbleCandidate bubble candidate objects through the prepare method, and then renderMain completes the one-time rendering output of all content. StreamablePlugin is designed for incremental streaming data pushed in segments by SSE. It adds the createStreamCandidate streaming candidate creation method and the processStream streaming event handling method. During the renderMain execution phase, it can call the RenderHandle.update() interface to continuously iterate and update the page rendering content, adapting to the scenario of large model segmented output.

[0028] In this embodiment, after completing the interface definition and plugin type classification, the system will uniformly register all local built-in plugins and remote plugins to be loaded to the PluginRegistry plugin registration center. Each plugin actively declares its supported contentType, priority, and isStreamable identifier during registration. The registration process synchronously records the plugin's complete lifecycle hooks. The plugin lifecycle fully covers the five stages of registration, activation, rendering, pause, and destruction. During the registration stage, registerPlugin() is executed to complete the information entry. During the activation stage, the rendering handle is instantiated after matching the content type. During the rendering stage, the corresponding rendering logic is called. When switching dialogues or unloading components, the system enters the pause stage. Finally, the resources are released and the plugin is unregistered through the destroy method.

[0029] In this embodiment, for the pre-registration loading process of remote plugins, this application establishes a four-layer progressive security-in-depth architecture, the overall security architecture as follows: Figure 3As shown, the four layers of protection, from the outside in, are the network transmission security layer, the resource integrity verification layer, the execution environment isolation layer, and the rendering isolation layer. The first layer, network transmission security, uses HTTPS encryption throughout the transmission of remote plugin resources, ensuring data confidentiality and integrity during plugin script transmission. The second layer, resource integrity verification, is implemented collaboratively by ManifestService and WebRemoteLoader. ManifestService remotely retrieves the plugin manifest index and caches it locally. After obtaining the remote plugin script, WebRemoteLoader performs SHA-256 algorithm SRI sub-resource integrity verification, comparing hash values ​​to determine if the script has been maliciously tampered with. If the verification fails, the loading process is terminated directly. The third layer, execution environment isolation, integrates multiple W3C standard security technologies to form a protective closed loop. It intercepts dynamic script XSS injection behavior through the Trusted Types security policy, constructs an independent isolated execution context using Blob URLs, and strictly restricts remote plugin network access, DOM manipulation, and other execution permissions with the IframeSandbox sandbox property. At the same time, the system can automatically identify and adapt the remote plugin's ES Module and UMD code formats. The fourth layer, rendering isolation, implements style and DOM isolation based on Shadow DOM, preventing remote plugin styles and scripts from polluting the main application page.

[0030] In this embodiment, a standardized plugin resource pool is provided for subsequent message matching and content rendering by defining a BasePlugin general interface, distinguishing between two types of rendering plugins, building a plugin registration center to manage the entire plugin lifecycle, and combining a four-layer progressive security mechanism to complete the trusted loading and registration of remote plugins.

[0031] S2 receives streaming messages pushed by the server, parses the streaming messages to identify content type tags, matches the corresponding rendering plugins from the plugin registry based on the content type tags, and generates a candidate list of bubbles containing rendering priorities.

[0032] In order to achieve standardized parsing of streaming messages, competitive matching of plugins, and simultaneous completion of memory retrieval, skill scheduling and thinking chain data extraction, this application parses the SSE data stream and generates a list of candidate bubbles with scores for subsequent rendering.

[0033] In the embodiments of this application, such as Figure 4As shown, when a user enters a question message in the ChatPanel interactive panel, the front end sends the user message to the FastAPI backend service via an HTTP request. The backend calls the LangChain business processing link to generate large model inference output, and at the same time starts the SSE one-way long connection to continuously push streaming event data in segments. The front end StreamProcessor continuously listens to the SSE long connection channel to obtain all streaming messages pushed by the server.

[0034] In this embodiment, the StreamProcessor has a built-in ReadableStreamDefaultReader reader that reads the raw binary data stream from the SSE connection block by block. It calls the TextDecoder to decode the binary bytes into standard text strings. According to the SSE protocol specification, it divides the SSE event blocks into independent blocks using double newline characters as delimiters. It parses the two core fields, event identifier and data payload, block by block. The system parses the data field string into a standard JSON object and extracts key parameters from messageData layer by layer. These parameters include the message status (distinguishing between three states: doing, done, and error), the contentType field of messageData.agentMsgVo (distinguishing between three types of rendered content: TEXT plain text, IMAGE image, and CHART chart), and the think chain marker field within the payload (for extracting AI deep inference content separately).

[0035] In this embodiment, StreamProcessor continuously monitors multiple core SSE event identifiers, including thinking event, content_block_start event, content_block_delta event, content_block_stop event, and done event. Different preprocessing logic is executed for each event.

[0036] In this embodiment, after parsing a single message or a single segment of streaming data, the AgentCore core engine calls the prepare matching method of all registered plugins in the PluginRegistry in parallel. Each plugin autonomously matches the business scenario based on the current message text, content type, and event identifier. A single matching process can return 0 to N BubbleCandidate bubble candidate objects. Each bubble candidate uniformly carries four key parameters: pluginId (unique plugin identifier), key (rendering primary key), score (matching score), and payload (rendering original data).

[0037] In this embodiment, the core engine collects the candidate bubble set output by all plugins, re-sorts the candidates in descending order according to their score values, and filters the top-ranked high-scoring candidates according to the system's preset topK truncation rules to generate an ordered candidate bubble list. For inference data with the "think" tag, the system extracts the AI ​​thinking process text separately, reserves an independent folding rendering area, and uses a green status bar with the text label "Deep Thinking" to visually distinguish the thinking chain area. It is fixedly arranged above the formal dialogue response area, with folding and unfolding interactive buttons for users to switch the display state independently. When the "done" streaming end event is detected, the thinking chain area is automatically folded to highlight the final output content.

[0038] In this embodiment, by decoding and parsing SSE streaming data block by block, calling plugins in parallel for competitive matching, and fusing multi-path memory retrieval and skill intent recognition, ordered high-scoring bubble candidates are generated and the thinking chain visualization data is preprocessed, laying the foundation for subsequent differentiated incremental rendering.

[0039] S3, for rendering plugins that support streaming, performs incremental rendering through an isolated container while receiving streaming messages, and generates rendering handles for updating and destroying rendering resources.

[0040] To avoid style pollution, page lag, and memory leaks caused by streaming rendering, this application diverts various streaming events, builds a Shadow DOM isolation container, and adopts a throttling incremental rendering and full lifecycle resource release mechanism.

[0041] In this embodiment, the AgentCore core engine accurately distributes SSE incremental streaming events to the corresponding StreamablePlugin streaming plugins based on the contentType carried by the bubble candidates. For TEXT plain text streaming data, the StreamHandler.onToken token incremental processing method is called; for IMAGE image resource type, the StreamHandler.onImage image loading processing method is called; and for CHART chart visualization type, the StreamHandler.onECharts chart incremental rendering method is called. After each type of streaming plugin receives the distribution event, the engine calls the createStreamCandidate streaming candidate creation method to generate a dedicated BubbleCandidate bubble candidate object adapted to the incremental push scenario.

[0042] In this embodiment, the system creates an independent Shadow DOM isolation container for each candidate bubble to be rendered, and calls the attachShadow({mode:'open'}) interface to enable the open mode shadow root node. All DOM elements and CSS styles generated by the plugin rendering are constrained within the independent Shadow Root, achieving complete isolation between plugin styles, scripts and the main application page from the bottom layer. This corresponds to the fourth rendering isolation layer protection logic of the four-layer security architecture, eliminating risks such as plugin style pollution, global variable conflicts, and malicious DOM tampering.

[0043] In this embodiment, the system passes the instantiated ShadowRoot to the renderMain method of the corresponding streaming plugin through the unified MainHost interface. After the plugin executes the rendering logic, it returns a standardized RenderHandle rendering handle object to the engine. The RenderHandle has two core built-in interfaces: update (incremental content update interface) and dispose (resource destruction and release interface).

[0044] In this embodiment, during the streaming process, incremental events of content_block_delta are continuously received. Whenever a new segment of streaming incremental data is acquired, the system automatically calls the RenderHandle.update (nextCandidate) interface to perform an incremental DOM update operation without having to redraw the entire dialog bubble. A separate 100ms timed throttling control mechanism is configured for the TEXT streaming plugin. Multiple token pushes in a short period of time only require a single batch DOM refresh. This, combined with the DocumentFragment document fragment batch caching of DOM nodes and the requestAnimationFrame browser frame animation scheduling interface, optimizes rendering performance, reduces the number of browser reflows and repaints, and significantly reduces the front-end computing power consumption in high-frequency streaming push scenarios.

[0045] In this embodiment, rendering isolation is achieved by distributing streaming events according to content type and creating independent Shadow DOM. Incremental rendering is optimized by throttling and document fragmentation. Content updates and resource destruction are completed by relying on rendering handles, and a streaming rendering container is output for subsequent business adaptation.

[0046] S4, for rendering plugins that do not support streaming, performs a one-time rendering through an isolated container after receiving streaming messages, and notifies relevant components to update their status through the event bus.

[0047] In order to achieve static rendering of non-streaming plugins, unified business access and hierarchical permission control, and closed-loop management of the entire lifecycle of skills and integrated output of complete dialogue pages, this application realizes multi-component state synchronization and system-wide closed-loop.

[0048] In this embodiment, for ordinary NormalPlugin plugins without streaming capabilities, the system waits for the SSE streaming transmission to complete and all data payloads to be received before executing the rendering process. Similarly, an independent Shadow DOM isolation container is created for the ordinary plugin bubble candidate, and the shadow DOM style isolation logic consistent with S3 is reused. The Shadow Root is passed to the plugin's renderMain method through the MainHost interface to complete a one-time complete rendering. The plugin synchronously returns a matching RenderHandle rendering handle for resource destruction when the component is unloaded later.

[0049] In this embodiment, after the plugin completes a one-time static rendering, the system pushes state change events to related components such as the page ChatPanel and MessageRender through the global event bus, and synchronously notifies the upper-layer business components to refresh the page display content and update the availability status of interactive buttons, so as to realize the linkage and synchronization of multiple component states.

[0050] In this embodiment, the system loads a globally unified FloatingDialog floating entry component. This component supports two integration modes: it can be directly embedded into a fixed area of ​​the business page, or it can be displayed independently in the form of a floating pop-up window. It adapts to the access needs of various enterprise business systems and realizes a standardized and unified user interaction entry for multi-agent products.

[0051] In this embodiment, the system has a built-in PermissionAdapter interface that forms an independent business permission adaptation layer. The PermissionAdapter connects to the enterprise's internal business system account permission system, reads the currently logged-in user's role, function access permissions, and data viewing permissions, and dynamically manages all available rendering plugins, skill calls, and knowledge base memory range of the intelligent agent in real time, so as to realize differentiated function management for different users.

[0052] In this embodiment, ordinary plugins are rendered in one go using Shadow DOM. Multiple business systems are adapted based on floating entry points and permission adaptation layers. A complete skill sandbox management system is built, and component states are synchronized and all rendering containers are aggregated to complete the overall output of the dialogue page.

[0053] Example 2 This invention relates to an intelligent agent plug-in streaming rendering system, such as... Figure 2 As shown, the system of this invention adopts a layered architecture design, which consists of the following layers from top to bottom: Presentation layer: Includes FloatingDialog, ChatPanel, InputBox, and MessageRenderer, responsible for managing user interaction and content display containers, and supports multi-platform publishing.

[0054] Engine layer: including AgentCore core engine (responsible for plugin registration and event dispatch), PluginManager plugin manager, StreamProcessor stream processor, and Reporter observability module, which is the core improvement of this invention.

[0055] Runtime layer: Includes WebRemoteLoader, IframeSandbox sandbox isolation, ManifestService manifest service, and VueAdapter / ReactAdapter framework adaptation layer, providing a runtime environment for plugin loading and secure isolation.

[0056] Plugin layer: Includes stream-text streaming text plugin, stream-echarts streaming chart plugin, stream-image streaming image plugin, text-plugin plain text plugin, etc., and supports on-demand expansion.

[0057] The backend service communicates with the frontend via HTTP and SSE protocols.

[0058] Example 3 This invention provides an intelligent agent plug-in streaming rendering device 10, such as... Figure 5 As shown, the device includes: Maintenance module 100 is used to maintain the plugin registry center through the core engine, where the plugin registry center stores the content type, rendering priority and streaming processing capability identifier declared by each plugin; The parsing module 200 is used to receive streaming messages pushed by the server, parse the streaming messages to identify content type tags, match the corresponding rendering plugins from the plugin registry based on the content type tags, and generate a candidate list of bubbles containing rendering priorities. The rendering module 300 is used to perform incremental rendering through an isolated container for rendering plugins that support streaming processing during the process of receiving streaming messages, and to generate rendering handles for updating and destroying rendering resources. The update module 400 is used to perform a one-time rendering through an isolated container after receiving a streaming message for rendering plugins that do not support streaming processing, and to notify relevant components to update their status through the event bus.

[0059] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0060] Example 4 To implement the methods of the above embodiments, the present invention also provides an electronic device, which includes a memory and a processor; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the various steps of the methods described above.

[0061] Example 5 To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.

[0062] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0063] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0064] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A pluggable streaming rendering method for intelligent agents, characterized in that, include: S1 maintains a plugin registry center through the core engine, where the plugin registry center stores the content type, rendering priority, and streaming processing capability identifier declared by each plugin. S2 receives streaming messages pushed by the server, parses the streaming messages to identify content type tags, matches the corresponding rendering plugins from the plugin registry based on the content type tags, and generates a candidate list of bubbles containing rendering priorities. S3, for rendering plugins that support streaming, performs incremental rendering through an isolated container while receiving streaming messages, and generates rendering handles for updating and destroying rendering resources. S4, for rendering plugins that do not support streaming, performs a one-time rendering through an isolated container after receiving streaming messages, and notifies relevant components to update their status through the event bus.

2. The method according to claim 1, characterized in that, The maintenance of the plugin registry center through the core engine includes: The intelligent agent core engine is initialized, and a plugin registry center is created. The plugin registry center maintains a mapping table between plugin types and rendering functions. Built-in plugins and remote plugins are registered through the plugin registry center. Each plugin declares its supported content types, rendering priorities, and streaming processing capabilities.

3. The method according to claim 2, characterized in that, The process of registering built-in plugins and remote plugins through the plugin registry center includes: Define a unified plugin interface, which includes content type, priority, streaming capability identifier, rendering method, and destruction method; Plugins are divided into two types: ordinary plugins and streaming plugins. Ordinary plugins process one-time data, produce bubble candidates through the preparation method, and render them all at once in the main rendering method. Streaming plugins process streaming data, create candidates through the stream candidate creation method, process streaming events through the stream processing method, and continuously update the rendering in the main rendering method through the render handle update method.

4. The method according to claim 1, characterized in that, The receiving server pushes streaming messages, parses the streaming messages to identify content type tags, matches the corresponding rendering plugins from the plugin registry based on the content type tags, and generates a candidate list of bubbles containing rendering priorities, including: Read binary data chunk by chunk from the SSE connection using the default readable stream reader, decode it into text using a text decoder; split SSE event blocks by double newline characters, parse event and data fields; parse the data into JSON objects, and extract the status, content type, and thought markers from the message data; The core engine calls the preparation methods of all registered plugins in parallel. Each plugin returns zero to N bubble candidate objects based on the message content. Each bubble candidate carries a plugin identifier, key, score, and rendering data. After collecting all candidates, the engine sorts them in descending order of score and renders the top K high-scoring candidates.

5. The method according to claim 1, characterized in that, The rendering plugin that supports streaming processing performs incremental rendering through an isolated container while receiving streaming messages, and generates rendering handles for updating and destroying rendering resources, including: Based on content type, streaming events are distributed to the corresponding streaming plugins. For text types, the token processing method of the streaming processor is called; for image types, the image processing method of the streaming processor is called; and for chart types, the chart processing method of the streaming processor is called. The core engine creates bubble candidates for each streaming plugin by creating a streaming candidate method. When the streaming ends or the component is unloaded, the method to destroy the render handle is called to release DOM resources and remove event listeners to prevent memory leaks.

6. The method according to claim 1, characterized in that, The process of rendering once through an isolated container and notifying relevant components to update their status via an event bus includes: The isolation container is a Shadow DOM isolation container. By creating a Shadow DOM isolation container for each bubble candidate, the rendering result is restricted to inside the Shadow Root to achieve CSS style isolation. The Shadow Root is passed to the plugin's main rendering method through the main host interface. The plugin returns a rendering handle object, which contains an update interface for content updates and a destruction interface for resource destruction.

7. A plug-in-based streaming rendering device for intelligent agents, characterized in that, include: The maintenance module is used to maintain the plugin registry center through the core engine. The plugin registry center stores the content type, rendering priority and streaming capability identifier declared by each plugin. The parsing module is used to receive streaming messages pushed by the server, parse the streaming messages to identify content type tags, match the corresponding rendering plugins from the plugin registry based on the content type tags, and generate a candidate list of bubbles containing rendering priorities. The rendering module is used to perform incremental rendering through an isolated container while receiving streaming messages for rendering plugins that support streaming processing, and to generate rendering handles for updating and destroying rendering resources. The update module is used to perform a one-time rendering through an isolated container after receiving streaming messages for rendering plugins that do not support streaming, and to notify relevant components to update their status through the event bus.

8. An electronic device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method as described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.