A method and apparatus for page rendering

CN122547448APending Publication Date: 2026-08-11BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

在生成的应答帧消息乱序时,服务端会存在消息积压的现象,严重影响服务端性能

Benefits of technology

[0015]上述发明中的一个实施例具有如下优点或有益效果:能够接收服务端发送的乱序的帧消息,并在客户端完成帧消息的排序,数据装备的操作。其中,由于将帧消息排序的操作转移到客户端执行,因此服务端在发送帧消息时无需关注帧消息的顺序,也就无需等待客户端的接收帧消息成功的信息再发送下一帧消息,大大提高了服务端发送帧消息的效率。同时,由于无需等待客户端的反馈信息再发送下一帧消息,服务端也就不会出现消息积压现象,大大降低了服务端的性能压力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122547448A_ABST
    Figure CN122547448A_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for page rendering, relating to the field of data processing technology. One specific embodiment of the method includes: determining the sequence number of a received frame message and its corresponding model identifier; sending the frame message to a corresponding cache queue for storage according to the model identifier and sequence number; repeatedly determining whether the frame message with the smallest sequence number in the cache queue meets a preset assembly condition; and if so, retrieving the frame message with the smallest sequence number for data assembly for page rendering. This embodiment can complete the sorting operation of frame messages in the cache queue for accurate data rendering, without strictly receiving frame messages in order from the server, avoiding message backlog on the server side when messages are out of order, improving server performance, and thus improving message response efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and apparatus for page rendering. Background Technology

[0002] Currently, with the rapid development of artificial intelligence technology, large-scale models are being applied more and more widely in various fields. Large-scale models, through their unique natural language processing technology, can understand and respond to various user questions, including product-related inquiries and after-sales issues in e-commerce, and data queries in intelligent question answering. Large-scale models can provide answers quickly and accurately. When generating response data, due to the complexity of the questions and the large amount of content in the responses, a streaming response method is often used to generate the response content. This method generates the response content gradually rather than displaying the entire response at once, enabling a faster response to user questions and improving user experience.

[0003] However, this response method requires the server to send response messages strictly in the order they appear and to render them on the client side to ensure the sequentiality and completeness of the response content. This necessitates the server sending response frames sequentially according to the overall model's response order; the server will only send the next frame after the previous one has been successfully received by the client. When the generated response frames are out of order, the server will experience message backlog, severely impacting server performance. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method and apparatus for page rendering, which can reduce server load and improve frame message processing efficiency to achieve rapid rendering of page response content.

[0005] To achieve the above objectives, according to one aspect of the present invention, a method for page rendering is provided, comprising: Determine the sequence number and model identifier of the received frame message, and store the frame message in the corresponding cache queue according to the model identifier and the sequence number; Repeat the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page based on the configured data.

[0006] Optionally, the preset equipment condition is that the sequence number of the frame message is the next sequential number after the sequence number of the target display frame corresponding to the model identifier, and the step of determining whether the frame message with the smallest sequence number in the cache queue satisfies the preset equipment condition includes: Calculate the difference between the sequence number of the frame message with the smallest sequence number in the cache queue and the sequence number of the target display frame corresponding to the model identifier; Based on the difference, determine whether the frame message with the smallest sequence number in the cache queue is the next sequence number of the target display frame corresponding to the model identifier.

[0007] Optionally, before storing the frame message to the corresponding cache queue according to the model identifier and the sequence number, the method further includes: Determine whether the frame message is duplicated with the frame message in the cache queue to obtain a first determination result, and determine that the frame message is not duplicated with the frame message in the cache queue based on the first determination result.

[0008] Optionally, storing the frame message to the corresponding cache queue according to the model identifier and the sequence number includes: The cache queue corresponding to the frame message is determined based on the model identifier; The target position in the cache queue is determined based on the sequence number and the sequence number of the frame message in the cache queue; The frame message is stored at the target location in the cache queue.

[0009] Optionally, retrieving frame messages that meet the preset equipment conditions from the cache queue for data equipment includes: Retrieve frame messages that meet the preset equipment conditions from the cache queue, and assemble the frame messages that meet the preset equipment conditions with the display frames corresponding to the model identifier.

[0010] Optionally, after retrieving frame messages that meet the preset equipment conditions from the buffer queue and performing data equipment, the method further includes: Based on the identifier of the frame message, determine whether the frame message is an acknowledgment end frame message, and obtain a second determination result; If the second determination result is an end-of-response frame message, the cache queue is deleted.

[0011] According to another aspect of the present invention, a page rendering apparatus is provided, comprising: The storage module is used to determine the sequence number and model identifier of the received frame message, and store the frame message to the corresponding cache queue according to the model identifier and the sequence number; The rendering module is used to repeatedly execute the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page according to the configured data.

[0012] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the page rendering method provided in the embodiments of the present invention.

[0013] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the page rendering method provided in the embodiments of the present invention.

[0014] According to another aspect of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, implements the page rendering method provided in the embodiments of the present invention.

[0015] One embodiment of the above invention has the following advantages or beneficial effects: it can receive out-of-order frame messages sent by the server and complete the sorting and data assembly operations of the frame messages on the client side. Since the frame message sorting operation is transferred to the client, the server does not need to pay attention to the order of frame messages when sending them, and therefore does not need to wait for the client's successful reception of a frame message before sending the next frame message, greatly improving the efficiency of the server in sending frame messages. At the same time, since there is no need to wait for feedback from the client before sending the next frame message, the server will not experience message backlog, greatly reducing the performance pressure on the server.

[0016] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0017] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is a schematic diagram illustrating the main steps of a page rendering method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the page rendering process according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating page rendering processing based on the received first frame message in one embodiment of the present invention; Figure 4This is a flowchart illustrating page rendering processing based on the received second frame message in one embodiment of the present invention; Figure 5 This is a flowchart illustrating page rendering based on a received third frame message in one embodiment of the present invention. Figure 6 This is a flowchart illustrating page rendering based on the received fourth frame message in one embodiment of the present invention. Figure 7 This is a flowchart illustrating page rendering based on the received fifth frame message in one embodiment of the present invention. Figure 8 This is a schematic diagram of the main modules of a page rendering apparatus according to an embodiment of the present invention; Figure 9 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 10 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0018] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details 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 and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

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

[0020] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention all comply with the provisions of relevant laws and regulations, and require notification to users and obtaining their consent or authorization. When applicable, user personal information is subjected to de-identification and / or anonymization and / or encryption technical processing.

[0021] In the current field of large-scale model technology, model response messages are typically generated using streaming responses. After receiving user input, the system can generate and gradually display the response content in real time, rather than waiting for the entire response to be generated before showing it to the user all at once. This instant feedback makes users feel that the system's response speed is very fast, reducing waiting time and improving user satisfaction. Simultaneously, through streaming responses, users can see the system's gradually generated response content, feeling as if they are conversing with a real person. This interactive experience is more natural and fluid, effectively enhancing user engagement and trust. Large-scale models, through streaming responses, can reduce user waiting time, enabling users to receive model responses quickly.

[0022] However, to ensure the accuracy of the response data generation, this streaming response method requires the server to send messages in sequence and the client to receive messages in sequence. In order to further ensure the accuracy of the message order, the server also needs to receive a successful reception message from the client before sending the next frame of the message. Otherwise, the next frame of the message and all subsequent frames of the message will be backed up on the server and cannot be sent, affecting the performance of the server. Especially during peak periods, the time it takes for the server to wait for the response will seriously affect the message sending and put a lot of pressure on the server.

[0023] To fully consider the shortcomings of the above methods, this embodiment of the invention provides a page rendering method that can transfer the sorting operation of frame messages to the client. When the server sends response frame messages, there is no need to consider the message order. Therefore, there is no need to wait for the client to send a successful reception message before sending the next frame message, which greatly reduces the message sending time of the server and reduces the performance pressure on the server.

[0024] Figure 1 This is a schematic diagram illustrating the main steps of a page rendering method according to an embodiment of the present invention. Figure 1 As shown, the page rendering method mainly includes steps S101 to S102. This method is applied to the client side.

[0025] Step S101: Determine the sequence number and model identifier of the received frame message, and store the frame message in the corresponding buffer queue according to the model identifier and sequence number.

[0026] Because this invention shifts message sorting operations from the server to the client, the received frame messages sent by the server may be out of order and need to be sorted. During sorting, the sequence number and corresponding model identifier of each received frame message are first determined. The frame message sequence number (frame n) represents the order / position of the current frame message in the current response; the model identifier (message n) represents which model's response message the current frame message belongs to. Messages received via streaming response are out of order, including out-of-order messages based on model category and message order. Therefore, it is necessary to first classify messages of different models and then sort the frame messages for each model. Specifically, the corresponding cache queue is determined based on the model identifier of the received frame message, and its sorting position in the cache queue is determined based on the frame message sequence number, so that the frame message is stored in the corresponding position in the cache queue. In an e-commerce scenario, the received out-of-order messages may include, for example, 1. richText module1 #message 1 #Frame1, 2. richText module1 #message 2 #Frame3, 3. ware module2 #message 1 #Frame3, etc. Among them, richText module1 refers to rich text messages, and ware module2 refers to product information.

[0027] In one embodiment, the cache queues are stored in the frame message rendering pipeline, which stores cache queues for frame messages corresponding to different models. Frame messages received from different models are stored in different cache queues according to their model identifiers. The number of cache queues depends on the number of models currently generating responses.

[0028] In one embodiment, when a response frame message of a certain model is received for the first time, a corresponding cache queue is created, and the model's identifier is used as the identifier of the cache queue so that subsequent frame messages with that identifier can be stored in the cache queue.

[0029] In one embodiment, for a frame message, its sequence number and model identifier can be combined as its globally unique identifier to determine the message's cache queue and its position in the cache queue.

[0030] Step S102: Repeat the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: Determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page according to the configured data.

[0031] After storing frame messages in the cache queue, it is necessary to determine whether the cache queue can be configured with data. The determination process specifically includes: retrieving the frame message a1 with the smallest sequence number in the current cache queue and determining whether it meets the preset configuration conditions. If it does not meet the conditions, the determination ends, and the process waits for the next frame message to be stored before re-determining. If it meets the conditions, the frame message a1 with the smallest sequence number is retrieved from the cache queue and stored in the view data model configurator for data configuration, so that subsequent page rendering and response data generation can be performed based on the configured data. After retrieving the frame message a1 with the smallest sequence number, for the remaining frame messages in the cache queue, the frame message a2 with the smallest sequence number needs to be identified, and the above determination and retrieval process is repeated for frame message a2 until the identified frame message an with the smallest sequence number does not meet the preset configuration conditions. At this point, the process ends, and the process waits for the next frame message to be stored. For the frame messages stored in the view data model configurator, page rendering can be performed based on them to generate response data.

[0032] In one embodiment, a preset equipment condition is used to determine the continuity of frame messages, that is, to determine whether the frame message with the smallest sequence number in the current cache queue is continuous with the frame message of the last frame (the currently displayed frame of the page) in the view data model equipment.

[0033] The page rendering method provided by this invention can receive out-of-order frame messages sent by the server and complete the sorting and data configuration operations of the frame messages on the client side. Since the frame message sorting operation is transferred to the client, the server does not need to pay attention to the order of frame messages when sending them, and therefore does not need to wait for the client's successful reception of a frame message before sending the next frame message, greatly improving the efficiency of the server in sending frame messages. At the same time, since there is no need to wait for client feedback before sending the next frame message, the server will not experience message backlog, significantly reducing the performance pressure on the server.

[0034] In one embodiment, the preset equipment condition is that the sequence number of the frame message is the next sequential number of the target display frame corresponding to the model identifier. Determining whether the frame message with the smallest sequence number in the buffer queue meets the preset equipment condition includes: calculating the difference between the sequence number of the frame message with the smallest sequence number in the buffer queue and the sequence number of the target display frame corresponding to the model identifier; and determining whether the frame message with the smallest sequence number in the buffer queue is the next sequential number of the target display frame corresponding to the model identifier based on the difference.

[0035] When determining whether the current display frame and the frame message with the smallest sequence number in the buffer queue are consecutive, the judgment can be made based on the sequence number of the frame messages. Specifically, it checks if the sequence numbers of the two frame messages are consecutive. Correspondingly, the preset condition is that the sequence number of the frame message is the next sequential number after the sequence number of the target display frame corresponding to the model identifier. For example, if the sequence number of the current display frame is 4, and the sequence number of the frame message with the smallest sequence number in the buffer queue is 5, and the sequence number is monotonically increasing, then the sequence number of the frame message with the smallest sequence number in the buffer queue is the next sequential number after the sequence number of the current display frame, and the frame message with the smallest sequence number in the buffer queue satisfies the preset condition. In actual judgment, the difference between the sequence numbers of the two frame messages is first calculated, and it is determined whether it satisfies the preset monotonically increasing difference. If it does, then the frame message with the smallest sequence number in the buffer queue satisfies the preset condition.

[0036] In one embodiment, streaming messaging does not send the entire message at once, but rather divides the message into multiple small frames, which are sent and displayed one by one. Upon receiving each frame, the client (e.g., a browser or application) typically adds it immediately to the already displayed message. Therefore, at any given moment, the message seen by the user is the cumulative result of all received frames, and the "currently displayed frame" is the last received and displayed frame. For example, a streaming response message contains 3 frames: 1. richTextmodule1#message1#frame1 (displaying "Current Product"); 2. richTextmodule1#message1#frame2 (displaying "Price Fluctuation"); 3. richTextmodule1#message1#frame3 (displaying "Smaller"). After receiving frame1, the current displayed frame is frame1, displaying "Current Product". After receiving frame2, the current displayed frame is frame2, displaying "Current Product Price Fluctuation". After receiving frame3, the current displayed frame is frame3, displaying "Current Product Price Fluctuation is Smaller".

[0037] The page rendering method provided by the embodiments of the present invention can accurately determine the sorting position of frame messages according to the model identifier and sequence number of the frame messages, so as to assemble the frame messages according to the accurate position, ensure the accuracy of the displayed frames, and thus ensure the accuracy of the final response content rendering.

[0038] In one embodiment, before storing the frame message to the corresponding cache queue according to the model identifier and sequence number, the method further includes: determining whether the frame message is duplicated with the frame message in the cache queue, obtaining a first determination result, and determining that the frame message is not duplicated with the frame message in the cache queue according to the first determination result.

[0039] Received frame messages need to undergo message deduplication to avoid duplicate message reception. This deduplication operation can be performed before storing the message in the buffer queue. First, it is determined whether the received frame message is a duplicate of a frame message in the buffer queue. If they are not duplicates, no processing is required, and the received frame message is directly stored in the buffer queue. If they are duplicates, the received frame message is deleted, and the system waits for the next frame message. The duplicate detection can be based on the globally unique identifier of the frame message, i.e., the sequence number plus the model identifier. If a frame message with the same identifier exists, it indicates that the frame message is a duplicate; otherwise, it is not a duplicate.

[0040] In one embodiment, the determination of whether different frame messages are duplicates can also be made based on the content hash value of the frame message, or by combining the frame message's identifier and timestamp. The timestamp of the frame message is the time when the frame message was generated.

[0041] In one embodiment, storing a frame message to a corresponding cache queue based on a model identifier and a sequence number includes: determining the cache queue corresponding to the frame message based on the model identifier; determining the target position in the cache queue based on the sequence number and the sequence number of the frame message in the cache queue; and storing the frame message at the target position in the cache queue.

[0042] When storing frame messages in the buffer queue, their specific storage location needs to be determined. First, the frame messages are sorted according to their sequence number and the sequence number of frame messages in the buffer queue to determine the target position of the frame message in the entire queue, and then stored in the target position so that frame messages can be retrieved sequentially in ascending order of their sequence number in the buffer queue.

[0043] In one embodiment, retrieving a frame message that meets the equipment conditions from the cache queue for data equipment includes: retrieving a frame message that meets preset equipment conditions from the cache queue, and assembling the frame message that meets the preset equipment conditions with a display frame corresponding to the model identifier.

[0044] During data configuration, the first step is to retrieve frame messages that meet preset configuration conditions from the cache queue. These frame messages are then assembled with the currently displayed frame to obtain a display frame based on the retrieved frame message, which is then displayed. The retrieved frame messages are initially placed in the view data model configurator, which is responsible for converting the data in frame messages from different models into the currently renderable data model for page rendering.

[0045] The page rendering method provided by the present invention can accurately sort the received out-of-order frame messages according to the model identifier and sequence number, and then assemble the display frames that meet the preset equipment conditions to complete page rendering.

[0046] In one embodiment, after retrieving a frame message that meets the preset equipment conditions from the cache queue and equipping it with data, the method further includes: determining whether the frame message is an acknowledgment end frame message based on the identifier of the frame message, and obtaining a second determination result; in response to the second determination result being an acknowledgment end frame message, deleting it from the cache queue.

[0047] After configuring the frame message, it's necessary to determine if it's the last frame in the current response. If it is, the current page rendering operation ends; otherwise, it needs to wait for the reception and configuration of other frame messages. When determining if it's the last frame, its identifier can be used to determine if it's a response end frame. If the result is yes, it means the current response round is over, the current model's cache queue is deleted, and it waits for the next trigger.

[0048] The page rendering method provided by this invention can transfer the sorting operation of response frame messages for large models to the client, meaning the server does not need to concern itself with the order of sent frame messages. On the client side, the received frame messages can be accurately sorted according to the model identifier and sequence number, and then data preparation and page rendering can be performed based on the sorting result. The server does not need to wait for client feedback to determine whether to send the next frame message, effectively avoiding message backlog on the server, reducing performance pressure, and improving page rendering efficiency.

[0049] Figure 2 This is a schematic diagram of the page rendering process according to an embodiment of the present invention. The process includes three main steps: streaming reception, frame message sorting, and frame message rendering. The streaming reception step receives multiple out-of-order streaming frame messages sent by the server, such as 1. richText module1 #Message1 #Frame1, 2. richText module1 #Message2 #Frame3, etc. The received frame messages are sent to the frame message rendering pipeline in the sorting step. The frame message rendering pipeline contains message cache queues for different models to store frame messages. Each time a received frame message is inserted into the cache queue, a judgment is triggered in the cache queue to determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions. Frame messages that meet the preset configuration conditions are sent to the view data model assembler for frame message configuration, that is, the frame messages are assembled in order, and page rendering is performed based on the assembled data. During assembly, the frame messages need to be assembled with the display frames of the page.

[0050] Figure 3-7 This is a flowchart illustrating page rendering based on the first to fifth received frame messages in one instance. For the same large model's response frame messages: Upon receiving the first streaming frame, a buffer (buffer queue) is created, and the frames are inserted sequentially, starting from frame 1 by default. The frame is then submitted to the view data model equipper (hereinafter referred to as the equipper) for data equipping, and the current display frame number is recorded as 1. Upon receiving the third streaming frame (out of order), it is inserted sequentially into the buffer. The system checks if the current display frame + 1 equals the first frame in the buffer. If not, it is buffered, waiting for the next trigger. Upon receiving the fourth streaming frame (out of order), it is inserted sequentially into the buffer. The system checks if the current display frame + 1 equals the sequence number of the first frame message in the buffer (the sequence number of the frame message with the smallest sequence number in the buffer). If not, it is buffered, waiting for the next trigger; if so, the system retrieves the subsequent consecutive frames from the buffer and submits them to the equipper. Upon receiving the second streaming frame, it is inserted sequentially into the buffer. The system checks if the current display frame + 1 equals the first frame in the buffer. If so, the system retrieves the subsequent consecutive frames from the buffer and submits them to the equipper. Receive the 5th frame of the stream, insert it into the buffer in sequence, and check if the current display frame + 1 equals the first frame in the buffer. If so, retrieve the consecutive frames from the buffer and deliver them to the assembler. If the current frame is the last frame, stop the large model response and destroy the buffer.

