Data rendering method, related devices and computer program product

By embedding business component metadata into the Markdown text stream and employing a dual-channel parsing method, the problem of rendering dynamic cards in existing technologies has been solved, resulting in a better user interaction experience and rendering effect.

CN120874812BActive Publication Date: 2026-07-10BEIJING SANKUAI CLOUD COMPUTING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SANKUAI CLOUD COMPUTING TECH CO LTD
Filing Date
2025-07-14
Publication Date
2026-07-10

Smart Images

  • Figure CN120874812B_ABST
    Figure CN120874812B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data rendering method, related equipment and computer program product, relating to the technical field of computer and Internet. The method comprises: receiving a mixed Markdown text stream, wherein the mixed Markdown text stream comprises Markdown syntax data and business component metadata, and the business component metadata is used for rendering a custom business component; dynamically identifying and incrementally parsing the mixed Markdown text stream through a first parsing channel, so as to parse the Markdown syntax data in the mixed Markdown text stream into an HTML fragment; dynamically identifying and incrementally parsing the mixed Markdown text stream through a second parsing channel, so as to incrementally obtain the business component metadata in the mixed Markdown text stream; and transmitting the parsed HTML fragment and the business component metadata to a client through a streaming pipeline, so as to streamingly render the Markdown syntax data and the business component metadata on the client. The embodiment of the present disclosure can synchronously render component data when rendering Markdown data, thereby improving the rich media rendering capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer and internet technology, and in particular to a data rendering method, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] This section is intended to provide background or context for the embodiments of this disclosure as set forth in the claims. The description herein is not intended to be a prior art simply because it is included in this section.

[0003] Current software generally uses standard Markdown syntax for content presentation. While it can achieve basic formatting, it cannot support the output of interactive components such as dynamic cards, resulting in limited content presentation on the client side and a poor interactive experience. Summary of the Invention

[0004] The purpose of this disclosure is to provide a data rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product that can render business components while rendering Markdown text data, thereby improving the rendering effect on the client side and enhancing the user interaction experience.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0006] This disclosure provides a data rendering method, comprising: receiving a mixed Markdown text stream, the mixed Markdown text stream including Markdown syntax data and business component metadata, the business component metadata being used to render a custom business component; dynamically identifying and incrementally parsing the mixed Markdown text stream through a first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments; dynamically identifying and incrementally parsing the mixed Markdown text stream through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream; and transmitting the parsed HTML fragments and the business component metadata to a client through a streaming pipeline for streaming rendering of the Markdown syntax data and the business component metadata on the client.

[0007] In some embodiments, the parsed HTML fragment and the business component metadata are transmitted to the client via a streaming pipeline to perform streaming rendering of the Markdown syntax data and the business component metadata on the client, including: streaming the HTML fragment on the client via a basic rendering pipeline; mounting the business component metadata to a DOM container via a component rendering pipeline to generate a real DOM tree, and continuously rendering the real DOM tree in the DOM container to the client.

[0008] In some embodiments, mounting the business component metadata to a DOM container to generate a real DOM tree includes: determining whether the custom business component already exists; if the custom business component does not exist, generating a persistent DOM container for the custom business component; generating a first virtual DOM tree based on the business component metadata; and mounting the first virtual DOM tree to the persistent DOM container corresponding to the custom business component to generate the real DOM tree.

[0009] In some embodiments, mounting the business component metadata into a DOM container to generate a real DOM tree further includes: if the custom business component already exists, generating a second virtual DOM tree based on the business component metadata; obtaining a third virtual DOM tree corresponding to the custom business component, wherein the third virtual DOM tree is generated before the second virtual DOM tree; determining the difference data between the second virtual DOM and the third virtual DOM tree through difference comparison; and updating the difference data between the second virtual DOM and the third virtual DOM tree onto the real DOM tree of the persistent DOM container.

[0010] In some embodiments, the Markdown text stream includes a first Markdown text, and the business component metadata includes first component metadata; the first Markdown text includes the first component metadata, the custom business component includes the first business component, and the first component metadata is used to generate the first business component; wherein, mounting the business component metadata to a DOM container to generate a real DOM tree includes: determining whether the first business component already exists based on at least one of the position of the first component metadata in the first Markdown text, the component name of the first component metadata, and the data content of the first component metadata; if the first business component does not exist, then it is the first business group. The process involves: generating a persistent DOM container for the first business component; generating a fourth virtual DOM tree based on the metadata of the first component; directly mounting the fourth virtual DOM tree to the persistent DOM container corresponding to the first business component to generate the real DOM tree corresponding to the first business component; if the first business component already exists, generating a fifth virtual DOM tree based on the metadata of the first component; obtaining a sixth virtual DOM tree corresponding to the first business component, wherein the sixth virtual DOM tree was generated before the fifth virtual DOM tree; determining the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree through difference comparison; and updating the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree to the real DOM tree corresponding to the first business component.

[0011] In some embodiments, the hybrid Markdown text stream is dynamically identified and incrementally parsed through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream. This includes: performing pattern matching on the Markdown text stream through the second parsing channel; locating component locators in the Markdown text stream through the pattern matching, wherein the component locators are used to identify and locate the business component metadata in the Markdown text stream; and incrementally obtaining the business component metadata in the Markdown text stream based on the component locators.

