CN108334251B - View multiplexing method and device - Google Patents

View multiplexing method and device Download PDF

Info

Publication number
CN108334251B
CN108334251B CN201710039525.XA CN201710039525A CN108334251B CN 108334251 B CN108334251 B CN 108334251B CN 201710039525 A CN201710039525 A CN 201710039525A CN 108334251 B CN108334251 B CN 108334251B
Authority
CN
China
Prior art keywords
view
identifier
queue
page
displayed
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
CN201710039525.XA
Other languages
Chinese (zh)
Other versions
CN108334251A (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 Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710039525.XA priority Critical patent/CN108334251B/en
Publication of CN108334251A publication Critical patent/CN108334251A/en
Application granted granted Critical
Publication of CN108334251B publication Critical patent/CN108334251B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Abstract

The application discloses a view multiplexing method and a view multiplexing device, wherein when a client monitors that a first page deviates in a terminal screen, a view identifier of a view to be displayed in the terminal screen is determined through a view container provided for displaying the first page, the client can search a view matched with the view identifier from a view multiplexing pool according to the view identifier of the view to be displayed, and the view is displayed on the terminal screen in a view multiplexing mode. The client can manage each view in the page through the view container arranged in the client, and does not use the view container arranged in the system to manage each view, so that when the client needs to multiplex the view from the view multiplexing pool, the client does not need to multiplex the view and the component corresponding to the view together, but can multiplex the view separately through the view container provided by the client, and the multiplexing rate of the view is greatly improved.

Description

View multiplexing method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for view multiplexing.
Background
Currently, each service platform successively provides its own Application (App), and a user can complete processing of each service through pages displayed by the apps at any time and any place, thereby bringing a brand-new implementation way for the user to process the service.
In practical application, in the process of displaying a page to a user, an App needs to acquire, from a server, page information such as view information of each view included in the page and identifier of each component displaying each view, and the App can determine, according to the acquired page information, a component rendering each view in the page from a preset component library and render each view in the page according to the view information included in the page information.
Limited by the size of the terminal screen, when the App displays the page, the App only renders the currently displayed page content in the terminal screen, and when the page content of other parts of the page to be displayed needs to be converted from the hidden state to the display state, the App renders and displays the part of the page content.
For the views in the hidden state, the App places the views in the hidden state in the view multiplexing pool through a view container and a view multiplexing pool which are built in the system (the views in the hidden state refer to views which are displayed before and are not displayed in a terminal screen at the moment), and when the views need to be displayed again, the views are directly multiplexed from the view multiplexing pool without acquiring page information corresponding to the views again from a server, so that the page display efficiency is improved.
In the prior art, each view in a page and each component corresponding to each view are usually bound and managed by a built-in view container, so when an App places a view in a hidden state in a view multiplexing pool through the built-in view container of a system, the view and a component rendering the view are usually placed in the view multiplexing pool in a close coupling manner, and therefore, when the App multiplexes the view in the view multiplexing pool through the view container, the view and the component also need to be multiplexed together, that is, the view cannot be multiplexed separately, so that the existing view multiplexing method cannot meet the requirement of the App for multiplexing the view separately, and thus the view multiplexing rate is reduced.
Disclosure of Invention
The embodiment of the application provides a view multiplexing method and device, which are used for solving the problem that the view multiplexing rate of an App is reduced in a view multiplexing mode in the prior art.
The embodiment of the application provides a view multiplexing method, which comprises the following steps:
providing a view container, wherein the view container comprises the corresponding relation between the view in the page and the component used by the view;
when the situation that the first page deviates in the terminal screen is monitored, determining a view identifier of a view to be displayed in the terminal screen through the view container;
and searching the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed, and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, wherein the view multiplexing pool is used for recovering the view which is changed from a display state to a hidden state.
The embodiment of the application provides a view multiplexing device, which is used for solving the problem that the view multiplexing rate of an App is reduced in a view multiplexing mode in the prior art.
The embodiment of the application provides a view multiplexing device, which comprises:
the container providing module is used for providing a view container, and the view container comprises the corresponding relation between the view in the page and the components used by the view;
the determining module is used for determining a view identifier of a view to be displayed in the terminal screen through the view container when the situation that the first page deviates in the terminal screen is monitored;
and the view multiplexing module is used for searching the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, wherein the view multiplexing pool is used for recovering the view changed from the display state to the hidden state.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
in the embodiment of the application, in the process of page display, the client can manage each view in the page through the view container arranged in the client, and does not use the view container built in the system to manage each view, so that in the embodiment of the application, when the client needs to multiplex the view from the view multiplexing pool, the client does not need to multiplex the view and the component corresponding to the view together, but can multiplex the view separately through the view container provided by the client, and compared with the prior art, the multiplexing rate of the view is greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a view multiplexing process provided in an embodiment of the present application;
fig. 2 is a schematic page display diagram of a client according to an embodiment of the present application;
FIG. 3 is a schematic diagram of determining a position of each view in a first page according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a first page shifting after a user performs a sliding operation on a terminal screen according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a detailed process of view multiplexing provided in an embodiment of the present application;
fig. 6 is a schematic process diagram for determining a to-be-displayed view and a hidden view according to an embodiment of the present application;
fig. 7 is a schematic diagram of a data acquisition apparatus according to an embodiment of the present application.
Detailed Description
In order to achieve the purpose of the present application, an embodiment of the present application provides a method and an apparatus for view multiplexing, in the method, when a client monitors that a first page deviates in a terminal screen, a view identifier of a view to be displayed in the terminal screen is determined through a view container provided for displaying the first page, and the client can search a view matched with the view identifier from a view multiplexing pool according to the view identifier of the view to be displayed, and display the view on the terminal screen in a manner of multiplexing the view. In the process of page display, the client can manage each view in the page through the view container arranged in the client, and does not use the view container arranged in the system to manage each view, so in the embodiment of the application, when the client needs to multiplex the view from the view multiplexing pool, the client does not need to multiplex the view and the component corresponding to the view together, but can multiplex the view separately through the view container provided by the client, and compared with the prior art, the multiplexing rate of the view is greatly improved.
In the embodiment of the present application, the first page does not refer to a single page displayed on the terminal screen, and the single page displayed on the terminal screen is usually only a part of the first page, so that the first page mentioned herein refers to an entire page that can be browsed by a user by sliding on the terminal screen without jumping to the page.
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic diagram of a view multiplexing process provided in an embodiment of the present application, which specifically includes the following steps:
s101: a view container is provided that contains a correspondence between views in a page and components used by the views.
In practical applications, if the page presented to the user by the client does not jump, the content of the page presented to the user by the client (the content of the page is composed of views) is usually unchanged, in other words, on the premise that the page does not jump, when a user slides the page on the terminal screen, the content of the page displayed on the terminal screen changes, but the content of the page hidden in the terminal screen does not change, for the page contents that the user browses before, the user can hide the part of the page contents in the terminal screen by sliding the terminal screen, and browse other page contents, when the user slides the page back on the terminal screen, however, the content of the page is re-displayed in the terminal screen, that is, when the user slides the page back on the terminal screen, the page content seen will be the same as the page content seen previously.
In view of this, in the prior art, the client performs management of view multiplexing using a view container built in the system, and is implemented only by standing at a point where the page content does not change. Since the page content previously browsed by the user is already placed in the view multiplexing pool by the view container built in the system, when the user slides back the page to browse the page content previously displayed by the client in the terminal screen, the client can multiplex each view and components thereof contained in the page content from the view multiplexing pool through the view container built in the system, and then display the previously displayed page content again.
In the prior art, when a client performs view multiplexing through a view container built in a system, only views and corresponding components thereof can be multiplexed together, so view multiplexing in the prior art can be understood as local area multiplexing of a page, as shown in fig. 2.
Fig. 2 is a schematic page display diagram of a client according to an embodiment of the present application.
In fig. 2, the dashed areas are one large component, in which 6 views are respectively shown, and when the user slides the page upwards on the terminal screen, the 6 views will be hidden together with the component at the upper end of the terminal screen, and at this time, the client will place the 6 views and the component thereof in the view multiplexing pool in tight coupling through the built-in view container of the system. And when the user slides the page downwards on the terminal screen, the 6 views and the components thereof which are hidden at the upper end of the terminal screen are also redisplayed in the terminal screen, in the process, the client terminal multiplexes the 6 views and the components thereof from the view multiplexing pool through a view container built in the system, and then the 6 views are redisplayed in the terminal screen. Therefore, from the perspective of the whole page, the 6 views and their components occupy a part of the whole page, and therefore, in the prior art, the client multiplexes the 6 views and their components together through the view container built in the system is equivalent to multiplexing a part of the page locally.
However, in practical applications, the client often encounters a situation where a view needs to be multiplexed separately. For example, assuming that the client currently displays the view a in the terminal screen, the user slides the terminal screen to slide the view a out of the terminal screen, at this time, the client places the view a and its components in the view multiplexing pool in close coupling manner through a view container built in the system, so as to be reused subsequently. And when the user continues to slide the terminal screen, the client monitors that the view A needs to be displayed in the terminal screen again through other components, and at the moment, the client needs to multiplex the view A from the view multiplexing pool. However, since the view a and its components are tightly coupled together in the view multiplexing pool, and if the client needs to multiplex the view a, the client needs to multiplex the view a and its components together, but the components used by the client to display the view a in the terminal screen at this time are different from the components corresponding to the view a stored in the preset multiplexing pool, so for this situation, the client cannot multiplex the view a in the preset multiplexing pool individually, thereby reducing the view multiplexing rate.
In order to effectively solve the problem, in the embodiment of the present application, the client may provide a view container for the page display process, where the view container may be preset in the client by a client developer, and the view container is different from a view container built in the system, and the view container built in the system only allows the client to multiplex a view and its components together.
In the prior art, the multiplexing of views is performed with respect to the content of a page that has been previously displayed, which is why a view container built in the system needs to multiplex the views and their components together. In the embodiment of the present application, the view multiplexing of the client is performed not only for the previously displayed page content, but also for the case that the previously displayed view is included in the page content to be displayed (the page content to be displayed does not include the previously displayed page content), so that, compared with the prior art, in the embodiment of the present application, the process of determining which views to display, multiplex, and place in the view multiplexing pool by the client according to the sliding operation of the user on the terminal screen is relatively complicated.
In order to accurately determine which view to reuse according to the operation of the user on the terminal screen, in the embodiment of the application, the view container provided by the client needs to determine the layout condition of each view in the whole page, and further, according to the determined actual layout of each view in the whole page, which view to reuse is accurately determined according to the operation of the user on the terminal screen.
Specifically, when the client determines that the specified page needs to be displayed to the user according to the specified operation of the user, the client may send a page content obtaining request for obtaining the specified page to the server, and after receiving the page content obtaining request, the server may return corresponding page information to the client, where the page information includes each view included in a first page (i.e., the specified page) to be displayed by the client, a component identifier of a component used when the client displays each view, and a layout of each view in the first page. The client may determine, according to the acquired page information, view identifiers of the views included in the first page and location information of the views in the first page, and further store the view identifiers of the views and the location information of the views in the first page in a view container provided by the client in a corresponding manner. The client can store the view identifier of each view and the position information of each view in the first page in a view container provided by the client in a value assignment mode.
The assignment form here can be understood as: the view container provided by the client may be a piece of code, which is used to manage page information such as views in a first page, components corresponding to the views, and position information of the views in the first page, where the view container initially does not include the page information but is only a code frame, and the client may add, in displaying the first page, the view included in the first page, the components corresponding to the views, and the position information of the views in the first page, which are acquired from the server, to a corresponding position in the code frame, in a process equivalent to storing the views, the components corresponding to the views, and the position information of the views in the first page in an assignment form in the view container, so that the view container manages the page information of the first page.
Of course, in the embodiment of the present application, the client may also determine, according to the acquired page information, view identifiers of the views included in the first page to be displayed and position information of the views on the first page, and then create a corresponding view container according to the determined view identifiers and the position information of the views, so that the client can accurately determine, in a subsequent process, the view identifiers of the views to be multiplexed through the view container.
It should be noted that, the specified page to be displayed by the client according to the specified operation performed by the user may be: when a user clicks the icon of the client in a terminal screen, the client can monitor that the user executes starting appointed operation on the client, and further determine that a home page of the client needs to be displayed to the user, wherein the home page is a first page.
Of course, in the application embodiment, when the user clicks the page jump control in the page displayed by the client, the client may monitor the operation of the user designating the page jump, and then determine that the page needing to jump is displayed to the user, where the page mentioned here as the jump page is the first page.
In practical application, an area surrounded by the components in the page is generally a rectangular area, and accordingly, the views obtained through component rendering are also generally rectangular, so that when determining the position of each view in the first page, the client may establish a rectangular coordinate system with a certain position in the first page according to the obtained layout of each view in the first page, and determine the position of each view in the first page by determining coordinate values of four sides of each view, where the coordinate values of four sides of each view are the determined position information of each view in the first page, as shown in fig. 3.
Fig. 3 is a schematic diagram for determining a position of each view in a first page according to an embodiment of the present application.
In fig. 3, the client may construct a rectangular coordinate system as shown in fig. 3 with the upper left corner of the first page as the origin of coordinates, so that the coordinates of the four sides of each view can be determined by the rectangular coordinate system, thereby obtaining the position information of each view in the first page.
S102: and when the situation that the first page deviates in the terminal screen is monitored, determining a view identifier of a view to be displayed in the terminal screen through the view container.
In practical application, due to the influence of the size of the terminal screen, the terminal screen can only display part of the page content, and in order to view the page content displayed on the whole page, a user generally needs to slide the page on the terminal screen, so that the page content of other parts can be slid onto the terminal screen for display. Therefore, during the page display process, the client needs to monitor the movement condition on the terminal screen in the first page in real time, so as to determine which views should be displayed in the terminal screen and which views should be hidden.
When the client monitors that the user performs the sliding operation on the terminal screen, the client can perform corresponding sliding on the first page on the terminal screen according to the sliding operation of the user, and in the process of sliding the first page, the client can determine the offset of the first page relative to the previous state, as shown in fig. 4.
Fig. 4 is a schematic diagram illustrating that a first page is shifted after a user performs a sliding operation on a terminal screen according to an embodiment of the present application.
It is assumed that, at the present moment, the display state of the first page on the terminal screen is shown by the dotted line area in fig. 4, and then, the user slides the first page upward in the terminal screen so that the display state of the first page in the terminal screen transitions to the display state shown by the implementation area due to the display state shown by the dotted line area, wherein the display state shown by the dotted line area belongs to the previous state of the first page on the terminal screen with respect to the display state shown by the first page in the terminal screen shown by the implementation area. In fig. 4, the distance between the top of the implementation area and the top of the dashed area is an offset of the current display state of the first page relative to the previous display state when the client determines that the user slides the first page on the terminal screen this time.
When the client determines the offset generated after the first page is offset on the terminal screen, the client can further determine the view identifier of the view to be displayed, which needs to be displayed in the terminal screen after the first page is offset this time, according to the offset and the view container provided by the client.
In order to accurately determine the view identifier of the view to be displayed, which needs to be displayed on the terminal screen, according to the offset, in this embodiment of the present application, before determining the view identifier of the view to be displayed, the client may arrange the view identifiers of the views included in the first page in an ascending order according to the size of the first coordinate of the determined location information of the views, so as to obtain a first view identifier queue, and in the same manner, the client may arrange the view identifiers of the views included in the first page in a descending order according to the size of the second coordinate of the determined location information of the views, so as to obtain a second view identifier queue, where the first coordinate mentioned here may be a coordinate of a top edge of each view in the first page, and the second coordinate may be the coordinate of the bottom edge of each view in the first page.
The client can store the obtained first view identification queue and the second view identification queue in a view container provided by the client, so that in the subsequent process, the view identification of the view to be displayed, which needs to be displayed in the terminal screen, is accurately determined through the view container and the determined offset.
It should be noted that, the above-mentioned manner of determining the first view identifier queue and the second view identifier queue is mainly performed when the user slides the first page vertically, because in practical applications, when the user browses most of pages, the user only needs to slide (i.e. vertically slide) the pages in the terminal screen up and down, so that the browsing of the whole page can be realized. Therefore, for this case, when determining the first view identification queue and the second view identification queue, the client determines the coordinates of the top edge and the bottom edge of the view, that is, the first coordinate is the coordinate of the top edge of the view in the first page, and the second coordinate is the coordinate of the bottom edge of the view in the first page.
Of course, for the first page capable of sliding left and right on the terminal screen, in this embodiment of the application, the client may also determine the first view identifier queue and the second view identifier queue respectively by using the coordinates of the left and right sides of each view, for example, the client may use the coordinates of the left side of the view in the first page as the first coordinates, and perform ascending arrangement on the view identifiers of each view according to the size of the first coordinates of each view to obtain the first view identifier queue, and the client may further use the coordinates of the right side of the view in the first page as the second coordinates, and perform descending arrangement on the view identifiers of each view according to the size of the second coordinates of each view to obtain the second view identifier queue.
In addition, for a first page that can slide up and down in the terminal screen and can also slide left and right on the terminal screen, in this embodiment of the application, the client may also determine the first view identifier longitudinal queue, the second view identifier longitudinal queue, the first view identifier transverse queue, and the second view identifier transverse queue respectively according to the coordinates of the left and right sides of each view and the coordinates of the upper and lower sides of each view, and store the obtained four view identifier queues in a view container provided by the client, so that in a subsequent process, the view identifier of the view to be displayed is accurately determined according to the four view identifier queues and the determined offset of the page.
It should be noted that, in the embodiment of the present application, the first coordinate and the second coordinate are opposite, that is, when the first coordinate is a coordinate of the top side of the view in the first page, the second coordinate is a coordinate of the bottom side of the view in the first page; and when the first coordinate is the coordinate on the left side of the view in the first page, the second coordinate is the coordinate on the right side of the view in the first page. Of course, the first coordinate may also be the coordinate of the bottom edge of the view in the first page, and correspondingly, the second coordinate may be the coordinate of the top edge of the view in the first page, and when the first coordinate is the coordinate of the right edge of the view in the first page, the second coordinate is the coordinate of the left edge of the view in the first page.
When the client determines the offset of the first page on the terminal screen according to the monitored sliding operation executed by the user on the terminal screen, the client needs to respectively determine a third view identification queue and a fourth view identification queue from the first view identification queue and the second view identification queue according to the offset, and determine which views need to enter the terminal screen for displaying and which views need to be removed from and hidden in the terminal screen after the first page is subjected to the offset on the terminal screen through the determined third view identification queue and the determined fourth view identification queue.
Specifically, after determining the offset, the client may determine that the top edge of the terminal screen is located at the coordinate of the first page when the first page is not offset in the terminal screen, where the coordinate may be referred to as a third coordinate. The client can determine a fourth coordinate according to the third coordinate and the offset, wherein the fourth coordinate refers to: and after the first page is subjected to the offset, coordinates of the top end of the terminal screen in the first page are located.
It should be noted that, the above-described manners of determining the third coordinate and the fourth coordinate are performed in a case that the first page can only slide up and down on the terminal screen, and for the page that can only slide left and right on the terminal screen, the third coordinate and the fourth coordinate manner and the above-described types are determined, that is, when the client can determine that the first page is not shifted in the terminal screen, the left side (or the right side) of the terminal screen is located at the coordinate of the first page, which is the third coordinate, and the fourth coordinate can be determined based on the third coordinate and the offset.
Of course, for the page that can slide up and down or left and right on the terminal screen, the client may determine the coordinate of the top edge and the right edge (of course, the combination of other edges may be also possible, as long as the two edges of the combination are ensured to be perpendicular to each other) of the first page before the first page is not shifted, and the coordinate is the third coordinate. And after determining the offset, the client can decompose the offset to obtain the longitudinal offset and the transverse offset of the first page on the terminal screen at this time, and determine a corresponding fourth coordinate according to the longitudinal offset, the transverse offset and the third coordinate.
In order to easily and clearly describe the embodiment of the present application, how to determine the third view identification queue and the fourth view identification queue is described below only in a case where the first page can only slide vertically on the terminal screen.
After determining the third coordinate and the fourth coordinate, the client may determine the longitudinal length of the terminal screen, and further determine a sum of the longitudinal length of the terminal screen and the fourth coordinate, and then, the client may determine a first view identifier whose top-side coordinate (i.e., the first coordinate) matches the sum from the first view identifier queue, and determine a third view identifier queue through view identifiers located before the first view identifier in the first view identifier queue, that is, the third view identifier queue is formed by view identifiers located before the first view identifier in the first view identifier queue.
In the process of determining the fourth view identifier queue, the client may determine, through the fourth coordinate, a second view identifier whose bottom coordinate (i.e., the second coordinate) matches the fourth coordinate from the second view identifier queue, and determine the fourth view identifier queue through view identifiers located before the second view identifier in the second view identifier queue, that is, the fourth view identifier queue is formed by view identifiers located before the second view identifier in the second view identifier queue.
It should be noted that, when determining that the sum is matched with each top edge coordinate in the first view identifier queue, the client may determine that the sum is matched with each top edge coordinate by determining a difference between the sum and each top edge coordinate, and when the difference between the sum and a certain top edge coordinate is smaller than a set threshold, determine that the top edge coordinate is matched with the sum. Similarly, the same method may be used to determine the bottom edge coordinate in the second view identifier queue, which matches the fourth coordinate.
Of course, the client may also use other algorithms to determine the top edge coordinate matched with the sum in the first view identifier queue, for example, calculate the distance between two points, the variance, and the like, which is not described herein again. Likewise, other algorithms may be used by the client to determine the bottom coordinate that matches the fourth coordinate in the second view identification queue.
After the client determines the third view identifier queue and the fourth view identifier queue, the client may further determine an intersection of the two view identifier queues, and determine, according to each view identifier included in the intersection and the view identifier of each view displayed in the terminal screen before the first page is not subjected to the offset, the view identifier of each view that the terminal screen should display after the first page is subjected to the offset.
Since the first page is not shifted before, there may be an overlapping portion between each view displayed in the terminal screen and each view displayed in the terminal screen after the shift of the first page, in other words, a portion of the view still remains in the terminal screen after the shift of the first page on the terminal screen.
Therefore, in order to determine that the first page is shifted this time, the view to be displayed needs to be added to the terminal screen for display, and the view needs to be moved out of the terminal screen and hidden.
Then, the client may prune the determined view identifier still remaining on the terminal screen from the intersection (where the intersection is the intersection before the third view identifier queue and the fourth view identifier queue), and further obtain the view identifier of the view to be displayed, which needs to be added to the terminal screen for displaying after the first page is subjected to the current offset on the terminal screen, that is, determine the view identifier of the view to be displayed in the terminal screen after the first page is subjected to the current offset on the terminal screen.
The client may remove the determined view identifier still remaining on the terminal screen from the view identifiers of the views displayed in the terminal screen before the first page is not subjected to the offset, so as to obtain the view identifier of the view that needs to be moved out of the terminal screen after the first page is subjected to the offset on the terminal screen, that is, determine the view identifier of the view to be hidden in the terminal screen after the first page is subjected to the offset on the terminal screen.
It should be noted that, in practical applications, there is usually more than one view of the first page in the transverse direction, i.e. a row of the first page contains multiple views. Therefore, for the case that the first page can only slide vertically on the terminal screen, the client determines more than one view identifier whose top-side coordinate (i.e. the first coordinate) matches the sum (i.e. the sum of the fourth coordinate and the vertical length of the terminal screen) from the first view identifier queue, and how to determine a designated view identifier from the view identifiers whose top-side coordinates all match the sum, and determine the previous view identifiers before the view identifier as the third view identifier queue, it is relevant to determine whether the view identifier of the view to be displayed on the terminal screen after the first page has undergone the shift on the terminal screen can be accurately determined, and similarly, the determination of the fourth view identifier queue also involves the problem.
Therefore, in this embodiment of the present application, when determining the first view identifier queue, for view identifiers having the same top-side coordinate (i.e., the first coordinate), the client needs to arrange these view identifiers adjacently, and as to which view identifier precedes and which view identifier succeeds, the client does not need to determine, that is, for view identifiers having the same top-side coordinate, the client may arrange these view identifiers randomly, but it is ensured that these view identifiers are adjacent to each other in the first view identifier queue. And for view marks with different top edge coordinates, the view marks are arranged in sequence according to the ascending order of the top edge coordinates.
For example, assuming that there are 8 views with view identifier A, B, C, D, E, F, G, H, in the 8 views, the top edge coordinates of C, F, G of the 3 views are all the same, and if the 3 views are regarded as a whole P, sorting the whole P and the remaining 5 views in ascending order of top edge coordinates will result in B, A, P, E, D, H, i.e., the top edge coordinates increase sequentially. Since the top coordinates of the 3 views in the whole P are the same, the client can randomly sort the 3 views next to each other, and finally get the first view identification queue B, A, F, C, G, E, D, H, where F, C, G is a sort that is random but next to each other.
For the second view identifier queue, when there are view identifiers having the same bottom-side coordinates (i.e., second coordinates), the client may also sort the view identifiers randomly, but to ensure that the view identifiers are adjacent to each other and have different bottom-side coordinates, the client sorts the view identifiers in a descending order of the bottom-side coordinates, so as to obtain the second view identifier queue.
Of course, whether the view identifier is the same as the top-side coordinate (i.e., the first coordinate) or the view identifier is the same as the bottom-side coordinate (i.e., the second coordinate), the client may also sort the view identifiers by identifying the left or right coordinates of the corresponding views.
For example, taking O, I, U views with the same top-side coordinates as an example, the coordinates of the top-side coordinates of the 3 views are the same, but the coordinates of the left side of the 3 views are different, i.e., the 3 views are in the same row in the first page, but have different positions in the first page. Based on this, the client may arrange the 3 views in order from small to large left coordinates, so as to obtain an ordering result as follows: u, O, I, i.e., in the first page, view U is to the left, view O is in the middle, view I is to the right, these 3 views are in the same row.
In addition, the client may also use other manners to sort the view identifiers having the same top coordinate or the same bottom coordinate, only needing to ensure that the view identifiers are adjacent to each other no matter in the first view identifier queue or the second view identifier queue.
For each view identifier in the first view identifier queue, there exists a first queue number in the first view identifier queue for each view identifier, that is, the sequence number of each view identifier in the first view identifier queue. Therefore, when the client determines more than one view identifier whose top-side coordinate (i.e., the first coordinate) matches the sum (i.e., the sum of the fourth coordinate and the longitudinal length of the terminal screen) from the first view identifier queue, the view identifier with the smallest first queue number from among the view identifiers may be determined as the first view identifier whose top-side coordinate matches the sum, that is, the view identifier that is the top-most view identifier in the first view identifier queue among the view identifiers is determined as the first view identifier.
For each view identifier in the second view identifier queue, each view identifier has a second queue number in the second view identifier queue, that is, the sequence number of each view identifier in the second view identifier queue. When the client determines more than one view identifier whose bottom coordinate (i.e., the second coordinate) matches the fourth coordinate from the second view identifier queue, the view identifier with the smallest second queue number among the view identifiers may also be determined as the second view identifier, i.e., the view identifier that is ranked the top in the second view identifier queue among the view identifiers may also be determined as the second view identifier.
After determining the first view identifier from the first view identifier queue, the client may determine each view identifier located before the first view identifier in the first view identifier queue as a third view identifier queue.
After the client determines the third view identifier queue and the fourth view identifier queue, the client may: by determining the view identifiers of the views displayed in the terminal screen before the first page is not subjected to the offset, and determining the intersection between the third view identifier queue and the fourth view identifier queue, it is determined that the view identifiers of the views which need to be added to the terminal screen for display after the first page is subjected to the offset on the terminal screen, that is, the view identifiers of the views to be displayed.
Similarly, the client may further determine the view identifier of the view to be hidden in the terminal screen from the views displayed on the terminal screen before the first page is not subjected to the current offset, that is, after the first page is subjected to the current offset, the view identifier of the view of the terminal screen needs to be moved out.
For view identifiers of views to be hidden in a terminal screen, a client may store views corresponding to the view identifiers and component correspondences corresponding to the views in a view multiplexing pool for subsequent multiplexing. When the client stores the views and the components corresponding to the views in the view multiplexing pool through the view container, the views and the components corresponding to the views are not bound and stored in the preset multiplexing pool, but are correspondingly stored, and the corresponding storage can be understood as follows: in addition to a view set and a component set, a corresponding relationship between a view identifier and a component identifier is stored in the view multiplexing pool, and when a client needs to determine a component corresponding to a certain view, the component corresponding to the view can be determined from each view in the view set through the corresponding relationship, or vice versa.
S103: and searching the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed, and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, wherein the view multiplexing pool is used for recovering the view which is changed from a display state to a hidden state.
After determining the view identifier of the view to be displayed, the client can search whether the view corresponding to the view identifier exists in the view multiplexing pool, if so, the view is multiplexed from the multiplexing pool and displayed, if not, the component matched with the component identifier can be determined from the view multiplexing pool according to the component identifier of the component corresponding to the view to be displayed, and the view to be displayed is rendered and displayed through multiplexing the component and the view acquired from the view container.
Of course, when the client multiplexes the component and finds that the view container only contains the view identifier of the view to be displayed and does not contain the view to be displayed, the client may acquire a corresponding view from the server according to the view identifier of the view to be displayed, and then render and display the view to be displayed through the multiplexed component.
If the client does not find the component corresponding to the component in the view multiplexing pool, the component corresponding to the component can be determined from a component library preset in the client according to the component identifier, and the view to be displayed is rendered and displayed through the component according to the view information of the view to be displayed, which is acquired from the server.
It can be seen from the above method that the client does not need to multiplex the views and their components together from the view multiplexing pool through the view container built in the system, but can multiplex the views or components separately from the view multiplexing pool through the view container improved by the client, thereby greatly improving the view multiplexing rate compared with the prior art.
It should be noted that, in step S102, when determining, from the first view identifier queue, a view identifier whose top-side coordinate (i.e., the first coordinate) matches the sum (i.e., the sum of the fourth coordinate and the longitudinal length of the terminal screen), the client may quickly locate the view identifier by using a binary search method. Similarly, when the client determines the view identifier whose bottom coordinate (i.e., the second coordinate) matches the fourth coordinate from the second view identifier queue, the client may also quickly locate the view identifier by using a binary search method.
Of course, the client may also use other manners in the process of determining the first view identifier and the second view identifier, such as linear lookup, interpolation lookup, Fibonacci lookup, hash lookup, and the like.
In order to further clearly explain the whole view multiplexing process, the method for multiplexing views provided above for the embodiment of the present application will be described below by using a specific example, as shown in fig. 5.
Fig. 5 is a schematic diagram of a detailed process of view multiplexing provided in an embodiment of the present application.
In the embodiment of the present application, the detailed process of view multiplexing can be roughly divided into the following stages: firstly, creating a view container; secondly, establishing a view identification queue; thirdly, determining a view to be displayed; and fourthly, view multiplexing and hiding stages which are gradually explained below.
Firstly, a creating stage of a view container:
s501: and receiving a page display request for displaying the specified page.
When a client monitors that a user clicks an icon of the client on a terminal screen, the client monitors the designated operation of the user on the terminal screen, and further receives a page display request for displaying a home page to the user, wherein the home page is the designated page to be displayed to the user, and the home page is the page displayed to the user by the client at the first time. Certainly, when the client monitors that the user clicks controls for jumping to other pages in the page, it is determined that a page display request for displaying the jumped page to the user is received, where the jumped page is a specified page to be displayed to the user.
S502: and acquiring the page information of the specified page from the server.
After receiving the page display request, the client can send a page information acquisition request for acquiring the page information of the specified page to the server, and the server can return the page information of the specified page to the client according to the page information acquisition request sent by the client. The page information includes view identifiers of views to be displayed on the designated page, component identifiers of components corresponding to the views, and page layout of the views in the designated page.
S503: and creating a view container according to the page information.
After receiving the page information returned by the server, the client may further determine, from the page information, view identifiers of the views included in the specified page and location information of the views in the specified page, where the location information may be specifically represented in a form of coordinates. However, most of the pages are pages that slide vertically on the terminal screen, so in this embodiment of the present application, the position information of each view may specifically be top-side coordinates and bottom-side coordinates of each view in the specified page.
After determining the position information of each view in the designated page, the client may further determine a corresponding relationship between the view identifier of each view and each position information, and in addition, the client may determine, through the component identifier of each component corresponding to each view included in the page information, each component required when the designated page is displayed, and establish a corresponding relationship between each view and each component, where the corresponding relationship mentioned here does not bind the view and its corresponding component. The client can create the view container corresponding to the designated page according to the determined two corresponding relations.
Of course, the view container may also be determined in advance by the client, and when the specified page needs to be displayed, the view container is provided for displaying the specified page, and at this time, the client needs to write the determined two correspondence relationships into the view container in an assignment manner, so that the view container becomes the view container corresponding to the specified page.
Secondly, establishing a view identification queue:
s601: and respectively determining the top edge coordinate of each view in the specified page through the view container.
After the client creates the view container corresponding to the specified page, the top side coordinate of each view in the specified page can be determined through the position information of each view in the specified page, which is contained in the view container, wherein the top side coordinate is determined in the following way: the client may set up a rectangular coordinate system with the upper left corner (or the upper right corner, of course) of the designated page as the origin of coordinates, and determine the top edge coordinates of each view in the rectangular coordinate system.
S602: and arranging the view identifications of the views in an ascending order according to the size of the top edge coordinates to obtain a first view identification queue.
After the client determines the top edge coordinates of each view in the designated page, the view identifiers of each view can be arranged from small to large according to the top edge coordinates, namely, the view identifiers are arranged in an ascending order, and a first view identifier queue is obtained.
S603: and respectively determining the bottom edge coordinates of each view in the specified page through the visual container.
The client may determine the bottom edge coordinates of each view in the designated page by determining the top edge coordinates, the specific process is the same as that in step S601, and details are not described here.
S604: and arranging the view identifiers of the views in a descending order according to the size of the bottom edge coordinates to obtain a second view identifier queue.
After the client determines the coordinates of the bottom edges of the views in the designated page, the view identifiers of the views can be arranged from large to small according to the coordinates of the bottom edges, namely, the view identifiers are arranged in a descending order, and a second view identifier queue is obtained.
The client can store the determined first view identification queue and the determined second view identification queue in the view container, so that in the subsequent process, the view identification of the view to be displayed on the terminal screen is determined through the first view identification queue and the second view identification queue.
Thirdly, determining a view to be displayed:
s701: and when the specified page is monitored to deviate on a terminal screen, determining the deviation of the specified page.
When the client monitors that the user slides the appointed page on the terminal screen, the offset generated in the process that the appointed page is offset on the terminal screen can be monitored. In this embodiment of the present application, since the designated page refers to a page that can only slide vertically on the terminal screen, the offset of the designated page on the terminal screen, which is monitored by the client, is substantially a vertical offset.
S702: and determining a third view identification queue according to the offset and the first view identification queue.
After determining the offset, the client may find a top-side coordinate matching the sum of the offset and the longitudinal length of the terminal screen from the first view identifier queue included in the view container, and determine the view identifier corresponding to the top-side coordinate as the first view identifier matching the sum. Then, the client may determine each view identifier in the first view identifier queue before the first view identifier as a third view identifier queue.
S703: and determining a fourth view identification queue according to the offset and the second view identification queue.
The client may further find the bottom coordinate matched with the offset from the second view identifier queue included in the view container, and determine the view identifier corresponding to the bottom coordinate as the second view identifier matched with the offset. Then, the client may determine each view identifier in the second view identifier queue before the second view identifier as a fourth view identifier queue.
S704: and determining the view identifier of the view to be displayed on the terminal screen according to the third view identifier queue, the fourth view identifier queue and the view identifier of each view displayed on the terminal screen when the designated page is not subjected to the offset.
After the client determines the third view identification queue and the fourth view identification queue, the client can further determine the view identification of each view displayed on the terminal screen when the designated page is not shifted. Then, the client may further determine an intersection between the third view identifier queue and the fourth view identifier queue, and determine, through the view identifiers included in the intersection and the view identifiers of the views displayed on the terminal screen when the specified page is not shifted, the view identifier of the view to be displayed on the terminal screen and the view identifier of the view to be hidden after the specified page is shifted this time, where a specific determination manner is shown in fig. 6.
Fig. 6 is a schematic process diagram for determining a to-be-displayed view and a hidden view according to an embodiment of the present application.
Suppose that the designated page contains 7 views shown in fig. 6, the 7 views are laid out in the designated page in the manner shown in fig. 6, the views 1 and 2 are located side by side at the top of the designated page, the view 3 is located below the views 1 and 2 in a row alone, the views 4 and 5 are located below the view 3 in a side by side manner, and the views 6 and 7 are located at the bottom of the designated page in a side by side manner.
The first view identification queue and the second view identification queue determined by the client for the specified page are shown as two view queues in fig. 6. The 7 views in the first view identification queue are sorted in ascending coordinate order at the top side, and the 7 views in the second view identification queue are sorted in descending coordinate order at the bottom side, and each view identification has a corresponding queue number in a different view identification queue.
In fig. 6, the client constructs a rectangular coordinate system with the top left corner of the designated page as the origin of coordinates, and the view of the designated page displayed on the terminal screen at the beginning is: view 1, view 2, view 3, and when the user slides the designated page vertically on the terminal screen, the designated page slides upward in the terminal screen and generates a vertical offset as shown in fig. 6.
The client can determine the position y1 of the top end of the terminal screen in the designated page after the designated page is subjected to the longitudinal offset, wherein the y1 is the vertical coordinate of the top end of the terminal screen in the designated page at this time. The client can further determine the longitudinal length of the terminal screen and determine the sum y2 of the longitudinal length of the terminal screen and y1, i.e. the longitudinal coordinate of the bottom end of the terminal screen in the designated page at this time.
After the client determines y1 and y2, a view identifier whose top-side coordinate matches y2 may be determined from the first view identifier queue, where the client finds that the top-side coordinate of views 6 and 7 matches y2 in the first view identifier queue, and at this time, the client may determine the view 6 with the smallest queue number as the first view identifier matching y2, and determine each view identifier in the first view identifier queue that is located before the first view identifier as a third view queue, that is, views 1, 2, 3, 4, and 5 contained in the third view identifier queue.
Similarly, the client may determine a view identifier whose bottom coordinate matches y1 from the second view identifier queue, where the client finds that the bottom coordinate of views 1 and 2 matches y1 in the second view identifier queue, and at this time, the client may determine view 2 with the smallest sequence number in the second view identifier queue as the second view identifier matching y1, and determine each view identifier located before the second view identifier in the second view identifier queue as the fourth view identifier queue, that is, the fourth view identifier queue includes views 3, 4, 5, 6, and 7.
After the client determines the third view identifier queue and the fourth view identifier queue, the intersection of the two view identifier queues can be further determined, the intersection comprises views 3, 4 and 5, and the three views are the views to be displayed on the terminal screen after the specified page is subjected to the current offset.
The client can determine that when the specified page is not shifted, the view displayed on the terminal screen is as follows: view 1, 2, 3, after which the client may further determine the intersection between the above intersection and view 1, 2, 3, i.e. view 3. Thus, the client end eliminates the view 3 from the intersection between the third view identifier queue and the fourth view identifier queue, that is, after the specified page is subjected to the offset, the view which needs to be added to the terminal screen for display is as follows: and 4, 5, namely the views to be displayed.
Similarly, when the client does not deviate from the specified page this time, the client removes the view 3 from the view displayed on the terminal screen, that is, after the specified page deviates this time, the view that needs to be moved out of the terminal screen is: views 1 and 2, namely views to be hidden.
Fourthly, view multiplexing and hiding:
s801: and searching whether a view corresponding to the view identifier of the view to be displayed exists or not from the view multiplexing pool, if so, executing step S802, and if not, executing step S803.
S802: and multiplexing the views from the view multiplexing pool and displaying the views.
S803: and determining the component matched with the component identifier from a view multiplexing pool according to the component identifier of the component corresponding to the view to be displayed, and rendering and displaying the view to be displayed through the component and the view information of the view to be displayed, which is acquired from a server.
And when the client does not find the component matched with the component identifier in the view multiplexing pool, calling the component matched with the client from a preset component library through the component identifier, and rendering and displaying the view to be displayed through the view information of the view to be displayed, which is acquired from the server, wherein the view information can be contained in the page information acquired from the server by the client.
Based on the same idea, the data acquisition method and the data display method provided in the embodiments of the present application further provide a data acquisition device and a data display device, respectively, as shown in fig. 7.
Fig. 7 is a schematic diagram of a data acquisition apparatus provided in an embodiment of the present application, which specifically includes:
a container providing module 701, which provides a view container, wherein the view container comprises the corresponding relation between the views in the page and the components used by the views;
a determining module 702, configured to determine, through the view container, a view identifier of a view to be displayed in a terminal screen when it is monitored that a first page deviates in the terminal screen;
the view multiplexing module 703 is configured to search the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed, and multiplex the searched view to be displayed, so that the view to be displayed is displayed on the terminal screen, where the view multiplexing pool is used to recover the view that is changed from the display state to the hidden state.
The container providing module 701 determines view identifiers of views included in a first page in a terminal screen, component identifiers of components used by the views, and position information of the views in the first page; and creating the view container according to the view identification, the component identification and the position information.
The determining module 702 performs ascending arrangement on the view identifiers of the views according to the size of the first coordinate in the determined position information, so as to obtain a first view identifier queue; according to the size of the second coordinate in each determined position information, view identifiers of each view are arranged in a descending order to obtain a second view identifier queue; saving the first view identification queue and the second view identification queue in the view container.
The determining module 702 determines the offset of the first page in the terminal screen when it is monitored that the first page is offset in the terminal screen; and determining a view identifier of a view to be displayed in the terminal screen according to the offset and the view container.
The determining module 702 determines a third view identifier queue according to the offset, the longitudinal length of the display area of the terminal screen, and the first view identifier queue included in the view container; determining a fourth view identification queue according to the offset and a second view identification queue contained in the view container; and determining the view identifier of the view to be displayed in the terminal screen according to the third view identifier queue and the fourth view identifier queue.
The determining module 702 determines a third coordinate of the top end of the terminal screen corresponding to the first page before the first page is not shifted in the terminal screen; determining a fourth coordinate of the top end of the terminal screen corresponding to the first page after the first page is shifted in the terminal screen; determining the sum of the fourth coordinate and the longitudinal length of the terminal screen display area; determining a first view identifier with a first coordinate matching the sum value in a first view identifier queue contained in the view container; and obtaining a third view identification queue according to each view identification in the first view identification queue before the first view identification.
The determining module 702 determines a second view identifier whose second coordinate matches the fourth coordinate in a second view identifier queue included in the view container; and obtaining a fourth view identification queue according to each view identification in the second view identification queue before the second view identification.
The determining module 702 determines, when there is a first coordinate corresponding to at least one view identifier in the first view identifier queue and matches the sum, a view identifier with a smallest first queue number in the at least one view identifier as the first view identifier with the first coordinate matching the sum;
the determining module 702 determines, when there is a match between the second coordinate corresponding to at least one view identifier and the fourth coordinate in the second view identifier queue, a view identifier with a smallest second queue number in the at least one view identifier as the second view identifier with the second coordinate matching the fourth coordinate.
The determining module 702 determines, in a binary search manner, a first view identifier whose first coordinate matches the sum value in a first view identifier queue included in the view container;
the determining module 702 determines, by using a binary search method, a second view identifier whose second coordinate matches the fourth coordinate in a second view identifier queue included in the view container.
The determining module 702 determines that the third view identifier queue and the fourth view identifier queue take an intersection to obtain a common view identifier of the third view identifier queue and the fourth view identifier queue; and determining the view identifier of the view to be displayed in the terminal screen according to the view identifier of each view displayed in the terminal screen before the first page is not subjected to the offset and the common view identifier.
The determining module 702 determines, according to the view identifier of each view displayed in the terminal screen before the first page is not shifted and the common view identifier, a view whose display state changes to a hidden state after the first page is shifted, from among the views displayed in the terminal screen before the first page is not shifted; and correspondingly recycling the determined view and/or the component corresponding to the terminal view to the view multiplexing pool.
The view multiplexing module 703 searches whether a view corresponding to the view identifier of the view to be displayed exists in a view multiplexing pool; if so, multiplexing and displaying the view to be displayed from the view multiplexing pool; if not, rendering and displaying the view to be displayed according to the view information of the view to be displayed, which is acquired from the server, of the view to be displayed according to the component identifier corresponding to the view to be displayed.
The view multiplexing module 703, when it is determined that the view multiplexing pool includes a component corresponding to the component identifier, multiplexes the component from the view multiplexing pool, and renders, by the component, view information of the view to be displayed, which is obtained from the server, so as to display the view to be displayed; when the view multiplexing pool is determined not to contain the component corresponding to the component identifier, determining the component corresponding to the component identifier from a preset component library according to the component identifier; and through the assembly and the view information for displaying the view to be displayed acquired from the server, rendering and displaying the view to be displayed.
The embodiment of the application provides a view multiplexing method and a view multiplexing device, wherein in the method, when a client monitors that a first page deviates in a terminal screen, a view identifier of a view to be displayed in the terminal screen is determined through a view container provided for displaying the first page, the client can search a view matched with the view identifier from a view multiplexing pool according to the view identifier of the view to be displayed, and the view is displayed on the terminal screen in a view multiplexing mode. In the process of page display, the client can manage each view in the page through the view container arranged in the client, and does not use the view container arranged in the system to manage each view, so in the embodiment of the application, when the client needs to multiplex the view from the view multiplexing pool, the client does not need to multiplex the view and the component corresponding to the view together, but can multiplex the view separately through the view container provided by the client, and compared with the prior art, the multiplexing rate of the view is greatly improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (24)

1. A method of view multiplexing, comprising:
providing a view container, wherein the view container comprises the corresponding relation between the view in the page and the component used by the view;
when the situation that the first page deviates in the terminal screen is monitored, determining a view identifier of a view to be displayed in the terminal screen through the view container;
according to the view identification of the view to be displayed, searching the view to be displayed from a view multiplexing pool, and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, wherein the view multiplexing pool is used for recovering the view changed from a display state to a hidden state;
wherein, provide the view container, specifically include:
determining view identification of each view contained in a first page in a terminal screen, component identification of a component used by each view and position information of each view in the first page;
and creating the view container according to the view identification, the component identification and the position information, so that the view is independently multiplexed when the view container is used for view multiplexing.
2. The method of claim 1, wherein the method further comprises:
according to the size of the first coordinate in each determined position information, view identifiers of each view are arranged in an ascending order to obtain a first view identifier queue;
according to the size of the second coordinate in each determined position information, view identifiers of each view are arranged in a descending order to obtain a second view identifier queue;
saving the first view identification queue and the second view identification queue in the view container.
3. The method according to any one of claims 1 to 2, wherein when it is monitored that the first page is shifted in the terminal screen, determining, by the view container, a view identifier of a view to be displayed in the terminal screen specifically includes:
when the first page is monitored to be deviated in the terminal screen, determining the deviation amount of the first page in the terminal screen;
and determining a view identifier of a view to be displayed in the terminal screen according to the offset and the view container.
4. The method according to claim 3, wherein determining, according to the offset and the view container, a view identifier of a view to be displayed in the terminal screen specifically includes:
determining a third view identification queue according to the offset, the longitudinal length of the terminal screen display area and the first view identification queue contained in the view container;
determining a fourth view identification queue according to the offset and a second view identification queue contained in the view container;
and determining the view identifier of the view to be displayed in the terminal screen according to the third view identifier queue and the fourth view identifier queue.
5. The method of claim 4, wherein determining a third view identifier queue according to the offset, the longitudinal length of the display area of the terminal screen, and the first view identifier queue included in the view container comprises:
determining a third coordinate of the top of the terminal screen corresponding to the first page before the first page is not shifted in the terminal screen;
determining a fourth coordinate of the top end of the terminal screen corresponding to the first page after the first page is shifted in the terminal screen;
determining the sum of the fourth coordinate and the longitudinal length of the terminal screen display area;
determining a first view identifier with a first coordinate matching the sum value in a first view identifier queue contained in the view container;
and obtaining a third view identification queue according to each view identification in the first view identification queue before the first view identification.
6. The method according to claim 5, wherein determining a fourth view label queue according to the offset and a second view identifier queue included in the view container comprises:
determining a second view identifier with a second coordinate matched with the fourth coordinate in a second view identifier queue contained in the view container;
and obtaining a fourth view identification queue according to each view identification in the second view identification queue before the second view identification.
7. The method of claim 6, wherein determining a first view identifier having a first coordinate matching the sum in a first view identifier queue included in the view container comprises:
when a first coordinate corresponding to at least one view identifier exists in the first view identifier queue and is matched with the sum value, determining the view identifier with the smallest first queue sequence number in the at least one view identifier as the first view identifier with the first coordinate matched with the sum value;
determining a view identifier with a second coordinate matched with the fourth coordinate in a second view identifier queue included in the view container, specifically including:
and when a second coordinate corresponding to at least one view identifier is matched with the fourth coordinate in the second view identifier queue, determining the view identifier with the smallest second queue serial number in the at least one view identifier as the second view identifier with the second coordinate matched with the fourth coordinate.
8. The method of claim 7, wherein determining a first view identifier having a first coordinate matching the sum in a first view identifier queue included in the view container comprises:
determining a first view identifier with a first coordinate matched with the sum value in a first view identifier queue contained in the view container in a binary search mode;
determining a second view identifier with a second coordinate matched with the fourth coordinate in a second view identifier queue included in the view container, specifically including:
and determining a second view identifier with a second coordinate matched with the fourth coordinate in a second view identifier queue contained in the view container by a binary search method.
9. The method of claim 4, wherein determining the view identifier of the view to be displayed in the terminal screen according to the third view identifier queue and the fourth view identifier queue specifically comprises:
determining that the third view identification queue and the fourth view identification queue take an intersection to obtain a common view identification of the third view identification queue and the fourth view identification queue;
and determining the view identifier of the view to be displayed in the terminal screen according to the view identifier of each view displayed in the terminal screen before the first page is not subjected to the offset and the common view identifier.
10. The method of claim 9, wherein the method further comprises:
determining a view of which the display state is changed to a hidden state after the first page is shifted from the views displayed on the terminal screen before the first page is not shifted according to the view identifiers of the views displayed on the terminal screen before the first page is not shifted and the common view identifier;
and recycling the determined view and/or the component corresponding to the view into the view multiplexing pool.
11. The method according to claim 1 or 10, wherein the searching for the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed, and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, specifically includes:
searching whether a view corresponding to the view identifier of the view to be displayed exists in a view multiplexing pool;
if so, multiplexing and displaying the view to be displayed from the view multiplexing pool;
if not, rendering and displaying the view to be displayed according to the view information of the view to be displayed, which is acquired from the server, of the view to be displayed according to the component identifier corresponding to the view to be displayed.
12. The method of claim 11, wherein the method further comprises:
when the view multiplexing pool is determined to contain the component corresponding to the component identifier, multiplexing the component from the view multiplexing pool, and rendering the view information of the view to be displayed, which is acquired from the server, through the component so as to display the view to be displayed;
when the view multiplexing pool is determined not to contain the component corresponding to the component identifier, determining the component corresponding to the component identifier from a preset component library according to the component identifier; and through the assembly and the view information for displaying the view to be displayed acquired from the server, rendering and displaying the view to be displayed.
13. An apparatus for view multiplexing, comprising:
the container providing module is used for providing a view container, and the view container comprises the corresponding relation between the view in the page and the components used by the view;
the determining module is used for determining a view identifier of a view to be displayed in the terminal screen through the view container when the situation that the first page deviates in the terminal screen is monitored;
the view multiplexing module is used for searching the view to be displayed from a view multiplexing pool according to the view identifier of the view to be displayed, and multiplexing the searched view to be displayed so as to display the view to be displayed in the terminal screen, wherein the view multiplexing pool is used for recovering the view changed from a display state to a hidden state;
the container providing module is used for determining view identification of each view contained in a first page in a terminal screen, component identification of a component used by each view and position information of each view in the first page; and creating the view container according to the view identification, the component identification and the position information, so that the view is independently multiplexed when the view container is used for view multiplexing.
14. The apparatus according to claim 13, wherein the determining module arranges the view identifiers of the views in ascending order according to the size of the first coordinate in the determined position information, to obtain a first view identifier queue; according to the size of the second coordinate in each determined position information, view identifiers of each view are arranged in a descending order to obtain a second view identifier queue; saving the first view identification queue and the second view identification queue in the view container.
15. The apparatus according to any one of claims 13 to 14, wherein the determining module determines the offset of the first page in the terminal screen when the offset of the first page in the terminal screen is monitored; and determining a view identifier of a view to be displayed in the terminal screen according to the offset and the view container.
16. The apparatus of claim 15, wherein the determining module determines a third view id queue according to the offset, the longitudinal length of the display area of the terminal screen, and the first view id queue included in the view container; determining a fourth view identification queue according to the offset and a second view identification queue contained in the view container; and determining the view identifier of the view to be displayed in the terminal screen according to the third view identifier queue and the fourth view identifier queue.
17. The apparatus of claim 16, wherein the determining module determines that the top of the terminal screen corresponds to the third coordinate of the first page before the first page is not shifted in the terminal screen; determining a fourth coordinate of the top end of the terminal screen corresponding to the first page after the first page is shifted in the terminal screen; determining the sum of the fourth coordinate and the longitudinal length of the terminal screen display area; determining a first view identifier with a first coordinate matching the sum value in a first view identifier queue contained in the view container; and obtaining a third view identification queue according to each view identification in the first view identification queue before the first view identification.
18. The apparatus of claim 17, wherein the determining module determines a second view identifier having a second coordinate matching the fourth coordinate in a second view identifier queue included in the view container; and obtaining a fourth view identification queue according to each view identification in the second view identification queue before the second view identification.
19. The apparatus of claim 18, wherein the determining module determines a view identifier with a smallest first queue number among the at least one view identifier as the first view identifier with the first coordinate matching the sum, when there is a first coordinate matching the sum corresponding to the at least one view identifier in the first view identifier queue;
and the determining module is configured to determine, when a second coordinate corresponding to at least one view identifier is matched with the fourth coordinate in the second view identifier queue, a view identifier with a smallest second queue number in the at least one view identifier as the second view identifier with the second coordinate matched with the fourth coordinate.
20. The apparatus according to claim 19, wherein the determining module determines a first view identifier whose first coordinate matches the sum value in a first view identifier queue included in the view container by means of binary search;
and the determining module determines a second view identifier with a second coordinate matched with the fourth coordinate in a second view identifier queue contained in the view container by a binary search method.
21. The apparatus of claim 16, wherein the means for determining determines that the third view identification queue intersects the fourth view identification queue to obtain a common view identification for the third view identification queue and the fourth view identification queue; and determining the view identifier of the view to be displayed in the terminal screen according to the view identifier of each view displayed in the terminal screen before the first page is not subjected to the offset and the common view identifier.
22. The apparatus according to claim 21, wherein the determining module determines, from among the views displayed on the terminal screen before the first page has not been shifted, a view whose display state changes to a hidden state after the shift of the first page, based on the view identification of the views displayed on the terminal screen before the shift of the first page has not occurred and the common view identification; and correspondingly recycling the determined view and/or the component corresponding to the view multiplexing pool.
23. The apparatus according to claim 13 or 22, wherein the view multiplexing module searches whether there is a view corresponding to the view identifier of the view to be displayed from a view multiplexing pool; if so, multiplexing and displaying the view to be displayed from the view multiplexing pool; if not, rendering and displaying the view to be displayed according to the view information of the view to be displayed, which is acquired from the server, of the view to be displayed according to the component identifier corresponding to the view to be displayed.
24. The apparatus of claim 23, wherein the view multiplexing module, when determining that the component corresponding to the component identifier is included in the view multiplexing pool, multiplexes the component from the view multiplexing pool, and renders, by the component, the view information of the view to be displayed, which is obtained from the server, to display the view to be displayed; when the view multiplexing pool is determined not to contain the component corresponding to the component identifier, determining the component corresponding to the component identifier from a preset component library according to the component identifier; and through the assembly and the view information for displaying the view to be displayed acquired from the server, rendering and displaying the view to be displayed.
CN201710039525.XA 2017-01-19 2017-01-19 View multiplexing method and device Active CN108334251B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710039525.XA CN108334251B (en) 2017-01-19 2017-01-19 View multiplexing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710039525.XA CN108334251B (en) 2017-01-19 2017-01-19 View multiplexing method and device

Publications (2)

Publication Number Publication Date
CN108334251A CN108334251A (en) 2018-07-27
CN108334251B true CN108334251B (en) 2021-07-27

Family

ID=62922020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710039525.XA Active CN108334251B (en) 2017-01-19 2017-01-19 View multiplexing method and device

Country Status (1)

Country Link
CN (1) CN108334251B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459375B (en) * 2020-03-31 2021-08-24 北京金山安全软件有限公司 Page sliding position control method and device, electronic equipment and storage medium
CN112581589A (en) * 2020-12-28 2021-03-30 深圳市优必选科技股份有限公司 View list layout method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440131A (en) * 2013-08-30 2013-12-11 四川九洲电器集团有限责任公司 Mobile terminal touch screen view layout adjustment method based on Android system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9052845B2 (en) * 2011-01-31 2015-06-09 Sap Se Unified interface for meta model checking, modifying, and reporting
CN105630267B (en) * 2014-10-29 2019-04-12 阿里巴巴集团控股有限公司 View interface method for managing resource and device
CN105607900A (en) * 2015-11-26 2016-05-25 小米科技有限责任公司 Display object processing method and apparatus

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440131A (en) * 2013-08-30 2013-12-11 四川九洲电器集团有限责任公司 Mobile terminal touch screen view layout adjustment method based on Android system

Also Published As

Publication number Publication date
CN108334251A (en) 2018-07-27

Similar Documents

Publication Publication Date Title
CN110502298B (en) Method and equipment for providing update reminding information of electronic book
US20090327965A1 (en) Selection of items in a virtualized view
CN106407371A (en) User comment data displaying method and system, server and client
US20230229718A1 (en) Shared User Driven Clipping of Multiple Web Pages
CN111752557A (en) Display method and device
CN106156189B (en) Label generation method and device, and information acquisition method and device
CN105354203A (en) Information display method and apparatus
CN104281359A (en) Layout method and layout device for objects with different sizes
US20210304379A1 (en) System and Methods for an Image Mosaic Representing a Group of Links
CN105069037A (en) Search content display method and apparatus
CN105335423A (en) Collecting and processing method and apparatus for user feedbacks of webpage
CN108334251B (en) View multiplexing method and device
CN109582305B (en) Encoding method and device for mobile application page elements and electronic equipment
CN105573595A (en) Information display method and device
CN106971004B (en) Search result providing method and device
CN105630792A (en) Information display method and device as well as information push method and device
CN110442826B (en) Cross-layer page jumping method, device and system based on page identification
CN111427865A (en) Method and device for managing objects of database
CN108572817B (en) Method, apparatus and medium for dynamic resource configuration based on business modeling
CN105630310A (en) Method and device for displaying titles during graph group switching
CN111986553B (en) Method, device and storage medium for map association based on semantic label
CN104808995A (en) Method and device for storing application contents over applications
CN106649374B (en) Navigation tag sequencing method and device
CN115687662A (en) Multimedia work processing method, device, equipment and storage medium
CN104267967A (en) Method and device for generating program codes of software

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1258481

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant