Page rendering method and device based on large model, electronic equipment and medium

By detecting and closing unclosed start tags in the large model streaming output data, the page rendering error caused by unclosed tags is solved, thus achieving real-time page rendering and improved user experience.

CN120780397BActive Publication Date: 2026-11-24BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510887096.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2026-11-24
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

In existing technologies, when large models output markup language data for page rendering, unclosed, non-self-closing start tags cause page rendering errors, affecting rendering effects and user experience.

Method used

In the streaming output data of the large model, detect unclosed start tags, perform closing operations, and generate temporary end tags to ensure tag closure, thereby achieving real-time page rendering.

Benefits of technology

By closing unclosed tags in real time, real-time page rendering that perfectly corresponds to the output of the large model is achieved, improving rendering effects and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780397B_ABST
    Figure CN120780397B_ABST
Patent Text Reader

Abstract

The present disclosure provides a large model-based page rendering method and device, electronic equipment and medium, relating to the technical field of artificial intelligence, and particularly to the technical field of large models and front-end development. The implementation scheme is: obtaining streaming output data of the large model, wherein the streaming output data includes markup language data, and the streaming output data is associated with rendering of a target page; in response to determining that there is an unclosed first start tag in the streaming output data obtained at the current time, performing a target operation on the streaming output data obtained at the current time to obtain target data, wherein the first start tag is a non-self-closing tag, and the target operation is used to close the first start tag; and rendering the target page based on the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and more particularly to the field of large model and front-end development technology, specifically to a page rendering method, apparatus, electronic device, computer-readable storage medium and computer program product based on a large model. Background Technology

[0002] Currently, it is possible to input page rendering-related prompts into a large model, so that the large model can output markup language data for rendering the page based on the prompts.

[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention

[0004] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for rendering pages based on a large model.

[0005] According to one aspect of this disclosure, a page rendering method based on a large model is provided, comprising: acquiring streaming output data of the large model, wherein the streaming output data includes markup language data, and the streaming output data is associated with the rendering of a target page; in response to determining that there is an unclosed first start tag in the streaming output data acquired at the current time, performing a target operation on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag, and the target operation is used to close the first start tag; and rendering the target page based on the target data.

[0006] According to another aspect of this disclosure, a page rendering apparatus based on a large model is provided, comprising: a first module configured to acquire streaming output data of the large model, wherein the streaming output data includes markup language data and the streaming output data is associated with the rendering of a target page; a second module configured to, in response to determining that there is an unclosed first start tag in the streaming output data acquired at a current time, perform a target operation on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag and the target operation is used to close the first start tag; and a third module configured to render the target page based on the target data.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods described above.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the above-described method.

[0009] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the above-described method.

[0010] According to one or more embodiments of this disclosure, a page rendering method based on a large model is provided. In the case of using a large model to stream markup language data for page rendering, when it is determined that there is an unclosed, non-self-closing start tag in the currently received streaming output data, the start tag is closed to allow real-time page rendering that is completely corresponding to the current output of the large model, thereby improving the rendering effect and enhancing the user experience.

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

[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 This is a schematic diagram illustrating an example system in which various methods described herein may be implemented according to exemplary embodiments;

[0014] Figure 2 A flowchart illustrating a large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0016] Figure 4A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0017] Figure 5 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0018] Figure 6 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0020] Figure 8 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown;

[0021] Figure 9 A structural block diagram of a large-model-based page rendering apparatus according to embodiments of the present disclosure is shown; and

[0022] Figure 10 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0023] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0024] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.

[0025] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.

[0026] In related technologies, prompts related to page rendering can be input into a large model, enabling the large model to output markup language data for page rendering based on these prompts. However, the large model needs to output token by token (the smallest semantic unit of model output). Therefore, this method requires waiting for the large model's output to be completely finished before obtaining complete markup language data for page rendering. Otherwise, unclosed tags in the output data will cause page rendering errors.

[0027] To address the aforementioned issues, this disclosure provides a page rendering method based on a large model. Specifically, when a large model is used to stream markup language data for page rendering, if an unclosed, non-self-closing start tag is detected in the currently received streaming output data, a closing operation is performed on that start tag. This allows for real-time page rendering that fully corresponds to the current output of the large model, improving rendering quality and enhancing user experience.

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

[0029] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.

[0030] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of page rendering methods based on large models.

[0031] In some embodiments, server 120 may also provide other services or software applications that may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105 and / or 106 under a Software as a Service (SaaS) model.

[0032] exist Figure 1In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the large model-based page rendering method described in this paper, and is not intended to be limiting.

[0033] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to execute page rendering methods based on large models. The client devices can provide interfaces that allow users to interact with them. The client devices can also output information to the user through these interfaces. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.

[0034] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.

[0035] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0036] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0037] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0038] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.

[0039] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

[0040] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as markup language files and rendering component files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located remotely to server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.

[0041] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.

[0042] Figure 1 The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.

[0043] Figure 2 A flowchart of a large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0044] like Figure 2 As shown, the page rendering method 200 based on a large model includes:

[0045] Step 210: Obtain the streaming output data of the large model, wherein the streaming output data includes markup language data and the streaming output data is associated with the rendering of the target page;

[0046] Step 220: In response to determining that there is an unclosed first start tag in the streaming output data acquired at the current time, perform a target operation on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag, and the target operation is used to close the first start tag; and

[0047] Step 230: Render the target page based on the target data.

[0048] Therefore, when using a large model to stream markup language data for page rendering, if it is determined that there is an unclosed, non-self-closing start tag in the currently received streaming output data, the start tag is closed to allow real-time page rendering that is completely consistent with the current output of the large model, thereby improving rendering effects and enhancing user experience.

[0049] In step 210, the large model includes, but is not limited to, large language models and multimodal large models, which are models that can output markup language data for page generation and rendering based on input prompt words.

[0050] In step 210, the streaming output data can be, for example, data from a large model that is output in chunks, one token at a time (the smallest semantic unit of the model's output). For instance, streaming output data can be pushed to the target page (front-end page) based on streaming rendering methods such as SSE (Server-Sent Events, a mechanism for a server to push data one-way to a browser) to achieve rendering of the target page.

[0051] In step 210, the markup language data can be, for example, HTML (Hyper Text Markup Language) data, XHTML (eXtensible HyperText Markup Language) data, CSS (Cascading Style Sheets) data, and JavaScript (a programming language) data.

[0052] In step 220, the non-self-closing tag includes a start tag and an end tag, to define the structure and content of the related element based on the start tag and the end tag.

[0053] In the example, the HTML-formatted streaming output data obtained at the current moment is as follows:

[0054] "...

[0055] <title>….< / title>

[0056] …”

[0057] As can be seen, the currently acquired streaming output data contains at least two unclosed first start tags, namely, and If page rendering is performed directly based on the aforementioned streaming output data at the current moment, an error will occur. Therefore, in this case, a target operation can be performed on the two first start tags to close them, thereby achieving a page rendering progress that completely corresponds to the aforementioned streaming output data.

[0058] Figure 3 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0059] According to some embodiments, such as Figure 3 As shown, the target operations include:

[0060] Step 310: Generate the first end tag corresponding to the first start tag; and

[0061] Step 320: Insert the first end tag into the streaming output data obtained at the current moment.

[0062] Thus, by generating a first end tag for the first start tag and inserting it into the streaming output data, the closure of the first start tag is achieved simply and effectively.

[0063] For example, referring to the example above, labels can be generated and inserted. After tagging, and then receiving the subsequent data. The tag-related element content is inserted before the tag is confirmed to be received from the output of the large model.

[0064] For example, because the element content of the tag includes Tags and their related content are used to generate tags, which are then inserted after the tags to enable real-time page rendering.

[0065] It is understood that the examples above for the first start tag and the first end tag are for illustrative purposes only, and the forms of the first start tag and the second start tag may differ for different types of markup languages.

[0066] Figure 4 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0067] According to some embodiments, such as Figure 4 As shown, method 200 also includes:

[0068] Step 410: In response to determining that a second end label corresponding to a first start label exists in the streaming output data acquired at the first time after the current time, delete the first end label to update the target data; and

[0069] Step 420: Render the target page based on the updated target data.

[0070] The first end tag generated above can be regarded as a temporary tag set for real-time page rendering. Therefore, after determining the second end tag corresponding to the first start tag of the received large model output, the temporary first end tag can be deleted to ensure the correctness of the received streaming output data.

[0071] In step 410, the second end tag and the first end tag may be the same or different. For example, since the first end tag is a temporary tag added to achieve tag closure, its structure can be slightly modified (e.g., by adding a marker word) to distinguish it from the second end tag.

[0072] For example, if the first end label and the second end label are exactly the same, it is also possible to choose to delete the second end label while retaining the first end label.

[0073] In one example, part of the execution process of the target operation based on SSE streaming rendering is shown below:

[0074] / / SSE data block processing example

[0075] const sse=new EventSource(' / stream');

[0076] sse.onmessage=(e)=>{

[0077] const chunk=fixSelfClosing(markdownToHTML(e.data));

[0078] const vnode=htmlToVnodes(chunk);

[0079] patchDOM(currentVNode,vnode);

[0080] };

[0081] / / Label Closure Algorithm

[0082] function fixSelfClosing(html){

[0083] return html

[0084] .replace( / <img([^> ]+)\ / ? > / g,'<img$1> ')

[0085] .replace( / <br\ / ?> / g,' ');

[0086] }

[0087] It is understandable that the tags in the above examples are standard tags in markup languages, so the specific meaning of each tag will not be elaborated here.

[0088] In step 230, for example, the rendering of the target page can be implemented based on a headless browser. For instance, after obtaining the target data, the headless browser parses the target data to render the front-end page (target page).

[0089] For example, the rendering process may specifically include chunked loading and progressive rendering, rich text editing, SSE output, markdown (a lightweight markup language) container format conversion, HtmlToVnodes (a node conversion method) conversion, dynamic component insertion, regular expression preprocessing standardization, parser serialization, and dynamic HTML insertion, etc., which will not be elaborated further.

[0090] Figure 5 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0091] According to some embodiments, such as Figure 5 As shown, method 200 also includes:

[0092] Step 510: Obtain the chart component library, wherein the chart component library includes multiple self-closing chart tags, and each of the multiple self-closing chart tags corresponds to at least one type of chart component;

[0093] Step 520: In response to determining that the currently acquired streaming output data contains a prompt word corresponding to at least one self-closing chart label in the chart component library, invoke at least one self-closing chart label; and

[0094] Step 530: Render the target page based on at least one self-closing chart label and target data.

[0095] Chart components are typically associated with a large number of tags. When a chart component needs to be rendered for a target page, performing the target operation to close the tag for each tag associated with the chart component would be complex and error-prone.

[0096] Therefore, a corresponding mapping relationship of "hint word - self-closing chart label - chart component" can be customized for each type of chart component, so that the self-closing chart label can be called directly based on the hint word to realize the rendering of the corresponding chart component, effectively reducing the processing difficulty.

[0097] In step 510, for example, the chart component library includes chart component types including but not limited to bar chart components, pie chart components, and flowchart components, and the multiple self-closing chart labels in the chart component library can be, for example, custom labels.

[0098] In step 510, for example, the large model can be pre-trained so that it can directly output self-closing chart labels from the chart component library when chart component rendering is required.

[0099] In step 520, for example, self-closing chart labels do not require a closing operation, which can further reduce processing complexity.

[0100] In step 520, for example, an open-source visualization library based on canvas and ECharts (two types of open-source visualization libraries implemented using JavaScript) can be used as a chart component library.

[0101] In step 520, for example, the markup language code corresponding to the reference chart component can be packaged as the initial component code package, and the association between the self-closing chart tag and the corresponding initial component code package can be established by customizing the relationship, so as to realize the calling of the initial component code package based on the self-closing chart tag for the front-end page to parse and render.

[0102] In one example, in response to determining the output prompt "insert bar chart" for the large model, it can match... <canvas>The component (used for calling related charts from the canvas library) performs the following parsing process:

[0103] const dynamicComponents = {

[0104] 'canvas':()=>import('. / Chart.vue')

[0105] }

[0106] In step 530, for example, after calling the initial component code package, it can be parsed together with other related content in the target data to adjust the style, layout and content of the final rendered bar chart component for specific scenarios.

[0107] Figure 6 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0108] According to some embodiments, such as Figure 6 As shown, prior to step 210, method 200 further includes:

[0109] Step 610: Obtain input data, wherein the input data indicates at least one of the page theme and page layout of the target page; and

[0110] Step 620: Process the input data using a large model to output streaming data.

[0111] Therefore, based on the understanding capabilities of the large model, it is possible to understand and generate corresponding streaming output data for the target page, so as to achieve correct rendering of the target page.

[0112] In step 610, the input data can be, for example, prompts entered by the user. For instance, the input could be "Generate a weather forecast page, using a line graph to depict the temperature changes in location A over the next 7 days," etc. For instance, in the case of a multimodal large model, the input data can further include image data, audio data, and video data, etc., to enable the large model to better understand the user's needs.

[0113] For example, page themes include, but are not limited to, news, encyclopedia, education, research reports, academic, search, and structured pages.

[0114] For example, a page layout includes page elements, which include, but are not limited to, text, images, audio, video, charts, maps, etc.

[0115] According to some embodiments, after step 230, method 200 further includes:

[0116] Step 240: Display at least one of the first interface and the second interface, wherein the first interface displays the streaming output data acquired at the current moment, and the second interface displays the target page rendered based on the target data.

[0117] Therefore, by visualizing the current output data of the large model and the real-time page rendering effect that corresponds exactly to the current output data, users can more intuitively obtain the real-time progress and specific effects of page rendering, effectively improving the user experience.

[0118] Figure 7 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0119] According to some embodiments, such as Figure 7 As shown, method 200 also includes:

[0120] Step 710: In response to confirming the display of the first interface, allow the interactive object to edit the currently acquired streaming output data based on the first interface; and

[0121] Step 720: In response to confirming the display of the second interface, allow the interactive object to edit the rendered target page based on the second interface.

[0122] After visualizing the current output data of the large model and the real-time page rendering effect that corresponds exactly to the current output data, interactive objects (such as users) can be directly edited based on the display interface, which effectively improves the user experience.

[0123] In step 710, exemplarily, in the first interface, the user is allowed to directly modify the code, and the user's modifications will be reflected in the second interface in real time. For example, the user is allowed to modify at least one of the style, layout, and content of the target page through code.

[0124] In step 720, for example, in the second interface, the user is allowed to directly modify at least one of the style, layout, and content of the target page.

[0125] Figure 8 A partial flowchart of another large-model-based page rendering method according to an embodiment of the present disclosure is shown.

[0126] According to some embodiments, such as Figure 8 As shown, method 200 also includes:

[0127] Step 810: In response to determining that the streaming output data also includes non-markup language data, obtain a rendering component for rendering the target page based on the non-markup language data; and

[0128] Step 820: Render the target page based on the rendering components and target data.

[0129] In some cases, the streaming output data of a large model may also include non-markup language data, which browsers cannot directly parse. Therefore, in this case, the corresponding upper-level component (rendering component) can be obtained to help achieve real-time rendering of the target page.

[0130] In step 810, for example, the non-markup language data can be, for example, JSON (JavaScript Object Notation) data and TXT (a text format) data.

[0131] According to some embodiments, after step 230, method 200 further includes:

[0132] Step 250: Convert the rendered target page into an image file.

[0133] This enables the conversion of markup language data into image formats for output, expanding its applicability and improving the user experience.

[0134] For example, image files can be, for instance, PDF files and JPG files.

[0135] For example, after the target page is rendered, it can be paginated and headers and footers can be added to perform PDF rendering and generate a binary stream, thereby converting the target page into an image file.

[0136] For example, when the target page is divided into multiple images, the target page can be analyzed in blocks and rendered in parallel, and then PDF stitched together so that the target page can be output as a complete long image.

[0137] According to another aspect of this disclosure, a page rendering apparatus based on a large model is provided. For example... Figure 9 As shown, the page rendering apparatus 900 based on a large model includes: a first module 910 configured to acquire streaming output data of the large model, wherein the streaming output data includes markup language data and is associated with the rendering of a target page; a second module 920 configured to, in response to determining that there is an unclosed first start tag in the streaming output data acquired at the current time, perform a target operation on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag and the target operation is used to close the first start tag; and a third module 930 configured to render the target page based on the target data.

[0138] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned method.

[0139] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform the aforementioned method.

[0140] According to another aspect of this disclosure, a computer program product is also provided, including a computer program, wherein the computer program implements the aforementioned method when executed by a processor.

[0141] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the electronic device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0142] Multiple components in electronic device 1000 are connected to I / O interface 1005, including: input unit 1006, output unit 1007, storage unit 1008, and communication unit 1009. Input unit 1006 can be any type of device capable of inputting information to electronic device 1000. Input unit 1006 can receive input digital or character information and generate key signal input related to user settings and / or function control of electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 1007 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1008 may include, but is not limited to, disk and optical disk. Communication unit 1009 allows electronic device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth. TM Devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices and / or the like.

[0143] The computing unit 1001 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as GPU-based matrix computation methods. For example, in some embodiments, the GPU-based matrix computation method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the GPU-based matrix computation method described above can be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform GPU-based matrix computation methods by any other suitable means (e.g., by means of firmware).

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

[0145] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

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

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

[0148] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0149] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0150] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0151] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.< / canvas>

Claims

1. A page rendering method based on a large model, comprising: Obtain the streaming output data of the large model, wherein the streaming output data includes markup language data and the streaming output data is associated with the rendering of the target page; In response to determining that there is an unclosed first start tag in the streaming output data acquired at the current time, a target operation is performed on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag, and the target operation is used to close the first start tag, wherein the target operation includes: generating a first end tag corresponding to the first start tag; and inserting the first end tag into the streaming output data acquired at the current time; Render the target page based on the target data; In response to determining that a second end tag corresponding to the first start tag exists in the streaming output data acquired at a first time after the current time, the first end tag is deleted to update the target data; and The target page is rendered based on the updated target data.

2. The method according to claim 1, further comprising: Obtain a chart component library, wherein the chart component library includes multiple self-closing chart tags, and each of the multiple self-closing chart tags corresponds to at least one type of chart component; In response to determining that the streaming output data acquired at the current time contains a prompt word corresponding to at least one self-closing chart label in the chart component library, the at least one self-closing chart label is invoked; and The target page is rendered based on the at least one self-closing chart label and the target data.

3. The method according to claim 1, wherein, Before acquiring the streaming output data of the large model, the method further includes: Obtain input data, wherein the input data indicates at least one of the page theme and page layout of the target page; and The input data is processed using the large model to output the streaming output data.

4. The method according to any one of claims 1-3, wherein, After rendering the target page based on the target data, the method further includes: Display at least one of a first interface and a second interface, wherein the first interface displays the streaming output data acquired at the current moment, and the second interface displays the target page rendered based on the target data.

5. The method according to claim 4, further comprising: In response to determining that the first interface is to be displayed, the interactive object is allowed to edit the streaming output data acquired at the current moment based on the first interface; as well as In response to determining that the second interface is to be displayed, the interactive object is allowed to edit the rendered target page based on the second interface.

6. The method according to any one of claims 1-3, further comprising: In response to determining that the streaming output data also includes non-markup language data, a rendering component for rendering the target page based on the non-markup language data is obtained; as well as The target page is rendered based on the rendering component and the target data.

7. The method according to any one of claims 1-3, wherein, After rendering the target page based on the target data, the method further includes: The rendered target page is converted into an image file.

8. A page rendering device based on a large model, comprising: The first module is configured to acquire streaming output data of the large model, wherein the streaming output data includes markup language data and is associated with the rendering of the target page; The second module is configured to, in response to determining that there is an unclosed first start tag in the streaming output data acquired at the current time, perform a target operation on the streaming output data acquired at the current time to obtain target data, wherein the first start tag is a non-self-closing tag, and the target operation is used to close the first start tag, wherein the target operation includes: generating a first end tag corresponding to the first start tag; and inserting the first end tag into the streaming output data acquired at the current time; The third module is configured to render the target page based on the target data; The large-model-based page rendering apparatus further includes: a module for deleting the first end tag to update the target data in response to determining that a second end tag corresponding to the first start tag exists in the streaming output data acquired at a first time after the current time; and A module for rendering the target page based on the updated target data.

9. An electronic device, comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.

11. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Inserting a benign tag in an unclosed fragment

    US20120311427A1