CN107479960B - Method and device for displaying unit view - Google Patents

Method and device for displaying unit view Download PDF

Info

Publication number
CN107479960B
CN107479960B CN201710742903.0A CN201710742903A CN107479960B CN 107479960 B CN107479960 B CN 107479960B CN 201710742903 A CN201710742903 A CN 201710742903A CN 107479960 B CN107479960 B CN 107479960B
Authority
CN
China
Prior art keywords
data
view
filling
task
block
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
CN201710742903.0A
Other languages
Chinese (zh)
Other versions
CN107479960A (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 China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201710742903.0A priority Critical patent/CN107479960B/en
Publication of CN107479960A publication Critical patent/CN107479960A/en
Application granted granted Critical
Publication of CN107479960B publication Critical patent/CN107479960B/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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a method and a device for displaying a unit view. The method comprises the following steps: acquiring data content to be filled in the unit view; dividing the unit view into 1 or more different blocks based on the role of the data content and the number of data contents repeated for the same role; and generating corresponding 1 or more view controls based on the data content to be displayed of the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, thereby displaying the unit view.

Description

Method and device for displaying unit view
Technical Field
The invention relates to the technical field of page display, in particular to a method and a device for displaying a unit view.
Background
At present, with the popularization and development of intelligent mobile terminals, the content displayed on the intelligent terminals is more and more abundant, and the requirements on data processing and display capabilities are further improved.
The mainstream operating systems used on the smart mobile terminal at present are the android system and the ios system. Application program products developed based on the android system generally present various rich data contents to users through a display screen with a small area, especially for smart phones. The data content that needs to be displayed is most often presented using the list control as a carrier and interacting with the user. However, the single repeated card-type unit view obviously cannot meet the increasing experience demand of users, so that various unit views need to be presented in a page list to enrich the product content, which makes the complex card-type unit view largely used in third-party application products.
The rich content of the cell view also means that the list control needs to handle a large and complex amount of data. Generally, a plurality of card-type unit views in the list are displayed in a first-in first-out (FIFO) order, that is, when the content of one card-type unit view is completely displayed and then the content of the next card-type unit view is displayed, the more complicated the content of the card-type unit view is, the longer the time required for displaying the content is, the more computing resources are occupied, and the very easy the phenomenon of a pause occurs, especially when the user operates other events, such as clicking a button, sliding a page, and the like. In addition, when the cell view slides following the operation gesture of the user, especially when the cell view leaves the screen, a click phenomenon in the list sliding process is extremely easily caused in the recycling and multiplexing process of the cell view.
Disclosure of Invention
The present invention aims to provide a method and an apparatus for displaying a cell view to improve the above problems.
A first embodiment of the present invention provides a method for displaying a cell view, including:
acquiring data content to be filled in the unit view;
dividing the unit view into 1 or more different blocks based on the role of the data content and the number of data contents repeated for the same role;
and generating corresponding 1 or more view controls based on the data content to be displayed of the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, thereby displaying the unit view.
Wherein the dividing of the unit view into 1 or more different blocks based on the role of the data contents and the number of data contents repeated for the same role includes:
when the role of the data content is 1 and a plurality of data contents are not repeatedly used for the role, directly dividing the unit view into 1 block;
when the role of the data content is 1 but has a plurality of data contents repeated for the role, or when the role of the data content is 2 or more and no plurality of data contents are repeated for the 2 or more roles, or when the role of the data content is 2 or more and has a plurality of data contents repeated for 1 or more roles therein, the unit view is divided into a plurality of different blocks based on the role of the data content and the number of data contents repeated for the same role.
And in the step of sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, putting the data filling tasks of the 1 or more different blocks to be processed into a thread queue to be queued for execution.
The method comprises the following steps that a plurality of filling tasks of a plurality of blocks to be processed are placed into a thread queue at one time to be queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued.
Wherein other task events can be inserted between any 2 or more blocks of data stuffing tasks queued for execution by the thread queue.
Wherein, still include: and when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents, canceling the task of filling the view control corresponding to the block with the data corresponding to the 1 or more different blocks.
Wherein the task of canceling the filling of the view control corresponding to the 1 or more different blocks with data corresponding to the different blocks comprises: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
A second embodiment of the present invention provides an apparatus for displaying a view of a unit, including:
the data acquisition module is used for acquiring data contents to be filled in the unit view;
a tile dividing module for dividing the unit view into 1 or more different tiles based on the role of the data content and the number of data contents repeatedly used for the same role;
and the view display module is used for generating corresponding 1 or more view controls based on the data content to be displayed of the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block so as to display the unit view.
Wherein the block division module is configured to:
when the role of the data content is 1 and a plurality of data contents are not repeatedly used for the role, directly dividing the unit view into 1 block;
when the role of the data content is 1 but has a plurality of data contents repeated for the role, or when the role of the data content is 2 or more and no plurality of data contents are repeated for the 2 or more roles, or when the role of the data content is 2 or more and has a plurality of data contents repeated for 1 or more roles therein, the unit view is divided into a plurality of different blocks based on the role of the data content and the number of data contents repeated for the same role.
The view display module is used for placing a plurality of filling tasks of a plurality of blocks to be processed into a thread queue at one time to be queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued.
Wherein other task events can be inserted between any 2 or more blocks of data stuffing tasks queued for execution by the thread queue.
Wherein the apparatus further comprises:
and the filling task canceling module is used for canceling the task of filling the data corresponding to the 1 or more different blocks into the view control corresponding to the block when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents.
The task canceling mode comprises the following steps: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
A third embodiment of the present invention provides an interface display method, including:
and filling the data content to be displayed into each unit view in the list view on the interface for displaying by adopting the method described in the first embodiment and/or the corresponding preferred embodiment.
A fourth embodiment of the invention provides a memory device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method of the first embodiment and/or the preferred embodiments.
According to the unit view display method and device, the unit view with large data volume and complexity is divided into the plurality of blocks, and the data filling tasks of the blocks are respectively placed into the main thread queue to be queued for execution, so that other task events can be inserted between the data filling tasks of any 2 or more blocks, the utilization rate of system resources is improved, and the pause phenomenon caused by other events operated by a user in the unit view display process is greatly improved. In addition, when the unit view completely leaves the screen or the display data of the unit view is multiplexed, if the unprocessed data filling task is still in the main thread queue, the data filling task is cancelled in time, so that the occupation of system resources is saved, the stuck phenomenon in the list sliding or refreshing process is greatly improved, and the page display fluency is improved.
Drawings
Fig. 1 is a flowchart of a method for displaying a cell view according to a first embodiment of the present invention;
fig. 2 is a schematic block diagram of an apparatus for displaying a cell view according to a second embodiment of the present invention.
FIG. 3 is a schematic screenshot of example 1 in which a block needs to be divided according to a display method of a unit view of the present invention;
FIG. 4 is a schematic screenshot of example 2 in which a block needs to be divided according to a display method of a unit view of the present invention;
FIG. 5 is a schematic screenshot of example 3 in which a block needs to be divided according to a display method of a unit view of the present invention;
fig. 6 is a schematic screenshot of example 4 in which a block needs to be divided according to a display method of a unit view of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention and the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Before describing the technical solutions of the present invention, some knowledge and terms used herein will be briefly introduced.
The mainstream operating systems of the smart mobile terminals in the current market are an Android (Android) system and an IOS (internet of things) system, and various interfaces or pages displayed on the smart mobile terminals are generated by using controls under the corresponding systems. The ListView control is one of the common controls for developing various interfaces displayed on the mobile terminal under the android system, and the UITableView control is one of the common controls for developing various interfaces displayed on the mobile terminal by the IOS system. The following is a brief description of the android system as an example.
ListView is used to display data in a tabular form. In the ListView, data is mostly displayed in row units, and due to the problem of the screen size of the mobile terminal, especially the small screen of the smart phone, displaying multiple rows on the small-size screen is not beneficial to operation. For example, news items displayed on various browsers APP are displayed in a line unit, that is, a news information is briefly listed in a line; for another example, various information is displayed on the pay bank APP display page in a behavior unit; for another example, various commodity item information is displayed on the page displayed by the Taobao APP in a row unit. In the field of interface or page display development involving intelligent mobile terminals, those skilled in the art generally refer to each line unit view displaying data in a list form as one unit view. Because each row looks much like a card, it is also commonly referred to as a card-like unit view, simply a card. In addition, the layout of the content displayed by a cell view can be diversified by adding a plurality of sub-views on the cell view, for example, several columns of different content can be displayed on one cell view.
Fig. 1 is a flowchart of a method for displaying a cell view according to a first embodiment of the present invention. As shown in fig. 1, the method for displaying a cell view of the present invention includes:
s1: and acquiring data content to be filled in the unit view.
Generally, the display method of the present invention is applied to an intelligent terminal, such as an intelligent mobile terminal that needs to display a page, for example, a smart phone, a tablet computer, and the like. When the intelligent terminal displays a page, the intelligent terminal needs to request the server through the network to acquire a data content type predefined by a protocol between the server and the intelligent terminal.
S2: the unit view is divided into 1 or more different blocks based on the role of the data content and the number of data contents repeated for the same role.
Generally, when the effect of the display content (i.e. data content) of a cell view is single and no multiple display contents are repeatedly used for the effect, the display content is directly divided into 1 block, for example, when one cell view displays one news item, only a text-type news title or a text-type news title + thumbnail picture is generally displayed; the clickable picture + title and/or label are displayed when one video item is displayed in one unit view, and the unit view cannot be divided into a plurality of blocks because the data content to be displayed only has 1 effect although the data content comprises text and pictures, and a plurality of data contents to be displayed are not repeatedly used for the effect, so the unit view is directly divided into 1 block.
When the effect of the display contents (i.e., data contents) of the unit view is 1 but has a plurality of display contents repeated for the effect, or when the effect of the display contents (i.e., data contents) of the unit view is 2 or more and no plurality of display contents are repeated for the 2 or more effects (referring to repeated use for any 1 or more of the 2 or more effects), or when the effect of the display contents (i.e., data contents) of the unit view is 2 or more and has 1 or more effects in which a plurality of display contents are repeated for the same effect, the unit view is divided into a plurality of different blocks based on the effect of the data contents and the number of data contents repeated for the same effect. If the background of the unit view has special settings, such as adding background pictures, characters, special effects, etc., the background of the unit view is divided into a block.
In the schematic screenshot of example 1 shown in fig. 3, it can be seen that in the unit view providing the "explore new games" function, the displayed contents include: background content, new games to be downloaded, "prince of diese", "don't think of maze", "fairy war god", and "hero war song hd".
As can be seen from this screenshot, the display content of the cell view has 2 effects: role 1 is to provide background content; role 2 is to provide multiple game downloads and 4 games to be downloaded are provided, i.e. 4 display contents are all for download (same role 2). Therefore, the data contents have 2 roles, and 4 data contents (4 game contents) are all used for one of the same roles (provision download), so that the number of display contents repeated for the same role is 4, whereby the view of the unit providing the "dig new game" function of example 1 can be divided into 5 blocks based on the roles of the data contents and the number of data contents repeated for the same role.
In the schematic screenshot of example 1 shown in fig. 4, it can be seen that in the unit view providing the "long count in 2017 game years" function, the displayed contents include: background content, games to be downloaded and installed, namely 'chaser 2', 'greedy snake combat', 'speed and passion 8', and 'arrow and hand combat'.
As can be seen from this screenshot, the display content of the cell view has 2 effects: role 1 is to provide background content; role 2 is to provide multiple game downloads and 4 games to be downloaded are provided, i.e. 4 display contents are all for download (same role 2). Therefore, the data contents have 2 roles, and 4 data contents (4 game contents) are all used for one of the same roles (provision download), so that the number of display contents repeated for the same role is 4, whereby the view of the unit providing the "long stock in the game year of 2017" function of example 2 can be divided into 5 blocks based on the roles of the data contents and the number of data contents repeated for the same role.
In the schematic screenshot of example 1 shown in fig. 5, it can be seen that in the unit view providing the game "xian jian qi xian she", the displayed contents include: the detailed content introduction of the game 'Xianjiaqi man biography' and the downloading and installation of the game 'Xianjiaqi man biography' are realized.
As can be seen from this screenshot, the display content of the cell view has 2 effects: action 1 is to introduce the detailed content of the game ' Xian Jian Qi Xian Tuo ' in an information flow mode (the upper part of the view ' Xian Jian Qi Xian Jian Yi |, the faked edge is in love); action 2 is to provide a download installation of the game (lower part of the view). Thus, the data content has 2 roles, and no multiple data contents are reused for one or both of these 2 roles (content introduction and provision download), whereby the unit view of example 3 providing the game "xian swordsman biography" can be divided into 2 tiles based on the roles of the data content and the number of data contents reused for the same role.
In the schematic screenshot of example 1 shown in fig. 6, it can be seen that in the unit view providing the game "crouchaerugeibi", the displayed contents include: the video playing introduction of the game "two tiger-Tibetan dragon" and the downloading installation of the game "two tiger-Tibetan dragon".
As can be seen from this screenshot, the display content of the cell view has 2 effects: action 1 is to adopt the video playing mode to introduce the content of the game "crouching tiger two" (the upper part of the view is obviously a video playing window, and the characters on the picture show that the purpose is to introduce the game); action 2 is to provide a download of the game (lower part of the view). Thus, the data content has 2 roles, and no multiple data content is reused for one or both of these 2 roles (video playback and provide download), whereby the unit view of example 4 providing the game "crouch dragon two" can be divided into 2 blocks based on the role of the data content and the number of data contents reused for the same role.
In addition, although the data content is used as a basis for dividing the unit view into a plurality of blocks, it can be known to those skilled in the art from the description and specific examples of the related content of the present invention that other words with the same meaning are also applicable, such as "use", "purpose", and the like. In addition, in order to avoid that the division of the block of the unit view is too fine to affect the speed of loading and displaying the data of the page, it can be known from the division method described by the example that a plurality of data types can be divided into one block from the aspect of function or purpose, for example, in the example shown in fig. 3 and 4, the background part includes 2 pictures and title words; in the example shown in fig. 5, the information stream portion includes 3 types of titles, textual descriptions, and pictures.
S3: and generating corresponding 1 or more view controls based on the data content to be displayed of the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, thereby displaying the unit view.
The data content to be displayed is displayed through various view controls, the data content to be displayed of the partitioned blocks of the invention may need 1 or more controls to be displayed, for example, text data content needs to be displayed through a TextView control, picture data content needs to be displayed through an ImageView control, video data content needs to be displayed through a VideoView control … …, and the like. Therefore, it is necessary to first generate corresponding 1 or more view controls based on the data content to be displayed by the 1 or more different tiles, and then fill the corresponding data into the generated corresponding view controls. When the number of the blocks is large and the data contents corresponding to some different blocks are of the same category, a situation of data mis-filling may occur, for example, the text "game recommendation" is intended to be displayed on the block 1, the text "video recommendation" is displayed on the block 2, and if some technical processing is not performed, a wrong display of the text "video recommendation" displayed on the block 1 is likely to occur. One of the common methods is to assign unique IDs to different tiles, and the corresponding 1 or more view controls generated based on the tile with a unique ID may also be assigned with a unique ID, so that a mis-filling situation does not occur when the data corresponding to one tile is filled into the corresponding 1 or more view controls generated.
In a preferred embodiment, in the step of sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, the data filling tasks of the 1 or more different blocks to be processed are put into a thread queue to be queued for execution. More preferably, the data filling tasks of the blocks to be processed are sequentially placed into the main thread queue to be queued for execution according to the layout sequence of the 1 or more different blocks. The method for placing a plurality of data filling tasks of a plurality of blocks to be processed into the thread queue comprises the following steps: putting a plurality of filling tasks of a plurality of blocks to be processed into a thread queue at one time to be queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued.
In the preferred embodiment of placing multiple fill tasks for multiple pending blocks at once into the thread queue for execution, other task events can be inserted between the data fill tasks for any 2 or more blocks queued for execution by the thread queue, either 1 or more other tasks.
In the preferred embodiment of queuing a filling task of another to-be-processed tile in the thread queue after each completion of the filling task of one to-be-processed tile, it is obvious that other task events, either 1 or more, may be added before queuing a filling task of another to-be-processed tile in the thread queue.
The specific method for putting the data filling task of the block to be processed into the thread queue to be queued for execution is as follows: and calling a post method through a Handler control to send the data filling tasks of the 1 or more different blocks to be processed in the unit view to a main thread (UI thread) queue to be queued for execution.
For example, a conventional approach for a main thread execution queue where an existing cell view requires display of data content is shown in schematic table 1:
unit view whole continuous filling data task Event 1 Event 2 Event 3 Event 4 Event 5 Event 6
TABLE 1
As can be seen from table 1, when data processing and displaying are performed on a cell view (card view), continuous filling of all data into corresponding controls is performed on a plurality of data contents in the cell view, during which if an event 1 occurs, the event 1 can be responded to and executed only after the completion of all data filling tasks of the cell view, and when the amount of data to be displayed in the cell view is large, a stuck phenomenon easily occurs.
The process of dividing the data contents to be displayed in a unit view into a plurality of blocks and putting the task of data filling the plurality of blocks (abbreviated as a block filling task) into the main thread execution queue by using the method of the present invention is shown in schematic table 2:
Figure BDA0001389497020000101
TABLE 2
As can be seen from table 2, assuming that a unit view is divided into 5 blocks, the block filling tasks 1-5 of the 5 blocks can be put into the main thread execution queue at a time for waiting execution; the block filling task of block 1 may be first put into the main thread execution queue to wait for execution, and when the block filling task of block 1 is completed, the block filling task of block 2 may be put into the main thread execution queue to wait for execution, in this way, until the block filling task of block 4 is completed, the block filling task of block 5 may be put into the main thread execution queue to wait for execution. When data processing and displaying a unit view (card view), the data filling task for tile 1 is performed first, and if event 1 occurs, as shown in table 2, the event 1 is inserted after the tile 1 filling task, and then event 1 can be performed in response to the execution of event 1 only after the data filling task for tile 1 is performed first, instead of waiting for the rendering and displaying tasks of the entire unit view to be completed and then performing event 1. Similarly, when the events 2 and 3 are inserted between the data stuffing task of the block 2 and the data stuffing task of the block 3, and the events 4 and 5 are inserted between the data stuffing task of the block 4 and the data stuffing task of the block 5, the execution of the events 2 and 3 can be directly responded to only after the data stuffing task of the block 2 is executed, and the execution of the events 4 and 5 can be directly responded to after the data stuffing task of the block 4 is executed. The utilization rate of system resources is improved, and the phenomenon of pause caused by other events operated by a user in the process of displaying the unit view is greatly improved.
In addition, an application scenario needs to be considered in practice, in which when a user swipes a page up or down quickly, so that a currently displayed cell view follows a slide-out screen, and if the sliding distance is too long, it may occur that the cell view follows a slide-out screen when it is being displayed in a multiplexed manner by other data content, but not yet displaying part or all of the data content. In addition, the user may also prepare to refresh the currently displayed page by pulling down the refresh mode or clicking the refresh button, and the cell view including the data content being displayed on the page may also need to update the currently displayed data content (assuming that new data is to be updated at this time). In such an application scenario, the first embodiment of the present invention and the method provided by the preferred embodiment thereof need to cancel the data stuffing task that is still queued or the like in the main thread queue associated with the cell view that is moved out of the screen or the cell view that is ready to update the data content.
Thus, the first embodiment of the present invention and its preferred embodiment may further include: and when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents, canceling the task of filling the view control corresponding to the block with the data corresponding to the 1 or more different blocks. In this way, data content in the blocks that have not been displayed need not be processed for display when the cell view is moved completely off the screen or when it is detected that the cell view needs to be multiplexed with other data content.
Wherein the task of canceling the filling of the view control corresponding to the 1 or more different blocks with data corresponding to the different blocks comprises: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
The unit view described herein needs to be multiplexed with other data content including: the data content currently displayed on the cell view needs to be replaced by new data content.
Through simulation experiments, by adopting the unit view display method, the curve for displaying the cpu resource occupation situation has a relatively long and gentle curve, no obvious cpu resource occupation peak exists, and the relatively gentle curve for displaying the cpu resource occupation situation shows that the cpu resource occupation is balanced and the phenomenon of pause is not easy to occur.
According to the unit view display method, the unit view with large data volume and complexity is divided into the blocks, the data filling tasks of the blocks are respectively placed into the main thread queue to be queued for execution, and other task events can be allowed to be inserted between the data filling tasks of any 2 or more blocks, so that the utilization rate of system resources is improved, and the karton phenomenon caused by other events operated by a user in the unit view display process is greatly improved. In addition, when the unit view completely leaves the screen or the display data of the unit view is multiplexed, if the unprocessed data filling task is still in the main thread queue, the data filling task is cancelled in time, so that the occupation of system resources is saved, the stuck phenomenon in the list sliding or refreshing process is greatly improved, and the page display fluency is improved.
Fig. 2 is a schematic block diagram of an apparatus for displaying a cell view according to a second embodiment of the present invention. As shown in fig. 2, the apparatus for displaying a unit view of the present invention includes:
the data acquisition module is used for acquiring data contents to be filled in the unit view;
a tile dividing module for dividing the unit view into 1 or more different tiles based on the role of the data content and the number of data contents repeatedly used for the same role;
and the view display module is used for generating corresponding 1 or more view controls based on the data content to be displayed of the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block so as to display the unit view.
Wherein the block division module is configured to:
when the role of the data content is 1 and a plurality of data contents are not repeatedly used for the role, directly dividing the unit view into 1 block;
when the role of the data content is 1 but has a plurality of data contents repeated for the role, or when the role of the data content is 2 or more and no plurality of data contents are repeated for the 2 or more roles, or when the role of the data content is 2 or more and has a plurality of data contents repeated for 1 or more roles therein, the unit view is divided into a plurality of different blocks based on the role of the data content and the number of data contents repeated for the same role.
The view display module is used for putting data filling tasks of 1 or more different blocks to be processed into a thread queue to be queued for execution; specifically, a plurality of filling tasks of a plurality of blocks to be processed are placed into a thread queue at one time to be queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued. In addition, other task events can be inserted between any 2 or more blocks of data fill tasks queued for execution by the thread queue, either 1 or more other tasks.
On the basis of the second embodiment and its preferred embodiments, there is also provided a preferred embodiment, that is, the apparatus for displaying a view of a unit further includes:
and the filling task canceling module is used for canceling the task of filling the data corresponding to the 1 or more different blocks into the view control corresponding to the block when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents.
The task canceling mode comprises the following steps: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
It is clear to those skilled in the art that for the convenience and brevity of description, the specific operation of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, the example illustrated in the foregoing method embodiment and the related description, which are also applicable to explain the operation of the apparatus, and will not be repeated here.
According to the device for displaying the unit view, the unit view with large data volume and complexity is divided into the plurality of blocks, and the data filling tasks of the blocks are respectively placed into the main thread queue to be queued for execution, so that other task events can be inserted between the data filling tasks of any 2 or more blocks, the utilization rate of system resources is improved, and the pause phenomenon caused by other events operated by a user in the unit view display process is greatly improved. In addition, when the unit view completely leaves the screen or the display data of the unit view is multiplexed, if the unprocessed data filling task is still in the main thread queue, the data filling task is cancelled in time, so that the occupation of system resources is saved, the stuck phenomenon in the list sliding or refreshing process is greatly improved, and the page display fluency is improved.
The third embodiment of the present invention further provides an interface display method, including:
and filling the data content to be displayed into each unit view in the list view on the interface for displaying by adopting the method according to the first embodiment and the preferred embodiment.
The present invention further provides a computer program product of a method for displaying a cell view, including a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, which is not described herein again.
To this end, the present invention also provides a storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to the first embodiment and its preferred embodiments described above.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a smart tablet, a smart phone, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (12)

1. A method of displaying a cell view, comprising:
acquiring data content to be filled in the unit view;
dividing the unit view into 1 or more different blocks based on the role of the data content and the number of data contents repeated for the same role;
generating 1 or more corresponding view controls based on the data content to be displayed in the 1 or more different blocks, and sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, thereby displaying the cell view, wherein in the step of sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, the data filling tasks of the 1 or more different blocks to be processed are put into a thread queue to be queued for execution, the method further comprises:
inserting a task event occurring during execution of a data stuffing task for a block behind the data stuffing task for the block in the thread queue;
the task event is executed directly after the data stuffing task for the block is executed.
2. The method according to claim 1, wherein in the step of dividing the unit view into 1 or more different blocks based on the role of the data contents and the number of data contents repeated for the same role, comprises:
when the role of the data content is 1 and a plurality of data contents are not repeatedly used for the role, directly dividing the unit view into 1 block;
when the role of the data content is 1 but has a plurality of data contents repeated for the role, or when the role of the data content is 2 or more and no plurality of data contents are repeated for the 2 or more roles, or when the role of the data content is 2 or more and has a plurality of data contents repeated for 1 or more roles therein, the unit view is divided into a plurality of different blocks based on the role of the data content and the number of data contents repeated for the same role.
3. The method of claim 1, wherein a plurality of fill tasks for a plurality of pending blocks are placed in a thread queue at a time and queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued.
4. The method according to one of claims 1-3, further comprising: and when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents, canceling the task of filling the view control corresponding to the block with the data corresponding to the 1 or more different blocks.
5. The method according to claim 4, wherein the step of canceling the task of populating the view control corresponding to the 1 or more different tiles with data corresponding to the 1 or more different tiles comprises: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
6. An interface display method, comprising:
filling data content to be displayed into each unit view in the list view on the interface for displaying by adopting the method according to one of claims 1 to 5.
7. An apparatus to display a cell view, comprising:
the data acquisition module is used for acquiring data contents to be filled in the unit view;
a tile dividing module for dividing the unit view into 1 or more different tiles based on the role of the data content and the number of data contents repeatedly used for the same role;
a view display module for generating corresponding 1 or more view controls based on the data content to be displayed for the 1 or more different tiles, and sequentially filling data to be displayed corresponding to the 1 or more different tiles into the view control corresponding to the tile, thereby displaying the cell view, wherein, in the step of sequentially filling the data to be displayed corresponding to the 1 or more different blocks into the view control corresponding to the block, the view display module puts data filling tasks of 1 or more different blocks to be processed into a thread queue to be queued for execution, and the view display module inserts task events occurring during the execution of the data filling task of the block into the thread queue after the data filling task of the block is executed, and directly executes the task events after the data filling task of the block is executed.
8. The apparatus of claim 7, wherein the block partitioning module is configured to:
when the role of the data content is 1 and a plurality of data contents are not repeatedly used for the role, directly dividing the unit view into 1 block;
when the role of the data content is 1 but has a plurality of data contents repeated for the role, or when the role of the data content is 2 or more and no plurality of data contents are repeated for the 2 or more roles, or when the role of the data content is 2 or more and has a plurality of data contents repeated for 1 or more roles therein, the unit view is divided into a plurality of different blocks based on the role of the data content and the number of data contents repeated for the same role.
9. The apparatus according to claim 7, wherein the view display module is configured to put a plurality of filling tasks for a plurality of to-be-processed tiles into a thread queue at a time to be queued for execution; or, the filling task of one block to be processed is put into the thread queue to be queued at one time, and the filling task of another block to be processed is put into the thread queue to be queued after the filling task of the block to be processed is completed, so that the filling task of the last block to be processed is put into the thread queue to be queued.
10. The apparatus according to any one of claims 7-9, further comprising:
and the filling task canceling module is used for canceling the task of filling the data corresponding to the 1 or more different blocks into the view control corresponding to the block when the unit view is completely moved out of the screen or the unit view is detected to be multiplexed by other data contents.
11. The apparatus of claim 10, wherein the means for canceling a task comprises: deleting data filling tasks which are not executed in the data filling tasks of the 1 or more different blocks.
12. A memory device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to any one of claims 1 to 5.
CN201710742903.0A 2017-08-25 2017-08-25 Method and device for displaying unit view Active CN107479960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710742903.0A CN107479960B (en) 2017-08-25 2017-08-25 Method and device for displaying unit view

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710742903.0A CN107479960B (en) 2017-08-25 2017-08-25 Method and device for displaying unit view

Publications (2)

Publication Number Publication Date
CN107479960A CN107479960A (en) 2017-12-15
CN107479960B true CN107479960B (en) 2021-02-19

Family

ID=60602507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710742903.0A Active CN107479960B (en) 2017-08-25 2017-08-25 Method and device for displaying unit view

Country Status (1)

Country Link
CN (1) CN107479960B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334393B (en) * 2018-01-10 2021-11-26 武汉斗鱼网络科技有限公司 iOS end view resource multiplexing method, storage medium, equipment and system
CN111724453A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Rich text rendering method and device, terminal equipment and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102236550A (en) * 2010-04-30 2011-11-09 微软公司 Software development tool
CN102236551A (en) * 2010-04-30 2011-11-09 微软公司 Software development tool

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7137117B2 (en) * 2000-06-02 2006-11-14 Microsoft Corporation Dynamically variable idle time thread scheduling
CN1601916A (en) * 2004-10-10 2005-03-30 倚天资讯股份有限公司 Hand-held electronic device and its operation displaying method
KR20110063297A (en) * 2009-12-02 2011-06-10 삼성전자주식회사 Mobile device and control method thereof
CN103902197A (en) * 2012-12-28 2014-07-02 北京新媒传信科技有限公司 Method and device for displaying data based on list displaying in Android system
CN104881409B (en) * 2014-02-27 2018-04-20 北京方捷软件有限公司 A kind of method and device of document loading
CN105653610A (en) * 2015-12-25 2016-06-08 数源科技股份有限公司 Method for rapidly displaying large-volume data information
CN105938440A (en) * 2015-12-28 2016-09-14 乐视移动智能信息技术(北京)有限公司 Picture display method and system for mobile terminal
FI127227B (en) * 2016-01-04 2018-01-31 Trimble Solutions Corp Display area control area
CN106990946A (en) * 2016-01-21 2017-07-28 阿里巴巴集团控股有限公司 A kind of interface processing method, device and intelligent terminal
CN107066244B (en) * 2016-12-12 2020-12-18 阿里巴巴(中国)有限公司 Method and device for generating application interface of mobile terminal
CN106933527A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of display control method of mobile terminal, device and mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102236550A (en) * 2010-04-30 2011-11-09 微软公司 Software development tool
CN102236551A (en) * 2010-04-30 2011-11-09 微软公司 Software development tool

Also Published As

Publication number Publication date
CN107479960A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
CN107341018B (en) Method and device for continuously displaying view after page switching
CN110049456B (en) Method and device for displaying rich media on mobile terminal and mobile terminal
US20110197165A1 (en) Methods and apparatus for organizing a collection of widgets on a mobile device display
CN105867714B (en) Application program method for down loading, apparatus and system
US9092131B2 (en) Highlighting of tappable web page elements
US20210160553A1 (en) Method and system of displaying a video
CN110007829B (en) Content display method, device, terminal and storage medium
CN106325687B (en) Method and terminal for calling program
CN113553507B (en) Interest tag-based processing method, device, equipment and storage medium
CN105335383B (en) Input information processing method and device
CN105224318B (en) information processing method and electronic equipment
US20170171277A1 (en) Method and electronic device for multimedia recommendation based on android platform
CN106095816B (en) Information delivery method and device
CN111124668A (en) Memory release method and device, storage medium and terminal
CN107479960B (en) Method and device for displaying unit view
CN111966860A (en) Audio playing method and device and electronic equipment
CN106708478B (en) Scroll view display method and apparatus
CN111324398B (en) Method, device, terminal and storage medium for processing latest content
CN109683760B (en) Recent content display method, device, terminal and storage medium
CN112148395A (en) Page display method, device, equipment and storage medium
CN111857480B (en) Icon alignment method and device, storage medium and electronic equipment
CN117555459A (en) Application group processing method and device, storage medium and electronic equipment
CN113342755A (en) Display control method and device
CN106716980A (en) Method for displaying view and terminal device
CN113784194A (en) Embedding method and device of video player

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200903

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 15 layer self unit 02

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant