Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The application provides a method for controlling a page presentation stream, and a process for controlling the page presentation stream may include: receiving an ID list of a presentation block sent by a server; receive the ith0To the ithNDisplaying the content data of the individual display blocks in the page; receiving a pull-down loading instruction of a user, and acquiring a current page number according to the pull-down loading instruction; acquiring an identifier of the exhibition block to be loaded according to the page number and the ID list, and sending the identifier of the exhibition block to be loaded to a server; and receiving the content data of the display block to be loaded fed back by the server and displaying the content data in the page. The method for controlling the page presentation stream may be used as an independent application, for example, the presentation of the page presentation stream, or a presentation block loader may implement a control process of the page presentation stream, that is, an identifier of the presentation block is obtained according to the ID of the presentation block and the current page number, so as to obtain content data corresponding to the presentation block and present the content data in a corresponding page.
Fig. 1 is a flowchart of a method for controlling a page presentation flow according to an embodiment of the present application.
As shown in fig. 1, the method for controlling the page presentation stream includes:
s110, receiving an ID list of the exhibition blocks sent by the server, wherein the ID list comprises identifications of M exhibition blocks, and M is a positive integer. In the embodiment of the application, because the ID of the presentation block is a field, network traffic is consumed little, and traffic of the client is not lost.
In an embodiment of the present application, when a user requests content data for the first time through a client or when the client updates, the server sends an ID list of all relevant presentation blocks to the client. Wherein, the ID list of all the presentation blocks sent by the server further includes M presentation block identifiers. The identifier of the presentation block can provide an effective basis for determining the content data of the presentation block corresponding to the identifier of the server, that is, the client can obtain the content data of the corresponding presentation block from the server according to the identifier of the presentation block. For example, when the client loads the to-be-loaded presentation block, the server may determine the content data corresponding to the to-be-loaded presentation block according to the identifier of the to-be-loaded presentation block by only sending the identifier of the to-be-loaded presentation block to the server.
It is to be understood that the identity of a presentation block is unique and can be used to uniquely identify the corresponding presentation block.
In another embodiment of the present application, the server sends the current time as a timestamp to the client while sending the list of IDs of the presentation blocks. Where the timestamp is used to mark the field of the current request time. Since the server will update the content data in the presentation block, it is necessary to record the current time stamp, so as to update with reference to the time stamp in the subsequent presentation block update process, which will be described in detail later.
For example, as shown in FIG. 2, the server may send a list of IDs for presentation blocks and a timestamp for each presentation block to the client. For example, referring to fig. 2, the server sends to the client a list of presentation blocks with IDs 1-500 (i.e., M-500), along with the current timestamp t3, and the home page content. After receiving the ID list and the corresponding timestamp of the presentation block sent by the server, the client stores the ID list and the corresponding timestamp locally, presents the content data of the first page in the page of the client, and records that the current page number is 1.
It should be noted that, in the present application, the client may be a smart phone, a personal computer, a tablet computer, or other devices.
S120, receiving the ith0To the ithNThe content data of the individual presentation blocks are incorporated inAnd displaying in the page, wherein N is the number of display blocks which can be displayed by the page.
In one embodiment of the present application, for the first request for content data, the ith0To the ithNThe content data of each presentation block may be the content data of the first page of the client, for example, the 1 st to 5 th presentation blocks, where N is five, which is the maximum number of presentation blocks that can be presented in the page. In another embodiment of the present application, for updating content data, the ith0To the ithNThe content data of each presentation block is determined based on the presentation block of the previous page. Referring to fig. 2, the first page content data, i.e., the 1 st to 5 th presentation blocks, is presented in the page due to the first request.
In another embodiment of the present application, it is also necessary to present the list of presentation block IDs from 1-M in the page.
And S130, receiving a pull-down loading instruction of a user, and acquiring the current page number according to the pull-down loading instruction.
And receiving a pull-down gesture of a user for the page, generating a pull-down loading instruction according to the pull-down gesture, and acquiring the current page number of the current page.
Continuing with the example shown in FIG. 2, if the first page content data is a 1 st to 5 th presentation block, then the current page number of the page is 1.
And S140, acquiring the identifier of the exhibition block to be loaded according to the page number and the ID list, and sending the identifier of the exhibition block to be loaded to a server.
In an embodiment of the present application, obtaining the identifier of the exhibition block to be loaded may be obtained by the following formula, for example: [ current page number N +1, (current page number +1) × N ], where N is the number of presentation blocks that a page can present. As described above, by sending the identifier of the presentation block to be loaded to the server, the content data of the corresponding presentation block can be accurately determined, which is simple and efficient.
For example, when a user browses a microblog, when new content needs to be viewed after content data of a current page is read, the new content can be loaded through a display page of a pull-down client. And the client performs related calculation according to the page number of the current browsed page of the user and the content quantity displayed by the page according to the pull-down loading instruction to obtain the identifier of the content data of the next page, and sends the obtained identifier of the content data of the next page to a related server for query. And the server determines a content queue corresponding to the content data in the ID list according to the identification of the content data, finds out a corresponding content data snapshot according to the corresponding timestamp, packages the content data snapshot into a presentation block, and returns the content data snapshot to the client. For example, as shown in fig. 2, since the home page represents the content data of the 1 st to 5 th presentation blocks, the identifier of the presentation block of the next page, i.e. the identifier of the 6 th to 10 th presentation blocks, can be calculated by using the identification formula of the presentation block to be loaded and the page number of the home page, and the obtained identifier of the presentation block is sent to the server to query the corresponding presentation block, i.e. the 6 th to 10 th presentation blocks.
And S150, receiving the content data of the to-be-loaded display block fed back by the server and displaying the content data in the page. As shown in fig. 5, the results are presented in the page.
In the embodiment of the application, the client renders the content data of the to-be-loaded presentation block fed back by the server, presents the rendered content data and updates the page number of the page.
In one embodiment of the application, a client receives a pull-up operation of a user and generates a pull-up update instruction. And the client sends the pull-up updating instruction to the server and receives a new ID list and a new timestamp of the display block fed back by the server. Of course, after the client is restarted, it is also necessary to receive a new ID list and a new timestamp of the presentation block sent by the server. Continuing to refer to fig. 2, further, after the server queries the corresponding presentation block through the identifier of the 6 th to 10 th presentation blocks, feeding back the content data of the presentation block to the client, rendering the content data by the client, then presenting the content data, and updating the current page to 2.
The execution steps may be executed by one execution main body, or may be implemented by different execution main bodies, where the execution main body may refer to one program module or one function module, and may have different definitions according to specific scenarios.
To make the present application more clear to those skilled in the art, for example, as shown in fig. 3, the method for controlling the page display flow further includes:
and S310, receiving the time stamp corresponding to each presentation block sent by the server.
In one embodiment of the present application, the timestamp is a field marking the current request time, and can uniquely identify the time of a certain moment, so as to find a more suitable snapshot of the presentation block when more content data is loaded.
And S320, sending the time stamp corresponding to the presentation block to be loaded to the server so that the server determines the content data corresponding to the presentation block to be loaded according to the time stamp.
In the embodiment of the application, the client sends the time stamp to the server, and the server selects the corresponding content data to feed back to the client according to the time stamp.
Specifically, as shown in fig. 4, the determining, by the server according to the timestamp, content data corresponding to the presentation block to be loaded specifically includes:
s410, the server determines whether the presentation block to be loaded has been updated according to the timestamp, for example, whether the data content of the presentation block is updated after the timestamp.
And S420, if the update is judged, taking the data of the presentation block to be loaded before the time stamp as the content data. Because the pull-up update instruction of the user is not received at present, the timestamp corresponding to the presentation block to be loaded is sent by the server before, at this time, if the data content of the presentation block is updated, the content of the presentation block does not correspond to the content of other presentation blocks, and therefore when the update is judged, the server still feeds back the data before the timestamp to the client. Therefore, the embodiment of the application solves the problem caused by the update of the display block.
And S430, if the updating is not judged, taking the current data of the presentation block to be loaded as the content data.
According to the embodiment of the application, the ID list of the display block sent by the server can be used for calculating the identifier of the display block to be loaded according to the current page number and the ID list of the display block. Therefore, on the premise of not changing the display form of the display block in the page, the display stability of the display block is improved, and the phenomenon of loss or repetition of the display block is reduced or even avoided. In addition, the display performance of the display blocks in the page can be optimized, and the use experience of a user is improved.
A page presentation flow control system according to an embodiment of the disclosure is described in detail below with reference to the accompanying drawings, and is shown in fig. 6.
Fig. 6 is a schematic structural diagram of a control system of a page presentation flow according to the present application.
As shown in fig. 6, the page presentation flow control system 100 includes: client 110 and server 120.
Wherein, the client 110 is used for receiving the ID list of the exhibition block sent by the server 120 and receiving the ith0To the ithNThe method comprises the steps of displaying content data of individual display blocks in a page, receiving a pull-down loading instruction of a user, obtaining a current page number according to the pull-down loading instruction, obtaining an identifier of a display block to be loaded according to the page number and an ID list, receiving content data of the display block to be loaded fed back by a server 120, and displaying the content data in the page, wherein the ID list comprises the identifiers of M display blocks, M is a positive integer, and N is the number of the display blocks which can be displayed in the page.
In the embodiment of the application, because the ID of the presentation block is a field, network traffic is consumed little, and traffic of the client is not lost.
In one embodiment of the present application, when the user requests content data for the first time through the client 110 or when the client 110 updates, the server 120 sends the ID list of all relevant presentation blocks to the client 110. Wherein, the ID list of all the presentation blocks sent by the server 120 further includes M presentation block identifiers. The presentation block identifier may provide a valid basis for the server 120 to later determine the content data of the presentation block corresponding thereto, i.e., the client 110 may obtain the content data of the corresponding presentation block from the server 120 according to the presentation block identifier. For example, when the client 110 loads the to-be-displayed block, only the identifier of the to-be-displayed block needs to be sent to the server 120, and the server 120 may determine the content data corresponding to the to-be-loaded displayed block according to the identifier of the to-be-loaded displayed block.
It can be understood that the identity of the presentation block is unique, and can be used to uniquely identify the corresponding presentation block.
In another embodiment of the present application, the server 120 sends the current time as a timestamp to the client 110 at the same time as sending the list of IDs of the presentation blocks. Where the timestamp is used to mark the field of the current request time. Since the server 120 will update the content data in the presentation block, it is necessary to record the current time stamp so as to update with reference to the time stamp in the subsequent presentation block update process, which will be described in detail later. For example, as shown in FIG. 2, server 120 may send a list of IDs for presentation blocks and a timestamp for each presentation block to client 110. For example, referring to fig. 2, the server sends to the client a list of presentation blocks with IDs 1-500 (i.e., M-500), along with the current timestamp t3, and the home page content. After receiving the ID list and the corresponding timestamp of the presentation block sent by the server 120, the client 110 stores the ID list and the corresponding timestamp locally, presents the top page content data in the page of the client 110, and records that the current page number is 1.
It should be noted that, in the present application, the client 110 may be a smart phone, a personal computer, a tablet computer, or the like.
In the embodiment of the present application, for the first request of content data, the ith0To the ithNThe content data of each presentation block may be the content data of the first page of the client, for example, the 1 st to 5 th presentation blocks, where N is five, which is the maximum number of presentation blocks that can be presented in the page. In another embodiment of the present application, for updating content data, the ith0To the ithNThe content data of each presentation block is determined based on the presentation block of the previous page. Referring to fig. 2, the first page content data, i.e., the 1 st to 5 th presentation blocks, is presented in the page due to the first request.
In another embodiment of the present application, it is also necessary to present the list of presentation block IDs from 1-M in the page.
In an embodiment of the present application, the client 110 receives a pull-down gesture of a user for a page, generates a pull-down loading instruction according to the pull-down gesture, and obtains a current page number of the current page. Continuing with the example shown in FIG. 2, if the first page content data is a 1 st to 5 th presentation block, then the current page number of the page is 1.
In an embodiment of the present application, obtaining the identifier of the exhibition block to be loaded may be obtained by the following formula, for example: [ current page number N +1, (current page number +1) × N ], where N is the number of presentation blocks that a page can present. As described above, by sending the identifier of the presentation block to be loaded to the server 120, the content data of the corresponding presentation block can be accurately determined, which is simple and efficient.
Further, in an embodiment of the present application, the client 110 is further configured to receive a timestamp sent by the server 120 and corresponding to each presentation block, and send the timestamp corresponding to the presentation block to be loaded to the server 120, so that the server 120 determines, according to the timestamp, content data corresponding to the presentation block to be loaded.
For example, when a user browses a microblog, when new content needs to be viewed after content data of a current page is read, the new content may be loaded through a display page of the pull-down client 110. The client 110 performs related calculation according to the page number of the currently browsed page of the user and the content quantity displayed on the page according to the pull-down instruction to obtain the identifier of the content data of the next page, and sends the obtained identifier of the content data of the next page to a related server for query. The server determines the content queue of the corresponding content data in the ID list according to the identifier of the content data, finds out the corresponding content data snapshot according to the corresponding timestamp, packages the content data snapshot into the presentation block, and returns the content data snapshot to the client 110. For example, as shown in fig. 2, since the home page represents the content data of the 1 st to 5 th presentation blocks, the identifier of the presentation block of the next page, i.e. the identifier of the 6 th to 10 th presentation blocks, can be calculated by using the identification formula of the presentation block to be loaded and the page number of the home page, and the obtained identifier of the presentation block is sent to the server to query the corresponding presentation block, i.e. the 6 th to 10 th presentation blocks.
In the embodiment of the present application, after the client 110 receives the content data of the presentation block to be loaded fed back by the server 120, the rendering is performed first, the rendered content data is presented, and the page number of the page is updated.
In one embodiment of the present application, the client 110 receives a pull-up operation of a user and generates a pull-up update instruction. The client 110 sends a pull-up update instruction to the server 120 and receives a new ID list and a new timestamp of the presentation block fed back by the server 120. Of course, after the client is restarted, it is also necessary to receive a new ID list and a new timestamp of the presentation block sent by the server. As shown in fig. 2, further, after the server queries the corresponding presentation block by obtaining the identifier of the 6 th to 10 th presentation blocks, the content data of the presentation block is fed back to the client, and the client renders the presentation block and then presents the rendered presentation block, and updates the current page to 2.
Wherein the server 120 is used to send the ID list and ith of the presentation Block to the client0To the ithNThe method comprises the steps of displaying the content data of the blocks, receiving the identification of the blocks to be loaded and sent by a client, acquiring the content data of the blocks to be loaded according to the identification of the blocks to be loaded and sending the content data to the client.
In an embodiment of the present application, the server 120 determines whether the to-be-loaded presentation block has an update according to the timestamp, and when it is determined that there is an update, takes data of the to-be-loaded presentation block before the timestamp as content data, and when it is determined that there is no update, takes current data of the to-be-loaded presentation block as content data.
Because the pull-up update instruction of the user is not received at present, the timestamp corresponding to the presentation block to be loaded is sent by the server before, at this time, if the data content of the presentation block is updated, the content of the presentation block does not correspond to the content of other presentation blocks, and therefore when the update is judged, the server still feeds back the data before the timestamp to the client. Therefore, the embodiment of the application solves the problem caused by the update of the display block.
According to the embodiment of the application, the ID list of the display block sent by the server can be used for calculating the identifier of the display block to be loaded according to the current page number and the ID list of the display block. Therefore, on the premise of not changing the display form of the display block in the page, the display stability of the display block is improved, and the phenomenon of loss or repetition of the display block is reduced or even avoided. In addition, the display performance of the display blocks in the page can be optimized, and the use experience of a user is improved.
The embodiment of the present application also provides a client, which is described in detail below with reference to the accompanying drawings, as shown in fig. 7. Fig. 7 is a schematic structural diagram of a client according to an embodiment of the present application.
The client 200 includes: a first receiving module 210, a first presentation module 220, a loading module 230, a first sending module 240, and a second presentation module 250.
The first receiving module 210 is configured to receive an ID list of the presentation blocks sent by the server, where the ID list includes identifiers of M presentation blocks, and M is a positive integer. In the embodiment of the present application, since the ID of the presentation block is a field, network traffic is consumed little, and no loss is caused to the traffic of the client 200.
In an embodiment of the present application, when the user requests content data for the first time through the client 200 or when the client 200 updates, the server sends all the ID lists of the relevant presentation blocks to the client 200. Wherein, the ID list of all the presentation blocks sent by the server further includes M presentation block identifiers. The display block identifier may provide a valid basis for determining the content data of the display block corresponding to the display block identifier later by the server, that is, the client 200 may obtain the content data of the corresponding display block from the server according to the display block identifier. For example, when the client 200 loads the to-be-loaded presentation block, the server may determine the content data corresponding to the to-be-loaded presentation block according to the identifier of the to-be-loaded presentation block by only sending the identifier of the to-be-loaded presentation block to the server.
It is to be understood that the identity of a presentation block is unique and can be used to uniquely identify the corresponding presentation block.
In another embodiment of the present application, the server sends the current time as a timestamp to the client 200 at the same time as sending the list of IDs of the presentation blocks. Where the timestamp is used to mark the field of the current request time. Since the server will update the content data in the presentation block, it is necessary to record the current time stamp, so as to update with reference to the time stamp in the subsequent presentation block update process, which will be described in detail later.
Further, in an embodiment of the present application, as shown in fig. 8, the client 200 further includes: and a second receiving module 260. The second receiving module 260 is configured to receive a timestamp sent by the server and corresponding to each presentation block. In one embodiment of the present application, the timestamp is a field marking the current request time, and can uniquely identify the time of a certain moment, so as to find a more suitable snapshot of the presentation block when more content data is loaded.
For example, as shown in FIG. 2, the server may send a list of IDs for presentation blocks and a timestamp for each presentation block to the client 200. For example, referring to fig. 2, the server sends a list of presentation blocks with IDs 1-500 (i.e., M-500), along with a current timestamp t3, and the home page content to the client 200. After receiving the ID list of the presentation block and the corresponding timestamp sent by the server, the client 200 stores the ID list and the corresponding timestamp locally, presents the top page content data in the page of the client 200, and records that the current page number is 1.
It should be noted that, in the present application, the client 200 may be a smart phone, a personal computer, a tablet computer, or the like.
Wherein the first presenting module 220 is used for receiving the ith0To the ithNAnd displaying the content data of each display block in the page, wherein N is the number of the display blocks which can be displayed by the page.
In one embodiment of the present application, for the first request for content data, the ith0To the ithNThe content data of each presentation block may be the content data of the first page of the client 200, such as the 1 st to 5 th presentation blocks, where N is five, which is the maximum number of presentation blocks that can be presented in the page. In another embodiment of the present application, forWhen new content data is present, i0To the ithNThe content data of each presentation block is determined based on the presentation block of the previous page. Referring to fig. 2, the first page content data, i.e., the 1 st to 5 th presentation blocks, is presented in the page due to the first request.
In another embodiment of the present application, it is also necessary to present the list of presentation block IDs from 1-M in the page.
The loading module 230 is configured to receive a pull-down loading instruction of a user, and obtain a current page number according to the pull-down loading instruction.
And receiving a pull-down gesture of a user for the page, generating a pull-down loading instruction according to the pull-down gesture, and acquiring the current page number of the current page.
Continuing with the example shown in FIG. 2, if the first page content data is a 1 st to 5 th presentation block, then the current page number of the page is 1.
The first sending module 240 is configured to obtain an identifier of the exhibition block to be loaded according to the page number and the ID list, and send the identifier of the exhibition block to be loaded to the server.
In an embodiment of the present application, obtaining the identifier of the exhibition block to be loaded may be obtained by the following formula, for example: [ current page number N +1, (current page number +1) × N ], where N is the number of presentation blocks that a page can present. As described above, by sending the identifier of the presentation block to be loaded to the server, the content data of the corresponding presentation block can be accurately determined, which is simple and efficient.
For example, when a user browses a microblog, when new content needs to be viewed after content data of a current page is read, the new content may be loaded through a display page of the pull-down client 200. The client 200 performs related calculation according to the page number of the currently browsed page of the user and the content quantity displayed on the page according to the pull-down loading instruction to obtain the identifier of the content data of the next page, and sends the obtained identifier of the content data of the next page to a related server for query. The server determines the content queue of the corresponding content data in the ID list according to the identifier of the content data, finds out the corresponding content data snapshot according to the corresponding timestamp, packages the content data snapshot into the presentation block, and returns the content data snapshot to the client 200. For example, as shown in fig. 2, since the home page displays the content data of the 1 st to 5 th display blocks, the identifier of the next display block, that is, the identifiers of the 6 th to 10 th display blocks, can be calculated through the identifier formula of the display block to be loaded and the page number of the home page, and the obtained identifiers of the display blocks are sent to the server to query to obtain the corresponding display blocks, that is, the 6 th to 10 th display blocks.
Further, in an embodiment of the present application, as shown in fig. 8, the client 200 further includes: a second sending module 270. The second sending module 270 is configured to send the timestamp corresponding to the to-be-loaded presentation block to the server, so that the server determines, according to the timestamp, the content data corresponding to the to-be-loaded presentation block. In the embodiment of the present application, the client 200 sends the timestamp to the server, and the server selects the corresponding content data according to the timestamp and feeds the content data back to the client 200.
The second presentation module 250 is configured to receive content data of the presentation block to be loaded, which is fed back by the server, and present the content data in the page. As shown in fig. 5, the results are presented in the page.
In the embodiment of the application, after the client 200 receives the content data of the presentation block to be loaded fed back by the server, the rendering is performed first, the rendered content data is presented, and the page number of the page is updated.
Further, in an embodiment of the present application, as shown in fig. 9, the client 200 further includes: an update module 280. The updating module 280 is configured to update the page number of the page after receiving the content data of the presentation block to be loaded and presented in the page, which is fed back by the server.
Further, in an embodiment of the present application, as shown in fig. 10, the client 200 further includes: a third receiving module 290, a third transmitting module 2100, and a fourth receiving module 2110. The third receiving module 290 is configured to receive a pull-up update instruction of a user; the third sending module 2100 is configured to send an update request to the server; the fourth receiving module 2110 is configured to receive a new ID list and a corresponding new timestamp of the presentation block sent by the server. Of course, after the client 200 is restarted, it is also necessary to receive a new ID list and a new time stamp of the presentation block transmitted by the server. As shown in fig. 2, further, after the server queries the corresponding presentation block by obtaining the identifier of the 6 th to 10 th presentation blocks, the content data of the presentation block is fed back to the client 200, and the client 200 renders the presentation block and then presents the rendered presentation block, and updates the current page to 2.
According to the embodiment of the application, the ID list of the display block sent by the server can be used for calculating the identifier of the display block to be loaded according to the current page number and the ID list of the display block. Therefore, on the premise of not changing the display form of the display block in the page, the display stability of the display block is improved, and the phenomenon of loss or repetition of the display block is reduced or even avoided. In addition, the display performance of the display blocks in the page can be optimized, and the use experience of a user is improved.
An embodiment of the present application further provides a server, which is described in detail below with reference to the drawings, as shown in fig. 11, fig. 11 is a schematic structural diagram of the server according to the embodiment of the present application.
The server 300 includes: a fourth sending module 310, a fifth receiving module 320, an obtaining module 330, and a fifth sending module 340.
Wherein the fourth sending module 310 is used for sending the ID list and ith of the exhibition block to the client0To the ithNAnd content data of each display block, wherein N is the number of display blocks which can be displayed by the page of the client.
In one embodiment of the present application, when a user requests content data for the first time through a client or when the client updates, the server 300 sends an ID list of all relevant presentation blocks to the client. Wherein, the ID list of all the presentation blocks sent by the server 300 further includes M presentation block identifiers. The presentation block identifier may provide a valid basis for the server 300 to determine the content data of the presentation block corresponding thereto later, i.e., the client may obtain the content data of the corresponding presentation block from the server 300 according to the presentation block identifier. For example, when the client loads the to-be-loaded presentation block, the server 300 may determine the content data corresponding to the to-be-loaded presentation block according to the identifier of the to-be-loaded presentation block by only sending the identifier of the to-be-loaded presentation block to the server 300.
It is to be understood that the identity of a presentation block is unique and can be used to uniquely identify the corresponding presentation block.
In another embodiment of the present application, the server 300 sends the list of IDs of the presentation blocks and also sends the current time as a timestamp to the client. Where the timestamp is used to mark the field of the current request time. Since the server 300 will update the content data in the presentation block, it is necessary to record the current time stamp so as to update with reference to the time stamp in the subsequent presentation block update process, which will be described in detail later.
For example, as shown in FIG. 2, the server 300 may send a list of IDs for presentation blocks and a timestamp for each presentation block to the client. For example, referring to fig. 2, the server 300 sends a list of presentation blocks with IDs 1-500 (i.e., M-500), along with the current timestamp t3, and the home page content to the client. After receiving the ID list of the presentation block and the corresponding timestamp sent by the server 300, the client stores the ID list and the corresponding timestamp locally, presents the content data of the top page in the page of the client, and records that the current page number is 1.
It should be noted that, in the present application, the client may be a smart phone, a personal computer, a tablet computer, or other devices.
The fifth receiving module 320 is configured to receive an identifier of a to-be-loaded presentation block sent by the client.
In an embodiment of the present application, obtaining the identifier of the exhibition block to be loaded may be obtained by the following formula, for example: [ current page number N +1, (current page number +1) × N ], where N is the number of presentation blocks that a page can present. As described above, by sending the identifier of the presentation block to be loaded to the server 300, the content data of the corresponding presentation block can be accurately determined, which is simple and efficient.
For example, when a user browses a microblog, when new content needs to be viewed after content data of a current page is read, the new content can be loaded through a display page of a pull-down client. The client performs related calculation according to the pull-down loading instruction and the page number of the currently browsed page of the user and the content quantity displayed on the page to obtain the identifier of the content data of the next page, and sends the obtained identifier of the content data of the next page to the related server 300 for query. The server 300 determines the content queue of the corresponding content data in the ID list according to the identifier of the content data, finds out the corresponding content data snapshot according to the corresponding timestamp, packages the content data snapshot into the presentation block, and returns the content data snapshot to the client. For example, as shown in fig. 2, since the home page represents the content data of the 1 st to 5 th presentation blocks, the identifier of the presentation block of the next page, i.e. the identifier of the 6 th to 10 th presentation blocks, can be calculated by the identification formula of the presentation block to be loaded and the page number of the home page, and the obtained identifier of the presentation block is sent to the server 300 to query the corresponding presentation block, i.e. the 6 th to 10 th presentation blocks.
The obtaining module 330 is configured to obtain content data of the exhibition block to be loaded according to the identifier of the exhibition block to be loaded.
In an embodiment of the present application, the server 300 determines a content queue of corresponding content data in the ID list according to the identifier of the content data, finds out a corresponding content data snapshot according to the corresponding timestamp, packages the content data snapshot into a presentation block, and returns the presentation block to the client.
Further, in an embodiment of the present application, the obtaining module 330 specifically includes: a decision sub-module 3310 and an acquisition sub-module 3320, as shown in fig. 12. The determining sub-module 3310 is configured to determine whether the presentation block to be loaded is updated according to the timestamp, for example, determine whether the data content of the presentation block is updated after the timestamp.
The obtaining sub-module 3320 is configured to, when the determining module determines that there is an update, use data of the presentation block to be loaded before the timestamp as content data, and when the determining module determines that there is no update, use current data of the presentation block to be loaded as content data. Because the pull-up update instruction of the user is not received at present, the timestamp corresponding to the presentation block to be loaded is sent by the server before, at this time, if the data content of the presentation block is updated, the content of the presentation block does not correspond to the content of other presentation blocks, and therefore when the update is judged, the server still feeds back the data before the timestamp to the client. Therefore, the embodiment of the application solves the problem caused by the update of the display block.
The fifth sending module 340 is configured to send the content data of the presentation block to be loaded to the client. As shown in fig. 5, the results are presented in the page.
In the embodiment of the present application, the ID list of the presentation block sent by the server 300 may be used to calculate the identifier of the presentation block to be loaded according to the current page number and the ID list of the presentation block. Therefore, on the premise of not changing the display form of the display block in the page, the display stability of the display block is improved, and the phenomenon of loss or repetition of the display block is reduced or even avoided. In addition, the display performance of the display blocks in the page can be optimized, and the use experience of a user is improved.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.