[0012] This disclosure provides a data rendering apparatus, including: a receiving module, a first parsing module, a second parsing module, and a transmission module.

[0013] The receiving module receives a mixed Markdown text stream, which includes Markdown syntax data and business component metadata. The business component metadata is used to render custom business components. The first parsing module dynamically identifies and incrementally parses the mixed Markdown text stream through a first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments. The second parsing module dynamically identifies and incrementally parses the mixed Markdown text stream through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream. The transmission module transmits the parsed HTML fragments and the business component metadata to the client through a streaming pipeline for streaming rendering of the Markdown syntax data and the business component metadata on the client.

[0014] This disclosure provides an electronic device comprising: a memory and a processor; the memory for storing computer program instructions; and the processor for calling the computer program instructions stored in the memory to implement the data rendering method described above.

[0015] This disclosure provides a computer-readable storage medium storing computer program instructions to implement the data rendering method as described in any of the preceding embodiments.

[0016] This disclosure provides a computer program product or computer program that includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and the processor executes the computer program instructions to implement the aforementioned data rendering method.

[0017] The data rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in this disclosure, on the one hand, add business component metadata to the Markdown text stream, which can add streaming rendering of business components while retaining the advantages of Markdown data stream rendering, thereby increasing interactive methods and improving user experience; on the other hand, dual-channel parsing can reduce the impact on the parsing channel corresponding to Markdown syntax data and reduce the difficulty of technical transformation.

[0018] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this disclosure. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0020] Figure 1 A schematic diagram of a scenario that can be applied to the data rendering method or data rendering apparatus of the embodiments of this disclosure is shown.

[0021] Figure 2 This is a flowchart illustrating a data rendering method according to an exemplary embodiment.

[0022] Figure 3 This is a flowchart illustrating a method for data rendering on a client side according to an exemplary embodiment.

[0023] Figure 4 This is a flowchart illustrating a real tree generation method according to an exemplary embodiment.

[0024] Figure 5 This is a flowchart illustrating a method for mounting business component metadata to a DOM container to generate a real DOM tree, according to an exemplary embodiment.

[0025] Figure 6 This is a schematic diagram illustrating the structure of a data rendering method according to an exemplary embodiment.

[0026] Figure 7 This is a block diagram illustrating a data rendering apparatus according to an exemplary embodiment.

[0027] Figure 8 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0028] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0029] Those skilled in the art will recognize that embodiments of this disclosure can be a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0030] The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0031] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0032] The accompanying drawings are merely illustrative of this disclosure, and the same reference numerals in the drawings denote the same or similar parts, thus omitting repeated descriptions of them. Some block diagrams shown in the drawings do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0033] The flowchart shown in the accompanying drawings is merely illustrative and does not necessarily include all content and steps, nor does it require execution in the described order. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0034] In the description of this disclosure, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences; the terms "contains," "includes," and "has" are used to indicate an open-ended meaning of inclusion and refer to the existence of additional elements / components / etc. besides those listed.

[0035] To better understand the above-mentioned objectives, features and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0036] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security and network security.

[0037] The following section will first explain some of the terms used in the embodiments of this disclosure so that those skilled in the art can understand them.

[0038] MCP (Model Context Protocol) is an open protocol that defines how applications and AI (Artificial Intelligence) systems (such as large language models) exchange contextual information. It is a unified protocol standard that enables AI systems to connect to various data sources and tools in a consistent manner.

[0039] Tools are powerful primitives in the Model Context Protocol (MCP) that enable servers to expose executable functionality to clients. Through tools, large language models can interact with external systems, perform computations, and execute operations in the real world.

[0040] Token: During the compilation / parsing process, the source code is broken down into meaningful code units.

[0041] Markdown is a lightweight text markup language that allows users to write documents in an easy-to-read and easy-to-write plain document format, and then convert them into valid XHTML (Extensible HyperText Markup Language) or HTML (HyperText Markup Language) formats. Due to its lightweight, easy-to-read, and easy-to-write characteristics, Markdown is widely used. Markdown was initially designed as a lightweight, static, easy-to-read, and easy-to-write plain text markup language, primarily used for generating simple static documents. It does not natively support interactive components (dynamic cards).

[0042] Currently, the industry generally uses the standard Markdown protocol for data transmission. While Markdown has the advantage of streaming transmission, it cannot carry structured component data and is difficult to adapt to dynamic streaming scenarios.

[0043] Markdown has the advantage of streaming, for the following reasons:

[0044] 1. Markdown is a linear, sequential plain text format where each line represents a logical block (such as a paragraph, heading, or list), making it easy to parse and transmit line by line. This structure is naturally suited for streaming (such as loading line by line over the network and real-time rendering);

[0045] 2. No nesting. Markdown syntax (such as #, -, etc.) does not rely on deep nesting structures. The parser can process line by line, and the entire DOM (Document Object Model) / AST (Abstract Syntax Tree) can be constructed for rendering. In contrast, HTML requires matching closing tags (such as...). …, The parentheses (.) must be parsed before they can be rendered correctly. JSON / YAML requires complete matching of brackets / indentation; otherwise, parsing will fail. Markdown, however, can still display correctly even if transmission is interrupted.

[0046] 3. Low parsing overhead. Markdown's parsing algorithm is simple, making it suitable for low-latency scenarios (such as chat messages and real-time document collaboration); while structured data (such as nested JSON objects) requires more complex parsers, resulting in higher streaming processing costs.

[0047] In related technologies, Markdown was initially designed as a lightweight, static, easy-to-read and easy-to-write plain text markup language, primarily used for generating simple static documents. It does not inherently support dynamic cards or interactive components.

[0048] In response to the above situation, this application proposes a technique for rendering business components while rendering Markdown data streams.

[0049] The preceding text introduced some terms and concepts involved in the embodiments of this disclosure. The following text introduces the technical features involved in the embodiments of this disclosure.

[0050] The exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0051] Figure 1 A schematic diagram of a scenario that can be applied to the data rendering method or data rendering apparatus of the embodiments of this disclosure is shown.

