Page rendering method, device, and storage medium

By generating multiple call functions on the server to simulate multiple interface requests, the problem that a single streaming interface cannot support streaming rendering is solved, achieving faster page rendering speed and better user experience.

WO2025201412A1PCT designated stage Publication Date: 2025-10-02BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/085051
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-29
Filing Date
2025-03-26
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

In some business scenarios, the server only provides a streaming interface that cannot support streaming rendering, resulting in the inability to effectively transmit HTML data in segments for rendering, affecting page rendering performance and user experience.

Method used

By receiving access requests from terminal devices, a streaming interface is used to asynchronously obtain multiple data blocks of the target page, and multiple calling functions are generated. These data blocks are called separately for rendering using streaming rendering, simulating multiple interface requests and realizing the return of streaming rendering results.

Benefits of technology

It reduces the number of interfaces and the time consumption, improves the rendering speed of the target page, reduces the waiting time of terminal device users, and improves the user browsing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025085051_02102025_PF_FP_ABST
    Figure CN2025085051_02102025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a page rendering method, a device, and a storage medium. The method comprises: by means of a server end, receiving an access request of a terminal device for a target page, and asynchronously acquiring a plurality of data chunks of the target page by means of a streaming interface; generating a plurality of call functions for the streaming interface, wherein each call function is used for calling one data chunk; and performing rendering in a streaming rendering mode, respectively calling the plurality of call functions during the rendering to acquire corresponding data chunks, performing rendering to obtain a streaming rendering result, and returning the streaming rendering result to the terminal device. A server end acquires a plurality of data chunks of a target page by means of a streaming interface, and calls, by means of call functions during streaming rendering, the plurality of data chunks which are acquired by the streaming interface, such that it is not necessary to use a plurality of interfaces to request the data chunks in a streaming rendering stage, and the combination of the streaming interface and streaming rendering is realized, thereby increasing the rendering speed of the target page, and improving the experience of a user browsing the target page.
Need to check novelty before this filing date? Find Prior Art

Description

Page rendering method, device and storage medium

[0001] This application claims priority to Chinese Patent Application No. 202410382056.1 filed on March 29, 2024, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] The embodiments of the present disclosure relate to a page rendering method, device, and storage medium. Background Art

[0003] When optimizing the performance of front-end pages, streaming rendering is usually used during back-end rendering. That is, the server transmits HTML data in chunks (chunk-by-chunk) for rendering, without having to wait until the entire page is rendered before sending it to the terminal device. This can greatly improve page rendering performance and allow terminal device users to see page content earlier.

[0004] When the server retrieves data chunks from a page, each chunk requires a specific API (usually determined by the framework). This API can only handle chunks returned once, not multiple chunks. Therefore, streaming rendering typically requires multiple APIs. However, in some business scenarios, only one API is provided. If this API is a streaming API, meaning it returns multiple chunks, streaming rendering is unsupported. Summary of the Invention

[0005] Embodiments of the present disclosure provide a page rendering method, device, and storage medium.

[0006] In a first aspect, an embodiment of the present disclosure provides a page rendering method, applied to a server, the method comprising:

[0007] receiving an access request for a target page sent by a terminal device, and asynchronously acquiring multiple data blocks of the target page through a streaming interface;

[0008] For the streaming interface, generating a plurality of calling functions, wherein each calling function is used to call a data block received by the streaming interface;

[0009] The target page is rendered using a streaming rendering method. During the rendering process, the multiple calling functions are called separately through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result. The streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

[0010] In a second aspect, an embodiment of the present disclosure provides a page rendering device, including:

[0011] A request unit, configured to receive an access request for a target page sent by a terminal device;

[0012] A receiving unit, configured to asynchronously obtain multiple data blocks of the target page through a streaming interface;

[0013] a conversion unit, configured to generate a plurality of calling functions for the streaming interface, wherein each calling function is configured to call a data block received by the streaming interface;

[0014] A rendering unit is used to render the target page using a streaming rendering method. During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result, and the streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0016] The memory stores computer-executable instructions;

[0017] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the page rendering method described in the first aspect and various possible designs of the first aspect.

