CN112579241A - Page layout method and device, computer-readable storage medium and electronic equipment - Google Patents

Page layout method and device, computer-readable storage medium and electronic equipment Download PDF

Info

Publication number
CN112579241A
CN112579241A CN202011535106.3A CN202011535106A CN112579241A CN 112579241 A CN112579241 A CN 112579241A CN 202011535106 A CN202011535106 A CN 202011535106A CN 112579241 A CN112579241 A CN 112579241A
Authority
CN
China
Prior art keywords
data
cell
laid out
page
current page
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.)
Pending
Application number
CN202011535106.3A
Other languages
Chinese (zh)
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology Co 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 Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202011535106.3A priority Critical patent/CN112579241A/en
Publication of CN112579241A publication Critical patent/CN112579241A/en
Pending legal-status Critical Current

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

Abstract

The disclosed embodiment relates to a page layout method, a page layout device, a computer readable storage medium and an electronic device, relating to the technical field of computers, the method comprises the following steps: responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page; determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page; determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell; and according to the position to be laid out, laying out the second cell in the current page. The embodiment of the disclosure reduces the resource consumption of the central processing unit.

Description

Page layout method and device, computer-readable storage medium and electronic equipment
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular relates to a page layout method, a page layout device, a computer-readable storage medium and an electronic device.
Background
The home page of the live broadcast application usually adopts a multi-column layout with uneven visual appearance, and data blocks are continuously loaded along with the rolling of a page scroll bar, and the layout mode is called a waterfall flow type data layout.
The waterfall flow type data layout is realized by a custom layout class, the interface complexity is effectively reduced by the custom layout class, the space is saved, and meanwhile, the interaction mode of the touch screen equipment is more intuitive. The existing waterfall flow type data layout scheme is as follows: when the list data is loaded by the sliding list, position calculation needs to be performed on all data in the local list, along with sliding of the user, the obtained data is continuously increased, the calculation amount is also continuously increased, a large amount of CPU resources are spent, application is blocked, and user experience is reduced.
Therefore, it is desirable to provide a new page layout method.
It is to be noted that the information invented in the above background section is only for enhancing the understanding of the background of the present invention, and therefore, may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present invention is directed to a page layout method, a page layout apparatus, a computer-readable storage medium, and an electronic device, which overcome, at least to some extent, the problem of large CPU resource consumption due to the limitations and disadvantages of the related art.
According to an aspect of the present disclosure, there is provided a page layout method including:
responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page;
determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page;
determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell;
and according to the position to be laid out, laying out the second cell in the current page.
In an exemplary embodiment of the present disclosure, before acquiring data to be laid out, the page layout method further includes:
when the preset operation is a pull-down refreshing operation, acquiring data included in the current page, and setting the data included in the current page as local list data;
and clearing cache information of the position of the first cell included in the current page, and setting the accumulated height of the waterfall flow included in the current page and the value of a marking variable to be zero, wherein the marking variable is used for marking the number of the first cells which are laid out in the current page.
In an exemplary embodiment of the present disclosure, after acquiring data to be laid out in response to a preset operation, the page layout method further includes:
and adding the data to be laid out into local list data, wherein the data with the data label larger than the marking variable in the local list data is the data to be laid out, and the data label is the position of the data to be laid out in the local list data.
In an exemplary embodiment of the present disclosure, determining a target column of a waterfall flow according to an accumulated height of the waterfall flow included in the current page includes:
acquiring the column number of the waterfall flow and the accumulated height of the waterfall flow in the current page, and sequencing the accumulated height of the waterfall flow to obtain a sequencing result;
and taking the column of the waterfall flow with the minimum accumulated height of the waterfall flow included in the sequencing result as a target column of the waterfall flow.
In an exemplary embodiment of the present disclosure, after determining the position of the second cell to be laid out in the current page, the page layout method further includes:
and updating the accumulated height of the waterfall flow included in the current page according to the height of the second cell.
In an exemplary embodiment of the present disclosure, the page layout method further includes:
caching the second cell and the position of the second cell to be laid out in the current page in a data stream dictionary, and updating the value of the marking variable.
In an exemplary embodiment of the present disclosure, the page layout method further includes:
judging whether the second cell exists in the data stream dictionary, and acquiring a position to be laid out of the second cell when the data stream dictionary comprises the second cell;
and according to the position to be laid out of the second cell, laying out the second cell corresponding to the data to be laid out.
According to an aspect of the present disclosure, there is provided a page layout apparatus including:
the cell height determining module is used for responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page;
the column determination module is used for determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page;
a position to be laid out determining module, configured to determine a position to be laid out of the second cell in the current page according to the target column and the height of the second cell;
and the cell layout module is used for laying out the second cells in the current page according to the position to be laid out.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the page layout method of any one of the above.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform any of the page layout methods described above via execution of the executable instructions.
On one hand, the game data processing method provided by the embodiment of the invention responds to preset operation, obtains data to be laid out, and determines the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page; determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page; determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell; according to the position to be laid out, the second cell is laid out in the current page, and only the position of the cell corresponding to the data to be laid out in the page needs to be calculated for the obtained data to be laid out, so that the problem that the resource consumption of a central processing unit is high due to the fact that the position of the cell containing new data and historical data needs to be calculated in the prior art is solved, and the probability of application blockage caused by high calculation pressure of a processor is reduced; on the other hand, since the amount of data required for position calculation is reduced, the speed of page data layout is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a block diagram that schematically illustrates a relationship between an aggregation view class and an aggregation view layout class, in accordance with an illustrative embodiment of the present invention.
FIG. 2 schematically illustrates a cell-aligned page layout scenario diagram according to an exemplary embodiment of the present invention.
FIG. 3 schematically illustrates a page layout scenario diagram of cell misalignment according to an exemplary embodiment of the present invention.
Fig. 4 schematically shows a flowchart of a page layout method according to an exemplary embodiment of the present invention.
FIG. 5 schematically illustrates a block diagram of a page layout system according to an exemplary embodiment of the present invention.
Fig. 6 schematically illustrates a scene diagram for determining a column in which a cell is located according to an exemplary embodiment of the present invention.
Fig. 7 schematically shows a flowchart of a page layout method according to an exemplary embodiment of the present invention.
Fig. 8 schematically shows a block diagram of a page layout apparatus according to an exemplary embodiment of the present invention.
Fig. 9 schematically illustrates an electronic device for implementing the above-described page layout method according to an exemplary embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the invention.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In a waterfall streaming page layout, a sliding list control is often used, which is implemented by an aggregate view class of the system, and the style of the page layout is determined by a streaming layout class (a subclass that inherits from the aggregate view layout class). Referring to fig. 1, the relationship between the set view class and the set view layout class is: the collection view class is used for merging the data and the layout information and then presenting the merged data and the merged layout information on the page, the collection view layout class is used for providing the view layout information, the data source is used for providing a view object for presenting the data, and the user interaction is realized through a proxy method. When the page content needs to be displayed, firstly, obtaining cells from a data source, and sending the obtained cells to an assembly view class; secondly, acquiring corresponding layout attributes from the set view layout class by the set view class; and finally, laying out the cells according to the layout attribute corresponding to each cell to generate a final display page. The page layout with the cells aligned horizontally or vertically as shown in fig. 2 can be obtained by using the page view class. Referring to FIG. 3, when a heterogeneous multi-column layout needs to be presented, then a custom layout class (a subclass, inherited from the Collection View layout class) is required. In most practical application scenarios, the sliding list is designed as a paged data request, i.e., a first page is refreshed by pulling down: obtaining a first page of paging data from a server and bottom loading a next page: when the page is scrolled to the bottom of the page, the next page data is acquired from the server, the acquired data is added to the tail of the local list, and the data of the local list is loaded into the page.
Based on the above problem, the exemplary embodiment of the present disclosure first provides a page layout method, where the method may be executed in a device terminal, and the device terminal may include a PC terminal, a mobile terminal, and the like. Referring to fig. 4, the data layout method may include the steps of:
s410, responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page;
step S420, determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page;
s430, determining a position to be laid out of the second cell in the current page according to the height of the target column and the height of the second cell;
step S440, according to the position to be laid out, the second cell is laid out in the current page.
On one hand, the page layout method responds to preset operation, obtains data to be laid out, and determines the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page; determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page; determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell; according to the position to be laid out, the second cell is laid out in the current page, and only the position of the cell corresponding to the data to be laid out in the page needs to be calculated for the obtained data to be laid out, so that the problem that the resource consumption of a central processing unit is high due to the fact that the position of the cell containing new data and historical data needs to be calculated in the prior art is solved, and the probability of application blockage caused by high calculation pressure of a processor is reduced; on the other hand, since the amount of data required for position calculation is reduced, the speed of page data layout is improved.
Hereinafter, each step involved in the page layout method of the exemplary embodiment of the present disclosure is explained and explained in detail.
First, an application scenario and an object of the exemplary embodiment of the present disclosure are explained and explained.
Specifically, the exemplary embodiment of the present disclosure may be used in a sliding page of an IOS, and is mainly used for loading data of a new page according to a sliding operation of a user.
In the exemplary embodiment of the present disclosure, the sliding operation of the user may be bottom loading data or pull-down refreshing data, and by calculating and caching the positions of the cells where the data to be laid out is located, the positions of the cells whose positions have been calculated are not required to be calculated again after new data of the next page is acquired, so that the calculation pressure and resource consumption of the central processing unit are reduced. On one hand, when data is loaded at the bottom, firstly, the data to be laid out is loaded; secondly, calculating the position of a cell where the data to be laid out is located; and finally, caching the positions of the cells, and laying out the data to be loaded into the page according to the positions of the cells. When data is refreshed in a pull-down mode, firstly, the position cache of the previous cell is emptied; secondly, loading data to be laid out, and calculating the position of a cell where the data to be laid out is located; and finally, continuously caching the positions of the cells, and laying out the data to be laid out into the page according to the positions of the cells.
Next, a page layout system related to the exemplary embodiment of the present invention is explained and explained. Referring to FIG. 5, the page layout system may include an application system 510, a computing system 520, and a display interface 530. The application system 510 is used for responding to and recognizing the sliding operation of the user; the computing system 520 is in network connection with the application system 510 and is used for acquiring data to be laid out according to the response of the application system 510 and computing the position of the cell where the data to be laid out is located; and the display interface 530 is in network connection with the computing system 520 and is used for merging the data to be laid out and the position information of the cell where the data to be laid out is located and then displaying the merged data on the page.
Hereinafter, steps S410 to S440 will be explained and explained with reference to fig. 5.
In step S410, in response to a preset operation, data to be laid out is acquired, and a height of a second cell corresponding to the data to be laid out is determined according to attribute information of a first cell included in a current page.
The first cell is a cell which is already laid out in the current page, and the second cell is a cell which corresponds to the data to be laid out and is not laid out in the current page.
In this exemplary embodiment, the preset operation may be a bottom-touch loading operation, or a pull-down refresh operation;
when the preset operation is a pull-down refresh operation, before the data to be laid out is acquired, the page layout method further includes:
acquiring data included in the current page, and setting the data included in the current page as local list data;
and clearing cache information of the position of the first cell included in the current page, and setting the accumulated height of the waterfall flow included in the current page and the value of a marking variable to be zero, wherein the marking variable is used for marking the number of the first cells which are laid out in the current page.
The data in the local list data is data which is displayed on a page in a layout mode; caching cache information of the position of a cell included in a current page in a data stream dictionary, wherein keys of the dictionary are labels of the cell corresponding to data to be laid out in the page, and values of the keys are cell objects corresponding to the labels of the cell in the page; the cumulative height of the waterfall flow is stored in a data flow array, wherein the subscript of the cumulative height in the data represents the number of columns of the waterfall flow in the page, for example, the waterfall flow array is {20,56,76,80}, wherein the position of the waterfall flow with the cumulative height 80 in the page is column 4.
Specifically, when the application system 510 recognizes that the operation of the user is a pull-down refresh operation, the data of a new first page is acquired again, and the location information of the cell where the history data included in the cache is located in the page is invalid, so that the location information of the cell whose location has been calculated needs to be completely emptied during the pull-down refresh, the accumulated height of each column of waterfall flow in the page is cleared, and the lower location of the cell whose location has been calculated is set to zero.
Further, when the preset operation is a pull-down refresh operation, before the data to be laid out is obtained, the page layout method further includes:
acquiring data included in the current page, and setting the data included in the current page as local list data;
and clearing cache information of the position of the first cell included in the current page, and setting the accumulated height of the waterfall flow included in the current page and the value of a marking variable to be zero, wherein the marking variable is used for marking the number of the first cells which are laid out in the current page.
Specifically, when the user operation is a pull-down refresh operation, the computing system 520 first pre-processes a data flow dictionary, a data flow array, and a flag variable included in a current page, where the data flow dictionary is used to cache a position of a first cell already existing in the current page, the data flow array is used to record a column number of a waterfall flow and an accumulated height of the waterfall flow included in the current page, and the flag variable is used to flag a number of the first cells already laid out in the current page; secondly, loading data to be laid out, and calculating the position of a second cell corresponding to the data to be laid out; and finally, according to the calculated position of the second cell, laying out the data to be laid out in the page. It should be added that the difference between the pull-down refresh operation and the bottom-loading operation is that after the application system 510 responds to the pull-down refresh operation, the computing system 520 needs to pre-process the data stream dictionary, the data stream array, and the flag variable. Hereinafter, a data layout method common to the pull-down refresh operation and the bottom-touch load operation will be explained and explained.
In this exemplary embodiment, after the data to be laid out is acquired in response to the preset operation, the page layout method further includes:
and adding the data to be laid out into local list data, wherein the data with the data label larger than the marking variable in the local list data is the data to be laid out, and the data label is the position of the data to be laid out in the local list data.
The data corresponding to the cells of the current page layout is local list data, and therefore, when the acquired data to be laid out needs to be displayed in the page, the data to be laid out needs to be added to the local list data. In the local list data, only the data with the data label greater than the mark variable is the newly obtained data to be laid out. The value of the tag variable is consistent with the index of the first cell corresponding to the last data in the page.
Further, after the data to be laid out is acquired, the height of the second cell corresponding to the data to be laid out can be determined according to the attribute information of the first cell included in the current page. Wherein the attribute information of the first cell includes: cell width, cell cover width to height ratio, and cell title line number.
In step S420, a target column of the waterfall flow is determined according to an accumulated height of the waterfall flow included in the current page.
When the second cells are laid out on the current page, the second cells include the column number of the waterfall flow on the current page.
In this example embodiment, determining a target column of the waterfall flow according to an accumulated height of the waterfall flow included in the current page includes:
acquiring the column number of the waterfall flow and the accumulated height of the waterfall flow in the current page, and sequencing the accumulated height of the waterfall flow to obtain a sequencing result;
and taking the column of the waterfall flow with the minimum accumulated height of the waterfall flow included in the sequencing result as a target column of the waterfall flow.
The cumulative height of the waterfall flow is determined by the height of the cells included in the column of waterfall flow and the row spacing between the cells of the waterfall flow, and the number of columns of the waterfall flow included in the page can be determined by a page layout attribute, wherein the page layout attribute can include: the number of columns of waterfall flow, the interval of columns of waterfall flow, the row interval between cells of waterfall flow and the inner edge distance of the content of the sliding list. Specifically, the method can be as follows: and acquiring the accumulated height of the waterfall flow of each column included in the page, and sequencing the accumulated height of the waterfall flow of each column, wherein the column with the smallest accumulated height is the column of the waterfall flow in which the second cell is located when the second cell is laid out on the current page.
Referring to fig. 6, the column number of the waterfall flow is three columns, the number of cells already laid out in the page is 10, that is, the value of the flag variable is 10, when the data to be laid out is laid out on the page, the number of the cells in the page is 11, and the column of the cells in the page is the column where the cell 2, the cell 4 and the cell 8 are located.
In step S430, a position to be laid out of the second cell in the current page is determined according to the target column and the height of the second cell.
Specifically, after the height of the second cell corresponding to the data to be laid out and the column of the waterfall flow where the second cell is located in the current page are obtained, the specific position of the second cell corresponding to the data to be laid out in the current page may be determined according to the height of the second cell, the column of the waterfall flow corresponding to the second cell, and the interval of the columns of the waterfall flow and the interval of the rows between the cells of the waterfall flow included in the page attribute.
Further, in order to ensure the accuracy of the layout position of the data to be laid out in the page, after the position of the second cell corresponding to the data to be laid out in the page is obtained by calculation, the page layout method further includes:
and updating the accumulated height of the waterfall flow included in the current page according to the height of the second cell.
Specifically, after the position of the second cell corresponding to the data to be laid out in the page is obtained, the accumulated height of the waterfall flow of the second cell in the page is updated according to the height of the second cell corresponding to the data to be laid out, that is, the value in the waterfall flow array is updated, the value in the updated waterfall flow array is the sum of the accumulated height of the original waterfall flow, the height of the cell where the data to be laid out is located, and the line spacing between the cells, for example, in fig. 6, after the height of the second cell where the data to be laid out is located is obtained, the accumulated height of the waterfall flow column where the second cell is located needs to be updated, that is, the accumulated height of the waterfall flow in the second column is the sum of the heights of the cells 2, 4, 8 and the line spacing between the cells.
In step S440, the second cell is laid out in the current page according to the position to be laid out.
Specifically, after the position of the second cell in the page is obtained, the second cell corresponding to the data to be laid out is laid out in the corresponding position of the page according to the position.
Further, after obtaining the position to be laid out of the second cell in the page corresponding to the data to be laid out, in order to reduce the computing pressure of the computer and improve the loading efficiency when the second cell corresponding to the data to be laid out is loaded again, the page layout method further includes:
caching the second cell and the position of the second cell to be laid out in the current page in a data stream dictionary, and updating the value of the marking variable.
The data stream dictionary is used for caching the cells with calculated positions, keys of the dictionary are labels of the cells included in the current page in the page, and values of the keys are cell objects corresponding to the labels of the cells included in the current page; the position of the second cell corresponding to the data to be laid out in the page may be cached in the dictionary, or may be cached in other caching devices, which is not particularly limited in this example embodiment.
Specifically, after the position of the second cell in the page corresponding to the data to be laid out is obtained, the computing system 520 needs to cache the position of the second cell in the page in the dictionary in the data, when the application system 510 responds to the user operation again, the data to be laid out of the current layout is historical data, when the data in the local list data is displayed on the display interface 530, only the position of the cell where the newly acquired data is located in the page needs to be calculated, and only the position of the cell where the historical data is located in the page needs to be acquired from the cache, so that the calculation pressure of the central processing unit is reduced.
After caching the position to be laid out of the cell corresponding to the data to be laid out in the page in the data stream dictionary, the page layout method further comprises the following steps:
judging whether the second cell exists in the data stream dictionary, and acquiring a position to be laid out of the second cell when the data stream dictionary comprises the second cell;
and according to the position to be laid out of the second cell, laying out the second cell corresponding to the data to be laid out.
Specifically, when the user operation is a pull-down refresh operation and the second cell corresponding to the data to be laid out is already laid out in the current page, the user continues to browse the cells displayed on the display interface 530, and when the historical data included in the current page is displayed on the display interface again, the position to be laid out of the cell corresponding to the historical data in the page does not need to be calculated again, and only the cell object of the cell corresponding to the historical data is searched in the data stream dictionary, and whether the cell object exists is determined, and when the cell object exists, the key of the data stream dictionary corresponding to the cell object, that is, the label of the cell corresponding to the historical data in the page is obtained, and the cell is laid out in the page according to the label of the cell obtained from the data stream in the page.
The page layout method and the page layout system provided by the exemplary embodiment of the present invention have at least the following advantages:
on one hand, the cells with the calculated positions are cached to ensure that when new data to be distributed are obtained, only the positions of the cells corresponding to the newly obtained data to be distributed are required to be calculated, and the positions of the cells corresponding to historical data in local list data are not required to be calculated, so that the calculation pressure of a central processing unit is reduced, the resource consumption of the central processing unit is reduced, and the probability that a user is blocked by a device terminal when the user slides the list is reduced; on the other hand, the positions of the cells corresponding to the latest data to be laid out are only calculated, so that the calculation amount is reduced, and the speed of data page data layout is improved.
Hereinafter, the page layout method according to the exemplary embodiment of the present invention will be further explained and explained with reference to fig. 7. The data layout method can comprise the following steps:
s710, acquiring data to be distributed;
s720, judging whether the acquired data is first page data;
s7211, when the acquired data is first page data, setting the current first page data as local list data;
s7212, resetting each element in the data stream array;
s7213, clearing the data stream dictionary;
s7214, setting the value of the marking variable to be zero;
s7221, adding data to be distributed to the tail of the local list data;
s730, loading local list data;
s740, judging whether the value of the mark variable is smaller than the subscript of the tail data in the local list data;
s750, finding out a column with the minimum accumulated height in the data stream array;
s760, calculating the position of data corresponding to the mark variable in the local list data in the page;
s770, updating the accumulated height of the row with the minimum accumulated height in the data stream array;
s780, caching the positions of the cells where the data to be distributed are located in a data stream dictionary;
s790, updating the value of the marking variable.
In summary, after the application system 510 responds to the operation, the computing system 520 obtains the data to be laid out, and first determines whether the data to be laid out is the first page of data, that is, determines whether the operation of the user is a pull-down refresh operation or a bottom loading operation; secondly, when the data to be laid out is data of a first page, namely the operation of a user is pull-down refreshing, setting the data of the current first page as local list data, setting the value of each element in the data stream array as zero, emptying the data stream dictionary, and setting the value of a marking variable as zero; thirdly, when the data to be laid out is not the first page of data, namely when the operation of the user is bottom loading, adding the data to be laid out to the tail part of the local list data; furthermore, no matter whether the data to be laid out belongs to the first page data, the data in the local list data needs to be loaded, that is, the local list data is laid out in the page, and the specific process of loading is as follows: firstly, judging whether the value of a marking variable is smaller than the subscript of the last data in the local list data; secondly, determining the column with the minimum accumulated height in the data stream array as the column where the data to be laid out is located; thirdly, calculating the position of the data to be laid out in the local list data in the page; and finally, updating the height of the column with the minimum accumulated height in the data stream array, caching the position of the cell where the data to be laid out is obtained by calculation into the data stream dictionary, and adding one to the value of the marking variable.
An exemplary embodiment of the present invention further provides a page layout apparatus, and as shown in fig. 8, the page layout apparatus may include: a cell height determination module 810, a column determination module 820, a to-be-laid position determination module 830, and a cell layout module 840. Wherein:
a cell height determining module 810, configured to respond to a preset operation, acquire data to be laid out, and determine, according to attribute information of a first cell included in a current page, a height of a second cell corresponding to the data to be laid out;
a column determining module 820, configured to determine a target column of the waterfall flow according to an accumulated height of the waterfall flow included in the current page;
a to-be-laid position determining module 830, configured to determine, according to the target column and the height of the second cell, a to-be-laid position of the second cell in the current page;
the cell layout module 840 is configured to lay out the second cell in the current page according to the position to be laid out.
In an exemplary embodiment of the present disclosure, before acquiring data to be laid out, the page layout method further includes:
when the preset operation is a pull-down refreshing operation, acquiring data included in the current page, and setting the data included in the current page as local list data;
and clearing cache information of the position of the first cell included in the current page, and setting the accumulated height of the waterfall flow included in the current page and the value of a marking variable to be zero, wherein the marking variable is used for marking the number of the first cells which are laid out in the current page.
In an exemplary embodiment of the present disclosure, after acquiring data to be laid out in response to a preset operation, the page layout method further includes:
and adding the data to be laid out into local list data, wherein the data with the data label larger than the marking variable in the local list data is the data to be laid out, and the data label is the position of the data to be laid out in the local list data.
In an exemplary embodiment of the present disclosure, determining a target column of a waterfall flow according to an accumulated height of the waterfall flow included in the current page includes:
acquiring the column number of the waterfall flow and the accumulated height of the waterfall flow in the current page, and sequencing the accumulated height of the waterfall flow to obtain a sequencing result;
and taking the column of the waterfall flow with the minimum accumulated height of the waterfall flow included in the sequencing result as a target column of the waterfall flow.
In an exemplary embodiment of the present disclosure, after determining the position of the second cell to be laid out in the current page, the page layout method further includes:
and updating the accumulated height of the waterfall flow included in the current page according to the height of the second cell.
In an exemplary embodiment of the present disclosure, the page layout method further includes:
caching the second cell and the position of the second cell to be laid out in the current page in a data stream dictionary, and updating the value of the marking variable.
In an exemplary embodiment of the present disclosure, the page layout method further includes:
judging whether the second cell exists in the data stream dictionary, and acquiring a position to be laid out of the second cell when the data stream dictionary comprises the second cell;
and according to the position to be laid out of the second cell, laying out the second cell corresponding to the data to be laid out.
The specific details of each module in the page layout apparatus have been described in detail in the corresponding page layout method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present invention are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
In an exemplary embodiment of the present invention, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to this embodiment of the invention is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
Wherein the storage unit stores program code that is executable by the processing unit 910 to cause the processing unit 910 to perform steps according to various exemplary embodiments of the present invention described in the above section "exemplary methods" of the present specification. For example, the processing unit 910 may perform step S410 as shown in fig. 4: responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page; s420: determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page; s430: determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell; s440: and according to the position to be laid out, laying out the second cell in the current page.
The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM)9201 and/or a cache memory unit 9202, and may further include a read only memory unit (ROM) 9203.
Storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 930 can be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 900, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 950. Also, the electronic device 900 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 960. As shown, the network adapter 960 communicates with the other modules of the electronic device 900 via the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiment of the present invention.
In an exemplary embodiment of the present invention, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
According to the program product for realizing the method, the portable compact disc read only memory (CD-ROM) can be adopted, the program code is included, and the program product can be operated on terminal equipment, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

Claims (10)

1. A page layout method, comprising:
responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page;
determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page;
determining the position of the second cell to be laid in the current page according to the height of the target column and the height of the second cell;
and according to the position to be laid out, laying out the second cell in the current page.
2. The page layout method according to claim 1, wherein before acquiring the data to be laid out, the page layout method further comprises:
when the preset operation is a pull-down refreshing operation, acquiring data included in the current page, and setting the data included in the current page as local list data;
and clearing cache information of the position of the first cell included in the current page, and setting the accumulated height of the waterfall flow included in the current page and the value of a marking variable to be zero, wherein the marking variable is used for marking the number of the first cells which are laid out in the current page.
3. The page layout method according to claim 1, wherein after acquiring the data to be laid out in response to a preset operation, the page layout method further comprises:
and adding the data to be laid out into local list data, wherein the data with the data label larger than the marking variable in the local list data is the data to be laid out, and the data label is the position of the data to be laid out in the local list data.
4. The page layout method according to claim 3, wherein determining the target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page comprises:
acquiring the column number of the waterfall flow and the accumulated height of the waterfall flow in the current page, and sequencing the accumulated height of the waterfall flow to obtain a sequencing result;
and taking the column of the waterfall flow with the minimum accumulated height of the waterfall flow included in the sequencing result as a target column of the waterfall flow.
5. The page layout method according to claim 4, wherein after determining the position of the second cell to be laid out in the current page, the page layout method further comprises:
and updating the accumulated height of the waterfall flow included in the current page according to the height of the second cell.
6. The page layout method according to claim 5, further comprising:
caching the second cell and the position of the second cell to be laid out in the current page in a data stream dictionary, and updating the value of the marking variable.
7. The page layout method according to claim 6, further comprising:
judging whether the second cell exists in the data stream dictionary, and acquiring a position to be laid out of the second cell when the data stream dictionary comprises the second cell;
and according to the position to be laid out of the second cell, laying out the second cell corresponding to the data to be laid out.
8. A page layout apparatus, comprising:
the cell height determining module is used for responding to preset operation, acquiring data to be laid out, and determining the height of a second cell corresponding to the data to be laid out according to attribute information of a first cell included in a current page;
the column determination module is used for determining a target column of the waterfall flow according to the accumulated height of the waterfall flow included in the current page;
a position to be laid out determining module, configured to determine a position to be laid out of the second cell in the current page according to the target column and the height of the second cell;
and the cell layout module is used for laying out the second cells in the current page according to the position to be laid out.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the page layout method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page layout method of any of claims 1-7 via execution of the executable instructions.
CN202011535106.3A 2020-12-22 2020-12-22 Page layout method and device, computer-readable storage medium and electronic equipment Pending CN112579241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011535106.3A CN112579241A (en) 2020-12-22 2020-12-22 Page layout method and device, computer-readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011535106.3A CN112579241A (en) 2020-12-22 2020-12-22 Page layout method and device, computer-readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112579241A true CN112579241A (en) 2021-03-30

Family

ID=75139457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011535106.3A Pending CN112579241A (en) 2020-12-22 2020-12-22 Page layout method and device, computer-readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112579241A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626125A (en) * 2021-08-17 2021-11-09 广州博冠信息科技有限公司 Popup window processing method and device, storage medium and electronic equipment
CN113835806A (en) * 2021-09-18 2021-12-24 北京天融信网络安全技术有限公司 Page layout method and device, electronic equipment and storage medium
CN113867862A (en) * 2021-09-26 2021-12-31 掌阅科技股份有限公司 List page layout method and computing device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247748A (en) * 2017-05-24 2017-10-13 北京潘达互娱科技有限公司 Page loading method and device
CN107302725A (en) * 2017-06-29 2017-10-27 环球智达科技(北京)有限公司 Method for exporting the waterfall stream page
CN107343216A (en) * 2017-06-29 2017-11-10 环球智达科技(北京)有限公司 System for showing the waterfall stream page
CN107766528A (en) * 2017-10-24 2018-03-06 深圳市雷鸟网络传媒有限公司 Data load method, terminal and the computer-readable recording medium of the waterfall stream page
CN108196964A (en) * 2017-12-29 2018-06-22 北京奇虎科技有限公司 A kind of method and apparatus by Streams Module
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110895594A (en) * 2018-08-23 2020-03-20 武汉斗鱼网络科技有限公司 Page display method and related equipment
CN111309216A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 List page display method and device, computer equipment and storage medium
CN111324833A (en) * 2018-12-14 2020-06-23 北京京东尚科信息技术有限公司 Page display method, device, electronic design and computer readable medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247748A (en) * 2017-05-24 2017-10-13 北京潘达互娱科技有限公司 Page loading method and device
CN107302725A (en) * 2017-06-29 2017-10-27 环球智达科技(北京)有限公司 Method for exporting the waterfall stream page
CN107343216A (en) * 2017-06-29 2017-11-10 环球智达科技(北京)有限公司 System for showing the waterfall stream page
CN107766528A (en) * 2017-10-24 2018-03-06 深圳市雷鸟网络传媒有限公司 Data load method, terminal and the computer-readable recording medium of the waterfall stream page
CN108196964A (en) * 2017-12-29 2018-06-22 北京奇虎科技有限公司 A kind of method and apparatus by Streams Module
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110895594A (en) * 2018-08-23 2020-03-20 武汉斗鱼网络科技有限公司 Page display method and related equipment
CN111324833A (en) * 2018-12-14 2020-06-23 北京京东尚科信息技术有限公司 Page display method, device, electronic design and computer readable medium
CN111309216A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 List page display method and device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626125A (en) * 2021-08-17 2021-11-09 广州博冠信息科技有限公司 Popup window processing method and device, storage medium and electronic equipment
CN113626125B (en) * 2021-08-17 2024-03-15 广州博冠信息科技有限公司 Popup window processing method and device, storage medium and electronic equipment
CN113835806A (en) * 2021-09-18 2021-12-24 北京天融信网络安全技术有限公司 Page layout method and device, electronic equipment and storage medium
CN113835806B (en) * 2021-09-18 2024-03-15 北京天融信网络安全技术有限公司 Page layout method and device, electronic equipment and storage medium
CN113867862A (en) * 2021-09-26 2021-12-31 掌阅科技股份有限公司 List page layout method and computing device
CN113867862B (en) * 2021-09-26 2024-04-26 掌阅科技股份有限公司 List page layout method and computing device

Similar Documents

Publication Publication Date Title
CN112579241A (en) Page layout method and device, computer-readable storage medium and electronic equipment
CN107463693B (en) Data processing method, device, terminal and computer readable storage medium
CN110309475B (en) Page display method and device, terminal equipment and storage medium
US20130024802A1 (en) Presetting input mode for input box
CN103984538A (en) Application scenario identification method, power consumption management method, devices and terminal equipment
CN111190882B (en) Target template creation method and device, electronic equipment and storage medium
US20140189716A1 (en) Systems And Methods For Measurement Of Unsupported User Interface Actions
CN114140947A (en) Interface display method and device, electronic equipment, storage medium and program product
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
KR100963976B1 (en) Method, apparatus, system and computer-readable recording medium for arithmetical operation based on image information
US10275525B2 (en) Method and system for mining trends around trending terms
CN113076358A (en) Report generation method, device, equipment and storage medium
US20190220160A1 (en) Display for input selection on a compact information processing device
CN112800373B (en) Webpage resource data generation method and device, computer equipment and storage medium
CN107729347B (en) Method, device and equipment for acquiring synonym label and computer readable storage medium
CN114201729A (en) Method, device and equipment for selecting matrix operation mode and storage medium
US9001146B2 (en) Automatically determining an object display mode to display objects
CN110888583B (en) Page display method, system and device and electronic equipment
CN114356475A (en) Display processing method, device, equipment and storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN113419711A (en) Page guiding method and device, electronic equipment and storage medium
CN111078112A (en) Terminal device control method and device, computer device and storage medium
CN111785353A (en) Digital pathological section processing method and device, storage medium and electronic equipment
CN116009849B (en) Graphic interface display method and device based on visual programming platform
CN116501223B (en) Object display method and device, electronic equipment and storage medium

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