[0052] Please refer to Figure 1 The diagram illustrates an implementation environment provided by an exemplary embodiment of this disclosure.

[0053] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0054] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, desktop computers, wearable devices, virtual reality devices, smart home devices, etc.

[0055] Server 105 can be a server that provides various services, such as a backend management server that supports the devices operated by users using terminal devices 101, 102, and 103. The backend management server can analyze and process received requests and other data, and feed the processing results back to the terminal devices.

[0056] A server can be a standalone physical server, a server cluster or a distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This disclosure does not impose any restrictions on this.

[0057] Server 105 may, for example, receive a mixed Markdown text stream, which includes Markdown syntax data and business component metadata, the latter being used to render custom business components; Server 105 may, for example, dynamically identify and incrementally parse the mixed Markdown text stream through a first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments; Server 105 may, for example, dynamically identify and incrementally parse the mixed Markdown text stream through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream; Server 105 may, for example, transmit the parsed HTML fragments and business component metadata to the client through a streaming pipeline so that the Markdown syntax data and business component metadata can be streamed and rendered on the client.

[0058] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Server 105 can be a single physical server or a combination of multiple servers. Depending on actual needs, it can have any number of terminal devices, networks, and servers.

[0059] Figure 2 This is a flowchart illustrating a data rendering method according to an exemplary embodiment. The method provided in this disclosure can be executed by any electronic device with computing power; for example, the method can be executed by the above-described... Figure 1 The execution can be performed by a server or terminal device in the embodiments, or it can be performed by both a server and a terminal device. In the following embodiments, the server is used as the execution subject for illustration, but this disclosure is not limited to this.

[0060] Reference Figure 2 The data rendering method provided in this disclosure may include the following steps.

[0061] Step S202: Receive a mixed Markdown text stream, which includes Markdown syntax data and business component metadata. The business component metadata is used to render custom business components. The Markdown text stream is generated by the large language model based on the MCP extension protocol.

[0062] Markdown data can be data written using Markdown syntax.

[0063] In related technologies, large language models can transmit Markdown information to other software and hardware based on the MCP protocol. In this application, the aforementioned MCP protocol can be extended to enable the large language model to generate the hybrid Markdown text stream as described in this application based on the extended MCP protocol, and to enable the large language model to transmit information to other software and hardware through the aforementioned hybrid Markdown text stream.

[0064] In some embodiments, the aforementioned mixed Markdown text stream may originate from a large language model.

[0065] This large language model can generate the aforementioned Markdown text stream based on an extension of the MCP (or MCP Tool) protocol.

[0066] A business component refers to a reusable software unit that encapsulates specific business functions, rules, and logic. It represents a complete, self-contained business function module that can be independently developed, tested, and deployed. The aforementioned business components can be, for example, cards (dynamic), tables, forms, lists, etc., and this application does not impose any limitations on this.

