CN106610832B - Page asynchronous rendering method and device - Google Patents

Page asynchronous rendering method and device Download PDF

Info

Publication number
CN106610832B
CN106610832B CN201510708490.5A CN201510708490A CN106610832B CN 106610832 B CN106610832 B CN 106610832B CN 201510708490 A CN201510708490 A CN 201510708490A CN 106610832 B CN106610832 B CN 106610832B
Authority
CN
China
Prior art keywords
block
block information
current page
information
blocks included
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510708490.5A
Other languages
Chinese (zh)
Other versions
CN106610832A (en
Inventor
瞿宝明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510708490.5A priority Critical patent/CN106610832B/en
Publication of CN106610832A publication Critical patent/CN106610832A/en
Application granted granted Critical
Publication of CN106610832B publication Critical patent/CN106610832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a page asynchronous rendering method and a device, relating to the technical field of networks and comprising the following steps: respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block is rendered according to the obtained block information; saving the received block information; monitoring whether block information of all blocks included in the current page is stored or not; if the block information of all the blocks included in the current page is stored, the block information of all the blocks included in the current page is respectively sent to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all the blocks included in the current page, and the rendering of the block is completed. The scheme saves CPU resources and improves the rendering efficiency of the whole current page.

Description

Page asynchronous rendering method and device
Technical Field
The present application relates to the field of network technologies, and in particular, to a method and an apparatus for asynchronous page rendering.
Background
With the rapid development of network technology, more and more users acquire information through a network. The user can install a browser on the terminal, then requests information from the server through the browser, the server sends the requested information to the browser, and the browser opens a page to display the received information, wherein the process of opening the page by the browser is the process of rendering the page.
Generally, a page includes a plurality of blocks, asynchronous rendering is performed between the blocks, and rendering of one block may need to depend on block information of another block. As shown in fig. 1, a structural diagram of a page is shown, where the page includes a block a and a block B, the block B further includes a sub-block, and the block B needs to complete rendering of the sub-block depending on block information of the block a, and the following describes an asynchronous rendering process of the page: and the block A and the block B respectively acquire respective block information from the server and render the block information, the block A sends the block information to the block B, and the block B continues to render the sub-block according to the block information of the block A, so that the rendering of the whole page is completed. In order to acquire the block information of the block a in time, the block B needs to periodically poll the block a, acquire the block information of the block a from the block a after detecting that the block a acquires the block information, and then complete rendering according to the block information of the block a.
In the above asynchronous page rendering method, the block B needs to periodically poll the block a to detect whether the block a receives the block information, which may excessively consume a Central Processing Unit (CPU) resource and affect the whole page rendering efficiency.
Disclosure of Invention
The embodiment of the application provides a page asynchronous rendering method and device, which are used for solving the problem that the rendering efficiency of the whole page is influenced by excessive consumption of CPU resources in the related technology.
According to an embodiment of the present application, a method for asynchronous rendering of a page is provided, including:
respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block is rendered according to the obtained block information;
saving the received block information;
monitoring whether block information of all blocks included in the current page is stored or not;
if the block information of all the blocks included in the current page is stored, the block information of all the blocks included in the current page is respectively sent to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all the blocks included in the current page, and the rendering of the block is completed.
Specifically, storing the received block information includes:
determining whether the received block information is stored in the data variable;
and if the received block information is not stored in the data variable, updating the quantity variable according to the quantity of the received block information, and storing the received block information in the data variable.
Specifically, monitoring whether block information of all blocks included in the current page is stored includes:
acquiring the number of blocks included in the current page;
determining whether the value of the quantity variable is equal to the quantity of the blocks included in the current page;
if the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is stored;
and if the numerical value of the quantity variable is smaller than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
Specifically, the sending the block information of all the blocks included in the current page to each block included in the current page respectively includes:
combining the block information of all blocks included in the current page to obtain a block information set of the current page;
and respectively sending the block information set to each block included in the current page.
Specifically, combining the block information of all blocks included in the current page to obtain the block information set of the current page includes:
acquiring block information of all blocks included in the current page;
and randomly combining or combining the block information of all blocks included in the current page according to the time sequence of receiving the block information to obtain a block information set of the current page.
Specifically, the method for enabling each block included in the current page to acquire required block information from the block information of all blocks included in the current page and completing rendering of the block of the current page includes:
so that each block included in the current page determines whether the rendering of the block is finished;
for the blocks which are rendered completely, ignoring the received block information of all the blocks included in the current page;
and for the blocks which are not rendered completely, receiving the block information of all the blocks included in the current page, acquiring the required block information from the block information of all the blocks included in the current page, and rendering the blocks of the current page.
According to an embodiment of the present application, there is also provided a page asynchronous rendering method, including:
respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block is rendered according to the obtained block information;
determining a block associated with each received block information;
and sending the block information with the associated block to the associated block so that the block receiving the block information completes the rendering of the block.
Specifically, determining the block associated with each received block information includes:
acquiring an association relation table of the block information and the blocks;
searching an item comprising information of each block from the association relation table;
and acquiring the block corresponding to each block information from the searched table entry.
According to an embodiment of the present application, there is also provided a page asynchronous rendering device, including:
the receiving unit is used for respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block of the receiving unit is rendered according to the obtained block information;
a storage unit for storing the received block information;
the monitoring unit is used for monitoring whether the block information of all blocks included in the current page is stored or not;
and a sending unit, configured to send the block information of all blocks included in the current page to each block included in the current page, respectively, if the block information of all blocks included in the current page is already stored, so that each block included in the current page obtains required block information from the block information of all blocks included in the current page, and completes rendering of its own block.
Specifically, the storing unit is configured to store the received block information, and specifically configured to:
determining whether the received block information is stored in the data variable;
and if the received block information is not stored in the data variable, updating the quantity variable according to the quantity of the received block information, and storing the received block information in the data variable.
Specifically, the monitoring unit is configured to monitor whether block information of all blocks included in the current page is stored, and specifically, is configured to:
acquiring the number of blocks included in the current page;
determining whether the value of the quantity variable is equal to the quantity of the blocks included in the current page;
if the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is stored;
and if the numerical value of the quantity variable is smaller than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
Specifically, the sending unit is configured to send the block information of all the blocks included in the current page to each block included in the current page, and is specifically configured to:
combining the block information of all blocks included in the current page to obtain a block information set of the current page;
and respectively sending the block information set to each block included in the current page.
Specifically, the sending unit is configured to combine the block information of all blocks included in the current page to obtain a block information set of the current page, and specifically configured to:
acquiring block information of all blocks included in the current page;
and randomly combining or combining the block information of all blocks included in the current page according to the time sequence of receiving the block information to obtain a block information set of the current page.
Specifically, the sending unit is configured to enable each block included in the current page to obtain required block information from the block information of all blocks included in the current page, and complete rendering of the block of the sending unit, and specifically configured to:
so that each block included in the current page determines whether the rendering of the block is finished;
for the blocks which are rendered completely, ignoring the received block information of all the blocks included in the current page;
and for the blocks which are not rendered completely, receiving the block information of all the blocks included in the current page, acquiring the required block information from the block information of all the blocks included in the current page, and rendering the blocks of the current page.
According to an embodiment of the present application, there is also provided a page asynchronous rendering device, including:
the receiving unit is used for respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block of the receiving unit is rendered according to the obtained block information;
a determining unit, configured to determine a block associated with each received block information;
and the sending unit is used for sending the block information with the associated block to the associated block so that the block receiving the block information completes the rendering of the block.
Specifically, the determining unit is configured to determine a block associated with each piece of received block information, and specifically configured to:
acquiring an association relation table of the block information and the blocks;
searching an item comprising information of each block from the association relation table;
and acquiring the block corresponding to each block information from the searched table entry.
The embodiment of the application provides a page asynchronous rendering method and device, which respectively receive respective block information sent by each block included in a current page, wherein the block information of each block is obtained by a server corresponding to the block, and is sent after the block is rendered according to the obtained block information; saving the received block information; monitoring whether block information of all blocks included in the current page is stored or not; if the block information of all the blocks included in the current page is stored, the block information of all the blocks included in the current page is respectively sent to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all the blocks included in the current page, and the rendering of the block is completed. In the scheme, one block is not required to periodically poll another block, but the block information of all blocks included in the current page is directly sent to each block included in the current page, and each block included in the current page can receive the block information of all blocks included in the current page, so that each block included in the current page can be successfully rendered, asynchronous rendering of the whole current page is guaranteed, and the blocks are not required to be periodically polled, so that CPU resources are saved, and the rendering efficiency of the whole current page is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of a page structure in the related art;
FIG. 2 is a flowchart of a method for asynchronous rendering of a page according to an embodiment of the present application;
FIG. 3 is a flowchart of S22 in the embodiment of the present application;
FIG. 4 is a flowchart of S23 in the example of the present application;
FIG. 5 is a flowchart of S24 in the example of the present application;
FIG. 6 is a flowchart of another asynchronous page rendering method according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a page asynchronous rendering method according to another embodiment of the present application;
FIG. 8 is a schematic structural diagram of an asynchronous page rendering apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of another asynchronous page rendering device in this embodiment.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present application clearer and clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In order to solve the problem that the CPU resource is excessively consumed and the rendering efficiency of the whole page is affected in the related art, an embodiment of the present application provides a page asynchronous rendering method, which may be but is not limited to be applied to a browser set in a terminal, and a flow of the method is shown in fig. 2, and includes the following steps:
s21: and respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained from the server corresponding to the block, and is sent after the block is rendered according to the obtained block information.
The browser arranged on the terminal can simultaneously open a plurality of pages, and the currently displayed page is the current page.
The current page may include a plurality of blocks, each block may separately request respective block information from the server, each block renders its own block after receiving the block information fed back by the server, and sends the received block information to the browser.
S22: and saving the received block information.
And the browser receives and stores the respective block information sent by each block included in the current page.
The implementation modes of the two steps of S21 and S22 can be flexibly set, and can be real-time, that is, one block information sent by one block included in the current page is received and stored; or non-real-time, that is, after receiving the block information of the set number, the block information may be stored.
S23: and monitoring whether block information of all blocks included in the current page is saved.
Whether the block information of all blocks included in the current page is saved is monitored in a set period, wherein the set period can be set according to actual needs, for example, set to 1 second, 5 seconds, 10 seconds, and the like.
The sequence of S21 and S23 is not strict, and the two steps can be executed simultaneously or sequentially.
S24: if the block information of all blocks included in the current page is stored, the block information of all blocks included in the current page is respectively sent to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all blocks included in the current page, and the rendering of the block is completed.
The browser needs to monitor whether block information of all blocks included in the current page is stored, and if the block information of all blocks included in the current page is not stored, it indicates that the browser does not acquire the block information required by rendering each block included in the current page, and S23 needs to be continuously executed for monitoring; if the block information of all blocks included in the current page is stored, which indicates that the browser has acquired the block information required for rendering each block included in the current page, the block information of all blocks included in the current page may be respectively sent to each block included in the current page, so that each block included in the current page determines whether the block itself is rendered, and for the block whose rendering has been completed before S21, the received block information of all blocks included in the current page is ignored; for the block whose rendering is not completed before S21, the tile information of all the tiles included in the current page is received, the required tile information is obtained from the tile information of all the tiles included in the current page, and the rendering of the tile itself is completed, thereby implementing asynchronous rendering of the entire page.
In the scheme, one block is not required to periodically poll another block, but the block information of all blocks included in the current page is directly sent to each block included in the current page, and each block included in the current page can receive the block information of all blocks included in the current page, so that each block included in the current page can be successfully rendered, asynchronous rendering of the whole current page is guaranteed, and the blocks are not required to be periodically polled, so that CPU resources are saved, and the rendering efficiency of the whole current page is improved.
Each step of the above page asynchronous rendering method is described in detail below.
Specifically, the implementation process of saving the received tile information in S22, as shown in fig. 3, specifically includes the following steps:
s221: it is determined whether the received block information has been saved in the data variable.
S222: and if the received block information is not stored in the data variable, updating the quantity variable according to the quantity of the received block information, and storing the received block information in the data variable.
Two variables may be set to hold the received tile information, i.e., a quantity variable (data) identifying the quantity of the received tile information and a data variable (state) holding the received tile information.
When the received block information is stored, whether the received block information is stored in the state is determined, if not, the data is updated according to the number of the received block information, and the received block information is stored in the state, for example, when the number of the block information is 1, the data is increased by 1, and when the number of the block information is 5, the data is increased by 5, and the received block information is stored in the state.
Of course, there are many ways to store the received block information, and other ways are not described herein.
Specifically, the implementation process of monitoring whether the block information of all blocks included in the current page is saved in S23 includes, as shown in fig. 4, the following steps:
s231: and acquiring the number of blocks included in the current page.
The number of the blocks included in the current page is fixed, and the obtaining mode has various modes, and the obtaining mode can be obtained from a server, can also be obtained from the attribute information of the current page, and can also be used for directly counting the number of the blocks included in the current page.
S232: determining whether the value of the quantity variable is equal to the quantity of the blocks included in the current page, and if the value of the quantity variable is equal to the quantity of the blocks included in the current page, executing S233; if the value of the number variable is smaller than the number of blocks included in the current page, S234 is executed.
S233: block information of all blocks included in the current page is determined to have been saved.
S234: and determining that the block information of all blocks included in the current page is not saved.
If the number of the received block information is identified by using the number variable, whether the block information of all blocks included in the current page is stored can be determined according to whether the numerical value of the number variable is equal to the number of the blocks included in the current page, and if the numerical value of the number variable is equal to the number of the blocks included in the current page, the block information of all blocks included in the current page is determined to be stored; and if the numerical value of the quantity variable is less than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
Specifically, the implementation process of sending the block information of all the blocks included in the current page to each block included in the current page in S24, as shown in fig. 5, specifically includes the following steps:
s241: and combining the block information of all blocks included in the current page to obtain a block information set of the current page.
When the block information of all blocks included in the current page is respectively sent to each block included in the current page, the block information of all blocks included in the current page may be firstly combined to obtain a block information set of the current page. The specific implementation process includes the steps of firstly obtaining block information of all blocks included in a current page, and then combining the block information of all the blocks included in the current page randomly or according to the time sequence of receiving the block information to obtain a block information set of the current page.
S242: and respectively sending the block information set to each block included in the current page.
And sending the block information set of the current page obtained in S241 to each block included in the current page, so that each block included in the current page can conveniently obtain the required block information from the block information set to complete rendering, thereby ensuring that the current page smoothly completes asynchronous rendering.
The embodiment of the present application further provides another asynchronous page rendering method, which is described by taking asynchronous rendering of a page shown in fig. 1 as an example, and the method may be but is not limited to be applied to a browser set on a terminal, and the process is shown in fig. 6, and specifically includes the following steps:
s61: the respective block information sent by the block a and the block B is received.
The block information of the block A and the block B is obtained by the block A and the block B from the server respectively, and the block A and the block B render the block according to the obtained block information and then send the rendered block to the browser.
S62: determining whether the received block information is stored in the state; and if the received block information is not stored in the state, updating the data according to the quantity of the received block information, and storing the received block information in the state.
After the block information of the block A or the block information of the block B is saved, if the current numerical value of the data is 0, updating the numerical value of the data to be 1; if the numerical value of the data is 1, updating the numerical value of the data to be 2; and stores the received block information in the state.
S63: and acquiring the number of blocks included in the current page.
Since the current page includes two blocks, the number is 2.
S64: determining whether the value of the quantity variable is equal to the number of blocks included in the current page, and if the value of the quantity variable is equal to the number of blocks included in the current page, performing S65; if the value of the number variable is smaller than the number of blocks included in the current page, S66 is executed.
S65: determining the tile information of the saved tile a and tile B, S67 is performed.
S66: it is determined that the tile information of tile a and tile B is not saved, S64 is performed.
S67: and acquiring the block information of the block A and the block B, and then randomly combining the block information of the block A and the block B to obtain a block information set of the current page.
S68: and respectively sending the block information sets to a block A and a block B, so that the block A and the block B acquire required block information from the block information sets of the current page and finish rendering of the blocks of the block A and the block B.
Since the tile a can be rendered only according to the tile information of the tile a, the tile a is rendered before S61, and therefore the tile a does not need to render the tile after receiving the set of tile information; since the block B needs not only its own block information but also the block information of the block a, the block B only completes partial rendering before S61, and after receiving the block information set, the block information of the block a needs to be obtained from the block information set, and the sub-block is rendered according to the block information of the block a, so that the rendering of the whole current page is completed.
According to the scheme, the block B is not required to poll the block A regularly, but the block information of the block A and the block information of the block B are directly combined to obtain a block information set of the current page, and then the block information set is sent to the block A and the block B.
Based on the same inventive concept, the embodiment of the present application further provides another asynchronous page rendering method, which may be but is not limited to be applied to a browser configured by a terminal, and a flow of the method is shown in fig. 7, and specifically includes the following steps:
s71: and respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained from the server corresponding to the block, and is sent after the block is rendered according to the obtained block information.
The browser arranged on the terminal can simultaneously open a plurality of pages, and the currently displayed page is the current page.
The current page can comprise a plurality of blocks, each block can independently request the server for respective block information, each block renders the block after receiving the block information fed back by the server, and the received block information is sent to the browser.
S72: and determining the block associated with each piece of received block information.
Because the blocks included in the current page are certain, the association relationship between the block information and the blocks can be pre-established, after the block information is received, the association relationship table is obtained, the table entry including each block information is searched from the association relationship table, and the block corresponding to each block information is obtained from the searched table entry. Referring to the page shown in fig. 1, the block information of block a and block B may be associated, and after the block information of block a is received, the block associated with the block information of block a is determined to be block B.
S73: and sending the block information with the associated block to the associated block so that the block receiving the block information completes the rendering of the block.
Continuing with the above example, after the block B receives the block information of the block a, rendering of the block itself can be completed according to the block information of the block a, thereby implementing asynchronous rendering of the entire page.
According to the scheme, a block does not need to periodically poll another block, but respectively receives respective block information sent by each block included in the current page, the block associated with each received block information is determined, then the block information with the associated block is sent to the associated block, so that the block receiving the block information completes rendering of the block, and since the block information with the associated block directly exists and is sent to the corresponding block, each block included in the current page can obtain all block information required for completing rendering, thereby ensuring that each block included in the current page can successfully complete rendering, further ensuring that the whole current page completes asynchronous rendering, and as the blocks do not need to periodically poll, CPU resources are saved, and the rendering efficiency of the whole current page is improved.
Based on the same inventive concept, the embodiment of the present application further provides a page asynchronous rendering apparatus, which corresponds to the page rendering method shown in fig. 2, and may be, but is not limited to be, disposed in a terminal, and the apparatus has a structure shown in fig. 8, and includes a receiving unit 81, a saving unit 82, a monitoring unit 83, and a sending unit 84. Wherein:
the receiving unit 81 is configured to receive respective block information sent by each block included in the current page, where the block information of each block is obtained from the server corresponding to the block, and is sent after rendering the block according to the obtained block information;
the storage unit 82 is configured to store the received tile information;
the monitoring unit 83 is configured to monitor whether block information of all blocks included in the current page is stored;
the sending unit 84 is configured to, if the block information of all the blocks included in the current page is already stored, send the block information of all the blocks included in the current page to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all the blocks included in the current page, and complete rendering of the block of the current page.
In the scheme, one block is not required to periodically poll another block, but the block information of all blocks included in the current page is directly sent to each block included in the current page, and each block included in the current page can receive the block information of all blocks included in the current page, so that each block included in the current page can be successfully rendered, asynchronous rendering of the whole current page is guaranteed, and the blocks are not required to be periodically polled, so that CPU resources are saved, and the rendering efficiency of the whole current page is improved.
Specifically, the storing unit 82 is configured to store the received block information, and specifically configured to:
determining whether the received block information is stored in the data variable;
and if the received block information is not stored in the data variable, updating the quantity variable according to the quantity of the received block information, and storing the received block information in the data variable.
Specifically, the monitoring unit 83 is configured to monitor whether block information of all blocks included in the current page is stored, and specifically configured to:
acquiring the number of blocks included in a current page;
determining whether the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page;
if the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is stored;
and if the numerical value of the quantity variable is less than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
Specifically, the sending unit 84 is configured to send the block information of all the blocks included in the current page to each block included in the current page, and specifically configured to:
combining the block information of all blocks included in the current page to obtain a block information set of the current page;
and respectively sending the block information set to each block included in the current page.
Specifically, the sending unit 84 is configured to combine the block information of all blocks included in the current page to obtain a block information set of the current page, and specifically configured to:
acquiring block information of all blocks included in a current page;
and randomly combining or combining the block information of all blocks included in the current page according to the time sequence of receiving the block information to obtain a block information set of the current page.
Specifically, the sending unit 84 is configured to enable each block included in the current page to obtain required block information from the block information of all blocks included in the current page, and complete rendering of the block of the sending unit, and specifically configured to:
so that each block included in the current page determines whether the rendering of the block is finished;
for the blocks which are rendered completely, ignoring the received block information of all the blocks included in the current page;
and for the blocks which are not rendered completely, receiving the block information of all the blocks included in the current page, acquiring the required block information from the block information of all the blocks included in the current page, and rendering the blocks of the current page.
Based on the same inventive concept, an embodiment of the present application further provides another asynchronous page rendering apparatus, which corresponds to the page rendering method shown in fig. 7, and may be, but is not limited to, disposed in a terminal, and the structure of the apparatus is shown in fig. 9, and includes a receiving unit 91, a determining unit 92, and a sending unit 93, where:
the receiving unit 91 is configured to receive respective block information sent by each block included in the current page, where the block information of each block is obtained from the server corresponding to the block, and is sent after rendering the block according to the obtained block information;
the determining unit 92 is configured to determine a block associated with each received block information;
the sending unit 93 is configured to send the block information with the associated block to the associated block, so that the block that receives the block information completes rendering of its own block.
According to the scheme, a block does not need to periodically poll another block, but respectively receives respective block information sent by each block included in the current page, the block associated with each received block information is determined, then the block information with the associated block is sent to the associated block, so that the block receiving the block information completes rendering of the block, and since the block information with the associated block directly exists and is sent to the corresponding block, each block included in the current page can obtain all block information required for completing rendering, thereby ensuring that each block included in the current page can successfully complete rendering, further ensuring that the whole current page completes asynchronous rendering, and as the blocks do not need to periodically poll, CPU resources are saved, and the rendering efficiency of the whole current page is improved.
Specifically, the determining unit 92 is configured to determine a block associated with each received block information, and specifically configured to:
acquiring an association relation table of the block information and the blocks;
searching an item comprising information of each block from the association relation table;
and acquiring the block corresponding to each block information from the searched table entry.
The foregoing description shows and describes the preferred embodiments of the present application, but as aforementioned, it is to be understood that the application is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the inventive concept as expressed herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the application, which is to be protected by the claims appended hereto.

Claims (14)

1. A page asynchronous rendering method is characterized by comprising the following steps:
respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block is rendered according to the obtained block information;
saving the received block information;
monitoring whether block information of all blocks included in the current page is stored or not;
if the block information of all the blocks included in the current page is stored, the block information of all the blocks included in the current page is respectively sent to each block included in the current page, so that each block included in the current page obtains the required block information from the block information of all the blocks included in the current page, and the rendering of the block is completed.
2. The method of claim 1, wherein storing the received block information comprises:
determining whether the received block information is stored in the data variable; the data variable is used for storing the received block information;
if the received block information is not stored in the data variables, updating the quantity variables according to the quantity of the received block information, and storing the received block information in the data variables; wherein the quantity variable is used to identify the quantity of the received block information.
3. The method of claim 2, wherein monitoring whether block information of all blocks included in the current page has been saved comprises:
acquiring the number of blocks included in the current page;
determining whether the value of the quantity variable is equal to the quantity of the blocks included in the current page;
if the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is stored;
and if the numerical value of the quantity variable is smaller than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
4. The method according to any one of claims 1 to 3, wherein the step of sending the block information of all blocks included in the current page to each block included in the current page comprises:
acquiring block information of all blocks included in the current page;
randomly combining or combining the block information of all blocks included in the current page according to the time sequence of receiving the block information to obtain a block information set of the current page;
and respectively sending the block information set to each block included in the current page.
5. The method of claim 1, wherein the step of enabling each block included in the current page to obtain required block information from the block information of all blocks included in the current page and completing the rendering of the block comprises:
so that each block included in the current page determines whether the rendering of the block is finished;
for the blocks which are rendered completely, ignoring the received block information of all the blocks included in the current page;
and for the blocks which are not rendered completely, receiving the block information of all the blocks included in the current page, acquiring the required block information from the block information of all the blocks included in the current page, and rendering the blocks of the current page.
6. A page asynchronous rendering method is characterized by comprising the following steps:
respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block is rendered according to the obtained block information;
determining a block associated with each received block information;
and sending the block information with the associated block to the associated block so that the block receiving the block information completes the rendering of the block.
7. The method of claim 6, wherein determining the block associated with each received block information comprises:
acquiring an association relation table of the block information and the blocks;
searching an item comprising information of each block from the association relation table;
and acquiring the block corresponding to each block information from the searched table entry.
8. An apparatus for asynchronous rendering of pages, comprising:
the receiving unit is used for respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block of the receiving unit is rendered according to the obtained block information;
a storage unit for storing the received block information;
the monitoring unit is used for monitoring whether the block information of all blocks included in the current page is stored or not;
and a sending unit, configured to send the block information of all blocks included in the current page to each block included in the current page, respectively, if the block information of all blocks included in the current page is already stored, so that each block included in the current page obtains required block information from the block information of all blocks included in the current page, and completes rendering of its own block.
9. The apparatus of claim 8, wherein the storing unit is configured to store the received block information, and is specifically configured to:
determining whether the received block information is stored in the data variable; the data variable is used for storing the received block information;
if the received block information is not stored in the data variables, updating the quantity variables according to the quantity of the received block information, and storing the received block information in the data variables; wherein the quantity variable is used to identify the quantity of the received block information.
10. The apparatus of claim 9, wherein the monitoring unit is configured to monitor whether block information of all blocks included in the current page is already saved, and is specifically configured to:
acquiring the number of blocks included in the current page;
determining whether the value of the quantity variable is equal to the quantity of the blocks included in the current page;
if the numerical value of the quantity variable is equal to the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is stored;
and if the numerical value of the quantity variable is smaller than the quantity of the blocks included in the current page, determining that the block information of all the blocks included in the current page is not stored.
11. The apparatus according to any one of claims 8 to 10, wherein the sending unit is configured to send block information of all blocks included in the current page to each block included in the current page, and is specifically configured to:
acquiring block information of all blocks included in the current page;
randomly combining or combining the block information of all blocks included in the current page according to the time sequence of receiving the block information to obtain a block information set of the current page;
and respectively sending the block information set to each block included in the current page.
12. The apparatus of claim 8, wherein the sending unit, configured to enable each block included in the current page to obtain required block information from the block information of all blocks included in the current page, and complete rendering of the self block, is specifically configured to:
so that each block included in the current page determines whether the rendering of the block is finished;
for the blocks which are rendered completely, ignoring the received block information of all the blocks included in the current page;
and for the blocks which are not rendered completely, receiving the block information of all the blocks included in the current page, acquiring the required block information from the block information of all the blocks included in the current page, and rendering the blocks of the current page.
13. An apparatus for asynchronous rendering of pages, comprising:
the receiving unit is used for respectively receiving respective block information sent by each block included in the current page, wherein the block information of each block is obtained by the corresponding block from the server respectively, and is sent after the block of the receiving unit is rendered according to the obtained block information;
a determining unit, configured to determine a block associated with each received block information;
and the sending unit is used for sending the block information with the associated block to the associated block so that the block receiving the block information completes the rendering of the block.
14. The apparatus of claim 13, wherein the determining unit is configured to determine the block associated with each received block information, and is specifically configured to:
acquiring an association relation table of the block information and the blocks;
searching an item comprising information of each block from the association relation table;
and acquiring the block corresponding to each block information from the searched table entry.
CN201510708490.5A 2015-10-27 2015-10-27 Page asynchronous rendering method and device Active CN106610832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510708490.5A CN106610832B (en) 2015-10-27 2015-10-27 Page asynchronous rendering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510708490.5A CN106610832B (en) 2015-10-27 2015-10-27 Page asynchronous rendering method and device

Publications (2)

Publication Number Publication Date
CN106610832A CN106610832A (en) 2017-05-03
CN106610832B true CN106610832B (en) 2020-06-05

Family

ID=58615108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510708490.5A Active CN106610832B (en) 2015-10-27 2015-10-27 Page asynchronous rendering method and device

Country Status (1)

Country Link
CN (1) CN106610832B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893625B (en) * 2016-05-05 2019-05-10 郑州悉知信息科技股份有限公司 A kind of page rendering method and device
CN109508434B (en) * 2018-10-24 2020-07-28 北京创鑫旅程网络技术有限公司 Block generation method, webpage rendering method and device
CN111355766B (en) * 2018-12-20 2023-08-04 福建福昕软件开发股份有限公司 Rendering method for PDF file to be loaded on network according to need
CN109977331B (en) * 2019-03-04 2021-06-04 东软集团股份有限公司 Method and device for controlling execution of page resources
CN111723321A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Page request method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136201A (en) * 2011-11-22 2013-06-05 阿里巴巴集团控股有限公司 Page information display method and page information display device
CN103744932A (en) * 2013-12-30 2014-04-23 华为技术有限公司 Page processing method and device
CN103902664A (en) * 2014-03-10 2014-07-02 百度在线网络技术(北京)有限公司 Page image rendering method and information providing method and device
CN104519081A (en) * 2013-09-27 2015-04-15 阿里巴巴集团控股有限公司 Page access method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136201A (en) * 2011-11-22 2013-06-05 阿里巴巴集团控股有限公司 Page information display method and page information display device
CN104519081A (en) * 2013-09-27 2015-04-15 阿里巴巴集团控股有限公司 Page access method and device
CN103744932A (en) * 2013-12-30 2014-04-23 华为技术有限公司 Page processing method and device
CN103902664A (en) * 2014-03-10 2014-07-02 百度在线网络技术(北京)有限公司 Page image rendering method and information providing method and device

Also Published As

Publication number Publication date
CN106610832A (en) 2017-05-03

Similar Documents

Publication Publication Date Title
CN106610832B (en) Page asynchronous rendering method and device
CN104038908B (en) Push message sending method and device
CN107798108B (en) Asynchronous task query method and device
CN106059825A (en) Distributed system and configuration method
CN104092555B (en) A kind of methods, devices and systems of undated parameter value
Tong et al. Application-aware traffic scheduling for workload offloading in mobile clouds
CN107741899B (en) Method, device and system for processing terminal data
CN104579768A (en) Client upgrading method and device
CN103517405B (en) A kind of method and system of network positions, mobile terminal and network side equipment
JP2013105319A5 (en)
CN104869162A (en) Method of resource downloading and apparatus thereof
CN104683457A (en) Concurrency control method and device
CN103237060A (en) Method, device and system for data object acquisition
CN111464352A (en) Call link data processing method and device
CN114553762B (en) Method and device for processing flow table items in flow table
CN104317473B (en) A kind of interface display method and client
CN103763181A (en) Automatic attribute setting device and method
CN106375561B (en) Mobile terminal and its remaining detection method for using the time
WO2015154391A1 (en) Method and device for processing power consumption of radio access network
CN110636598A (en) Terminal power saving control method and device, mobile terminal and storage medium
CN107800780B (en) Data service method, device, storage medium and computer equipment
CN103095786B (en) Online service request recognition methods, system, server and line server cluster
CN104954148A (en) Control method and device of node equipment and router
WO2021259168A1 (en) Network mode control method and apparatus for mobile terminal, and computer device
CN110990219B (en) Computer monitoring method based on prediction model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240307

Address after: # 04-08, Lai Zanda Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: Grand Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands