Page pre-rendering method and related device
By separating the details page snapshot data from the page style and determining the appropriate page style when the client selects content for rendering, the problem of excessive server pressure and page style jump is solved, and efficient page loading and optimized user experience is achieved.
Patent Information
- Application Number
- CN202410028273.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-05
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, the client sends real-time pre-rendering requests to the server, resulting in excessive pressure on the server and wastes costs for invalid requests, and offline pre-rendering causes page style jumps to affect user experience.
Separate the details page snapshot data from the page style, generate the details page snapshot data offline in advance, and when the client selects content, determine the appropriate page style from multiple page styles for rendering to avoid page style jumps.
Reduces the server's real-time computing pressure, reduces invalid requests, improves the user experience, avoids page style jumps, and improves page loading speed and user satisfaction.
Smart Images

Figure CN120277289A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method and related device for page pre-rendering. Background Art
[0002] With the booming development of the mobile Internet, clients of types such as live broadcast, e-commerce, social networking, and media provide convenient services for users. Although various clients have different forms, the user movement lines are basically similar. Generally, the user first enters the home page of the client. The home page of the client includes multiple contents, and then enters the detail page of one of the contents. Finally, the user enters the core function page (such as the play function, payment function, etc.). Among them, if the opening speed of the detail page is slow, it may lead to a poor user experience. For example, the user may not enter the core function page because they can't wait, or even stop using the client, and there are also problems such as the conversion rate of the number of user views not being converted into the order volume.
[0003] In the related art, to optimize the opening speed of the page, the page real-time pre-rendering (prerender) method is generally adopted. Specifically, after the user enters the home page of the client through the client, the client sends a request for the home page of the client to the server. The server pre-renders multiple detail pages that the user may enter and sends the multiple pre-rendered detail pages to the client. When the user selects and enters the detail page corresponding to one of the contents, the client obtains and displays the corresponding detail page from the multiple pre-rendered detail pages, shortening the user's waiting time.
[0004] However, after the client sends a request for the home page of the client to the server, without knowing which content the user will enter the detail page of, the real-time pre-rendering method needs to request the data required for all possible detail pages in real time, resulting in serious request diffusion and imposing a great pressure on the server. Moreover, the user will ultimately only enter the detail page corresponding to one content, and a large number of invalid requests cause cost waste. Summary of the Invention
[0005] To solve the above technical problems, this application provides a method and related device for page pre-rendering, which is used to reduce the real-time computing pressure on the server and reduce the cost waste caused by invalid requests.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] In a first aspect, an embodiment of this application provides a method for page pre-rendering, and the method includes:
[0008] Obtain the home page data for rendering the home page of the client, and the snapshot addresses of the detail pages corresponding to the multiple contents included in the home page data;
[0009] During the process of displaying the home page of the client, obtain the detailed page snapshot data corresponding to each of the multiple detailed page snapshot addresses. The detailed page snapshot data is generated offline by the server and is used to describe the pre-rendered detailed page.
[0010] In response to obtaining a selection operation for a first target content among the multiple contents, display the target pre-rendered detailed page corresponding to the first target content. The target pre-rendered detailed page is rendered based on the target page style and the detailed page snapshot data corresponding to the first target content. The target page style is determined from among multiple pre-obtained page styles and is a page style suitable for the client.
[0011] In a second aspect, an embodiment of the present application provides a method for page pre-rendering. The method includes:
[0012] Obtain a home page data acquisition request and a page style acquisition request from the client;
[0013] According to the page style acquisition request, determine multiple page styles and send the multiple page styles to the client;
[0014] According to the home page data acquisition request, determine the home page data for rendering the home page of the client. The home page data includes multiple contents;
[0015] From among multiple pre-stored detailed page snapshot addresses, obtain the detailed page snapshot addresses corresponding to each of the multiple contents. The detailed page snapshot addresses are used to instruct the client to obtain the detailed page snapshot data corresponding to each of the multiple contents. The detailed page snapshot data is generated offline and is used to describe the pre-rendered detailed page.
[0016] Send the home page data and the detailed page snapshot addresses corresponding to each of the multiple contents included in the home page data to the client.
[0017] In a third aspect, an embodiment of the present application provides a page pre-rendering apparatus. The apparatus includes: a first acquisition unit, a second acquisition unit, and a display unit;
[0018] The first acquisition unit is configured to acquire the home page data for rendering the home page of the client, as well as the detailed page snapshot addresses corresponding to each of the multiple contents included in the home page data;
[0019] The second acquisition unit is configured to, during the process of displaying the home page of the client, acquire the detailed page snapshot data corresponding to each of the multiple detailed page snapshot addresses. The detailed page snapshot data is generated offline by the server and is used to describe the pre-rendered detailed page.
[0020] The display unit is configured to, in response to obtaining a selection operation for a first target content among the multiple contents, display a target pre-rendered detail page corresponding to the first target content, where the target pre-rendered detail page is rendered based on a target page style and detail page snapshot data corresponding to the first target content, and the target page style is a page style determined from a plurality of pre-obtained page styles and applicable to the client.
[0021] In a fourth aspect, an embodiment of the present application provides a page pre-rendering device, which includes: a first acquisition unit, a second acquisition unit, a first determination unit, a second determination unit, and a sending unit;
[0022] The first acquisition unit is configured to acquire a home page data acquisition request and a page style acquisition request from the client;
[0023] The first determination unit is configured to determine a plurality of page styles according to the page style acquisition request, and send the plurality of page styles to the client;
[0024] The second determination unit is configured to determine home page data for rendering the client home page according to the home page data acquisition request, where the home page data includes a plurality of contents;
[0025] The second acquisition unit is configured to acquire detail page snapshot addresses respectively corresponding to the plurality of contents from a plurality of pre-stored detail page snapshot addresses, where the detail page snapshot addresses are used to instruct the client to acquire detail page snapshot data respectively corresponding to the plurality of contents, and the detail page snapshot data is offline-generated data for describing a pre-rendered detail page;
[0026] The sending unit is configured to send the home page data and the detail page snapshot addresses respectively corresponding to the plurality of contents included in the home page data to the client.
[0027] In a fifth aspect, an embodiment of the present application provides a page pre-rendering system, which includes a client and a server;
[0028] The client is configured to execute the method described in the first aspect;
[0029] The server is configured to execute the method described in the second aspect.
[0030] In a sixth aspect, an embodiment of the present application provides a computer device, which includes a processor and a memory:
[0031] The memory is configured to store a computer program and transmit the computer program to the processor;
[0032] The processor is configured to execute the method described in the first aspect or the second aspect according to the instructions in the computer program.
[0033] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, where the computer program is used to execute the method described in the first aspect or the second aspect.
[0034] In an eighth aspect, an embodiment of the present application provides a computer program product including a computer program, which, when running on a computer device, causes the computer device to execute the method described in the first aspect or the second aspect.
[0035] It can be seen from the above technical solutions that the home page data and the snapshot addresses of the detail pages corresponding to the multiple contents included in the home page data are obtained. Based on the home page data, the client home page can be rendered. During the display of the client home page, the snapshot data of the detail pages corresponding to the multiple snapshot addresses of the detail pages are obtained, that is, the snapshot data of the detail pages is not generated in real time but is generated offline in advance, thereby reducing the real-time computing pressure on the server and reducing the cost waste caused by invalid requests. Taking the first target content among the multiple contents on the client home page as an example, in response to obtaining a selection operation for the first target content, the target pre-rendered detail page corresponding to the first target content is displayed. Among them, the target pre-rendered detail page is rendered based on the target page style and the snapshot data of the detail page corresponding to the first target content, the target page style is determined from the multiple page styles obtained in advance, and the target page style is applicable to the current client.
[0036] Thus, the snapshot data of the detail page is separated from the page style. After obtaining the snapshot data of the detail page corresponding to the first target content, instead of directly rendering based on the snapshot data of the detail page, the target page style applicable to the client is determined from the multiple page styles obtained in advance, so that the target pre-rendered detail page rendered based on the target page style and the snapshot data of the detail page is applicable to the client, thereby avoiding the problem of page style jump after the detail page is refreshed for the second time and improving the user experience. Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0038] Figure 1 It is a schematic diagram of a user movement line provided by an embodiment of the present application;
[0039] Figure 2 Schematic diagram of a page style of a details page provided by an embodiment of the present application;
[0040] Figure 3 Schematic diagram of an application scenario of a page pre - rendering method provided by an embodiment of the present application;
[0041] Figure 4 Signaling flowchart of a page pre - rendering method provided by an embodiment of the present application;
[0042] Figure 5 Schematic diagram of the architecture of a page pre - rendering system provided by an embodiment of the present application;
[0043] Figure 6 Schematic diagram of a server generating snapshot data of a details page offline provided by an embodiment of the present application;
[0044] Figure 7 Schematic diagram of a client rendering a details page provided by an embodiment of the present application;
[0045] Figure 8 Schematic diagram of the structure of a page pre - rendering device provided by an embodiment of the present application;
[0046] Figure 9 Schematic diagram of the structure of a page pre - rendering device provided by an embodiment of the present application;
[0047] Figure 10 Schematic diagram of the structure of a server provided by an embodiment of the present application;
[0048] Figure 11 Schematic diagram of the structure of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0049] The embodiments of the present application will be described below with reference to the accompanying drawings.
[0050] As can be seen from the foregoing, the user's movement route generally includes entering the client's home page, details page, and core function page. Below, it will be described Figure 1 separately. Refer to Figure 1 , this figure is a schematic diagram of a user's movement route provided by an embodiment of the present application. In Figure 1 , taking the video client as an example of the client to illustrate the user's movement route. After the user opens the video client, the client pulls the home page data from the server, renders the client's home page based on the home page data and displays it. As shown in Figure 1 , the client's home page in figure (A) includes 9 contents, and different contents are used to display different content, that is, 9 contents are used to display 9 video recommendations.
[0051] After the user views the home page of the client, the user will click on the content of interest, such as clicking on Video Recommendation 2, and thus enter the details page corresponding to Video Recommendation 2, as Figure 1 shown in Figure (B) below. At this time, the client sends another request for the details page to the server. The server calculates the page style of the details page and the data required for this details page in real time, and returns the calculation result to the client for rendering. After the user enters the details page, the user can click on the episode that the user wants to watch to enter the player to play the video, that is, enter the core function page, as Figure 1 shown in Figure (C) below.
[0052] Therefore, if the opening speed of the details page is slow, the user may not enter the core function page anymore, or even stop using this video client, etc. Although the real-time pre-rendering method is adopted in the related art, this method not only causes great pressure on the server, but also wastes costs due to a large number of invalid requests.
[0053] Based on this, the offline pre-rendering method is also adopted in the related art. Specifically, the server will pre-generate snapshot data corresponding to different contents in an offline manner. The snapshot data includes the data required for introducing this content and the page style of the details page formed by this data, that is, the calculation result calculated by the server in real time according to the request of the details page. The client can obtain the required snapshot data from multiple offline-generated snapshot data, so as to achieve fast rendering.
[0054] After research, it is found that although this method converts the real-time calculation of the server into offline calculation, reducing the real-time calculation pressure of the server and avoiding waste of costs caused by invalid requests. However, this method will bring new problems of poor user experience. The following will be specifically described.
[0055] Since the video client will be continuously iterated with the development of the business, the page style of the details page will change. Refer to Figure 2 , which is a schematic diagram of the page style of a details page provided by an embodiment of the present application. As Figure 2 shown in Figure (A) below, the page style of the details page is a fluid structure. As Figure 2 shown in Figure (B) below, the page style of the details page is a left-right structure, and the page styles of the two details pages are different.
[0056] Therefore, if the offline calculation generates snapshot data applicable to a page style for the client, and the page style of the detailed page rendered and displayed by the client is the page style included in the snapshot data, after the pre-rendered detailed page is displayed, the client will also pull the calculation result of the real-time calculation (i.e., the data used to describe the detailed page) from the server, and render the real-time rendered detailed page based on the calculation result. If the page styles of the pre-rendered detailed page and the real-time rendered detailed page are different, it is equivalent to a page style jump after the secondary refresh of the detailed page of the client, resulting in a poor user experience.
[0057] Based on this, the embodiments of the present application provide a method and related device for page pre-rendering, which separate the snapshot data of the detailed page from the page style. After obtaining the snapshot data of the detailed page corresponding to the first target content, instead of directly rendering based on the snapshot data of the detailed page, it determines the target page style applicable to the client from multiple pre-obtained page styles, so that the target pre-rendered detailed page rendered based on the target page style and the snapshot data of the detailed page is applicable to the client, thereby avoiding the problem of page style jump after the secondary refresh of the detailed page and improving the user experience.
[0058] The method for page pre-rendering provided by the present application can be applied to computer devices with page pre-rendering capabilities, such as terminal devices and servers. Among them, the terminal device can specifically be a desktop computer, a laptop computer, a smart phone, a tablet computer, an Internet of Things device, a portable wearable device, and an aircraft, etc. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart vehicle-mounted device, etc. The smart vehicle-mounted device can be a vehicle-mounted navigation terminal and a vehicle-mounted computer, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc., but is not limited thereto; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not make any restrictions here.
[0059] To facilitate the understanding of the method for page pre-rendering provided by the embodiments of the present application, the following takes the execution entity of the method for page pre-rendering as the server as an example to exemplarily introduce the application scenario of the method for page pre-rendering.
[0060] See Figure 3 , this figure is a schematic diagram of the application scenario of a method for page pre-rendering provided by the embodiments of the present application. As Figure 3As shown in the figure, this application scenario includes a terminal device 310 and a server 320, and the terminal device 310 and the server 320 can communicate through a network. Among them, a client is installed in the terminal device 310, and the server 320 is used to provide services for the client. The client can be, for example, a video client, an information flow client, a game client, a browser client, etc.
[0061] The user can click on the client through the terminal device 310 to start the client. In response to the start of the client, the client sends a home page data acquisition request and a page style acquisition request to the server 320.
[0062] The server 320 separates the detail page snapshot data from the page style. Specifically, the server 320 pre-offline generates corresponding detail page snapshot data for each piece of content, and each detail page snapshot data corresponds to a detail page snapshot address, so that the client can subsequently obtain the detail page snapshot data based on the detail page snapshot address, and quickly render the corresponding detail page based on the detail page snapshot data, thereby reducing the real-time computing pressure of the server and reducing the cost waste caused by invalid requests. As can be seen from the foregoing, different versions of the client result in different page styles, so all page styles can be pre-stored in the server 320.
[0063] Based on this, after the server 320 obtains the page style acquisition request, it sends all page styles to the client. The server 320 determines the home page data for rendering the client home page according to the home page data acquisition request. The client home page includes multiple pieces of content, and each piece of content has a corresponding content identifier. Based on the content identifier, the detail page snapshot addresses corresponding to the multiple pieces of content included in the client home page can be obtained from multiple pre-generated detail page snapshot addresses, and the detail page snapshot addresses are sent to the client.
[0064] The client in the terminal device 310 obtains the home page data and the detail page snapshot addresses corresponding to the multiple pieces of content included in the home page data. The client home page of the client is rendered based on the home page data, and the detail page snapshot data corresponding to the multiple detail page snapshot addresses is obtained during the process of displaying the client home page through the terminal device 310.
[0065] Taking the first target content among the multiple pieces of content included in the client home page as an example, such as Figure 3As shown, the client's home page includes 9 pieces of content, with each video recommendation being one piece of content, and the first target content being video recommendation 2. If the user clicks on video recommendation 2 during the process of viewing the client's home page, in response to obtaining the selection operation for video recommendation 2, a target pre-rendered details page corresponding to video recommendation 2 is displayed. Among them, the target pre-rendered details page is rendered based on the target page style and the details page snapshot data corresponding to video recommendation 2. The target page style is determined from multiple pre-obtained page styles, and the target page style is applicable to the client in the terminal device 310.
[0066] Thus, the details page snapshot data is separated from the page style. After obtaining the details page snapshot data corresponding to the first target content, instead of directly rendering based on this details page snapshot data, a page style applicable to this client is determined from multiple pre-obtained page styles. As a result, the target pre-rendered details page rendered based on the target page style and this details page snapshot data is applicable to the client, thereby avoiding the problem of page style jump caused by the secondary refresh of the details page and improving the user experience.
[0067] The method for page pre-rendering provided by the embodiments of the present application can be executed by a terminal device. However, in other embodiments of the present application, the server can also have a similar function to the server, thereby executing the method for page pre-rendering provided by the embodiments of the present application, or the method for page pre-rendering provided by the embodiments of the present application can be jointly executed by the terminal device and the server. This embodiment does not make any limitations in this regard.
[0068] The following provides a detailed introduction to a method for page pre-rendering provided by the present application through method embodiments.
[0069] See Figure 4 , this figure is a signaling flow chart of a method for page pre-rendering provided by an embodiment of the present application. In Figure 4 , the client interacts with the server through the terminal device so that the client can first render the details page for the user to select content. Among them, the client is used to display pages and provide operations for the pages, etc., and the server provides data required to display pages, etc. As Figure 4 shown, the method for page pre-rendering includes the following S401 - S407.
[0070] S401: The client sends a home page data acquisition request and a page style acquisition request to the server.
[0071] The home page data acquisition request is used to acquire home page data. Based on this home page data, the client can render the client's home page, that is, the page displayed after opening the client. Taking a video client as an example, the client's home page is the page that displays various video recommendations.
[0072] The page style acquisition request is used to acquire all page styles applicable to the client. The embodiments of the present application do not specifically limit the combination manner of all page styles. They can be independent of various page styles or a collection of elements of multiple page styles. For example, if the same client has 100 page styles on different terminal devices, then all page styles include 100 page styles. Another example is that the page styles corresponding to the client version 1.0 include two fields A and B, and the page styles corresponding to the client version 2.0 include three fields B, C, and D. Then all page styles include four fields A, B, C, and D, that is, all page styles include a collection of elements of various page styles, so that the required page styles can be acquired from all page styles subsequently.
[0073] The embodiments of the present application do not specifically limit the time for sending the home page data acquisition request. For example, when the user opens the client, in response to the startup of the client, the client can send a home page data acquisition request to the server. Another example is that when the user returns from the detail page to the client home page, in response to the display of the client home page, the client can send a home page data acquisition request to the server.
[0074] Among them, in response indicates the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations to be executed can be real-time or have a set delay: Without special instructions, there is no limit on the execution order of multiple operations to be executed.
[0075] The embodiments of the present application do not specifically limit the time for sending the page style acquisition request. For example, when the user opens the client, in response to the startup of the client, the client can send a page style acquisition request to the server. Another example is that after acquiring the snapshot data of the detail pages corresponding to multiple contents included in the client home page, the client can send a page style acquisition request to the server. Another example is that during the process of displaying the client home page, the client can send a page style acquisition request to the server.
[0076] S402: The server determines multiple page styles according to the page style acquisition request and sends the multiple page styles to the client.
[0077] As can be seen from the foregoing, in the related art, the server offline calculates and generates one kind of snapshot data for one content. This snapshot data not only includes the data required to describe the content, but also includes the page style required for the client to display this data, that is, the data is coupled with the page style. As a result, when the client renders based on this snapshot data, only one pre-rendered page can be generated. If the page style of the pre-rendered detail page is different from that of the real-time rendered detail page, then there will be a jump in the page style after the second refresh of the detail page of the client. For example, the plot introduction displayed on the right in the pre-rendered page is displayed below in the real-time rendered detail page after the second refresh, resulting in a poor user experience.
[0078] Based on this, in the embodiments of the present application, the page style is no longer coupled with the data used to describe the content. Instead, the data used to describe the content, that is, the detail page snapshot data and the page style are separated. The server pre-offline generates the page style for each content in advance. The client selects the page style applicable to the content included in the client home page from the multiple pre-acquired page styles, so as to fuse the page style and the detail page snapshot data and then perform rendering to obtain the target pre-rendered detail page applicable to the client. The page style will be described first below.
[0079] The page style refers to the structure of the data constituting the client home page. Continuing to take the client as a video client as an example, the page style can be the title content of the video, the display position of the video, the control position for clicking to play the video, etc. As a possible implementation manner, the page style may include attributes and attribute values. The attribute corresponds to the rule type, and the attribute value corresponds to the description of the rule. For example, if the attribute is used to describe the device rule, the attribute value may be the model of the device where the client is located, the version of the client installed on the device, and other descriptions of the rules related to the device. If the attribute is used to describe the content rule, the attribute value may be the type of the content, whether the content is paid, and other descriptions of the rules related to the content.
[0080] As a possible implementation manner, the staff of the client stores all the page styles applicable to all corresponding applications in the server, so that after the server receives a page style acquisition request, it can send the page styles applicable to various clients to the client, so that the client can subsequently select a suitable page style from multiple page styles.
[0081] S403: The server determines the home page data for rendering the client home page according to the home page data acquisition request.
[0082] The home page data is the data describing the client home page. The client can render the client home page based on the home page data. The home page data generally includes multiple contents. Taking the video client as an example, the client home page will display the titles of multiple videos and the poster data of the videos. Each video is a content for recommendation to users. Each content can be selected to enter the detail page corresponding to the content. Each content has a content identifier to quickly obtain the detail page snapshot address based on the content identifier.
[0083] S404: The server obtains the detail page snapshot addresses corresponding to multiple contents from the multiple pre-stored detail page snapshot addresses.
[0084] The server stores all the content that may be displayed by the client, and pre-offline generates snapshot data of the detailed pages describing each piece of content, as well as the detailed page snapshot addresses corresponding to the snapshot data of each detailed page. Thus, compared with the server calculating the snapshot data of the detailed page corresponding to each piece of content in real time, the server calculates the snapshot data of the detailed page corresponding to each piece of content offline, reducing the real-time calculation pressure on the server and avoiding waste of costs caused by invalid requests.
[0085] Among them, the detailed page snapshot address is used to instruct the client to obtain the snapshot data of the detailed page corresponding to each piece of content, that is, the detailed page snapshot address is the address describing the snapshot data of the detailed page. The client can obtain the corresponding detailed page snapshot data from the server based on the detailed page snapshot address.
[0086] The detailed page snapshot data is data generated offline and used to describe the detailed page. Continuing with the example of a video client, the client's home page includes multiple pieces of content, displaying the title and poster of each piece of content. When the user clicks on one of the pieces of content, they will enter the detailed page of that content. The detailed page includes not only the title and poster of the content, but also the actors, director, plot summary, play button, etc.
[0087] It should be noted that due to factors such as different versions of the client, different types of content included in the client's home page, and different device models of the terminal device where the client is located, etc., all will result in different page styles. For the same piece of content, there will be differences in the detailed page snapshot data required for different page styles. Therefore, the detailed page snapshot data of different pieces of content pre-calculated offline by the server can include all the data required for all page styles.
[0088] Based on this, after the server determines the home page data according to the home page data acquisition request, the home page data includes multiple pieces of content. From the multiple detailed page snapshot addresses pre-generated offline, it determines the detailed page snapshot addresses corresponding to the content included in the home page data respectively.
[0089] As a possible implementation, different pieces of content can have different content identifiers. The snapshot data of the detailed pages of each piece of content and the addresses storing the snapshot data of each detailed page, that is, the detailed page snapshot addresses, can be generated offline, so that the detailed page snapshot addresses corresponding to each piece of content can be obtained based on the content identifiers.
[0090] S405: The server sends the home page data and the detailed page snapshot addresses corresponding to the multiple pieces of content included in the home page data to the client.
[0091] The client obtains the home page data and the detailed page snapshot addresses corresponding to the multiple pieces of content included in the home page data, and renders based on the home page data to obtain the client's home page and display the client's home page.
[0092] S406: During the process of displaying the client's home page, the client obtains the snapshot data of the detail pages corresponding to multiple detail page snapshot addresses respectively.
[0093] After the client's home page is displayed, since the user may perform selection operations on multiple contents included in the client's home page and thus enter the detail page corresponding to the content. Based on this, during the process of displaying the client's home page, the client can, based on the obtained snapshot addresses of each detail page, pre-obtain the snapshot data of the detail page corresponding to each snapshot address of the detail page, so that after the user performs a selection operation on a certain content, based on the snapshot data of the detail page corresponding to the content, quickly display the pre-rendered detail page rendered based on the snapshot data of the detail page. The following takes the first target content among multiple contents as an example for illustration.
[0094] S407: In response to obtaining a selection operation for the first target content among multiple contents, the client displays the target pre-rendered detail page corresponding to the first target content.
[0095] Among them, the first target content is one of the multiple contents, the target pre-rendered detail page is rendered based on the target page style and the snapshot data of the detail page corresponding to the first target content, and the target page style is determined from multiple pre-obtained page styles and is a page style applicable to the current client.
[0096] It can be seen from the above technical solution that the home page data and the snapshot addresses of the detail pages corresponding to multiple contents included in the home page data are obtained. Based on the home page data, the client's home page can be rendered. During the process of displaying the client's home page, the snapshot data of the detail pages corresponding to multiple snapshot addresses of the detail pages are obtained, that is, the snapshot data of the detail pages are not generated in real time but are pre-generated offline, thereby reducing the real-time computing pressure on the server and reducing the cost waste caused by invalid requests. Taking the first target content among multiple contents in the client's home page as an example, in response to obtaining a selection operation for the first target content, the target pre-rendered detail page corresponding to the first target content is displayed. Among them, the target pre-rendered detail page is rendered based on the target page style and the snapshot data of the detail page corresponding to the first target content, the target page style is determined from multiple pre-obtained page styles, and the target page style is applicable to the current client.
[0097] Thus, the snapshot data of the detail page is separated from the page style. After obtaining the snapshot data of the detail page corresponding to the first target content, instead of directly rendering based on the snapshot data of the detail page, the target page style applicable to the client is determined from multiple pre-obtained page styles. Therefore, the target pre-rendered detail page rendered based on the target page style and the snapshot data of the detail page is applicable to the client, thus avoiding the problem of page style jump after the detail page is refreshed for the second time and improving the user experience.
[0098] In addition, the jump of the page style will also cause a relatively high rendering frame rate on the client side, resulting in problems such as stuttering and high CPU consumption. Since the page style does not jump in the embodiments of the present application, after the secondary refresh, the rendering result of the previous time can be reused, thereby reducing the client rendering frame rate, reducing the probability of problems such as stuttering and high CPU consumption, and improving the user experience.
[0099] The embodiments of the present application do not specifically limit the manner in which the client renders the target pre-rendered detail page. The following takes two manners as examples for illustration.
[0100] Manner 1: Real-time rendering.
[0101] If a user wants to enter the detail page for the first target content, the user can perform a selection operation on the first target content. At this time, in response to obtaining the selection operation for the first target content, the client obtains the detail page snapshot data corresponding to the first target content from the detail page snapshot data respectively corresponding to multiple detail page snapshot addresses. Since different clients require different page styles, before rendering, it is also necessary to determine the target page style applicable to the current client from multiple page styles, so as to render the target pre-rendered detail page corresponding to the first target content according to the target page style and the detail page snapshot data corresponding to the first target content, and display the target pre-rendered detail page.
[0102] Thus, after the user performs a selection operation on the first target content from multiple contents, it indicates that the user wants to enter the detail page corresponding to the first target content. At this time, the detail page snapshot data corresponding to the first target content can be obtained in a targeted manner, and then combined with the target page style applicable to the current client for rendering to obtain the target pre-rendered detail page corresponding to the first target content. Thereby, the waste of the client computing resources is avoided, and the costs brought by operations such as storage and maintenance are reduced.
[0103] It should be noted that not only different versions of the client will result in different page styles, but also factors such as different types of contents included in the client home page and different device models of the terminal device where the client is located will result in different page styles. For example, the page styles of the detail pages of videos belonging to the children's category are different from those of the detail pages of videos belonging to the reasoning category.
[0104] Therefore, the embodiments of the present application can determine multiple page styles based on device attributes and content attributes. For example, the decision logic of the component styles of the detailed page corresponding to the content is abstracted into a rule expression to obtain various page styles. Among them, the device attributes are used to describe the attributes of the device where the client is located, such as the model of the device, the version of the client installed on the device, etc. The content attributes are used to describe the attributes of the first target content, such as the type of the content, whether the content is paid, etc. Thus, the target page style determined based on multiple page styles not only adapts to various clients but also applies to various content types, thereby enriching the diversity of the content displayed on the client more.
[0105] Based on this, the embodiments of the present application also provide a method for determining the target page style. Specifically, when multiple pre-configured page styles are determined according to device attributes and content attributes, the target device attributes of the device where the client is located can be obtained, the target content attributes can be determined according to the snapshot data of the detailed page corresponding to the first target content, and the target page style can be determined from multiple page styles according to the target device attributes and the target content attributes, so that the target page style is a page style applicable to the snapshot data of the detailed page corresponding to the first target content and the current client.
[0106] Method 2: Premature rendering.
[0107] During the process of displaying the home page of the client, the performance consumption of the central processing unit of the device where the client is located can be obtained. Among them, the performance consumption of the central processing unit can reflect the current processing ability of the device. If the performance consumption of the central processing unit is less than the preset performance threshold, it means that the current processing ability of the device is relatively high. Therefore, the page styles applicable to the snapshot data of each detailed page can be determined from multiple page styles according to the snapshot data of the detailed pages corresponding to multiple detailed page snapshot addresses, that is, for each content included in the home page of the client, the page style applicable to each content is determined. It can be understood that the page styles applicable to each content are also applicable to the current client.
[0108] According to the snapshot data of each detailed page and the page styles corresponding to the snapshot data of each detailed page, pre-rendered detailed pages corresponding to multiple contents are rendered. Thus, when the processing ability of the current device is relatively high, the detailed pages of all contents included in the home page of the client can be pre-rendered in advance to obtain pre-rendered detailed pages corresponding to multiple contents. Then, in response to obtaining the selection operation for the first target content, the target pre-rendered detailed page corresponding to the first target content is determined from the pre-rendered detailed pages corresponding to multiple contents, and the target pre-rendered detailed page is displayed.
[0109] The embodiments of the present application do not specifically limit the size of the preset performance threshold, and those skilled in the art can set it according to factors such as the type of the client and the performance upper limit of the central processing unit of the device.
[0110] Therefore, during the process of displaying the client's home page, if the performance consumption of the central processing unit of the current device is low, the current processing capacity of the device is high. It is possible to pre-render the detailed pages corresponding to multiple contents included in the client's home page to obtain pre-rendered detailed pages corresponding to each content. When the user selects one of the contents, quickly determine the pre-rendered detailed page corresponding to the content from multiple pre-rendered detailed pages and quickly display the pre-rendered detailed page corresponding to the content. Thus, without affecting the operation of the client, the waiting time of the user can be reduced and the user experience can be improved.
[0111] As a possible implementation, since the server pre-generates the snapshot data of the detailed page offline, after the client obtains the snapshot data of the detailed pages corresponding to multiple contents included in the client's home page, the server may update the snapshot data of the detailed page, resulting in the client rendering and displaying the pre-rendered detailed page based on the snapshot data of the detailed page before the update.
[0112] Based on this, to ensure that the client can display a relatively accurate pre-rendered detailed page, after the client displays the target pre-rendered detailed page corresponding to the first target content, it is possible to obtain the real-time data corresponding to the first target content. The real-time data is generated by the server in real time and is used to describe the real-time detailed page. Since the real-time data is calculated in real time, the real-time data can reflect the latest data corresponding to the first target content. If the real-time data is different from the snapshot data of the detailed page corresponding to the first target content, then according to the target page style and the real-time data, render the target real-time rendered detailed page corresponding to the first target content and replace the target pre-rendered detailed page with the target real-time rendered detailed page, that is, the client no longer displays the target pre-rendered detailed page but displays the target real-time rendered detailed page.
[0113] It should be noted that since the real-time data is generated in real time and is used to render the real-time rendered detailed page, and the snapshot data of the detailed page is generated offline and is used to render the pre-rendered detailed page. The data forms of the two may not be completely consistent, but both are used to render the detailed page corresponding to the first target content. As long as the content of the real-time rendered detailed page is the same as the content of the pre-rendered detailed page, it can be considered that the real-time data is the same as the snapshot data of the detailed page corresponding to the first target content.
[0114] Thus, after the target pre-rendered details page corresponding to the first target content is displayed, the real-time data corresponding to the first target content can be obtained. If the real-time data is different from the details page snapshot data corresponding to the first target content, it indicates that the details page snapshot data corresponding to the first target content may have been updated. Therefore, in order to correctly display the details page corresponding to the first target content, based on the target page style and the real-time data, the target real-time rendered details page corresponding to the first target content can be rendered, and the target pre-rendered details page currently displayed on the client can be replaced with the target real-time rendered details page. It can be understood that since the target page style has not changed, the data structure of the target real-time rendered details page is the same as that of the target pre-rendered details page. Although the page has changed after the second refresh, the page style has not changed, which will not affect the user's viewing too much. It can also greatly improve the fluency of the user entering the details page, improve the accuracy of page display, optimize the user experience, and enhance the core business indicators such as business play conversion while reducing the business cost.
[0115] As a possible implementation, since the user may enter the client home page multiple times. Continuing with the video client as an example, after the user enters the details page for a certain video and does not play the video, that is, does not enter the core function page corresponding to the details page, but exits the details page and enters the client home page. After repeating this many times, the user will choose to watch a certain video.
[0116] During this process, the client home page generally does not change much. When the client home page is being displayed, the details page snapshot data corresponding to the multiple details page snapshot addresses included in the client home page can be obtained from the cache of the client first. If the attempt to obtain the details page snapshot data corresponding to the second target content from the cache fails, it indicates that when the client home page is displayed again, the second target content may be newly added content, and only the details page snapshot data corresponding to the historical content exists in the cache. Then, according to the details page snapshot address corresponding to the second target content, the details page snapshot data corresponding to the second target content is obtained from the content delivery network.
[0117] Among them, the second target content is one of the multiple contents included in the client home page. The content delivery network is used to generate multiple details page snapshot addresses and store the details page snapshot data corresponding to each details page snapshot address respectively. Thus, the details page snapshot data corresponding to the second target content can be obtained from the content delivery network based on the details page snapshot address corresponding to the second target content.
[0118] Therefore, since the client will enter the client home page multiple times and the changes in the client home page are not significant. For example, only some of the multiple contents on the client home page change. Thus, when obtaining the snapshot data of the detail page, the snapshot data corresponding to multiple detail page snapshot addresses can be first obtained from the cache of the client. If the snapshot data corresponding to some contents fails to be obtained, the snapshot data of the second target content is obtained from the content delivery network. This reduces the interaction between the client and the content delivery network, improves the speed of obtaining the snapshot data of the detail page, shortens the time required for rendering, and enhances the user experience.
[0119] As a possible implementation, the server includes a home page interface service, a snapshot read service, a snapshot write service, and a global configuration service. It can be understood that each service can be in a separate server, or multiple services can be in one server. The present application does not make specific limitations in this regard. Each service will be described below.
[0120] See Figure 5 , which is a schematic diagram of the architecture of a page pre-rendering system provided by an embodiment of the present application. The page pre-rendering system includes a client 510 and a server (the server is not labeled in the figure, but multiple services included in the server are labeled). The server includes a home page interface service 521, a snapshot read service 522, a snapshot write service 523, and a global configuration service 524, which will be described below.
[0121] The server may include a global configuration service 524, and the client 510 includes a rule engine 511. Thus, the staff of the client stores all the page styles corresponding to the client in the global configuration service 524. The client 510 can send a page style acquisition request to the global configuration service 524. After the global configuration service 524 obtains the page style acquisition request, the global configuration service 524 can determine multiple page styles according to the page style acquisition request and send the multiple page styles to the client 510. After the client 510 obtains the multiple page styles, it stores them in the rule engine 511 so as to select a suitable page style from the multiple page styles through the rule engine 511.
[0122] The server may include a home page interface service 521. The client 510 sends a home page data acquisition request to the home page interface service 521. After the home page interface service 521 obtains the home page data acquisition request, it determines the home page data for rendering the client home page according to the home page data acquisition request and sends a snapshot data address acquisition request to the snapshot read service 522 included in the server.
[0123] The snapshot reading service obtains the request for the snapshot data address, acquires the snapshot addresses of the detail pages corresponding to multiple contents respectively, and sends the snapshot addresses of the detail pages corresponding to multiple contents respectively to the home page interface service. As a possible implementation, continue to refer to Figure 5 , the page pre-rendering system may further include a snapshot index database 530. The snapshot index database 530 may include the snapshot addresses of the detail pages corresponding to multiple contents respectively, and may further include the basic information related to the snapshot data where the version of the detail page snapshot is equal to the snapshot data. Thus, after obtaining the request for the snapshot data address, the snapshot reading service 522 may initiate a request to the snapshot index database 530 according to the content identifiers of each content included in the client home page, for querying the snapshot addresses of the detail pages corresponding to each content, and return them to the snapshot reading service 522.
[0124] After obtaining the snapshot addresses of the detail pages corresponding to multiple contents respectively, the snapshot reading service 522 sends the snapshot addresses of the detail pages corresponding to multiple contents respectively to the home page interface service 521. The home page interface service 521 sends the home page data and the snapshot addresses of the detail pages corresponding to multiple contents included in the home page data to the client. It should be noted that the home page interface service 521 may first send the home page data and then send the snapshot addresses of the detail pages corresponding to multiple contents included in the home page data, rather than necessarily sending the home page data and the snapshot addresses of the detail pages corresponding to multiple contents included in the home page data at the same time.
[0125] Thus, by refining the functions of the server into multiple services, the maintainability and scalability of the system can be improved, while achieving better fault isolation and performance optimization. Specifically, refining the server into multiple services makes the entire system more modular, and each service focuses on a specific function. This makes the system easier to maintain and upgrade, only need to focus on and modify the code of a specific service without affecting the entire system. Moreover, the modular architecture makes the system easier to expand. When new functions need to be added or more requests need to be processed, new services can be simply added without modifying the entire system, improving the scalability and flexibility of the system. In addition, if a service has a problem, through fault isolation, it will not affect the operation of the entire system, improving the reliability and stability of the system. Moreover, some services may have high requirements for performance, and separating them out can make it easier to perform performance optimization, ensuring that the entire system is more efficient in terms of performance.
[0126] As a possible implementation, the server further includes a message queue. Continue to refer to Figure 5 , the page pre-rendering system further includes a message queue 525 and a media asset system 540, which will be described separately below.
[0127] Through the media asset system 540, the staff on the client side can edit the basic information of the operation content. Continuing with the video client as an example, through the media asset system 540, the relevant data required for each content can be edited, so as to offline generate the detail page snapshot data based on the relevant technology.
[0128] If the snapshot read service 522 fails to obtain the detail page snapshot address corresponding to the third target content according to the snapshot data address acquisition request, and obtains the detail page snapshot addresses of the remaining contents, where the third target content is the content for which the detail page snapshot address is not obtained among multiple contents, and the remaining contents are the contents other than the third target content among multiple contents. For example, the snapshot read service 522 only obtains the detail page snapshot addresses of the remaining contents from the snapshot index database 530, but fails to obtain the detail page snapshot address corresponding to the third target content, indicating that the media asset system 540 has not edited the third target content. At this time, the snapshot read service 522 can send the detail page snapshot addresses of the remaining contents to the home page interface service, and send a snapshot data update notice for the third target content to the message queue, so as to notify the media asset system to update the detail page snapshot data corresponding to the third target content through the message queue.
[0129] It should be noted that the media asset system needs to subscribe to the message change notice from the snapshot read service through the message queue in advance.
[0130] Thus, although the detail page snapshot address corresponding to the third target content is not obtained, the client can render based on the detail page snapshot addresses of the remaining contents. Although the rendered result does not have the third target content, the remaining contents can still be quickly displayed. Moreover, after discovering that there is no detail page snapshot address corresponding to the third target content, the media asset system can be notified through the message queue. Not only can the media asset system quickly complete the data of the required content, but also asynchronous communication can be achieved through the message queue. The sender and the receiver do not need to be online at the same time. After the sender puts the message into the queue, it can continue to execute other tasks without waiting for the receiver to immediately process the message.
[0131] As a possible implementation method, not only can the snapshot read service and the media asset system perform asynchronous communication through the message queue, but also the snapshot write service and the media asset system can perform asynchronous communication through the message queue.
[0132] Specifically, the snapshot writing service subscribes to message change notifications from the message queue; if the message queue obtains a message change notification including the fourth target content from the media asset system, the message queue notifies the snapshot writing service that the fourth target content has been updated; the snapshot writing service generates the detailed page snapshot data corresponding to the fourth target content offline; the snapshot writing service uploads the detailed page snapshot data corresponding to the fourth target content to the content delivery network; the snapshot writing service obtains the detailed page snapshot address corresponding to the fourth target content from the content delivery network; the snapshot writing service sends the detailed page snapshot address corresponding to the fourth target content to the snapshot reading server.
[0133] Continue to refer to Figure 5 As shown in the figure, the snapshot writing service 523 subscribes to message change notifications from the message queue 525. If the message queue 525 obtains a message change notification including the fourth target content from the media asset system 540, the message queue 525 notifies the snapshot writing service 523 that the fourth target content has been updated, and the snapshot writing service 523 generates the detailed page snapshot data corresponding to the fourth target content offline. Among them, the fourth target content is any content. The snapshot writing service 523 uploads the detailed page snapshot data corresponding to the fourth target content to the content delivery network 550.
[0134] As a result, the content delivery network 550 stores the detailed page snapshot data corresponding to the fourth target content and generates the detailed page snapshot address corresponding to the fourth target content, so that the client 510 can obtain the detailed page snapshot data corresponding to the fourth target content from the content delivery network 550 through this detailed page snapshot address. The snapshot writing service 523 obtains the detailed page snapshot address corresponding to the fourth target content from the content delivery network 550 and stores the detailed page snapshot address corresponding to the fourth target content in the snapshot index database 530 for the snapshot reading service 522 to obtain.
[0135] Thus, by using the CDN to store the detailed page snapshot data corresponding to the content, the network performance can be optimized, the availability can be improved, the latency can be reduced, and a better user experience can be provided, which is especially suitable for large-scale content distribution and global applications. Specifically, the CDN distributes multiple server nodes over a wide range and stores the detailed page snapshot data closer to the users, reducing the distance of data transmission, improving the loading speed of the content, and accelerating the response time of the website and application. The CDN caches the content and provides services at the edge nodes closer to the users, sharing the load of the source server, reducing the pressure on the source server, and improving the scalability and stability of the overall system. The CDN adopts an architecture with multi-node distribution. Therefore, even if a certain node or server fails, other nodes can still provide services. This improves the availability and robustness of the entire system.
[0136] In addition, continue to refer to Figure 5, the server further includes a detail page service 526. The client can obtain the real-time data corresponding to the first target content from the detail page service 526. So, if the real-time data is different from the detail page snapshot data corresponding to the first target content, the target real-time rendered detail page corresponding to the first target content is rendered according to the target page style and the real-time data; and the target pre-rendered detail page is replaced with the target real-time rendered detail page.
[0137] To facilitate further understanding of the technical solution provided by the embodiments of the present application, the following takes the client as a video client as an example to give an overall exemplary introduction to the page pre-rendering method.
[0138] In the Over The Top (OTT) service, the device performance is generally poor, and the impact of the opening speed of the detail page on the user experience and the core business metrics is more obvious. Moreover, for services like OTT, the version upgrade of the video client is relatively slow, and there are multiple versions of the video client online. Different versions of the video client may have style changes, resulting in the problem of page jumping caused by secondary refreshing, and the user experience is poor.
[0139] Based on this, the embodiments of the present application decouple the page style required for pre-rendering the detail page and the detail page snapshot data. First, the process of the server generating the detail page snapshot data offline is described below.
[0140] See Figure 6 , which is a schematic diagram of a server generating detail page snapshot data offline provided by the embodiments of the present application.
[0141] S601: The snapshot write service subscribes to the message change notification from the message queue.
[0142] S602: Obtain the relevant data corresponding to the updated content through the media asset system.
[0143] The staff of the video platform can update the data required for various contents through the media asset system, such as the relevant data of the leading actor and director of video A.
[0144] S603: The media asset system sends a message change notification to the message queue.
[0145] The message change notification includes the content identifier of the updated content, so as to determine the updated content based on the content identifier.
[0146] S604: The message queue notifies the snapshot write service that the updated content has been updated.
[0147] S605: The snapshot write service generates the detail page snapshot data corresponding to the updated content offline.
[0148] S606: The snapshot writing service uploads the snapshot data of the detail page corresponding to the content to be updated to the content delivery network.
[0149] S607: The content delivery network returns the snapshot address of the detail page corresponding to the content to be updated to the snapshot writing service.
[0150] S608: The snapshot writing service sends the snapshot address of the detail page corresponding to the content to be updated to the snapshot index database.
[0151] Thus, the page style required for pre-rendering the detail page and the snapshot data of the detail page are decoupled. The server pre-generates the snapshot data of the detail pages of each piece of content offline, such as a component data (such as a playback panel and an episode list) containing the underlying playback page and all media asset data on which the calculation of all regular expressions depends, and uploads it to the content delivery network through the snapshot writing service. Compared with the server calculating the snapshot data of the detail page corresponding to each piece of content in real time, the server calculates the snapshot data of the detail page corresponding to each piece of content offline, reducing the real-time calculation pressure on the server and avoiding cost waste caused by invalid requests.
[0152] The process of the client rendering the detail page will be described below.
[0153] Refer to Figure 7 , which is a schematic diagram of a client rendering a detail page provided by an embodiment of the present application.
[0154] S701: In response to entering the client home page, the client sends a home page data acquisition request to the home page interface service.
[0155] S702: According to the home page data acquisition request, the home page interface service determines the home page data for rendering the client home page and sends a snapshot data address acquisition request to the snapshot reading service.
[0156] S703: The snapshot reading service sends a data acquisition request to the snapshot index database.
[0157] The snapshot reading service sends a data acquisition request to the snapshot index database according to the snapshot data address acquisition request.
[0158] S704: The snapshot index database returns the snapshot addresses of the detail pages corresponding to multiple pieces of content to the snapshot reading service.
[0159] The snapshot index database determines the snapshot addresses of the detail pages corresponding to multiple pieces of content according to the data acquisition request and returns the snapshot addresses of the detail pages corresponding to multiple pieces of content to the snapshot reading service.
[0160] S705: If the snapshot reading service fails to obtain the snapshot address of the detail page, it sends a snapshot data update notification to the message queue.
[0161] Thereby, which content is not updated is sent to the media asset system through the message queue so as to update the relevant data corresponding to the content.
[0162] S706: The snapshot reading service sends the detail page snapshot addresses respectively corresponding to multiple contents to the home page interface service.
[0163] S707: The home page interface service sends the home page data and the detail page snapshot addresses respectively corresponding to multiple contents included in the home page data to the client.
[0164] S708: The client renders the client home page according to the home page data.
[0165] S709: The client obtains multiple detail page snapshot data according to multiple detail page snapshot addresses.
[0166] During the process of displaying the client home page, the client obtains the detail page snapshot data respectively corresponding to multiple detail page snapshot addresses from the content delivery network.
[0167] S710: The client sends a page style acquisition request to the global configuration service.
[0168] S711: The global configuration service sends multiple page styles to the client.
[0169] S712: The client determines the detail page snapshot data corresponding to the first target content.
[0170] In response to obtaining a selection operation for the first target content, the client obtains the detail page snapshot data corresponding to the first target content from multiple detail page snapshot data.
[0171] S713: The client determines a target page style from multiple page styles.
[0172] S714: The client renders the target pre-rendered detail page.
[0173] The client renders to obtain the target pre-rendered detail page according to the target page style and the detail page snapshot data corresponding to the first target content.
[0174] S715: The client displays the target pre-rendered detail page.
[0175] S716: The client obtains the real-time data corresponding to the first target content from the detail page interface service.
[0176] S717: The client renders and displays the target real-time rendered detail page based on the real-time data.
[0177] If the real-time data is different from the snapshot data of the detail page corresponding to the first target content, the client renders the target real-time rendering detail page corresponding to the first target content according to the target page style and the real-time data. The client replaces the target pre-rendered detail page with the target real-time rendering detail page, that is, the client refreshes and displays the target real-time rendering detail page for the second time.
[0178] Thus, the client loads the data of the detail page into the client in advance. When the user opens the detail page, without waiting for the network request to return, the target pre-rendered detail page can be displayed through the client, eliminating the experience of buffering and waiting when the user opens the page. Thereby, it not only avoids the high cost caused by the background generating multiple copies of snapshot data to be compatible with different page styles, but also avoids the problem of page jump caused by the secondary refresh of the page due to the upgrade of the page style, improving the user experience.
[0179] It can be understood that in the specific implementation manner of the present application, it involves data related to users, such as the information of the client included in requests such as the home page data acquisition request and the page style acquisition request. When the above embodiments of the present application are applied to specific products or technologies, the separate permission or separate consent of the user needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0180] For the page pre-rendering method described above, the present application also provides a corresponding page pre-rendering device to enable the above page pre-rendering method to be applied and implemented in practice.
[0181] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit including the function of the module or unit.
[0182] See Figure 8 , this figure is a schematic structural diagram of a page pre-rendering device provided by an embodiment of the present application. As Figure 8 shown, the page pre-rendering device 800 includes: a first acquisition unit 801, a second acquisition unit 802, and a display unit 803;
[0183] The first acquisition unit 801 is configured to acquire the home page data for rendering the client home page, and the snapshot addresses of the detail pages corresponding to multiple contents included in the home page data;
[0184] The second acquisition unit 802 is configured to acquire the detail page snapshot data corresponding to each of the multiple detail page snapshot addresses during the process of displaying the client home page, where the detail page snapshot data is pre-generated offline by the server and is used to describe the pre-rendered detail page;
[0185] The display unit 803 is configured to, in response to acquiring a selection operation for a first target content among the multiple contents, display a target pre-rendered detail page corresponding to the first target content, where the target pre-rendered detail page is rendered according to a target page style and the detail page snapshot data corresponding to the first target content, and the target page style is a page style determined from multiple pre-acquired page styles and is applicable to the client.
[0186] As can be seen from the above technical solution, the home page data and the detail page snapshot addresses corresponding to each of the multiple contents included in the home page data are acquired. Based on the home page data, the client home page can be rendered. During the process of displaying the client home page, the detail page snapshot data corresponding to each of the multiple detail page snapshot addresses is acquired, that is, the detail page snapshot data is not generated in real time but is pre-generated offline, thereby reducing the real-time computing pressure on the server and reducing the cost waste caused by invalid requests. Taking the first target content among the multiple contents on the client home page as an example, in response to acquiring a selection operation for the first target content, a target pre-rendered detail page corresponding to the first target content is displayed. Among them, the target pre-rendered detail page is rendered according to a target page style and the detail page snapshot data corresponding to the first target content, and the target page style is determined from multiple pre-acquired page styles and is applicable to the current client.
[0187] Therefore, the detail page snapshot data is separated from the page style. After acquiring the detail page snapshot data corresponding to the first target content, instead of directly rendering based on the detail page snapshot data, a target page style applicable to the client is determined from multiple pre-acquired page styles. Thus, the target pre-rendered detail page rendered based on the target page style and the detail page snapshot data is applicable to the client, thereby avoiding the problem of page style jump caused by the secondary refresh of the detail page and improving the user experience.
[0188] As a possible implementation manner, the page pre-rendering device 800 further includes a third acquisition unit, a first determination unit, and a rendering unit;
[0189] The third acquisition unit is configured to, in response to acquiring a selection operation for a first target content among the multiple contents, acquire the detail page snapshot data corresponding to the first target content from the detail page snapshot data corresponding to each of the multiple detail page snapshot addresses;
[0190] The first determination unit is configured to determine a target page style applicable to the client from the multiple page styles;
[0191] The rendering unit is configured to render a target pre-rendered detailed page corresponding to the first target content according to the target page style and the detailed page snapshot data corresponding to the first target content;
[0192] The display unit 803 is specifically configured to display the target pre-rendered detailed page.
[0193] As a possible implementation, the page pre-rendering device 800 further includes a fourth acquisition unit and a fifth acquisition unit;
[0194] The fourth acquisition unit is configured to acquire multiple pre-configured page styles, and the page styles are determined according to device attributes and content attributes;
[0195] The fifth acquisition unit is configured to acquire the target device attributes of the device where the client is located;
[0196] The first determination unit is specifically configured to determine target content attributes according to the detailed page snapshot data corresponding to the first target content; and determine a target page style from the multiple page styles according to the target device attributes and the target content attributes, where the target page style is applicable to the client and the detailed page snapshot data corresponding to the first target content.
[0197] As a possible implementation, the page pre-rendering device 800 further includes a sixth acquisition unit, a second determination unit, a rendering unit, and a third determination unit; after acquiring the detailed page snapshot data corresponding to the multiple detailed page snapshot addresses respectively, the sixth acquisition unit is configured to acquire the performance consumption of the central processing unit of the device where the client is located during the process of displaying the client home page;
[0198] The second determination unit is configured to, if the performance consumption of the central processing unit is less than a preset performance threshold, determine page styles applicable to the respective detailed page snapshot data from the multiple page styles according to the detailed page snapshot data corresponding to the multiple detailed page snapshot addresses respectively;
[0199] The rendering unit is configured to render pre-rendered detailed pages corresponding to the multiple contents according to the respective detailed page snapshot data and the page styles corresponding to the respective detailed page snapshot data;
[0200] The third determination unit is configured to, in response to acquiring a selection operation for a first target content among the multiple contents, determine a target pre-rendered detailed page corresponding to the first target content from the pre-rendered detailed pages corresponding to the multiple contents;
[0201] The display unit 803 is specifically configured to display the target pre-rendered detail page.
[0202] As a possible implementation, the page pre-rendering apparatus 800 further includes a seventh acquisition unit and a rendering unit. After displaying the target pre-rendered detail page corresponding to the first target content, the seventh acquisition unit is configured to acquire real-time data corresponding to the first target content, where the real-time data is real-time generated data for describing a real-time detail page;
[0203] The rendering unit is configured to, if the real-time data is different from the detail page snapshot data corresponding to the first target content, render a target real-time rendered detail page corresponding to the first target content according to the target page style and the real-time data;
[0204] The display unit 803 is specifically configured to replace the target pre-rendered detail page with the target real-time rendered detail page.
[0205] As a possible implementation, the first acquisition unit 801 is specifically configured to:
[0206] Acquire detail page snapshot data corresponding to multiple detail page snapshot addresses from a cache;
[0207] If the acquisition of the detail page snapshot data corresponding to the second target content fails from the cache, acquire the detail page snapshot data corresponding to the second target content from a content delivery network according to the detail page snapshot address corresponding to the second target content, where the second target content is one of multiple contents included in the client home page, and the content delivery network is configured to generate multiple detail page snapshot addresses and store the detail page snapshot data corresponding to each of the detail page snapshot addresses.
[0208] See Figure 9 This figure is a schematic structural diagram of a page pre-rendering apparatus provided by an embodiment of the present application. As Figure 9 shown, the page pre-rendering apparatus 900 includes: a first acquisition unit 901, a first determination unit 902, a second determination unit 903, a second acquisition unit 904, and a sending unit 905;
[0209] The first acquisition unit 901 is configured to acquire a home page data acquisition request and a page style acquisition request from a client;
[0210] The first determination unit 902 is configured to determine multiple page styles according to the page style acquisition request, and send the multiple page styles to the client;
[0211] The second determination unit 903 is configured to determine home page data for rendering the client home page according to the home page data acquisition request, where the home page data includes a plurality of contents;
[0212] The second acquisition unit 904 is configured to acquire, from a plurality of pre-stored detail page snapshot addresses, the detail page snapshot addresses respectively corresponding to the plurality of contents, where the detail page snapshot addresses are used to instruct the client to acquire the detail page snapshot data respectively corresponding to the plurality of contents, and the detail page snapshot data is offline-generated data for describing the pre-rendered detail page;
[0213] The sending unit 905 is configured to send the home page data and the detail page snapshot addresses respectively corresponding to the plurality of contents included in the home page data to the client.
[0214] As can be seen from the above technical solution, the home page data and the detail page snapshot addresses respectively corresponding to the plurality of contents included in the home page data are acquired. Based on the home page data, the client home page can be rendered. During the process of displaying the client home page, the detail page snapshot data respectively corresponding to the plurality of detail page snapshot addresses is acquired, that is, the detail page snapshot data is not generated in real time but is pre-generated offline, thereby reducing the real-time computing pressure of the server and reducing the cost waste caused by invalid requests. Taking the first target content among the plurality of contents on the client home page as an example, in response to acquiring a selection operation for the first target content, the target pre-rendered detail page corresponding to the first target content is displayed. Among them, the target pre-rendered detail page is rendered according to the target page style and the detail page snapshot data corresponding to the first target content, the target page style is determined from a plurality of pre-acquired page styles, and the target page style is applicable to the current client.
[0215] Therefore, the detail page snapshot data is separated from the page style. After acquiring the detail page snapshot data corresponding to the first target content, instead of directly rendering based on the detail page snapshot data, the target page style applicable to the client is determined from a plurality of pre-acquired page styles. Therefore, the target pre-rendered detail page rendered based on the target page style and the detail page snapshot data is applicable to the client, thereby avoiding the problem of page style jump caused by the secondary refresh of the detail page and improving the user experience.
[0216] As a possible implementation manner, the device 900 for page pre-rendering includes a home page interface service, a snapshot read service, a snapshot write service, and a global configuration service;
[0217] The global configuration service is configured to acquire a page style acquisition request from the client, and send a plurality of page styles to the client according to the page style acquisition request;
[0218] The home page interface service is used to obtain a home page data acquisition request from the client, determine the home page data for rendering the client's home page according to the home page data acquisition request, and send a snapshot data address acquisition request to the snapshot read service;
[0219] The snapshot read service is used to obtain the detail page snapshot addresses corresponding to the multiple contents according to the snapshot data address acquisition request, and send the detail page snapshot addresses corresponding to the multiple contents to the home page interface service;
[0220] The home page interface service is further used to send the home page data and the detail page snapshot addresses corresponding to the multiple contents included in the home page data to the client.
[0221] As a possible implementation manner, the page pre-rendering device 900 further includes a message queue. If the snapshot read service fails to obtain the detail page snapshot address corresponding to the third target content according to the snapshot data address acquisition request, and obtains the detail page snapshot addresses of the remaining contents, the snapshot read service is used to send the detail page snapshot addresses of the remaining contents to the home page interface service, and send a snapshot data update notification for the third target content to the message queue, so as to notify the media asset system to update the detail page snapshot data corresponding to the third target content through the message queue. The third target content is the content for which the detail page snapshot address is not obtained among the multiple contents, and the remaining contents are the contents other than the third target content among the multiple contents.
[0222] As a possible implementation manner, the snapshot write service is used to subscribe to message change notifications from the message queue;
[0223] The message queue is used to notify the snapshot write service that the fourth target content has been updated if the message queue obtains a message change notification including the fourth target content from the media asset system;
[0224] The snapshot write service is further used to offline generate the detail page snapshot data corresponding to the fourth target content, upload the detail page snapshot data corresponding to the fourth target content to the content delivery network, obtain the detail page snapshot address corresponding to the fourth target content from the content delivery network, and send the detail page snapshot address corresponding to the fourth target content to the snapshot read server.
[0225] An embodiment of the present application further provides a computer device, which may be a server or a terminal device. The computer device provided by the embodiment of the present application will be introduced from the perspective of hardware implementation below. Among them, Figure 10 The structure diagram of the server is shown, Figure 11 The structure diagram of the terminal device is shown.
[0226] See Figure 10 Figure, which is a schematic structural diagram of a server provided by an embodiment of the present application. The server 1400 may vary greatly due to different configurations or performances, and may include one or more processors 1422, such as Central Processing Units (CPUs), a memory 1432, and a storage medium 1430 (such as one or more mass storage devices) for storing one or more application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 may be transient storage or persistent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the processor 1422 may be configured to communicate with the storage medium 1430 and execute a series of instruction operations in the storage medium 1430 on the server 1400.
[0227] The server 1400 may further include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.
[0228] The steps executed by the server in the above embodiment may be based on the Figure 10 server structure shown.
[0229] Among them, the CPU 1422 is used to execute the following steps:
[0230] Obtain the home page data for rendering the client home page, and the snapshot address of the detail page corresponding to each of the multiple contents included in the home page data;
[0231] During the process of displaying the client home page, obtain the snapshot data of the detail page corresponding to each of the multiple snapshot addresses of the detail page. The snapshot data of the detail page is data generated offline by the server and used to describe the pre-rendered detail page;
[0232] In response to obtaining a selection operation for a first target content among the multiple contents, display a target pre-rendered details page corresponding to the first target content, where the target pre-rendered details page is rendered based on a target page style and details page snapshot data corresponding to the first target content, and the target page style is a page style determined from a plurality of pre-obtained page styles and applicable to the client.
[0233] Or the CPU 1422 is used to perform the following steps:
[0234] Obtain a home page data acquisition request and a page style acquisition request from the client;
[0235] Determine a plurality of page styles according to the page style acquisition request, and send the plurality of page styles to the client;
[0236] Determine home page data for rendering the client's home page according to the home page data acquisition request, where the home page data includes a plurality of contents;
[0237] Obtain details page snapshot addresses corresponding to the plurality of contents respectively from a plurality of pre-stored details page snapshot addresses, where the details page snapshot addresses are used to instruct the client to obtain details page snapshot data corresponding to the plurality of contents respectively, and the details page snapshot data is generated offline and is data for describing the pre-rendered details page;
[0238] Send the home page data and the details page snapshot addresses corresponding to the plurality of contents included in the home page data to the client.
[0239] Optionally, the CPU 1422 may also execute the method steps of any specific implementation manner of the page pre-rendering method in the embodiments of the present application.
[0240] See Figure 11 , this figure is a schematic structural diagram of a terminal device provided by an embodiment of the present application. Taking this terminal device as a smart phone as an example for illustration, Figure 11 Shown is a block diagram of a part of the structure of this smart phone. The smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590 and other components. Those skilled in the art can understand that Figure 11 the structure of the smart phone shown in
[0241] does not constitute a limitation on the smart phone, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Figure 11Specifically introduce each component of the smartphone:
[0242] The RF circuit 1510 can be used for receiving and transmitting signals during information reception or call processes. Specifically, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, it sends the designed uplink data to the base station.
[0243] The memory 1520 can be used to store software programs and modules. The processor 1580 runs the software programs and modules stored in the memory 1520 to implement various functional applications and data processing of the smartphone.
[0244] The input unit 1530 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the smartphone. Specifically, the input unit 1530 can include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect touch operations of the user on or near it, and drive the corresponding connection device according to a preset program. In addition to the touch panel 1531, the input unit 1530 can also include other input devices 1532. Specifically, the other input devices 1532 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), trackballs, mice, joysticks, etc.
[0245] The display unit 1540 can be used to display information input by the user, information provided to the user, and various menus of the smartphone. The display unit 1540 can include a display panel 1541. Optionally, the display panel 1541 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0246] The smartphone can also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that the smartphone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be elaborated here.
[0247] An audio circuit 1560, a speaker 1561, and a microphone 1562 can provide an audio interface between the user and the smart phone. The audio circuit 1560 can transmit the electrical signal converted from the received audio data to the speaker 1561, and the speaker 1561 converts it into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560, converted into audio data, and then the audio data is output to the processor 1580 for processing. After that, it is sent through the RF circuit 1510 to, for example, another smart phone, or the audio data is output to the memory 1520 for further processing.
[0248] The processor 1580 is the control center of the smart phone, connecting various parts of the entire smart phone using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 1520, and by calling the data stored in the memory 1520, it executes various functions of the smart phone and processes data. Optionally, the processor 1580 may include one or more processing units.
[0249] The smart phone also includes a power supply 1590 (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby implementing functions such as management of charging, discharging, and power consumption management through the power management system.
[0250] Although not shown, the smart phone may also include a camera, a Bluetooth module, etc., which will not be elaborated here.
[0251] In the embodiments of the present application, the memory 1520 included in the smart phone can store a computer program and transmit the computer program to the processor.
[0252] The processor 1580 included in the smart phone can execute the method for page pre-rendering provided in the above embodiments according to the instructions in the computer program.
[0253] The embodiments of the present application also provide a computer-readable storage medium for storing a computer program, and the computer program is used to execute the method for page pre-rendering provided in the above embodiments.
[0254] The embodiments of the present application also provide a computer program product including a computer program. When it runs on a computer device, it causes the computer device to execute the method steps of any specific implementation manner of the method for page pre-rendering in the embodiments of the present application.
[0255] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium can be at least one of the following media: Read-Only Memory (ROM), RAM, magnetic disk, or optical disc, etc., which can store computer programs.
[0256] It should be noted that the embodiments in this specification are all described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiments. The device and system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0257] As described above, only a specific implementation manner of the present application is provided, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered by the protection scope of the present application. On the basis of the implementation manners provided in the above aspects, the present application can be further combined to provide more implementation manners. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for page pre-rendering, characterized in that, The method includes: Obtaining the home page data for rendering the client home page, and the snapshot addresses of the detail pages corresponding to the multiple contents included in the home page data; During the process of displaying the client home page, obtaining the snapshot data of the detail pages corresponding to the multiple snapshot addresses of the detail pages, where the snapshot data of the detail pages is data generated offline by the server and used to describe the pre-rendered detail pages; In response to obtaining a selection operation for a first target content among the multiple contents, displaying a target pre-rendered detail page corresponding to the first target content, where the target pre-rendered detail page is rendered based on a target page style and the snapshot data of the detail page corresponding to the first target content, and the target page style is a page style determined from multiple pre-obtained page styles and applicable to the client.
2. The method according to claim 1, characterized in that, The step of, in response to obtaining a selection operation for a first target content among the multiple contents, displaying a target pre-rendered detail page corresponding to the first target content, includes: In response to obtaining a selection operation for a first target content among the multiple contents, obtaining the snapshot data of the detail page corresponding to the first target content from the snapshot data of the detail pages corresponding to the multiple snapshot addresses of the detail pages; Determining a target page style applicable to the client from the multiple page styles; Rendering a target pre-rendered detail page corresponding to the first target content based on the target page style and the snapshot data of the detail page corresponding to the first target content; Displaying the target pre-rendered detail page.
3. The method according to claim 2, characterized in that, The method further includes: Obtaining multiple pre-configured page styles, where the page styles are determined based on device attributes and content attributes; Obtaining the target device attributes of the device where the client is located; The step of determining a target page style applicable to the client from the multiple page styles includes: Determining target content attributes based on the snapshot data of the detail page corresponding to the first target content; Determining a target page style from the multiple page styles based on the target device attributes and the target content attributes, where the target page style is applicable to the client and the snapshot data of the detail page corresponding to the first target content.
4. The method according to claim 1, characterized in that, After obtaining the snapshot data of the detail pages corresponding to the multiple snapshot addresses of the detail pages, the method further includes: During the process of displaying the client home page, obtaining the performance consumption of the central processing unit of the device where the client is located; If the performance consumption of the central processing unit is less than a preset performance threshold, determining a page style applicable to each snapshot data of the detail pages from the multiple page styles based on the snapshot data of the detail pages corresponding to the multiple snapshot addresses of the detail pages; Rendering pre-rendered detail pages corresponding to the multiple contents based on each snapshot data of the detail pages and the page style corresponding to each snapshot data of the detail pages; The step of, in response to obtaining a selection operation for a first target content among the multiple contents, displaying a target pre-rendered detail page corresponding to the first target content, includes: In response to obtaining a selection operation for a first target content among the multiple contents, determine a target pre-rendered detail page corresponding to the first target content from the pre-rendered detail pages respectively corresponding to the multiple contents; Display the target pre-rendered detail page.
5. The method according to claim 1, wherein After displaying the target pre-rendered detail page corresponding to the first target content, the method further includes: Obtain real-time data corresponding to the first target content, where the real-time data is data generated in real time and used to describe the real-time detail page; If the real-time data is different from the detail page snapshot data corresponding to the first target content, then render a target real-time rendered detail page corresponding to the first target content according to the target page style and the real-time data; Replace the target pre-rendered detail page with the target real-time rendered detail page.
6. The method according to claim 1, wherein The obtaining the detail page snapshot data respectively corresponding to the multiple detail page snapshot addresses includes: Obtain the detail page snapshot data respectively corresponding to the multiple detail page snapshot addresses from the cache; If the obtaining of the detail page snapshot data corresponding to a second target content from the cache fails, then obtain the detail page snapshot data corresponding to the second target content from a content delivery network according to the detail page snapshot address corresponding to the second target content, where the second target content is one of the multiple contents included in the client home page, and the content delivery network is used to generate multiple detail page snapshot addresses and store the detail page snapshot data respectively corresponding to each of the detail page snapshot addresses.
7. A method for page pre-rendering, characterized in that, The method includes: Obtain a home page data acquisition request and a page style acquisition request from the client; Determine multiple page styles according to the page style acquisition request, and send the multiple page styles to the client; Determine home page data for rendering the client home page according to the home page data acquisition request, where the home page data includes multiple contents; Obtain the detail page snapshot addresses respectively corresponding to the multiple contents from multiple pre-stored detail page snapshot addresses, where the detail page snapshot addresses are used to instruct the client to obtain the detail page snapshot data respectively corresponding to the multiple contents, and the detail page snapshot data is data generated offline and used to describe the pre-rendered detail page; Send the home page data and the detail page snapshot addresses respectively corresponding to the multiple contents included in the home page data to the client.
8. The method according to claim 7, characterized in that The method is executed by a server, and the server includes a home page interface service, a snapshot read service, a snapshot write service, and a global configuration service; The global configuration service is used to obtain a page style acquisition request from the client, and send multiple page styles to the client according to the page style acquisition request; The home page interface service is used to obtain a home page data acquisition request from the client, determine the home page data for rendering the client home page according to the home page data acquisition request, and send a snapshot data address acquisition request to the snapshot read service; The snapshot read service is used to obtain the detail page snapshot addresses respectively corresponding to the multiple contents according to the snapshot data address acquisition request, and send the detail page snapshot addresses respectively corresponding to the multiple contents to the home page interface service; The home page interface service is further configured to send the home page data and the snapshot addresses of the detail pages corresponding to the multiple contents included in the home page data to the client.
9. The method according to claim 8, wherein The server further includes a message queue, and the method further includes: If the snapshot reading service fails to obtain the snapshot address of the detail page corresponding to the third target content according to the snapshot data address acquisition request and obtains the snapshot addresses of the detail pages of the remaining contents, the snapshot reading service sends the snapshot addresses of the detail pages of the remaining contents to the home page interface service and sends a snapshot data update notification for the third target content to the message queue, so as to notify the media asset system to update the snapshot data of the detail page corresponding to the third target content through the message queue. The third target content is the content for which the snapshot address of the detail page is not obtained among the multiple contents, and the remaining contents are the contents other than the third target content among the multiple contents.
10. The method according to claim 9, wherein The method further includes: The snapshot writing service subscribes to the message change notification from the message queue; If the message queue obtains a message change notification including the fourth target content from the media asset system, the message queue notifies the snapshot writing service that the fourth target content has been updated; The snapshot writing service offline generates the snapshot data of the detail page corresponding to the fourth target content; The snapshot writing service uploads the snapshot data of the detail page corresponding to the fourth target content to the content delivery network; The snapshot writing service obtains the snapshot address of the detail page corresponding to the fourth target content from the content delivery network; The snapshot writing service sends the snapshot address of the detail page corresponding to the fourth target content to the snapshot reading server.
11. An apparatus for page pre-rendering, characterized in that, The device includes: a first acquisition unit, a second acquisition unit, and a display unit; The first acquisition unit is configured to acquire the home page data for rendering the client home page and the snapshot addresses of the detail pages corresponding to the multiple contents included in the home page data; The second acquisition unit is configured to acquire the snapshot data of the detail pages corresponding to the multiple snapshot addresses respectively during the process of displaying the client home page. The snapshot data of the detail page is data generated offline by the server and used to describe the pre-rendered detail page; The display unit is configured to, in response to obtaining a selection operation for the first target content among the multiple contents, display the target pre-rendered detail page corresponding to the first target content. The target pre-rendered detail page is rendered according to the target page style and the snapshot data of the detail page corresponding to the first target content, and the target page style is a page style determined from the multiple pre-obtained page styles and applicable to the client.
12. An apparatus for page pre-rendering, characterized in that, The device includes: a first acquisition unit, a second acquisition unit, a first determination unit, a second determination unit, and a sending unit; The first acquisition unit is configured to acquire a home page data acquisition request and a page style acquisition request from the client; The first determination unit is configured to determine multiple page styles according to the page style acquisition request and send the multiple page styles to the client; The second determination unit is configured to determine home page data for rendering the client home page according to the home page data acquisition request, where the home page data includes a plurality of contents; The second acquisition unit is configured to acquire, from a plurality of pre-stored detail page snapshot addresses, the detail page snapshot addresses respectively corresponding to the plurality of contents, where the detail page snapshot addresses are used to instruct the client to acquire the detail page snapshot data respectively corresponding to the plurality of contents, and the detail page snapshot data is offline-generated data for describing the pre-rendered detail page; The sending unit is configured to send the home page data and the detail page snapshot addresses respectively corresponding to the plurality of contents included in the home page data to the client.
13. A system for page pre-rendering, characterized in that, The system includes a client and a server; The client is configured to execute the method according to any one of claims 1-6; The server is configured to execute the method according to any one of claims 7-10.
14. A computer device, characterized in that, The computer device includes a processor and a memory: The memory is configured to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1-6 or execute the method according to any one of claims 7-10 according to the computer program.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium is configured to store a computer program, and the computer program is configured to execute the method according to any one of claims 1-6 or execute the method according to any one of claims 7-10.
16. A computer program product comprising a computer program, characterized in that, When running on a computer device, it causes the computer device to execute the method according to any one of claims 1-6 or execute the method according to any one of claims 7-10.