[0067] The aforementioned business component metadata can be structured information describing the characteristics and attributes of the business component. This business component metadata may include basic information and attribute information (technical attributes and / or business attributes). The basic information may include at least one of the following: component name, component ID / code, version number, description (description of the component's function and usage scenarios), category / tag, and creation / modification date.

[0068] The aforementioned mixed Markdown text stream may include multiple data packets, each of which may include at least one of Markdown data and business component metadata. For example, a data packet may include only Markdown data, only business component metadata, or both Markdown data and business component metadata; this application does not impose any restrictions on this.

[0069] In some embodiments, the aforementioned business component metadata can be located anywhere in the mixed Markdown text stream, and this application does not impose any restrictions on this.

[0070] The aforementioned business component metadata can be in JSON (JavaScript Object Notation) format, but this application is not limited to this.

[0071] In some embodiments, a mixed Markdown text stream may include business component metadata of one, two or more custom business components (e.g., it may include metadata of three custom business components, such as component 1, component 2 and component 1, etc.), and this application does not limit this.

[0072] In some embodiments, business component metadata can be identified in a mixed Markdown text stream using locators (or placeholders), which can be used to locate business component metadata in the Markdown text stream.

[0073] In some embodiments, business component metadata in JSON format can be embedded in Markdown using {ComponentName}. In this case, {ComponentName} can serve as a component locator, allowing the location of the business component metadata. Of course, those skilled in the art can also use other locators to identify and locate business components, and this application does not impose any limitations on this.

[0074] Step S204: Dynamically identify and incrementally parse the mixed Markdown text stream through the first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments.

[0075] In some embodiments, the first parsing channel may be the original Markdown parser.

[0076] In some embodiments, the first parsing channel can dynamically receive a mixed Markdown text stream and perform dynamic identification and incremental parsing of the mixed Markdown text stream.

[0077] Incremental parsing is a parsing technique that allows only the newly added or changed parts to be parsed as the input data arrives (or is modified) step by step, instead of re-parsing the entire document or data stream each time.

[0078] Step S206: Dynamically identify and incrementally parse the mixed Markdown text stream through the second parsing channel to incrementally obtain the business component metadata in the Markdown text stream.

[0079] The second parsing channel can operate independently of the first parsing channel. This second parsing channel allows for dynamic identification and incremental parsing of the mixed Markdown text stream to obtain metadata about business components within the Markdown text stream.

[0080] In some embodiments, dynamically identifying and incrementally parsing the mixed Markdown text stream through the second parsing channel to incrementally obtain business component metadata in the Markdown text stream may include the following steps: performing pattern matching on the Markdown text stream through the second parsing channel; locating component locators in the Markdown text stream through pattern matching, wherein the component locators are used to identify and locate the business component metadata in the Markdown text stream.

[0081] Pattern matching may include regular expression matching, syntax analysis, or other text matching methods, and this application does not impose any restrictions on this.

[0082] In some embodiments, the second parsing channel can incrementally obtain business component metadata from the Markdown text stream based on the component locator.

[0083] In some embodiments, the second parsing described above can be used by the markdown-it plugin to identify the component locator (or component placeholder).

[0084] The above solution reduces interference with the parsing of Markdown data by parsing the metadata of business components in the mixed Markdown text stream through a second parsing channel independent of the first parsing channel.

[0085] Step S208: The parsed HTML fragments and business component metadata are transmitted to the client through a streaming pipeline so that the Markdown syntax data and business component metadata can be progressively rendered by the client.

[0086] The above method extends the existing Markdown syntax with a custom component protocol, using the {ComponentName} tag to define component blocks and encapsulating structured attribute data internally, enabling unified transmission of multimodal content. Furthermore, a dual-channel parsing pipeline is established: regular expression matching identifies custom component blocks and extracts component type and attribute data, while markdown-it parses standard Markdown to generate HTML fragments, achieving parallel processing of regular content and components.

[0087] The above-mentioned technical methods, on the one hand, add business component metadata to the Markdown text stream, which can enhance the rendering of business components while retaining the advantages of Markdown data rendering, thereby increasing interactive methods and improving user experience; on the other hand, dual-channel parsing can reduce the impact on the corresponding parsing channels of Markdown syntax data, while reducing the difficulty of technical transformation.

[0088] Figure 3This is a flowchart illustrating a method for data rendering on a client side according to an exemplary embodiment.

[0089] refer to Figure 3 The above-mentioned method for data rendering on the client side may include the following steps.

[0090] Step S302: Stream the HTML fragment on the client through the basic rendering pipeline.

[0091] Step S304: The business component metadata is mounted into the DOM container through the component rendering pipeline to generate a real DOM tree, and the real DOM tree in the DOM container is continuously rendered by the client.

[0092] In some embodiments, the basic rendering pipeline may refer to the original rendering pipeline corresponding to Markdown. This basic rendering pipeline only renders the HTML fragments corresponding to the Markdown data.

[0093] In some embodiments, the component rendering pipeline may refer to the rendering pipeline of a business component.

[0094] In some embodiments, the basic rendering pipeline and the component rendering pipeline described above can be independent rendering pipelines.

[0095] The above method, on the one hand, renders business component metadata through a component rendering pipeline independent of the basic rendering pipeline, which can reduce the impact on Markdown data rendering; on the other hand, continuously mounting business component metadata into the DOM container can avoid unnecessary destruction and reconstruction, and the DOM container can isolate and avoid a full DOM refresh, thus improving rendering efficiency.

[0096] Figure 4 This is a flowchart illustrating a real tree generation method according to an exemplary embodiment.

[0097] refer to Figure 4 The above-mentioned method for generating a real tree may include the following steps.

[0098] Step S402: Determine whether the custom business component already exists.

[0099] In some embodiments, when the business component metadata of a certain business component (such as card 1) is received for the first time, a business ID will be assigned to the business component (such as card 1). Subsequently, each time the metadata corresponding to the business component (such as card 1) arrives, the business component metadata corresponding to the business component (such as card 1) will be assigned to the DOM tree corresponding to the business component (such as card 1) according to the business ID.

[0100] In some embodiments, different business components may correspond to different DOM trees.

[0101] In some embodiments, upon receiving metadata for a certain business component, it can be determined whether the business component corresponding to the metadata already exists. For example, this can be determined based on the component name, component type, or location of the component metadata, or it can be determined based on the hash tree corresponding to the metadata of the business component, etc. This application does not impose any limitations on these methods.

[0102] If the custom business component does not exist, proceed to steps S404 to S408.

[0103] Step S404: Generate a persistent DOM container for the custom business component.

[0104] In this context, a persistent DOM container refers to a DOM element container in a web application that can maintain its state and content from being accidentally destroyed or recreated.

[0105] Step S406: Generate the first virtual DOM tree based on the business component metadata.

[0106] The real DOM (Document Object Model) is how browsers parse and represent HTML documents. It is a tree-structured collection of node objects, with each node corresponding to an element, attribute, or text content in the HTML document.

[0107] The Virtual DOM is used to simulate the real DOM structure.

[0108] In some embodiments, if it is determined that there is no business component corresponding to the current business component metadata (that is, the current business component metadata is the first data to arrive), then the business component metadata is parsed to generate the first virtual DOM tree.

[0109] Step S408: Mount the first virtual DOM tree to the persistent DOM container corresponding to the custom business component to generate the real DOM tree.

[0110] In some embodiments, if the current business component metadata is the first metadata of the corresponding business component, the virtual DOM corresponding to the business component metadata is directly mounted into the DOM container to generate the real DOM.

[0111] In some embodiments, if the business component corresponding to the business component metadata already exists, steps S410 to S416 can be executed.

[0112] Step S410: Generate a second virtual DOM tree based on the business component metadata.

[0113] In some embodiments, if it is determined that the business component corresponding to the current business component metadata already exists, a second virtual DOM tree is generated in memory based on the business component metadata.

[0114] Step S412: Obtain the third virtual DOM tree corresponding to the custom business component. The third virtual DOM tree is generated before the second virtual DOM tree.

[0115] In some embodiments, a third virtual DOM tree generated before the second virtual DOM tree can be obtained, and the second and third virtual DOM trees can be virtual DOM trees of the same business component.

[0116] Step S414: Determine the difference data between the second virtual DOM and the third virtual DOM tree through difference comparison.

[0117] Step S416: Update the difference data between the second and third virtual DOM trees to the real DOM tree of the persistent DOM container.

[0118] In some embodiments, the differences between the second virtual DOM tree and the third virtual DOM tree can be compared.

[0119] Then the differences between the second and third virtual DOM trees are updated onto the real DOM tree.

[0120] In some embodiments, a comparison algorithm can be used to compare the differences between nodes in two virtual DOM trees layer by layer and record the changes, such as additions, updates, or deletions. The truly changed parts of the change records obtained through the comparison algorithm can then be applied to the real DOM to achieve a partial update.

[0121] The aforementioned partial update mechanism can reduce the number of operations on the real DOM tree, making the rendered business components more stable and avoiding flickering issues.

[0122] Figure 5 This is a flowchart illustrating a method for mounting business component metadata to a DOM container to generate a real DOM tree, according to an exemplary embodiment.

[0123] In some embodiments, the mixed Markdown text stream may include a first Markdown text, and the business component metadata may include first component metadata. The first Markdown text may include first component metadata, and the custom business component may include a first business component. The first component metadata can be used to generate the first business component.

[0124] The following example will use the first component metadata to illustrate how to mount the business component metadata into the DOM container.

[0125] refer to Figure 5 The method described above for mounting business component metadata into the DOM container to generate a real DOM tree may include the following steps.

[0126] Step S502: Determine whether the first business component already exists based on at least one of the following: the position of the first component metadata in the first Markdown text, the component name of the first component metadata, and the data content of the first component metadata.

[0127] In some embodiments, it can be determined whether the first business component corresponding to the first component metadata already exists based on at least one of the following: the position of the first component metadata in the first Markdown text, the component name, and the data content.

[0128] In some embodiments, the same business component may be located in the same place in Markdown.

[0129] In some embodiments, the text content similarity (which can be measured by the similarity of text vectors) of the component metadata of the same business component may be higher than a certain threshold.

[0130] In some embodiments, if the first business component described by the first business component metadata does not exist, then steps S504 to S508 are executed.

[0131] Step S504: Generate a persistent DOM container for the first business component.

[0132] In some embodiments, if it is determined that the first business component described by the first business component metadata does not exist (that is, the first business component metadata is the first data to be reached), a persistent DOM container is generated for the first business component so as to store the real tree corresponding to the first business component through the persistent DOM container.

[0133] Step S506: Generate the fourth virtual DOM tree based on the metadata of the first component.

[0134] Step S508: The fourth virtual DOM tree is directly mounted to the persistent DOM container corresponding to the first business component to generate the real DOM tree corresponding to the first business component.

[0135] In some embodiments, if the metadata of the first business component is the first data to arrive in the first business component, the virtual DOM tree corresponding to the metadata of the first component can be directly mounted to the persistent DOM container to generate the real DOM tree corresponding to the first business component.

[0136] If the first business component described by the first business component metadata already exists, then proceed with steps S510 to S516.

[0137] Step S510: Generate the fifth virtual DOM tree based on the metadata of the first component.

[0138] Step S512: Obtain the sixth virtual DOM tree corresponding to the first business component. The sixth virtual DOM tree is generated before the fifth virtual DOM tree.

[0139] In some embodiments, if other metadata of the first business component arrives before the first business component metadata arrives, then a fifth virtual tree can be generated based on the first business component metadata, and a sixth virtual tree generated before the fifth virtual tree can be obtained.

[0140] Step S514: Determine the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree through difference comparison.

[0141] Step S516: Update the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree to the real DOM tree corresponding to the first business component.

[0142] In some embodiments, after updating the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree to the real DOM tree corresponding to the first business component, the fifth virtual DOM tree is retained so that it can be compared with the fifth virtual DOM tree when the metadata of the first business component arrives again.

[0143] The above embodiment determines the differences in component metadata between two instances by comparing the virtual tree in memory, and then only mounts the differing content to the real DOM tree corresponding to the business component. This partial update mechanism reduces the number of operations on the real DOM tree, making the rendered business component more stable and preventing flickering issues.

[0144] Figure 6 This is a schematic diagram illustrating the structure of a data rendering method according to an exemplary embodiment.

[0145] like Figure 6 As shown, in related technologies, client-side data rendering can first parse the data A indicated by 602 through the data parsing pipeline indicated by 601 to obtain data B, and then use the rendering pipeline indicated by 601 to generate the data to be rendered according to the data B indicated by 602, so as to render it to the client.

[0146] The technical solution provided in this application uses two completely independent data parsing channels (such as the first parsing channel and the second parsing channel) to parse the received mixed Markdown text stream (A+a). The first parsing channel (the upper half of the 603 indicator) parses the Markdown text in the mixed Markdown text stream to obtain data B, which is then used to generate the data C to be rendered. The second parsing channel (the lower half of the 603 indicator) parses the Markdown text stream (A+a) to obtain the custom component metadata (a), passes the custom component metadata to the custom component rendering stream, and finally renders the metadata corresponding to the custom component on the client through the custom component rendering pipeline.

[0147] In this embodiment, for the first-time identified custom component metadata, a task flow manager based on RxJS (a tool specifically designed for handling asynchronous data streams and event-driven programming) can be created to generate a unique task ID and placeholder container. This triggers a dynamic loading mechanism and executes asynchronous rendering according to the task state machine (initialization → data loading → rendering ready → completion). A layered rendering architecture is adopted. The base layer quickly renders regular content, while the component layer uses ReactDOM.render (a rendering component) to mount custom components to reserved placeholder containers, thus forming an independent Virtual DOM tree. During streaming output, only the changed parts are updated through difference comparison, thus preserving the internal state of the component.

[0148] The specific implementation methods of each step in this embodiment can be referred to the above embodiment, and will not be repeated here.

[0149] The above embodiment innovatively constructs a three-layer architecture of "syntax extension - dynamic parsing - persistent rendering": First, the component metadata in JSON format (describing all key information of the component, including: type (such as button, input box), attributes (such as color, size), interaction logic (such as click events), and dependencies (such as CSS / JS that need to be loaded)) can be embedded in Markdown using the {ComponentName} syntax, realizing the mixed streaming transmission of business components and standard Markdown text; Second, a dual-channel parsing engine is designed. The second parsing channel can use the markdown-it plugin (which can convert ordinary Markdown text into HTML fragments) to identify component placeholders and generate a persistent DOM container (persistent DOM is an optimization technique that refers to maintaining the stability of the DOM structure during application runtime and avoiding unnecessary destruction and reconstruction), while establishing an independent rendering pipeline to manage the component lifecycle through RxJS (a tool for handling asynchronous data streams); Finally, an incremental update strategy is adopted to maintain the streaming rendering of the Markdown main body while realizing the preservation of component state and asynchronous loading. Compared to traditional solutions, this method supports segmented progressive rendering for streaming compatibility, avoids full DOM refresh by isolating components to keep them alive, and reduces modification costs by leveraging a plugin mechanism for protocol extensibility. Real-world testing shows that it improves rendering efficiency and reduces memory usage for complex components, and has been successfully applied to enterprise-level scenarios such as calendars and reminders.

[0150] This embodiment enables dynamic content upgrades from traditional text to business components, achieving real-time parsing and highly scalable rendering effects for multimodal interactive elements.

[0151] This embodiment employs a hybrid streaming design at the protocol layer. By embedding structured component descriptors into Markdown syntax, it maintains the high efficiency of traditional streaming while achieving native support for rich interactive components, ensuring seamless compatibility with the existing development ecosystem. At the parsing and rendering layer, a dual-pipeline processing architecture is constructed, employing a separate processing path to implement an error isolation mechanism (dual-channel), significantly improving interface rendering smoothness and system robustness. At the front-end framework level, a dynamic loading strategy is innovatively integrated, implementing an on-demand loading (lazy loading) mechanism based on modular building tools, effectively optimizing resource loading efficiency. Practical application verification shows that the system meets industrial-grade application standards in terms of rendering performance, resource utilization, and stability.

[0152] It should be particularly noted that the steps in the various embodiments of the above data rendering method can be overlapped, substituted, added, or deleted from each other. Therefore, these reasonable permutations and combinations of data rendering methods should also fall within the protection scope of this disclosure, and the protection scope of this disclosure should not be limited to the embodiments.

[0153] Based on the same inventive concept, this disclosure also provides a data rendering apparatus, as shown in the following embodiments. Since the principle by which this apparatus solves the problem is similar to that of the method embodiments described above, the implementation of this apparatus embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be elaborated further.

[0154] Figure 7 This is a block diagram illustrating a data rendering apparatus according to an exemplary embodiment. (Refer to...) Figure 7 The data rendering apparatus 700 provided in this embodiment may include: a receiving module 701, a first parsing module 702, a second parsing module 703, and a transmission module 704.

[0155] The receiving module 701 can be used to receive a mixed Markdown text stream, which includes Markdown syntax data and business component metadata. The business component metadata is used to render custom business components. The first parsing module 702 can be used to dynamically identify and incrementally parse the mixed Markdown text stream through a first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments. The second parsing module 703 can be used to dynamically identify and incrementally parse the mixed Markdown text stream through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream. The transmission module 704 can be used to transmit the parsed HTML fragments and business component metadata to the client through a streaming pipeline so that the Markdown syntax data and business component metadata can be streamed and rendered on the client.

[0156] It should be noted that the receiving module 701, the first parsing module 702, the second parsing module 703, and the transmission module 704 mentioned above correspond to S202 to S208 in the method embodiment. The examples and application scenarios implemented by the above modules and their corresponding steps are the same, but they are not limited to the content disclosed in the above method embodiment. It should be noted that the above modules, as part of the apparatus, can be executed in a computer system such as a set of computer-executable instructions.

[0157] In some embodiments, the transmission module 704 includes: a first rendering submodule and a second rendering submodule.

[0158] The first rendering submodule can be used to stream HTML fragments on the client through the basic rendering pipeline; the second rendering submodule can be used to mount business component metadata into the DOM container through the component rendering pipeline to generate a real DOM tree, and continuously render the real DOM tree in the DOM container to the client.

[0159] In some embodiments, the second rendering submodule includes: a component existence first determination unit, a first branch unit, a first virtual tree generation unit, and a first mounting unit.

[0160] The first component existence determination unit can be used to determine whether the custom business component already exists; the first branch unit can be used to generate a persistent DOM container for the custom business component if it does not exist; the first virtual tree generation unit can be used to generate a first virtual DOM tree based on the business component's metadata; and the first mounting unit can be used to mount the first virtual DOM tree to the persistent DOM container corresponding to the custom business component to generate a real DOM tree.

[0161] In some embodiments, the second rendering submodule further includes: a second branch unit, a third virtual tree generation unit, a third virtual tree acquisition unit, a difference comparison unit, and a second mounting unit.

[0162] The second branch unit can be used to generate a second virtual DOM tree based on the metadata of the custom business component if the custom business component already exists; the third virtual tree generation unit can be used to obtain the third virtual DOM tree corresponding to the custom business component, and the third virtual DOM tree is generated before the second virtual DOM tree; the difference comparison unit can be used to determine the difference data between the second virtual DOM and the third virtual DOM tree through difference comparison; and the second mounting unit can be used to update the difference data between the second virtual DOM and the third virtual DOM tree to the real DOM tree of the persistent DOM container.

[0163] In some embodiments, the Markdown text stream includes a first Markdown text, and the business component metadata includes the first component metadata; the first Markdown text includes the first component metadata, the custom business component includes the first business component, and the first component metadata is used to generate the first business component; wherein, the second rendering submodule may include: a second determination unit for the existence of the component, a third branch unit, and a fourth branch unit.

[0164] The second component existence determination unit can be used to determine whether the first business component already exists based on at least one of the following: the position of the first component's metadata in the first Markdown text, the component name of the first component's metadata, and the data content of the first component's metadata. The third branch unit can be used to generate a persistent DOM container for the first business component if it does not exist; generate a fourth virtual DOM tree based on the first component's metadata; directly mount the fourth virtual DOM tree to the persistent DOM container corresponding to the first business component to generate the real DOM tree corresponding to the first business component. The fourth branch unit can be used to generate a fifth virtual DOM tree based on the first component's metadata if the first business component already exists; obtain a sixth virtual DOM tree corresponding to the first business component, which is generated before the fifth virtual DOM tree; determine the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree through difference comparison; and update the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree to the real DOM tree corresponding to the first business component.

[0165] In some embodiments, the second parsing module 703 may include: a pattern matching submodule, a matching and positioning submodule, and a data acquisition submodule.

[0166] The pattern matching submodule can be used to perform pattern matching on the Markdown text stream through the second parsing channel; the matching and positioning submodule can be used to locate component locators in the Markdown text stream through pattern matching, and the component locators are used to identify and locate the business component metadata in the Markdown text stream; the data acquisition submodule can be used by the second parsing channel to incrementally acquire business component metadata in the Markdown text stream based on the component locators.

[0167] Since the functions of the device 700 have been described in detail in their respective method embodiments, they will not be repeated here.

[0168] The modules and / or sub-modules and / or units described in the embodiments of this disclosure can be implemented in software or hardware. The described modules and / or sub-modules and / or units can also be located in a processor. The names of these modules and / or sub-modules and / or units do not, in some cases, constitute a limitation on the module and / or sub-module and / or unit itself.

[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a portion of a module or program segment containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer program instructions.

[0170] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0171] Figure 8 A schematic diagram of an electronic device suitable for implementing embodiments of the present disclosure is shown. It should be noted that... Figure 8 The illustrated electronic device 800 is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0172] like Figure 8 As shown, the electronic device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the electronic device 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0173] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0174] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing computer program instructions for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this disclosure.

