Page display method, device and storage medium
By sending a request message carrying identifiers for volatile and non-volatile data from the terminal, the server generates a response message carrying volatile data, and the terminal performs a partial refresh, thus resolving the page flickering issue and improving the viewing experience.
Patent Information
- Application Number
- CN202010075682.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-22
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2040-03-25
Smart Images

Figure CN113158099B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a page display method, apparatus and storage medium. Background Technology
[0002] Devices such as smartphones and tablets are becoming increasingly feature-rich. Users can perform tasks such as web browsing, online shopping, or reading news on these devices. The process of users performing these operations frequently involves page display.
[0003] Currently, when a terminal receives a user-triggered page display command to display a specific page, it can first read the page data from the cache and then display the page based on that data. During this process, the terminal retrieves the latest page data from the server, and then refreshes the already displayed page based on this latest data, while simultaneously refreshing the cache.
[0004] However, because the terminal needs to perform a global refresh of the displayed page based on the latest page data, the page will flicker noticeably during this refresh process, which will seriously affect the viewing experience.
[0005] Invention Data
[0006] This application provides a page display method, apparatus, and storage medium, which can improve the page viewing experience. The technical solution is as follows:
[0007] On the one hand, a page display method is provided, applied to a terminal, the method comprising:
[0008] The target page is displayed based on the stored target page data, and a first request message is sent to the server to request the page data of the target page. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0009] The server receives a first response message, which is generated by the server when the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data.
[0010] The displayed target page is refreshed based on the volatile data in the latest page data.
[0011] On the one hand, a page display method is provided, applied to a server, the method comprising:
[0012] A receiving terminal sends a first request message for requesting page data of a target page. The first request message is sent by the terminal when it displays the target page based on stored target page data. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0013] If the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, then a first response message is generated, and the first response message carries the volatile data in the latest page data.
[0014] The first response message is sent to the terminal to instruct the terminal to refresh the displayed target page based on the volatile data in the latest page data.
[0015] On the one hand, a page display device is provided for use in a terminal, the device comprising:
[0016] The sending module is used to display a target page based on the stored target page data and send a first request message to the server to request page data of the target page. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0017] The receiving module is used to receive a first response message returned by the server. The first response message is generated by the server when the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data.
[0018] The refresh module is used to refresh the displayed target page based on the volatile data in the latest page data.
[0019] On one hand, a page display device is provided for use on a server, the device comprising:
[0020] The receiving module is configured to receive a first request message sent by the terminal for requesting page data of a target page. The first request message is sent by the terminal when it displays the target page according to the stored target page data. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0021] The generation module is configured to generate a first response message if the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, wherein the first response message carries the volatile data in the latest page data.
[0022] The sending module is used to send the first response message to the terminal to instruct the terminal to refresh the displayed target page according to the volatile data in the latest page data.
[0023] The technical solution provided in this application can bring at least the following beneficial effects:
[0024] The terminal displays the target page based on the stored target page data and sends a first request message to the server requesting page data for the target page. The first request message carries a first identifier and a second identifier. The first identifier identifies volatile data in the target page data, and the second identifier identifies non-volatile data in the target page data. Upon receiving the first request message from the terminal, if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, the server generates a first response message and returns it to the terminal. The first response message carries the volatile data from the latest page data. Upon receiving the first response message from the server, the terminal refreshes the displayed target page based on the volatile data in the latest page data. In this way, the terminal only needs to refresh the volatile parts of the target page, that is, only the areas where data has changed need to be partially refreshed, thereby avoiding global page flickering and improving the page viewing experience. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0027] Figure 2 This is a flowchart of a page display method provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a page display process provided in an embodiment of this application;
[0029] Figure 4 This is a schematic diagram of another page display process provided in an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of the structure of a page display device provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of another page display device provided in an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0035] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.
[0036] Before providing a detailed explanation of the embodiments of this application, the implementation environment of the embodiments of this application will be described first.
[0037] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1The implementation environment may include a terminal 101 and a server 102. The terminal 101 and the server 102 can communicate via a wired network or a wireless network.
[0038] Terminal 101 can be any electronic product capable of human-computer interaction, such as a PC (Personal Computer), mobile phone, PDA (Personal Digital Assistant), PPC (Pocket PC), tablet computer, smart TV, etc. Server 102 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0039] Terminal 101 can display the target page after receiving a page display command triggered by a user. Upon receiving the page display command, terminal 101 can request page data for the target page from server 102. Server 102 can store the latest page data of the target page.
[0040] Figure 2 This is a flowchart illustrating a page display method provided in an embodiment of this application. See also... Figure 2 The method includes:
[0041] Step 201: The terminal determines whether the target page data has been stored.
[0042] It should be noted that the terminal can determine whether the target page data has been stored when there is a need to display the target page. For example, the terminal can determine whether the target page data has been stored when it receives a page display command. The page display command is used to display the target page, and this command can be triggered by the user through actions such as clicking, swiping, voice commands, and gestures.
[0043] Furthermore, the target page can be an H5 page, a web page, etc., and this application embodiment does not limit this. Target page data is the page data of the target page. Generally, if the terminal opens the target page for the first time, it should not store target page data; if the terminal has opened the target page before, it may store target page data.
[0044] It should be noted that if the terminal does not store the target page data, steps 202-204 can be executed to display the target page. If the terminal stores the target page data, steps 205-210 can be executed to display the target page.
[0045] Step 202: If the terminal does not have the target page data stored, a second request message is sent to the server to request the page data of the target page.
[0046] It should be noted that if the terminal does not store the target page data, the terminal needs to obtain the target page data from the server in order to display the target page.
[0047] Step 203: If the server receives the second request message sent by the terminal, it generates a third response message and sends the third response message to the terminal.
[0048] It should be noted that the third response message carries the latest page data of the target page, the identifiers of volatile data within the latest page data, and the identifiers of non-volatile data within the latest page data. Furthermore, the third response message may also carry second indication information, which indicates that the third response message contains all page data of the target page.
[0049] In addition, the server can store the latest page data of the target page, that is, it can store the latest target page. Furthermore, the server can store the identifiers of volatile and non-volatile data within the latest page data of the target page.
[0050] Furthermore, the page data of the target page can include volatile and non-volatile data. The volatile data refers to the frequently changing parts of the target page, while the non-volatile data refers to the typically unchanged parts. These volatile and non-volatile data can be predefined from the data on the target page. For example, data used to construct the page framework can be considered non-volatile data, while all other data on the target page can be considered volatile data.
[0051] Finally, the identifier of the volatile data is used to uniquely identify the volatile data. For example, the identifier of the volatile data can be the MD5 (Message-Digest Algorithm 5) value, SHA1 (Secure Hash Algorithm 1) value, etc. This application embodiment does not limit this, as long as the identifier of the volatile data can uniquely identify the volatile data. The identifier of the non-volatile data is used to uniquely identify the non-volatile data. For example, the identifier of the non-volatile data can be the MD5 value, SHA1 value, etc. This application embodiment does not limit this, as long as the identifier of the non-volatile data can uniquely identify the non-volatile data.
[0052] Step 204: If the terminal receives a third response message, it displays the target page based on the latest page data of the target page.
[0053] Furthermore, the terminal can use the latest page data as the target page data, use the identifier of the volatile data in the latest page data as the first identifier, and use the identifier of the non-volatile data in the latest page data as the second identifier, storing the target page data, the first identifier, and the second identifier accordingly. Thus, after the terminal first requests the target page from the server, the terminal can store the target page data, the first identifier, and the second identifier accordingly.
[0054] It should be noted that the operation of displaying the latest page data of the target page is similar to the operation of displaying the page data of a certain page in related technologies, and this application embodiment will not elaborate on this in detail.
[0055] In addition, if the terminal finds that the third response message contains second indication information after receiving the third response message, it can directly display the target page based on the page data carried in the third response message.
[0056] Step 205: If the terminal stores target page data, the terminal displays the target page based on the stored target page data and sends a first request message to the server to request the page data of the target page.
[0057] The operation of the terminal displaying the target page data based on the target page data is similar to the operation of displaying the page data of a certain page based on the page data of a certain page in related technologies, and will not be described in detail in the embodiments of this application.
[0058] It should be noted that when the terminal has stored target page data, it can directly display the target page based on the target page data, thus ensuring a high page display speed. Simultaneously, the terminal can retrieve the target page data from the server.
[0059] In this scenario, the terminal can first obtain the first and second identifiers stored corresponding to the target page data, and then send them to the server along with the first request message. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data. That is, if the terminal stores the target page data, the first request message sent by the terminal to the server can carry the first and second identifiers stored corresponding to the target page data.
[0060] Step 206: If the server receives the first request message sent by the terminal, it determines whether the first identifier is the same as the identifier of the volatile data in the latest page data of the target page, and determines whether the second identifier is the same as the identifier of the non-volatile data in the latest page data.
[0061] It should be noted that the server can store the latest page data of the target page, that is, it can store the latest target page. Furthermore, the server can store identifiers for volatile and non-volatile data within the latest page data of the target page.
[0062] In addition, after receiving the first identifier and the second identifier sent by the terminal, the server can determine whether the first identifier is the same as the identifier of volatile data in the latest page data of the target page, and whether the second identifier is the same as the identifier of non-volatile data in the latest page data, and determine what kind of response message to return to the terminal based on the determination results.
[0063] Furthermore, if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, then steps 207-208 can be performed to display the target page on the terminal. If the second identifier differs from the identifier of non-volatile data in the latest page data of the target page, then steps 209-210 can be performed to display the target page on the terminal.
[0064] Step 207: If the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, then the server generates a first response message and sends the first response message to the terminal, the first response message carrying the volatile data in the latest page data.
[0065] It should be noted that if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, it indicates that the non-volatile portion of the latest target page has not changed relative to the target page already displayed on the terminal, while only the volatile portion has changed. Therefore, the server can send only the volatile data from the latest page data of the target page to the terminal, so that the terminal can refresh its already displayed target page based on this volatile data.
[0066] In addition, the first response message may also carry first indication information, which indicates that the first response message contains partial page data of the target page. Furthermore, the first response message may also carry an identifier of volatile data in the latest page data, so that the terminal can update its stored first identifier accordingly.
[0067] It is worth noting that in this embodiment of the application, the server may only return the volatile data in the latest page data of the target page to the terminal, that is, only return part of the page data of the target page to the terminal, thus saving network transmission traffic.
[0068] Step 208: If the terminal receives the first response message sent by the server, it refreshes the displayed target page according to the volatile data in the latest page data of the target page.
[0069] It should be noted that when refreshing the displayed target page based on the volatile data in the latest page data of the target page, the volatile data of the displayed target page can be updated to the volatile data in the latest page data of the target page, thereby achieving a partial refresh of the displayed target page.
[0070] In addition, when the terminal refreshes the displayed target page based on the volatile data in the latest page data of the target page, it only needs to refresh the volatile part of the target page. That is, it only needs to refresh the part of the target page where the data has changed, thereby avoiding global page flickering and improving the page viewing experience.
[0071] Furthermore, after receiving the first response message, if the terminal finds that the first response message carries first indication information, it can partially refresh the displayed target page based on the volatile data carried in the first response message.
[0072] Furthermore, after step 208, if the first response message carries the identifier of the volatile data in the latest page data of the target page, the page data of the displayed target page can be obtained, and then the stored target page data is updated to the obtained page data, and the stored first identifier is updated to the identifier of the volatile data in the latest page data.
[0073] In this way, it can be ensured that the target page data, the first identifier, and the second identifier stored in the terminal correspond to the latest page data of the target page in the server at the time of the terminal's current request, thereby ensuring the accuracy of the target page data, the first identifier, and the second identifier stored in the terminal.
[0074] Step 209: If the second identifier is different from the identifier of the non-volatile data in the latest page data of the target page, the server generates a second response message and sends the second response message to the terminal.
[0075] It should be noted that the second response message carries the latest page data of the target page, the identifiers of volatile data within the latest page data, and the identifiers of non-volatile data within the latest page data. Furthermore, the second response message may also carry second indication information, which indicates that the second response message contains all page data of the target page.
[0076] Furthermore, if the second identifier differs from the identifier of the non-volatile data in the latest page data of the target page, it indicates that the non-volatile parts of the latest target page have changed relative to the target page already displayed on the terminal; that is, parts of the target page that would normally not change have changed. Therefore, the server can send the latest page data of the target page, the identifiers of the volatile data and the identifiers of the non-volatile data in the latest page data to the terminal, so that the terminal can refresh the displayed target page and update its stored first and second identifiers accordingly.
[0077] Step 210: If the terminal receives the second response message sent by the server, it refreshes the displayed target page according to the latest page data of the target page.
[0078] Furthermore, the terminal can update the stored target page data to the latest page data of the target page, update the stored first identifier to the identifier of the volatile data in the latest page data, and update the stored second identifier to the identifier of the non-volatile data in the latest page data.
[0079] In this way, it can be ensured that the target page data, the first identifier, and the second identifier stored in the terminal correspond to the latest page data of the target page in the server at the time of the terminal's current request, thereby ensuring the accuracy of the target page data, the first identifier, and the second identifier stored in the terminal.
[0080] The operation of refreshing the displayed target page based on the latest page data of the target page is similar to the operation of refreshing a page based on the page data of a certain page in related technologies, and will not be described in detail in the embodiments of this application.
[0081] It should be noted that after receiving the second response message, if the terminal finds that the second response message carries second indication information, it can perform a global refresh on the displayed target page based on the page data carried in the second response message.
[0082] It is worth noting that if the first identifier is the same as the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, then the server can generate a fourth response message and send it to the terminal. This fourth response message may carry third indication information, which indicates that the target page has not changed. Thus, after receiving the fourth response message from the server, if the terminal finds that the fourth response message carries the third indication information, it can maintain the display of the target page without refreshing it.
[0083] It should be noted that, in this embodiment of the application, both the first request message and the second request message sent by the terminal to the server can carry the URL (Uniform Resource Locator) of the target page, so that when the server receives the first request message or the second request message, it can query the latest page data of the target page according to the URL of the target page.
[0084] Another point to note is that, in this embodiment of the application, both the first request message and the second request message sent by the terminal to the server can carry a specified flag, which can be preset.
[0085] In this scenario, when the server detects that the request message sent by the terminal carries a specified marker, it can execute the operations described in this embodiment. Specifically, the server can execute steps 206, 207, and 209 upon receiving the first request message, and step 203 upon receiving the second request message. When the server detects that the request message sent by the terminal does not carry the specified marker, it can directly obtain the latest page data of the target page and return it to the terminal. This achieves compatibility with existing page display methods and improves the flexibility and stability of page display.
[0086] In this embodiment, the terminal displays a target page based on stored target page data and sends a first request message to the server requesting page data for the target page. The first request message carries a first identifier and a second identifier. The first identifier identifies volatile data in the target page data, and the second identifier identifies non-volatile data in the target page data. Upon receiving the first request message from the terminal, if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, the server generates a first response message and returns it to the terminal. The first response message carries the volatile data in the latest page data. After receiving the first response message from the server, the terminal refreshes the displayed target page based on the volatile data in the latest page data. Thus, the terminal only needs to refresh the volatile parts of the target page, that is, only the areas where data has changed need to be partially refreshed, thereby avoiding global page flickering and improving the page viewing experience.
[0087] It should be noted that the page display method provided in this application embodiment can be specifically applied to a client installed on a terminal. This client may include a webso component, a webview component, and JavaScript scripts.
[0088] The following is combined Figure 3 Here is an explanation of the process when the client makes its first request to the target page:
[0089] 1. The webso component sends a second request message to the server.
[0090] It should be noted that the webso field in the header of the second request message can contain a specified tag (such as 3.0).
[0091] 2. After receiving the second request message, the server finds that the header of the second request message contains a specified flag, then generates a third response message and sends the third response message to the webso component.
[0092] It should be noted that the ETAGY field in the header of the third response message can contain identifiers of volatile data in the latest page data of the target page, the webso-page-version field can contain identifiers of non-volatile data in the latest page data, and the webso-content-type field can contain secondary indication information (such as HTML). The body of the third response message can contain the latest page data of the target page.
[0093] 3. After receiving the third response message sent by the server, the WebSo component finds that the header of the third response message contains the second indication information. It then transmits the latest page data of the target page to the WebView component and uses this latest page data as the target page data. It uses the identifier of the volatile data in the latest page data as the first identifier and the identifier of the non-volatile part of the latest page data as the second identifier. The target page data, the first identifier, and the second identifier are stored in the cache accordingly.
[0094] 4. After receiving the latest page data from the target page, the webview component displays the target page based on the latest page data.
[0095] It should be noted that the target page being displayed can contain JavaScript.
[0096] The following is combined Figure 4 Here is an explanation of the process when the client makes a request to the target page for the first time:
[0097] 1. The webso component first reads the target page data, the first identifier, and the second identifier from the cache, transmits the target page data to the webview component, and then sends the first request message to the server.
[0098] It should be noted that the webso field in the header of the first request message can contain a specified tag, the etag field can contain a first identifier, and the webso-page-version field can contain a second identifier.
[0099] 2. After receiving the latest page data of the target page, the webview component displays the target page based on the latest page data. The displayed target page may contain JavaScript scripts, which request data from the webview component by calling the first specified method.
[0100] It should be noted that the first specified method can be set in advance, such as jsbridge: / / WebSo / getData.
[0101] 3. After receiving the first request message, the server finds that the header of the first request message contains a specified flag, a first identifier, and a second identifier. The server then compares the first identifier with the identifier of volatile data in the latest page data of the target page, and compares the second identifier with the identifier of non-volatile data in the latest page data of the target page. If the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data of the target page, the server generates a first response message and sends the first response message to the webso component.
[0102] It should be noted that the ETAGY field in the header of the first response message can contain identifiers of volatile data from the latest page data of the target page, and the webso-content-type field can contain first indication information (such as JSON). The body of the first response message can contain volatile data from the latest page data of the target page.
[0103] 4. After receiving the first response message from the server, the webso component finds that the header of the first response message contains the first indication information and detects a data request from the JavaScript script. Then, it calls the first specified method to transfer the volatile data from the latest page data of the target page to the JavaScript script.
[0104] 5. After receiving the volatile data from the latest page data of the target page, the JavaScript script refreshes the displayed target page based on the volatile data in the latest page data of the target page, and after the refresh is completed, calls the second specified method to notify the webso component to obtain the page data of the displayed target page.
[0105] It should be noted that the second specified method can be set in advance, such as jsbridge: / / WebSo / updateWebSoCache.
[0106] 6. After the webso component detects a JavaScript notification, it obtains the page data of the target page by injecting JavaScript into the webview component.
[0107] For example, the JavaScript script injected by the webso component into the webview component can be webView.loadUrl("javascript:window._webso.catchHtml(document.getElementsByT agName('html')[0].outerHTML);").
[0108] 7. The webso component updates the stored target page data to the obtained page data, and updates the stored first identifier to the identifier of the volatile data in the latest page data of the target page carried in the first response message.
[0109] Figure 5 This is a schematic diagram of the structure of a page display device provided in an embodiment of this application. See also... Figure 5 The device is used in a terminal and includes:
[0110] The sending module 501 is used to display the target page according to the stored target page data, and send a first request message to the server to request the page data of the target page. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0111] The receiving module 502 is used to receive a first response message returned by the server. The first response message is generated by the server when the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data.
[0112] The refresh module 503 is used to refresh the displayed target page based on the volatile data in the latest page data.
[0113] Optionally, the first response message carries an identifier of volatile data in the latest page data, and the device further includes:
[0114] The acquisition module is used to retrieve the page data of the displayed target page;
[0115] The update module is used to update the stored target page data to the obtained page data, and to update the stored first identifier to the identifier of the volatile data in the latest page data.
[0116] Optionally, the receiving module 502 is further configured to receive a second response message returned by the server. The second response message is generated by the server when the second identifier is different from the identifier of the non-volatile data in the latest page data of the target page. The second response message carries the latest page data, the identifier of the volatile data in the latest page data, and the identifier of the non-volatile data in the latest page data.
[0117] The refresh module 503 is also used to refresh the displayed target page based on the latest page data;
[0118] Accordingly, the device also includes:
[0119] The update module is used to update the stored target page data to the latest page data, update the stored first identifier to the identifier of the volatile data in the latest page data, and update the stored second identifier to the identifier of the non-volatile data in the latest page data.
[0120] Optionally, the sending module 501 is further configured to send a second request message to the server to request page data for the target page if the target page data is not stored.
[0121] The receiving module 502 is also used to receive a third response message returned by the server, the third response message carrying the latest page data of the target page, the identifier of the volatile data in the latest page data and the identifier of the non-volatile data in the latest page data;
[0122] Accordingly, the device also includes:
[0123] The display module is used to display the target page based on the latest page data.
[0124] The storage module is used to use the latest page data as the target page data, use the identifier of the volatile data in the latest page data as the first identifier, use the identifier of the non-volatile data in the latest page data as the second identifier, and store the target page data, the first identifier, and the second identifier accordingly.
[0125] In this embodiment, the terminal displays a target page based on stored target page data and sends a first request message to the server requesting page data for the target page. The first request message carries a first identifier and a second identifier. The first identifier identifies volatile data in the target page data, and the second identifier identifies non-volatile data in the target page data. Upon receiving the first request message from the terminal, if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, the server generates a first response message and returns it to the terminal. The first response message carries the volatile data in the latest page data. After receiving the first response message from the server, the terminal refreshes the displayed target page based on the volatile data in the latest page data. Thus, the terminal only needs to refresh the volatile parts of the target page, that is, only the areas where data has changed need to be partially refreshed, thereby avoiding global page flickering and improving the page viewing experience.
[0126] Figure 6 This is a schematic diagram of the structure of a page display device provided in an embodiment of this application. See also... Figure 6 The device is used in servers and includes:
[0127] The receiving module 601 is used to receive a first request message sent by the terminal for requesting page data of a target page. The first request message is sent by the terminal when displaying the target page according to the stored target page data. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data.
[0128] The generation module 602 is used to generate a first response message if the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data.
[0129] The sending module 603 is used to send a first response message to the terminal to instruct the terminal to refresh the displayed target page according to the volatile data in the latest page data.
[0130] Optionally, the generation module 602 is further configured to generate a second response message if the second identifier is different from the identifier of the non-volatile data in the latest page data of the target page. The second response message carries the latest page data of the target page, the identifier of the volatile data in the latest page data, and the identifier of the non-volatile data in the latest page data.
[0131] The sending module 603 is also used to send the second response message to the terminal.
[0132] Optionally, the receiving module 601 is further configured to receive a second request message sent by the terminal for requesting page data of the target page;
[0133] The generation module 602 is also used to generate a third response message, which carries the latest page data of the target page, the identifier of the volatile data in the latest page data, and the identifier of the non-volatile data in the latest page data.
[0134] The sending module 603 is also used to send a third response message to the terminal.
[0135] In this embodiment, the terminal displays a target page based on stored target page data and sends a first request message to the server requesting page data for the target page. The first request message carries a first identifier and a second identifier. The first identifier identifies volatile data in the target page data, and the second identifier identifies non-volatile data in the target page data. Upon receiving the first request message from the terminal, if the first identifier differs from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, the server generates a first response message and returns it to the terminal. The first response message carries the volatile data in the latest page data. After receiving the first response message from the server, the terminal refreshes the displayed target page based on the volatile data in the latest page data. Thus, the terminal only needs to refresh the volatile parts of the target page, that is, only the areas where data has changed need to be partially refreshed, thereby avoiding global page flickering and improving the page viewing experience.
[0136] It should be noted that the page display device provided in the above embodiments is only illustrated by the division of the above functional modules when displaying a page. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the page display device and the page display method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0137] Figure 7 This is a schematic diagram of the structure of a terminal 700 provided in an embodiment of this application. Terminal 700 can be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 700 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0138] Typically, terminal 700 includes a processor 701 and a memory 702.
[0139] Processor 701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0140] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 702 are used to store at least one instruction, which is executed by the processor 701 to implement the operations performed by the terminal in the page display method provided in the method embodiments of this application.
[0141] In some embodiments, the terminal 700 may also optionally include a peripheral device interface 703 and at least one peripheral device. The processor 701, memory 702, and peripheral device interface 703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 704, a touch display screen 705, a camera 706, an audio circuit 707, a positioning component 708, and a power supply 709.
[0142] Peripheral device interface 703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 701 and memory 702. In some embodiments, processor 701, memory 702 and peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 701, memory 702 and peripheral device interface 703 can be implemented on separate chips or circuit boards, which is not limited in this application.
[0143] The radio frequency (RF) circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 704 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0144] Display screen 705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 705 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 701 for processing. In this case, display screen 705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 705, disposed on the front panel of terminal 700; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 700 or in a folded design; in still other embodiments, display screen 705 may be a flexible display screen, disposed on a curved or folded surface of terminal 700. Furthermore, display screen 705 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 705 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0145] The camera assembly 706 is used to acquire images or videos. Optionally, the camera assembly 706 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 706 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0146] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 701 for processing, or input to the radio frequency circuit 704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal 700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 707 may also include a headphone jack.
[0147] The positioning component 708 is used to determine the current geographic location of the terminal 700 in order to enable navigation or LBS (Location Based Service). The positioning component 708 can be a positioning component based on the US GPS (Global Positioning System), China's BeiDou system, Russia's Granas system, or the EU's Galileo system.
[0148] The power supply 709 is used to power the various components in the terminal 700. The power supply 709 can be AC power, DC power, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0149] In some embodiments, the terminal 700 further includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: an accelerometer 711, a gyroscope 712, a pressure sensor 713, a fingerprint sensor 714, an optical sensor 715, and a proximity sensor 716.
[0150] Accelerometer 711 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 700. For example, accelerometer 711 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 701 can control touchscreen display 705 to display the user interface in landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 711. Accelerometer 711 can also be used for games or for acquiring user motion data.
[0151] The gyroscope sensor 712 can detect the orientation and rotation angle of the terminal 700. The gyroscope sensor 712, in conjunction with the accelerometer sensor 711, can collect 3D motion data from the user on the terminal 700. Based on the data collected by the gyroscope sensor 712, the processor 701 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0152] The pressure sensor 713 can be disposed on the side bezel of the terminal 700 and / or on the lower layer of the touch display screen 705. When the pressure sensor 713 is disposed on the side bezel of the terminal 700, it can detect the user's grip signal on the terminal 700, and the processor 701 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed on the lower layer of the touch display screen 705, the processor 701 can control the operable controls on the UI interface based on the user's pressure operation on the touch display screen 705. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0153] The fingerprint sensor 714 is used to collect a user's fingerprint. The processor 701 identifies the user based on the fingerprint collected by the fingerprint sensor 714, or vice versa. When the user's identity is identified as trusted, the processor 701 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 714 can be located on the front, back, or side of the terminal 700. When the terminal 700 has a physical button or manufacturer logo, the fingerprint sensor 714 can be integrated with the physical button or manufacturer logo.
[0154] An optical sensor 715 is used to collect ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the touch screen 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the touch screen 705 is increased; when the ambient light intensity is low, the display brightness of the touch screen 705 is decreased. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 715.
[0155] The proximity sensor 716, also known as a distance sensor, is typically located on the front panel of the terminal 700. The proximity sensor 716 is used to detect the distance between the user and the front of the terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front of the terminal 700 is gradually decreasing, the processor 701 controls the touchscreen display 705 to switch from a screen-on state to a screen-off state; when the proximity sensor 716 detects that the distance between the user and the front of the terminal 700 is gradually increasing, the processor 701 controls the touchscreen display 705 to switch from a screen-off state to a screen-on state.
[0156] Those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on terminal 700, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0157] Figure 8 This is a schematic diagram of the structure of a server 800 provided in an embodiment of this application. Server 800 can be a server in a backend server cluster. Specifically:
[0158] Server 800 includes a CPU (Central Processing Unit) 801, a system memory 804 including RAM (Random Access Memory) 802 and ROM (Read-Only Memory) 803, and a system bus 805 connecting the system memory 804 and the central processing unit 801. Server 800 also includes a basic I / O (Input / Output) system 806 that facilitates information transfer between various devices within the computer, and a mass storage device 807 for storing the operating system 813, application programs 814, and other program modules 815.
[0159] The basic input / output system 806 includes a display 808 for displaying information and an input device 809 for user input, such as a mouse or keyboard. Both the display 808 and the input device 809 are connected to the central processing unit 801 via an input / output controller 810 connected to the system bus 805. The basic input / output system 806 may also include the input / output controller 810 for receiving and processing input from multiple other devices such as a keyboard, mouse, or stylus. Similarly, the input / output controller 810 also provides output to a display screen, printer, or other types of output devices.
[0160] Mass storage device 807 is connected to central processing unit 801 via a mass storage controller (not shown) connected to system bus 805. Mass storage device 807 and its associated computer-readable media provide non-volatile storage for server 800. That is, mass storage device 807 may include computer-readable media (not shown) such as hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.
[0161] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM (Electrically Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, as well as CD-ROM, DVD (Digital Versatile Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. System memory 804 and mass storage device 807 can be collectively referred to as memory.
[0162] According to various embodiments of this application, server 800 can also be connected to a remote computer on a network, such as the Internet. That is, server 800 can be connected to network 812 via network interface unit 811 connected to system bus 805, or it can use network interface unit 811 to connect to other types of networks or remote computer systems (not shown).
[0163] The aforementioned memory also includes one or more programs stored in the memory and configured to be executed by the CPU. These programs contain instructions for performing operations executed by the server in the page display method provided in the method embodiments of this application.
[0164] In some embodiments, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the above-described embodiments. Figure 2The steps of the page display method provided in the embodiment. For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0165] It is worth noting that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.
[0166] It should be understood that all or part of the steps of the above embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented in whole or in part as a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-described computer-readable storage medium.
[0167] In some embodiments, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the above-described... Figure 2 The steps of the page display method provided in the embodiment.
[0168] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A page display method, characterized in that, The method includes: The target page is displayed based on the stored target page data, and a first request message is sent to the server to request the page data of the target page. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data. The server receives a first response message, which is generated by the server when the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data. The displayed target page is refreshed based on the volatile data in the latest page data.
2. The method as described in claim 1, characterized in that, The first response message carries an identifier of volatile data in the latest page data. After refreshing the displayed target page based on the volatile data in the latest page data, the process further includes: Retrieve the page data of the target page that has already been displayed; The stored target page data is updated to the acquired page data, and the stored first identifier is updated to the identifier of the volatile data in the latest page data.
3. The method as described in claim 1, characterized in that, After sending the first request message to the server to request page data for the target page, the method further includes: The server receives a second response message, which is generated by the server when the second identifier is different from the identifier of non-volatile data in the latest page data of the target page. The second response message carries the latest page data, the identifier of volatile data in the latest page data, and the identifier of non-volatile data in the latest page data. Refresh the displayed target page based on the latest page data; The stored target page data is updated to the latest page data, the stored first identifier is updated to the identifier of volatile data in the latest page data, and the stored second identifier is updated to the identifier of non-volatile data in the latest page data.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: If the target page data is not stored, a second request message is sent to the server to request the page data of the target page; Receive a third response message returned by the server, the third response message carrying the latest page data of the target page, the identifier of volatile data in the latest page data, and the identifier of non-volatile data in the latest page data; The target page is displayed based on the latest page data; The latest page data is used as the target page data. The identifier of the volatile data in the latest page data is used as the first identifier, and the identifier of the non-volatile data in the latest page data is used as the second identifier. The target page data, the first identifier, and the second identifier are stored accordingly.
5. A page display method, characterized in that, The method includes: A receiving terminal sends a first request message for requesting page data of a target page. The first request message is sent by the terminal when it displays the target page based on stored target page data. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data. If the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, then a first response message is generated, and the first response message carries the volatile data in the latest page data. The first response message is sent to the terminal to instruct the terminal to refresh the displayed target page based on the volatile data in the latest page data.
6. The method as described in claim 5, characterized in that, Following the first request message sent by the receiving terminal for requesting page data of the target page, the message further includes: If the second identifier is different from the identifier of the non-volatile data in the latest page data of the target page, a second response message is generated, which carries the latest page data of the target page, the identifier of the volatile data in the latest page data, and the identifier of the non-volatile data in the latest page data. The second response message is sent to the terminal.
7. The method as described in claim 5 or 6, characterized in that, The method further includes: Receive a second request message sent by the terminal for requesting page data of the target page; Generate a third response message, which carries the latest page data of the target page, the identifier of volatile data in the latest page data, and the identifier of non-volatile data in the latest page data; The third response message is sent to the terminal.
8. A page display device, characterized in that, The device includes: The sending module is used to display a target page based on the stored target page data and send a first request message to the server to request page data of the target page. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data. The receiving module is used to receive a first response message returned by the server. The first response message is generated by the server when the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data. The first response message carries the volatile data in the latest page data. The refresh module is used to refresh the displayed target page based on the volatile data in the latest page data.
9. A page display device, characterized in that, The device includes: The receiving module is configured to receive a first request message sent by the terminal for requesting page data of a target page. The first request message is sent by the terminal when it displays the target page according to the stored target page data. The first request message carries a first identifier and a second identifier. The first identifier is used to identify volatile data in the target page data, and the second identifier is used to identify non-volatile data in the target page data. The generation module is configured to generate a first response message if the first identifier is different from the identifier of volatile data in the latest page data of the target page, and the second identifier is the same as the identifier of non-volatile data in the latest page data, wherein the first response message carries the volatile data in the latest page data. The sending module is used to send the first response message to the terminal to instruct the terminal to refresh the displayed target page according to the volatile data in the latest page data.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-7.
Citation Information
Patent Citations
Webpage request method, webpage response method, terminal, server, and webpage request and response system
CN105978933A
Method and device for loading web page
CN109359259A