[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the page rendering method described in the first aspect and various possible designs of the first aspect is implemented.

[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the page rendering method described in the first aspect and various possible designs of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] FIG1 is a diagram illustrating an example scenario of a page rendering method provided by an embodiment of the present disclosure;

[0022] FIG2 is a schematic diagram of a page rendering method according to an embodiment of the present disclosure;

[0023] FIG3 is a flow chart of a page rendering method provided by another embodiment of the present disclosure;

[0024] FIG4 is a structural block diagram of a page rendering device provided by an embodiment of the present disclosure;

[0025] FIG5 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0027] When optimizing the performance of front-end pages, streaming rendering is usually used during back-end rendering. That is, the server transmits HTML data in chunks (chunk-by-chunk) for rendering, without having to wait until the entire page is rendered before sending it to the terminal device. This can greatly improve page rendering performance and allow terminal device users to see page content earlier.

[0028] When the server retrieves data chunks from a page, each chunk requires a specific API (usually determined by the framework). This specific API can only handle a chunk of data returned once, not multiple chunks. Therefore, streaming rendering often requires multiple APIs. For example, in streaming rendering, data is retrieved from each component through a specific API.

[0029] However, in some business scenarios, only one interface is provided. If the interface is a streaming interface, that is, the interface returns data blocks multiple times, streaming rendering cannot be supported.

[0030] In order to solve the above technical problems, the present disclosure provides a page rendering method, in the hope of realizing the combination of streaming interface and streaming rendering in the back-end rendering process. Specifically, by receiving an access request for a target page sent by a terminal device, and asynchronously obtaining multiple data blocks of the target page through a streaming interface; generating multiple calling functions for the streaming interface, wherein each calling function is used to call a data block received by the streaming interface; rendering the target page using streaming rendering, calling the multiple calling functions respectively through a preset data acquisition interface during the rendering process to obtain corresponding data blocks, and rendering is performed respectively according to each data block to obtain a streaming rendering result, and returning the streaming rendering result to the terminal device, so that the terminal device displays the target page according to the streaming rendering result. In the embodiment of the present disclosure, after the server receives an access request for a target page from a terminal device, multiple data blocks of the target page can be obtained through a streaming interface, and multiple data blocks obtained by the streaming interface can be called during the streaming rendering process by calling a function, so that there is no need to use multiple interfaces to request data blocks during the streaming rendering stage, thereby realizing the combination of streaming interface and streaming rendering, reducing the number of interfaces and interface time consumption, and improving the rendering speed of the target page, reducing the waiting time of the terminal device user, and improving the user's experience of browsing the target page.

[0031] The application scenario of the page rendering method of the embodiment of the present disclosure is shown in Figure 1, including a terminal device and a server, wherein the terminal device may send an access request for the target page to the server when it needs to access the target page. After receiving the access request, the server may asynchronously obtain multiple data blocks of the target page through a streaming interface; in addition, the server may generate multiple calling functions for the streaming interface, wherein each calling function is used to call a data block received by the streaming interface; the target page is rendered using a streaming rendering method, and during the rendering process, multiple calling functions are called separately through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed separately according to each data block to obtain a streaming rendering result, and the streaming rendering result is returned to the terminal device, so that the terminal device displays the target page according to the streaming rendering result.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] The page rendering method disclosed herein will be described in detail below in conjunction with specific embodiments.

[0034] Refer to Figure 2, which is a flow chart of a page rendering method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a server, and the page rendering method includes:

[0035] S201: Receive an access request for a target page sent by a terminal device, and asynchronously obtain multiple data blocks of the target page through a streaming interface.

[0036] In this embodiment, when a terminal device needs to access a target page, it can send an access request for the target page to the server. To increase the rendering speed of the target page by the terminal device and allow the user of the terminal device to see the page content of the target page as soon as possible, the server can divide the target page into multiple data chunks and use a streaming interface to obtain the multiple data chunks of the target page, such as obtaining the multiple data chunks of the target page from a database. The use of a streaming interface is due to business needs, that is, only one interface can be provided for the server to obtain the data of the target page. The target page is divided into multiple data chunks, so the streaming interface is used. In addition, this embodiment does not limit the specific method for the server to divide the data chunks of the target page.

[0037] Among them, since the target page is divided into multiple data blocks and is received using a streaming interface, and streaming rendering can be used subsequently, there is no need to wait for each data block to be returned before executing subsequent steps. That is, in this embodiment, multiple data blocks of the target page returned by the server can be asynchronously received through a streaming interface.

[0038] S202: Generate multiple calling functions for the streaming interface, where each calling function is used to call a data block received by the streaming interface.

[0039] In this embodiment, after receiving an access request for a target page from a terminal device, the server can generate multiple call functions for the streaming interface. The call function is used to call a data block received by the streaming interface, so as to call multiple interfaces required for streaming rendering, each interface being used to obtain a data block of the target page. That is, the number of call functions can be equal to the number of data blocks of the target page. It should be noted that the generation of the call function can be executed after receiving the access request for the target page from the terminal device, without waiting for the receipt of multiple data blocks of the target page returned by the server. That is, S202 is not limited to being executed after S201, and can also be executed after S201 receives the access request for the target page from the terminal device.

[0040] Optionally, for different target pages, the calling functions are different. In order to isolate the calling functions of different target pages, the page context information (Page Context) of the target page can be obtained, and multiple calling functions can be generated based on the page context information and the number of data blocks of the target page. The input of any calling function is the page context information, and the output is the corresponding data block. The number of data blocks of the target page is used to limit the number of multiple calling functions, that is, the number of multiple calling functions is equal to the number of data blocks of the target page. The page context generally refers to the data or state associated with a specific page or session when the server processes the page, including but not limited to terminal device information, session variables, request parameters, the URL (Uniform Resource Location) of the target page, etc. The page context information is used to distinguish different target pages to avoid the inability to distinguish calling functions in a scenario where multiple different target pages exist concurrently, that is, to achieve isolation between different target pages, and at the same time, different calling functions of the same target page use and share the same page context information, and can also be adapted to the preset data acquisition interface in the subsequent streaming rendering process.

[0041] Optionally, a preset converter module can be used to generate a call function. Specifically, the page context information of the target page and the number of data blocks of the target page can be used as input to call the preset converter module, and the preset converter module can generate the multiple call functions. The preset conversion module can specifically use any feasible algorithm to realize the generation of the call function. It should be noted that in order to solve the call to the preset conversion module in the concurrent scenario of multiple different target pages, the page context information is isolated when different target pages call the preset conversion module, and the page context information is shared when the same target page calls the preset conversion module to generate different call functions. This can be achieved with the help of the Node native module async_hooks.

[0042] S203. Render the target page using a streaming rendering method. During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result. The streaming rendering result is returned to the terminal device, so that the terminal device displays the target page according to the streaming rendering result.

[0043] In this embodiment, a streaming rendering approach is used to render the target page. Traditional streaming rendering typically requires obtaining the target page's data (transmitting Hypertext Markup Language (HTML) data in chunks) from the server in a stream (chunk-by-chunk) format for rendering. The server typically uses a pre-defined data acquisition interface to obtain page data during rendering. However, this interface can only process page data returned once, not multiple times. In other words, in traditional streaming rendering, the number of pre-defined data acquisition interfaces must equal the number of segments of the target page, and each pre-defined data acquisition interface triggers a request (e.g., to a database) to obtain a segment of page data, requiring multiple requests. However, in this embodiment, due to business requirements, only one streaming interface exists. Therefore, the pre-defined data acquisition interface can be used to call the multiple call functions generated above to obtain the corresponding data chunks, simulating the pre-defined data acquisition interface sending a single request to obtain the segmented data of the target page in traditional streaming rendering. After obtaining the data chunks, other streaming rendering operations can be performed based on the data chunks.

[0044] Specifically, as shown in Figure 3, during the rendering process, different call functions can be called through a preset data acquisition interface at different stages to obtain corresponding data blocks, and then rendered to obtain the rendering results and sent to the terminal device. After one stage of rendering is completed, the next stage of calling and rendering can be carried out. The initialization process in Figure 3 also includes obtaining page context information and generating call functions, which will not be detailed here.

[0045] Optionally, when rendering is performed separately based on each data block to obtain a streaming rendering result, each data block may be rendered separately to obtain streaming Hypertext Markup Language (HTML) data, and the streaming HTML data may be used as the streaming rendering result. The data block received by the streaming interface may not be HTML data, for example, it may be JSON data. Therefore, after calling any call function in the preset data acquisition interface to obtain the corresponding data block, the data block may be processed into HTML data for rendering the HTML data.

[0046] In addition, in traditional streaming rendering, the preset data acquisition interface usually needs to request data based on the page context information (for example, requesting data from a database), that is, the page context information is the input of the preset data acquisition interface, and the input of the calling function in this embodiment is also designed to be page context information, that is, during the rendering process, multiple calling functions are called separately through the preset data acquisition interface, and the page context information is input to the multiple calling functions respectively, and the corresponding data blocks output by the multiple calling functions are obtained respectively, so that the page context information can be input normally to the preset data acquisition interface, and the simulated preset data acquisition interface requests data blocks based on the page context information, and the calling function can be adapted to the preset data acquisition interface, that is, the page context information is consumed to output data blocks.

[0047] The page rendering method provided in this embodiment receives an access request for a target page sent by a terminal device, and asynchronously obtains multiple data blocks of the target page through a streaming interface; generates multiple call functions for the streaming interface, wherein each call function is used to call a data block received by the streaming interface; renders the target page using a streaming rendering method, and during the rendering process, calls the multiple call functions respectively through a preset data acquisition interface to obtain corresponding data blocks, and renders according to each data block respectively to obtain a streaming rendering result, and returns the streaming rendering result to the terminal device so that the terminal device displays the target page according to the streaming rendering result. In this embodiment, the server obtains multiple data blocks of the target page through a streaming interface, and calls the multiple data blocks obtained by the streaming interface during the streaming rendering process by calling a function, so that the streaming rendering stage does not need to use multiple interfaces to request data blocks, realizes the combination of streaming interface and streaming rendering, reduces the number of interfaces and interface time consumption, and improves the rendering speed of the target page, reduces the waiting time of the terminal device user, and improves the user's browsing experience of the target page.

[0048] Based on any of the above embodiments, the multiple data blocks of the target page may specifically include a first data block, a second data block and a third data block; wherein the first data block is a data block corresponding to the predicted page content of the target page, and the predicted page content is the page content obtained by the prediction model according to the access request. The prediction model is a model for the server to quickly predict a part of the page content in the target page according to the access request. For example, for a feed stream player page, the first multimedia content in the feed stream player page can be predicted according to the access request through the prediction model; the second data block is a data block for characterizing the predictive validity of the predicted page content. Optionally, the predictive validity can be determined by the server comparing the actual page content obtained by the search engine for the target page with the predicted page content, wherein the actual page content of the target page is the page content obtained by the search engine for the target page normally, and by comparing the predicted page content with the target page. The predicted validity of the predicted page content can be determined by comparing the first data block with the corresponding part of the actual page content obtained. Optionally, when the server obtains the page content of the target page through the search engine, it can give priority to obtaining the part corresponding to the predicted page content, so as to obtain the second data block earlier. Optionally, the predicted validity can be identified by a Boolean value; the third data block is a data block corresponding to the actual page content of the target page, and the actual page content is the page content obtained through the search engine according to the access request, and whether the third data block includes the predicted page content is determined according to the predicted validity of the predicted page content, that is, if the predicted page content is predicted to be valid, the first data block is valid, and the third data block may not include the predicted page content, and there is no need to repeatedly send the predicted page content to reduce the data volume of the third data block. If the predicted page content is invalid, the first data block is invalid, and the third data block needs to include the complete actual page content of the target page.

[0049] On the basis of the above embodiment, S203 calls the multiple calling functions respectively through the preset data acquisition interface to obtain corresponding data blocks during the rendering process, and performs rendering according to each data block respectively, which may specifically include:

[0050] During the rendering process, a calling function corresponding to the second data block is preferentially called through a preset data acquisition interface to obtain the second data block;

[0051] If the second data block indicates that the predicted page content prediction is valid, the calling function corresponding to the first data block is called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block to preferentially display the predicted page content in the target page; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block.

[0052] In this embodiment, since the multiple data blocks of the target page include the above-mentioned first data block, second data block and third data block, during the rendering process, the calling function corresponding to the second data block is preferentially called through the preset data acquisition interface to obtain the second data block, and whether the predicted page content is predicted to be valid is determined based on the second data block. If the prediction is determined to be valid, it means that the first data block is available, and the first data block may be received by the streaming interface earlier than the third data block. Therefore, the calling function corresponding to the first data block can be called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block, and the rendering result is sent to the terminal device, so that the predicted page content included in the first data block is preferentially displayed in the target page on the terminal device; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block, and the rendering result is sent to the terminal device. Through the above process, the user can first view a part of the page content and then view the remaining page content, thereby reducing the user's waiting time.

[0053] In addition, if the second data block indicates that the predicted page content prediction is invalid, the calling function corresponding to the third data block is directly called through the preset data acquisition interface to obtain the third data block, and the entire page of the target page is rendered according to the third data block.

[0054] In this embodiment, if during the rendering process, the calling function corresponding to the second data block is preferentially called through the preset data acquisition interface to obtain the second data block, it is determined whether the predicted page content is valid based on the second data block. If it is determined that the prediction is invalid, it means that the first data block is unavailable, and there is no need to call the calling function corresponding to the first data block through the preset data acquisition interface to obtain the first data block. Instead, the calling function corresponding to the third data block is directly called through the preset data acquisition interface to obtain the third data block. Since the predicted page content is not predicted effectively, the third data block includes the complete actual page content of the target page. Therefore, the entire page of the target page can be rendered according to the third data block, and then the rendering result is sent to the terminal device, where the rendering result can also be sent to the terminal device in segments.

[0055] Corresponding to the page rendering method described in the above embodiment, FIG4 is a block diagram of the structure of a page rendering device provided by an embodiment of the present disclosure. For ease of illustration, only the portions relevant to the embodiment of the present disclosure are shown. Referring to FIG4 , the page rendering device 400 includes a request unit 401, a receiving unit 402, a conversion unit 403, and a rendering unit 404.

[0056] The request unit 401 is configured to receive an access request for a target page sent by a terminal device;

[0057] A receiving unit 402 is configured to asynchronously obtain multiple data blocks of the target page through a streaming interface;

[0058] The conversion unit 403 is configured to generate a plurality of calling functions for the streaming interface, wherein each calling function is configured to call a data block received by the streaming interface;

[0059] The rendering unit 404 is used to render the target page using a streaming rendering method. During the rendering process, the multiple calling functions are called separately through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result, and the streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

[0060] In one or more embodiments of the present disclosure, when rendering according to each data block to obtain a streaming rendering result, the rendering unit 404 is configured to:

[0061] Rendering is performed on each data block to obtain streaming hypertext markup language HTML data, and the streaming HTML data is used as the streaming rendering result.

[0062] In one or more embodiments of the present disclosure, when generating multiple call functions for the stream interface, the conversion unit 403 is configured to:

[0063] The page context information of the target page is obtained, and the multiple calling functions are generated according to the page context information and the number of data blocks of the target page, wherein the input of any calling function is the page context information and the output is the corresponding data block.

[0064] In one or more embodiments of the present disclosure, when the rendering unit 404 calls the multiple calling functions respectively through the preset data acquisition interface to obtain corresponding data blocks during the rendering process, it is configured to:

[0065] During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface, and the page context information is respectively input into the multiple calling functions, and corresponding data blocks output by the multiple calling functions are respectively acquired.

[0066] In one or more embodiments of the present disclosure, when generating the multiple calling functions according to the page context information and the number of data blocks of the target page, the conversion unit 403 is configured to:

[0067] The page context information and the number of data blocks of the target page are taken as input, and a preset converter module is called to generate the multiple calling modules.

[0068] In one or more embodiments of the present disclosure, the plurality of data blocks include a first data block, a second data block, and a third data block;

[0069] The first data block is a data block corresponding to the predicted page content of the target page, and the predicted page content is the page content obtained by the prediction model according to the access request; the second data block is a data block used to characterize the predictive validity of the predicted page content; the third data block is a data block corresponding to the actual page content of the target page, and the actual page content is the page content obtained by the search engine according to the access request, and whether the predicted page content is included in the third data block is determined based on the predictive validity of the predicted page content.

[0070] In one or more embodiments of the present disclosure, the rendering unit 404 calls the multiple calling functions respectively through the preset data acquisition interface to obtain corresponding data blocks during the rendering process, and performs rendering according to each data block respectively, which is used to:

[0071] During the rendering process, a calling function corresponding to the second data block is preferentially called through a preset data acquisition interface to obtain the second data block;

[0072] If the second data block indicates that the predicted page content prediction is valid, the calling function corresponding to the first data block is called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block to preferentially display the predicted page content in the target page; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block.

[0073] In one or more embodiments of the present disclosure, the rendering unit 404 is further configured to:

[0074] If the second data block indicates that the predicted page content prediction is invalid, the calling function corresponding to the third data block is directly called through the preset data acquisition interface to obtain the third data block, and the entire page of the target page is rendered according to the third data block.

[0075] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0076] Referring to FIG5 , there is shown a schematic diagram of the structure of an electronic device 500 suitable for implementing an embodiment of the present disclosure. The electronic device 500 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG5 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0077] As shown in FIG5 , the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0078] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG5 shows an electronic device 500 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0079] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0080] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0081] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0082] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0083] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).

[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0086] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

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

[0088] In a first aspect, according to one or more embodiments of the present disclosure, a page rendering method is provided, which is applied to a server, and the method includes:

[0089] receiving an access request for a target page sent by a terminal device, and asynchronously acquiring multiple data blocks of the target page through a streaming interface;

[0090] For the streaming interface, generating a plurality of calling functions, wherein each calling function is used to call a data block received by the streaming interface;

[0091] The target page is rendered using a streaming rendering method. During the rendering process, the multiple calling functions are called separately through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result. The streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

[0092] According to one or more embodiments of the present disclosure, rendering according to each data block to obtain a streaming rendering result includes:

[0093] Rendering is performed on each data block to obtain streaming hypertext markup language HTML data, and the streaming HTML data is used as the streaming rendering result.

[0094] According to one or more embodiments of the present disclosure, generating multiple calling functions for the streaming interface includes:

[0095] The page context information of the target page is obtained, and the multiple calling functions are generated according to the page context information and the number of data blocks of the target page, wherein the input of any calling function is the page context information and the output is the corresponding data block.

[0096] According to one or more embodiments of the present disclosure, the step of respectively calling the multiple calling functions through a preset data acquisition interface during the rendering process to acquire corresponding data blocks includes:

[0097] During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface, and the page context information is respectively input into the multiple calling functions, and corresponding data blocks output by the multiple calling functions are respectively acquired.

[0098] According to one or more embodiments of the present disclosure, generating the multiple calling functions according to the page context information and the number of data blocks of the target page includes:

[0099] The page context information and the number of data blocks of the target page are taken as input, and a preset converter module is called to generate the multiple calling modules.

[0100] According to one or more embodiments of the present disclosure, the plurality of data blocks include a first data block, a second data block, and a third data block;

[0101] The first data block is a data block corresponding to the predicted page content of the target page, and the predicted page content is the page content obtained by the prediction model according to the access request; the second data block is a data block used to characterize the predictive validity of the predicted page content; the third data block is a data block corresponding to the actual page content of the target page, and the actual page content is the page content obtained by the search engine according to the access request, and whether the predicted page content is included in the third data block is determined based on the predictive validity of the predicted page content.

[0102] According to one or more embodiments of the present disclosure, calling the plurality of calling functions respectively through a preset data acquisition interface to acquire corresponding data blocks during the rendering process, and rendering according to each data block respectively, includes:

[0103] During the rendering process, a calling function corresponding to the second data block is preferentially called through a preset data acquisition interface to obtain the second data block;

[0104] If the second data block indicates that the predicted page content prediction is valid, the calling function corresponding to the first data block is called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block to preferentially display the predicted page content in the target page; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block.

[0105] According to one or more embodiments of the present disclosure, the method further includes:

[0106] If the second data block indicates that the predicted page content prediction is invalid, the calling function corresponding to the third data block is directly called through the preset data acquisition interface to obtain the third data block, and the entire page of the target page is rendered according to the third data block.

[0107] In a second aspect, according to one or more embodiments of the present disclosure, a page rendering device is provided, including:

[0108] A request unit, configured to receive an access request for a target page sent by a terminal device;

[0109] A receiving unit, configured to asynchronously obtain multiple data blocks of the target page through a streaming interface;

[0110] a conversion unit, configured to generate a plurality of calling functions for the streaming interface, wherein each calling function is configured to call a data block received by the streaming interface;

[0111] A rendering unit is used to render the target page using a streaming rendering method. During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result, and the streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

[0112] According to one or more embodiments of the present disclosure, when the rendering unit performs rendering according to each data block and obtains a streaming rendering result, it is configured to:

[0113] Rendering is performed on each data block to obtain streaming hypertext markup language HTML data, and the streaming HTML data is used as the streaming rendering result.

[0114] According to one or more embodiments of the present disclosure, when generating multiple call functions for the stream interface, the conversion unit is configured to:

[0115] The page context information of the target page is obtained, and the multiple calling functions are generated according to the page context information and the number of data blocks of the target page, wherein the input of any calling function is the page context information and the output is the corresponding data block.

[0116] According to one or more embodiments of the present disclosure, when the rendering unit calls the multiple calling functions respectively through the preset data acquisition interface to obtain corresponding data blocks during the rendering process, it is configured to:

[0117] During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface, and the page context information is respectively input into the multiple calling functions, and corresponding data blocks output by the multiple calling functions are respectively acquired.

[0118] According to one or more embodiments of the present disclosure, when the conversion unit generates the multiple calling functions according to the page context information and the number of data blocks of the target page, it is configured to:

[0119] The page context information and the number of data blocks of the target page are taken as input, and a preset converter module is called to generate the multiple calling modules.

[0120] According to one or more embodiments of the present disclosure, the plurality of data blocks include a first data block, a second data block, and a third data block;

[0121] The first data block is a data block corresponding to the predicted page content of the target page, and the predicted page content is the page content obtained by the prediction model according to the access request; the second data block is a data block used to characterize the predictive validity of the predicted page content; the third data block is a data block corresponding to the actual page content of the target page, and the actual page content is the page content obtained by the search engine according to the access request, and whether the predicted page content is included in the third data block is determined based on the predictive validity of the predicted page content.

[0122] According to one or more embodiments of the present disclosure, the rendering unit is configured to:

[0123] During the rendering process, a calling function corresponding to the second data block is preferentially called through a preset data acquisition interface to obtain the second data block;

[0124] If the second data block indicates that the predicted page content prediction is valid, the calling function corresponding to the first data block is called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block to preferentially display the predicted page content in the target page; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block.

[0125] According to one or more embodiments of the present disclosure, the rendering unit is further configured to:

[0126] If the second data block indicates that the predicted page content prediction is invalid, the calling function corresponding to the third data block is directly called through the preset data acquisition interface to obtain the third data block, and the entire page of the target page is rendered according to the third data block.

[0127] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0128] The memory stores computer-executable instructions;

[0129] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the page rendering method described in the first aspect and various possible designs of the first aspect.

[0130] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the page rendering method described in the first aspect and various possible designs of the first aspect is implemented.

[0131] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the page rendering method as described in the first aspect and various possible designs of the first aspect is implemented.

[0132] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0133] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0134] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A page rendering method, applied to a server, comprising: receiving an access request for a target page sent by a terminal device, and asynchronously acquiring multiple data blocks of the target page through a streaming interface; For the streaming interface, generating a plurality of calling functions, wherein each calling function is used to call a data block received by the streaming interface; The target page is rendered using a streaming rendering method. During the rendering process, the multiple calling functions are called separately through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result. The streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