[0175] It should be noted that the computer-readable storage medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable computer program instructions. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Computer program instructions contained on a computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0176] In another aspect, this disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The aforementioned computer-readable storage medium carries one or more programs that, when executed by the device, enable the device to perform the following functions: receiving a mixed Markdown text stream, the mixed Markdown text stream including Markdown syntax data and business component metadata, the business component metadata being used to render custom business components; dynamically identifying and incrementally parsing the mixed Markdown text stream through a first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments; dynamically identifying and incrementally parsing the mixed Markdown text stream through a second parsing channel to incrementally obtain the business component metadata in the Markdown text stream; and transmitting the parsed HTML fragments and business component metadata to a client through a streaming pipeline for streaming rendering of the Markdown syntax data and business component metadata on the client.

[0177] According to one aspect of this disclosure, a computer program product or computer program is provided, comprising computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the methods provided in various optional implementations of the above embodiments.

[0178] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions of the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) and includes several computer program instructions to cause an electronic device (such as a server or terminal device, etc.) to execute the method according to the embodiments of this disclosure.

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

[0180] It should be understood that this disclosure is not limited to the detailed structures, drawing arrangements or implementations shown herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.

Claims

1. A data rendering method, characterized in that, include: The system receives a mixed Markdown text stream, which includes Markdown syntax data and business component metadata. The business component metadata is used to render custom business components. The mixed Markdown text stream is generated by the large language model based on an extended protocol of the Model Context Protocol (MCP). The mixed Markdown text stream is dynamically identified and incrementally parsed through the first parsing channel to parse the Markdown syntax data in the mixed Markdown text stream into HTML fragments; The mixed Markdown text stream is dynamically identified and incrementally parsed through the second parsing channel to incrementally obtain the metadata of the business components in the mixed Markdown text stream; The parsed HTML fragment and the business component metadata are transmitted to the client via a streaming pipeline so that the Markdown syntax data and the business component metadata can be progressively rendered by the client.