[0051] Figure 8 The diagram shows the main modules of the page rendering apparatus provided in an embodiment of the present invention. Figure 8 As shown, the page rendering device 800 mainly includes a storage module 801 and a rendering module 802.

[0052] The storage module 801 is used to determine the sequence number and model identifier of the received frame message, and store the frame message to the corresponding buffer queue according to the model identifier and sequence number; The rendering module 802 is used to repeatedly execute the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page according to the configured data.

[0053] The page rendering apparatus provided in this embodiment of the invention can receive out-of-order frame messages sent by the server and perform frame message sorting and data configuration operations on the client. Since the frame message sorting operation is transferred to the client, the server does not need to concern itself with the order of frame messages when sending them, and therefore does not need to wait for the client's successful reception of a frame message before sending the next frame message, greatly improving the efficiency of the server in sending frame messages. Simultaneously, since there is no need to wait for client feedback before sending the next frame message, the server will not experience message backlog, significantly reducing the performance pressure on the server.

[0054] In one embodiment, the preset equipment condition is that the sequence number of the frame message is the next sequential number of the target display frame corresponding to the model identifier. The rendering module 802 is further configured to: calculate the difference between the sequence number of the frame message with the smallest sequence number in the cache queue and the sequence number of the target display frame corresponding to the model identifier; and determine whether the frame message with the smallest sequence number in the cache queue is the next sequential number of the target display frame corresponding to the model identifier based on the difference.

[0055] In one embodiment, the page rendering apparatus 800 further includes: a first judgment module 803 (not shown in the figure), used to judge whether the frame message is duplicated with the frame message in the cache queue, obtain a first judgment result, and determine that the frame message is not duplicated with the frame message in the cache queue based on the first judgment result.

[0056] In one embodiment, the storage module 801 is further configured to: determine the cache queue corresponding to the frame message based on the model identifier; determine the target position in the cache queue based on the sequence number and the sequence number of the frame message in the cache queue; and store the frame message in the target position in the cache queue.

[0057] In one embodiment, the rendering module 802 is further configured to retrieve frame messages that meet preset equipment conditions from the cache queue, and assemble the frame messages that meet the preset equipment conditions with the display frames corresponding to the model identifier.

[0058] In one embodiment, the page rendering apparatus 800 further includes: a second judgment module 804 (not shown in the figure), configured to: determine whether the frame message is an acknowledgment end frame message based on the identifier of the frame message, and obtain a second judgment result; and delete the cache queue in response to the second judgment result being an acknowledgment end frame message.

[0059] The page rendering apparatus provided in this embodiment of the invention can transfer the sorting operation of response frame messages for large models to the client, meaning the server does not need to concern itself with the order of the sent frame messages when sending them. On the client side, the received frame messages can be accurately sorted according to the model identifier and sequence number, and then data preparation and page rendering can be performed based on the sorting result. The server does not need to wait for client feedback to determine whether to send the next frame message, effectively avoiding message backlog on the server, reducing performance pressure, and improving page rendering efficiency.

[0060] Figure 9 An exemplary system architecture 900 is shown, in which the page rendering method or apparatus of embodiments of the present invention can be applied.

[0061] like Figure 9As shown, system architecture 900 may include terminal devices 901, 902, and 903, network 904, and server 905. Network 904 is used as a medium to provide a communication link between terminal devices 901, 902, and 903 and server 905. Network 904 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0062] Users can use terminal devices 901, 902, and 903 to interact with server 905 via network 904 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 901, 902, and 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0063] Terminal devices 901, 902, and 903 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0064] Server 905 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 901, 902, and 903 (for example only). The backend management server can analyze and process data such as received rendering requests, and feed back the processing results (such as the rendered page - for example only) to the terminal devices.

[0065] It should be noted that the page rendering method provided in the embodiments of the present invention is generally executed by server 905, and correspondingly, the page rendering device is generally set in server 905.

[0066] It should be understood that Figure 9 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0067] The following is for reference. Figure 10 It shows a schematic diagram of the structure of a computer system 1000 suitable for implementing terminal devices or servers of the present invention. Figure 10 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0068] like Figure 10As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1002 or programs loaded from storage section 1008 into random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the system 1000. The CPU 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.

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

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

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

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

[0073] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be located in a processor; for example, a processor can be described as including a storage module and a rendering module. The names of these units or modules do not necessarily limit the unit or module itself. For example, a storage module can also be described as "a module for determining the sequence number and model identifier of a received frame message, and storing the frame message in the corresponding cache queue according to the model identifier and sequence number."

[0074] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: Determine the sequence number and model identifier of the received frame message, and store the frame message in the corresponding buffer queue according to the model identifier and sequence number; Repeat the following steps until the frame message with the smallest sequence number in the cache queue no longer meets the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page based on the configured data.

[0075] According to the technical solution of this invention, out-of-order frame messages sent by the server can be received, and the frame messages can be sorted and data equipped on the client side. Since the frame message sorting operation is transferred to the client, the server does not need to pay attention to the order of frame messages when sending them, and therefore does not need to wait for the client's successful reception of a frame message before sending the next frame message, greatly improving the efficiency of the server in sending frame messages. At the same time, since there is no need to wait for client feedback before sending the next frame message, the server will not experience message backlog, greatly reducing the performance pressure on the server.

[0076] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for rendering a page, characterized in that, include: Determine the sequence number and model identifier of the received frame message, and store the frame message in the corresponding cache queue according to the model identifier and the sequence number; Repeat the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page based on the configured data.

2. The method according to claim 1, characterized in that, The preset equipment condition is that the sequence number of the frame message is the next sequential number after the sequence number of the target display frame corresponding to the model identifier. The step of determining whether the frame message with the smallest sequence number in the cache queue satisfies the preset equipment condition includes: Calculate the difference between the sequence number of the frame message with the smallest sequence number in the cache queue and the sequence number of the target display frame corresponding to the model identifier; Based on the difference, determine whether the frame message with the smallest sequence number in the cache queue is the next sequence number of the target display frame corresponding to the model identifier.

3. The method according to claim 2, characterized in that, Before storing the frame message into the corresponding cache queue according to the model identifier and the sequence number, the method further includes: Determine whether the frame message is duplicated with the frame message in the cache queue to obtain a first determination result, and determine that the frame message is not duplicated with the frame message in the cache queue based on the first determination result.

4. The method according to any one of claims 1-3, characterized in that, The step of storing the frame message into the corresponding cache queue according to the model identifier and the sequence number includes: The cache queue corresponding to the frame message is determined based on the model identifier; The target position in the cache queue is determined based on the sequence number and the sequence number of the frame message in the cache queue; The frame message is stored at the target location in the cache queue.

5. The method according to claim 1, characterized in that, The step of retrieving frame messages that meet the preset equipment conditions from the cache queue for data equipment includes: Retrieve frame messages that meet the preset equipment conditions from the cache queue, and assemble the frame messages that meet the preset equipment conditions with the display frames corresponding to the model identifier.

6. The method according to any one of claims 1-5, characterized in that, After retrieving frame messages that meet the preset equipment conditions from the buffer queue and equipping them with data, the method further includes: Based on the identifier of the frame message, determine whether the frame message is an acknowledgment end frame message, and obtain a second determination result; If the second determination result is an end-of-response frame message, the cache queue is deleted.

7. A page rendering apparatus, characterized in that, include: The storage module is used to determine the sequence number and model identifier of the received frame message, and store the frame message to the corresponding cache queue according to the model identifier and the sequence number; The rendering module is used to repeatedly execute the following steps until the frame message with the smallest sequence number in the cache queue does not meet the preset configuration conditions: determine whether the frame message with the smallest sequence number in the cache queue meets the preset configuration conditions, retrieve the frame message that meets the preset configuration conditions from the cache queue, configure the data, and render the page according to the configured data.

8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

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

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.