2. The method according to claim 1, wherein The rendering is performed according to each data block to obtain a streaming rendering result, including: Rendering is performed on each data block to obtain streaming hypertext markup language HTML data, and the streaming HTML data is used as the streaming rendering result.

3. The method according to claim 1 or 2, wherein: The method generates multiple calling functions for the streaming interface, including: The page context information of the target page is obtained, and the multiple calling functions are generated according to the page context information and the number of data blocks of the target page, wherein the input of any calling function is the page context information and the output is the corresponding data block.

4. The method according to claim 3, wherein: The step of respectively calling the plurality of calling functions through a preset data acquisition interface to acquire corresponding data blocks during the rendering process includes: During the rendering process, the interface is obtained through the preset data to call the multiple calling functions respectively, and the page context information is input to the multiple calling functions respectively, and corresponding data blocks output by the multiple calling functions are obtained respectively.

5. The method according to claim 3 or 4, wherein: Generating the multiple calling functions according to the page context information and the number of data blocks of the target page includes: The page context information and the number of data blocks of the target page are taken as input, and a preset converter module is called to generate the multiple calling modules.

6. The method according to any one of claims 1 to 5, wherein: The multiple data blocks include a first data block, a second data block and a third data block; The first data block is a data block corresponding to the predicted page content of the target page, and the predicted page content is the page content obtained according to the access request through the prediction model; the second data block is a data block used to characterize the prediction validity of the predicted page content; The third data block is a data block corresponding to the actual page content of the target page, and the actual page content is the page content obtained by the search engine according to the access request, and whether the predicted page content is included in the third data block is determined based on the predicted validity of the predicted page content.

7. The method according to claim 6, wherein: The method of calling the plurality of calling functions respectively through a preset data acquisition interface to acquire corresponding data blocks during the rendering process, and performing rendering according to each data block respectively, includes: During the rendering process, the interface for obtaining the preset data preferentially calls a calling function corresponding to the second data block to obtain the second data block; If the second data block indicates that the predicted page content prediction is valid, the calling function corresponding to the first data block is called through the preset data acquisition interface to obtain the first data block, and the target page is partially rendered according to the first data block to preferentially display the predicted page content in the target page; then the calling function corresponding to the third data block is called through the preset data acquisition interface to obtain the third data block, and the remaining part of the target page is rendered according to the third data block.

8. The method according to claim 7, further comprising: If the second data block indicates that the predicted page content prediction is invalid, the interface is directly called through the preset data to call the calling function corresponding to the third data block to obtain the third data block, and the entire page of the target page is rendered according to the third data block.

9. A page rendering device, comprising: A request unit configured to receive an access request for a target page sent by a terminal device; a receiving unit configured to asynchronously obtain multiple data blocks of the target page through a streaming interface; a conversion unit configured to generate a plurality of calling functions for the streaming interface, wherein each calling function is used to call a data block received by the streaming interface; The rendering unit is configured to render the target page using a streaming rendering method. During the rendering process, the multiple calling functions are respectively called through a preset data acquisition interface to obtain corresponding data blocks, and rendering is performed according to each data block to obtain a streaming rendering result, and the streaming rendering result is returned to the terminal device so that the terminal device displays the target page according to the streaming rendering result.

10. An electronic device comprising at least one processor and a memory, wherein: The memory is configured to store computer-executable instructions; The at least one processor is configured to execute the computer-executable instructions stored in the memory, so that the at least one processor performs the page rendering method according to any one of claims 1 to 8.

11. A computer-readable storage medium storing computer-executable instructions, wherein: When the processor executes the computer-executable instruction, the page rendering method according to any one of claims 1 to 8 is implemented.

12. A computer program product comprising computer-executable instructions, wherein: When the processor executes the computer-executable instruction, the page rendering method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Server rendering method and device based on node server and computer equipment

    CN111859224A

  • Map rendering method and device for single page application, equipment and storage medium

    CN113821737A

  • Page pre-rendering method and device and electronic equipment

    CN115758023A

  • Small program page rendering method and device, electronic equipment and storage medium

    CN117614903A