2. The method according to claim 1, characterized in that, The parsed HTML fragment and the business component metadata are transmitted to the client via a streaming pipeline, so that the Markdown syntax data and the business component metadata can be progressively rendered by the client, including: The HTML fragment is streamed on the client via the basic rendering pipeline; The business component metadata is mounted into the DOM container through the component rendering pipeline to generate a real DOM tree, and the real DOM tree in the DOM container is continuously rendered through the client.

3. The method according to claim 2, characterized in that, Mounting the business component metadata to the DOM container to generate a real DOM tree includes: Determine whether the custom business component already exists; If the custom business component does not exist, a persistent DOM container is generated for the custom business component; A first virtual DOM tree is generated based on the metadata of the business components; The first virtual DOM tree is mounted to the persistent DOM container corresponding to the custom business component to generate the real DOM tree.

4. The method according to claim 2, characterized in that, Mounting the business component metadata to the DOM container to generate a real DOM tree includes: Determine whether the custom business component already exists; If the custom business component already exists, a second virtual DOM tree is generated based on the business component's metadata; Obtain the third virtual DOM tree corresponding to the custom business component, which is generated before the second virtual DOM tree; The difference data between the second virtual DOM and the third virtual DOM tree is determined by difference comparison; Update the difference data between the second virtual DOM and the third virtual DOM tree to the real DOM tree of the persistent DOM container corresponding to the custom business component.

5. The method according to claim 2, characterized in that, The hybrid Markdown text stream includes a first Markdown text, and the business component metadata includes first component metadata; the first Markdown text includes the first component metadata, the custom business component includes the first business component, and the first component metadata is used to generate the first business component; wherein, mounting the business component metadata to the DOM container to generate a real DOM tree includes: Based on at least one of the following: the position of the first component metadata in the first Markdown text, the component name of the first component metadata, and the data content of the first component metadata, determine whether the first business component already exists; If the first business component does not exist, a persistent DOM container is generated for the first business component; a fourth virtual DOM tree is generated based on the metadata of the first component; the fourth virtual DOM tree is directly mounted to the persistent DOM container corresponding to the first business component to generate the real DOM tree corresponding to the first business component.

6. The method according to claim 2, characterized in that, The hybrid Markdown text stream includes a first Markdown text, and the business component metadata includes first component metadata; the first Markdown text includes the first component metadata, the custom business component includes the first business component, and the first component metadata is used to generate the first business component; wherein, mounting the business component metadata to the DOM container to generate a real DOM tree includes: Based on at least one of the following: the position of the first component metadata in the first Markdown text, the component name of the first component metadata, and the data content of the first component metadata, determine whether the first business component already exists; If the first business component already exists, a fifth virtual DOM tree is generated based on the metadata of the first component; a sixth virtual DOM tree corresponding to the first business component is obtained, wherein the sixth virtual DOM tree is generated before the fifth virtual DOM tree; the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree is determined by difference comparison; and the difference data between the sixth virtual DOM tree and the fifth virtual DOM tree is updated to the real DOM tree corresponding to the first business component.

7. The method according to claim 1, characterized in that, The hybrid Markdown text stream is dynamically identified and incrementally parsed through a second parsing channel to incrementally obtain the metadata of the business components in the hybrid Markdown text stream, including: The mixed Markdown text stream is pattern matched using the second parsing channel; The component locator in the mixed Markdown text stream is located by means of the pattern matching, and the component locator is used to identify and locate the metadata of the business component in the mixed Markdown text stream; The second parsing channel incrementally retrieves the business component metadata from the mixed Markdown text stream based on the component locator.

8. The method according to claim 1, characterized in that, The first parsing channel and the second parsing channel are independent of each other.

9. An electronic device, characterized in that, include: Memory; as well as A processor integrated into the memory, the processor being used to execute the data rendering method as described in any one of claims 1-8 based on computer program instructions stored in the memory.

10. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the data rendering method as described in any one of claims 1-8.

11. A computer program product comprising computer program instructions stored in a computer-readable storage medium, characterized in that, When the computer program instructions are executed by the processor, they implement the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Page rendering method and device, electronic equipment and storage medium

    CN118227129A

  • Text conversion method and device, electronic equipment and storage medium

    CN119047425A