CN105740330B - Method and device for displaying data in paging mode - Google Patents

Method and device for displaying data in paging mode Download PDF

Info

Publication number
CN105740330B
CN105740330B CN201610042253.4A CN201610042253A CN105740330B CN 105740330 B CN105740330 B CN 105740330B CN 201610042253 A CN201610042253 A CN 201610042253A CN 105740330 B CN105740330 B CN 105740330B
Authority
CN
China
Prior art keywords
data
page
module
judging
unit
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
CN201610042253.4A
Other languages
Chinese (zh)
Other versions
CN105740330A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610042253.4A priority Critical patent/CN105740330B/en
Publication of CN105740330A publication Critical patent/CN105740330A/en
Application granted granted Critical
Publication of CN105740330B publication Critical patent/CN105740330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The application discloses a method for displaying data in a page mode, which comprises the following steps: when the page to be displayed is a first page, acquiring first data from a website server according to a first data unit and displaying the first data on the page, acquiring second data from the website server according to a second data unit, caching the second data, and judging whether the page is a last page or not according to the data quantity of the second data; when the page is not the first page, judging whether the page is the last page according to the data volume of current cache data and/or the data volume of third data acquired from the website server by using a second data unit, acquiring fourth data from the current cache data according to the first data unit, and displaying the fourth data in the page; when the page is not the last page, presenting an operation control for linking to the next page on the page, so as to determine to prepare to present the next page in response to the operation on the operation control; when the page is the last page, it is determined that the next page is not ready to be presented.

Description

Method and device for displaying data in paging mode
Technical Field
The present invention relates to information processing technologies, and in particular, to a method and an apparatus for displaying data in a page format.
Background
In the process of displaying information to a user, if the amount of information to be displayed is large, all the information cannot be displayed on one page, the information needs to be displayed to the user in a paging mode. When the conventional method for displaying information in pages is used, the total number of pages required for displaying the information needs to be determined in advance. When the last page is displayed, namely when the current page is equal to the total page number, the next page button is rendered into a non-clickable state so as to ensure the accuracy of paging display.
Disclosure of Invention
The embodiment of the invention provides a method for displaying data in a paging mode, which is used for reducing the complexity of displaying data in the paging mode.
The embodiment of the invention provides a device for displaying data in a paging mode, which is used for reducing the complexity of displaying data in the paging mode.
The embodiment of the invention provides a method for displaying data in a page mode. The method is applied to the browser in the terminal equipment. When exposing data from a Uniform Resource Locator (URL), the method comprises:
when determining that a page is to be displayed, judging whether the page is a first page;
when the page is a first page, acquiring first data from a website server according to a first data unit and displaying the first data in the page, acquiring second data from the website server according to a second data unit, caching the second data, and judging whether the page is a last page or not according to the data volume of the second data; when data is acquired from the website server according to the first data unit or the second data unit, if the amount of data of the URL currently existing in the website server is greater than or equal to the first data unit or the second data unit, acquiring the data of the first data unit or the second data unit from the website server, otherwise acquiring the data of the URL currently existing from the website server;
when the page is not the first page, judging whether the page is the last page according to the data volume of the current cached data and/or according to the data volume of third data acquired from the website server by using the second data unit, acquiring fourth data from the current cached data according to the first data unit, and displaying the fourth data in the page; wherein if the data amount of the currently cached data is greater than or equal to the first data unit, the data amount of the fourth data is equal to the first data unit; otherwise, the data volume of the fourth data is equal to the data volume of the current cached data;
when the page is not the last page, displaying an operation control for linking to the next page on the page, so as to respond to the operation of the operation control by a user and determine that the next page is ready to be displayed;
when the page is a last page, determining that a next page is not ready to be presented.
The embodiment of the invention provides a device for displaying data in a page-by-page mode, which is applied to a browser. The browser for presenting data from a Uniform Resource Locator (URL), the apparatus comprising:
the display device comprises a first judging module, a second judging module and a display module, wherein the first judging module is used for judging whether a page is a first page or not when the page is determined to be prepared to be displayed;
the second obtaining module is used for obtaining first data from a website server according to a first data unit and obtaining second data from the website server according to a second data unit when the first judging module judges that the page is the first page; when the first judging module judges that the page is not the first page, third data are obtained from the website server according to the second data unit;
a third cache module, configured to obtain and cache the second data and the third data from the second obtaining module;
the fourth judging module is used for judging whether the page is the last page or not according to the data volume of the second data when the first judging module judges that the page is the first page; when the first judging module judges that the page is not the first page, judging whether the page is the last page according to the data volume of the current cached data in the third caching module and/or the data volume of the third data;
the fifth display module is used for acquiring the first data from the second acquisition module and displaying the first data in the page when the first judgment module judges that the page is the first page; when the first judging module judges that the page is not the first page, acquiring fourth data from the current cached data in the third caching module according to the first data unit and displaying the fourth data in the page; when the fourth judging module judges that the page is not the last page, displaying an operation control for linking to the next page on the page; and
the sixth judging module is used for responding to the operation of the user on the operation control and determining that the next page is ready to be displayed; when the fourth judging module judges that the page is the last page, determining that the next page is not ready to be displayed;
the first data unit is a data amount of data which can be displayed on one page, the second data unit is a data amount of data which can be displayed on at least one page, when the second obtaining module obtains data from the website server according to the first data unit or the second data unit, if the data amount of the currently existing URL in the website server is larger than or equal to the first data unit or the second data unit, the second obtaining module obtains the data of the first data unit or the second data unit from the website server, otherwise, the second obtaining module obtains the data of the currently existing URL from the website server;
if the data volume of the currently cached data of the third caching module is greater than or equal to the first data unit, the data volume of the fourth data acquired by the fifth presentation module is equal to the first data unit, otherwise, the data volume of the fourth data is equal to the data volume of the currently cached data.
In the method and the device provided by the embodiment of the invention, when a page is determined to be prepared to be displayed, whether the page is a first page is judged; when the page is a first page, first data are obtained from a website server according to a first data unit and displayed in the page, second data are obtained from the website server according to a second data unit, the second data are cached, and whether the page is a last page or not is judged according to the data quantity of the second data. And when the page is not the first page, judging whether the page is the last page according to the data volume of the current cached data and/or the data volume of third data acquired from the website server by using the second data unit, acquiring fourth data from the current cached data according to the first data unit, and displaying the fourth data in the page. And when the page is not the last page, displaying an operation control for linking to the next page on the page, so that the next page is determined to be displayed in response to the operation of the operation control by the user. When the page is a last page, determining that a next page is not ready to be presented. By using the technical scheme provided by the embodiment of the invention, the total page number does not need to be determined in advance when the data is displayed in the paging mode, so that the complexity of the data displayed in the paging mode is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment in which embodiments of the present invention are implemented;
FIG. 2 is a flowchart illustrating a method for displaying data in a page format according to an embodiment of the invention;
FIG. 2A is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2;
FIG. 2B is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2;
FIG. 2C is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2;
FIG. 3 is a flowchart illustrating a method for displaying data in a page format according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating a method for displaying data in a page format according to an embodiment of the invention;
FIG. 5 is a flowchart illustrating a method for displaying data in a page format according to an embodiment of the invention;
FIG. 6 is a block diagram of an apparatus for displaying data in a page format according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for displaying data page by page according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 invention.
Fig. 1 is a schematic structural diagram of an implementation environment according to embodiments of the present invention. As shown in fig. 1, the implementation environment includes: terminal device 110, web server 120, and database 130.
The terminal device 110 operates with means for paging display data, such as a browser. The terminal device 110 may be a mobile phone, a tablet computer, a laptop portable computer, a desktop computer, and the like. The browser may include, among other things, means for displaying and managing paginated display data of pages, such as an Internet browser (IE), Internet Explorer, a roaming browser, and the like.
The terminal device 110 may be connected to the web server 120 through a wireless network or a wired network.
The website server 120 may be a server, a server cluster composed of several servers, or a cloud computing service center.
The database 130 may be a device for storing data, and may be connected to the web server 120 through a wired or wireless manner, so that the web server 120 reads data from the database 130.
Fig. 2 is a flowchart illustrating a method for displaying data in a page-wise manner according to an embodiment of the present invention. The method is applied to the browser in the terminal equipment. As shown in FIG. 2, when the browser exposes data from a Uniform Resource Locator (URL), the method includes the following steps.
Step 201, when determining that a page is ready to be displayed, determining whether the page is a first page.
In an embodiment of the present invention, after a user inputs a search keyword, the browser determines whether a page is the first page when the browser responds to the user's search request and determines to initially load the page. Alternatively, when an operation control for linking to the next page on the page, such as a "next page" button, is clicked, the browser determines whether the next page is the first page when determining that the next page is ready to be presented in response to the click request.
In one embodiment of the invention, a page number value may be set in preparation for presenting data from a URL and initialized to a first value. The first value is typically zero and may be a specific integer. In the subsequent page display process, when a certain page is displayed, the existing page numerical value is increased by one. For example, when the initial first value is zero, and is shown to the first page, then the first value is incremented by one, i.e., the current page value is one. In an embodiment of the present invention, whether the page is the first page is determined by determining whether the current page value is the first value. When the page value is the first value, judging that the page is a first page; otherwise, the page is judged not to be the first page. In an embodiment of the present invention, it may also be determined whether the page is the first page by determining whether the page number value is the first numerical value and whether the data size of the currently cached data is zero. If the current page value is the initialized first value and the data volume of the current cached data is zero, the page is determined to be the first page. If the current page value is not the first value or the data amount of the current cached data is not zero, the page is determined not to be the first page.
Alternatively, when data from a URL is to be presented, the value of the page flag is set and initialized to invalid, e.g., 0 or 1. When the page is displayed, judging whether the value of the page zone bit is invalid, if the value of the page zone bit is invalid, modifying the value of the page zone bit to be valid, for example, if 0 represents invalid, modifying the value of the page zone bit to be 1; if 1 represents invalid, the value of the flag bit of the page is modified to 0. Whether the page is the first page can be judged by judging whether the value of the page flag bit is invalid. And when the value of the page flag bit is invalid, determining that the page is the first page. Or, judging whether the value of the flag bit of the page is invalid or not, and judging whether the data volume of the current cached data is zero or not. And if the value of the page flag bit is invalid and the data volume of the current cached data is zero, judging that the page is the first page. And if the value of the flag bit of the page is valid or the data amount of the currently cached data is not zero, judging that the page is not the first page.
Step 202, when the page is a first page, acquiring first data from the website server according to a first data unit and displaying the first data in the page, acquiring second data from the website server according to a second data unit, caching the second data, and judging whether the page is a last page according to the data amount of the second data. The first data unit is a data amount of which one page can display data, and the second data unit is a data amount of which at least one page can display data. When data is acquired from the web server according to the first data unit or the second data unit, if the amount of data of the currently existing URL in the web server is greater than or equal to the first data unit or the second data unit, acquiring the data of the first data unit or the second data unit from the web server, otherwise acquiring the data of the currently existing URL from the web server.
When the page is a first page, the browser acquires first data from the website server according to a first data unit and displays the first data on the page. Specifically, the browser sends a data acquisition request to the website server, where the data acquisition request carries a first data unit. And the website server acquires a certain amount of data from the database according to the first data unit and sends the data to the browser. In an embodiment of the invention, the first data unit is a data amount of which one page can display data. According to the first data unit, the browser can acquire data of one page at most from the website server, namely data which can be displayed by one page. The browser may retrieve less than one page of data, e.g., half a page of data, or may not retrieve data. If the data about the URL currently existing in the website server is greater than or equal to the first data unit, acquiring the data of the first data unit, namely the data capable of being displayed by one page, from the website server. If the amount of data currently existing in the Web server about the URL is less than the first data unit, then data currently existing about the URL, e.g., half-page data, is obtained from the Web server. In an embodiment of the present invention, when the browser obtains a page of data from the web server, the page of data is displayed according to a default page display setting. When the acquired data is less than one page, for example, half page data, the browser may display the half page data according to a default page setting, that is, the data is displayed in a half page, and the half page is blank. Or the browser may present the half page of data on the entire page, except that the spacing between data is approximately twice the default.
In an embodiment of the present invention, the browser further obtains and caches the second data from the website server according to a second data unit. The second data unit is a data amount of which at least one page can display data. For example, the second data unit is a data amount of which two or more pages can show data, or a data amount of which one page can show data, or less than a data amount of which one page can show data, for example, half page data or zero. The second data unit may be determined according to the capacity of the above-described buffering means and the time and resources required to perform one buffering. In the specific process of acquiring the second data, if the amount of data currently existing in the web server about the URL is greater than or equal to the second data unit, the data of the second data unit is acquired from the web server. If the amount of data currently existing in the Web server about the URL is less than the second unit of data, then the currently existing data about the URL is obtained from the Web server.
In an embodiment of the present invention, in the process of displaying data in a paging manner, the browser needs to send a data obtaining request to the web server to request a certain amount of data. And the website server reads a certain amount of data from a database according to the data acquisition request and sends the data to the browser. The browser caches the data in its own cache device, or in a separate cache device. Because the data to be displayed is cached in the cache device, the data is only required to be read from the cache device when the data is displayed subsequently, and the data is not required to be read from a database through a website server when the data is displayed every time, so that the time for reading the data can be shortened, and the efficiency of displaying the data in pages is improved.
In an embodiment of the present invention, it is determined whether the data size of the second data is zero. And if the data volume of the second data cached currently is zero, judging that the page is the last page. If the data size of the second data is zero, it indicates that the browser does not obtain data from the web server, i.e., the database has no more data about the URL. When the data amount of the second data is not zero, it is determined that the page is not the last page.
In an embodiment of the invention, other execution sequences may be utilized to retrieve and present the first data from the web server and to retrieve and cache the second data. For example, the first data and the second data may be first obtained from the website server according to the first data unit and the second data unit, and then the first data is displayed and the second data is cached, or the second data is cached and then the first data is displayed. Or, the second data is firstly obtained from the website server and cached, and then the first data is obtained from the website server and displayed.
In one embodiment of the present invention, data may be obtained from the web server in an asynchronous request manner. Since the web server acquires data from the database after the browser issues a data acquisition request, and the operations of presenting data and caching data are performed by the browser, the above-described operation of acquiring data and the operation of presenting and caching data can be performed in parallel. For example, after a browser acquires first data from a website server, before or after the first data is presented, the browser sends a data acquisition request to the website server, and waits for receiving second data from the website server during presentation of the first data. Because the above operations can be executed in parallel, the time required by the paging display can be shortened, and the paging display efficiency can be improved.
Step 203, when the page is not the first page, judging whether the page is the last page according to the data volume of the currently cached data and/or according to the data volume of third data acquired from the website server by using the second data unit, and acquiring fourth data from the currently cached data according to the first data unit and displaying the fourth data in the page. When data is acquired from the web server according to the second data unit, if the data amount of the URL currently existing in the web server is greater than or equal to the second data unit, the data amount of the third data acquired from the web server is equal to the second data unit, otherwise, the third data acquired from the web server is the data of the ULR currently existing. If the data volume of the current cached data is greater than or equal to the first data unit, the data volume of the acquired fourth data is equal to the first data unit; otherwise, the data volume of the acquired fourth data is equal to the data volume of the currently cached data.
In an embodiment of the present invention, when the page is not the first page, the browser may determine whether the page is the last page according to the data amount of the currently cached data; or the browser can acquire third data from the website server according to the second data unit and judge whether the page is the last page according to the data volume of the third data; or the browser may determine whether the page is the last page according to the data amount of the currently cached data and the data amount of the third data. In an embodiment of the present invention, after determining whether the page is the last page, fourth data may be obtained from the currently cached data according to the first data unit and displayed in the page. Or before determining whether the page is the last page or in the process of determining whether the page is the last page, acquiring fourth data from the currently cached data according to the first data unit and displaying the fourth data in the page.
In an embodiment of the invention, the data amount of the currently buffered data may be smaller than the first data unit, and may also be equal to or larger than the first data unit. And if the data amount of the currently cached data is larger than or equal to the first data unit, the data amount of the fourth data acquired from the currently cached data is equal to the first data unit. And if the data volume of the currently cached data is smaller than the first data unit, the data volume of the fourth data acquired from the currently cached data is the data volume of the currently cached data.
Step 204, when the page is not the last page, displaying an operation control for linking to the next page on the page, so as to respond to the operation of the operation control by the user and determine to prepare to display the next page; when the page is the last page, it is determined that the next page is not ready to be presented.
FIG. 2A is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2. As shown in fig. 2A, the second data unit requested from the web server is a data amount that can show data for one page each time data is cached. The method comprises the following steps.
Step 201A compares the data size of the currently cached data with the first data unit.
Step 202A, when the data amount of the currently cached data is smaller than the first data unit, determining that the page is the last page.
Step 203A: when the data volume of the currently cached data is equal to the first data unit, acquiring and caching the third data from the website server according to the second data unit, and judging whether the data volume of the third data is zero or not; when the data volume of the third data is zero, judging that the page is the last page; when the data amount of the third data is not zero, it is determined that the page is not the last page.
FIG. 2B is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2. As shown in fig. 2B, the second data unit requested from the web server is a data amount that can show data for one page each time data is cached. The method comprises the following steps.
Step 201B, obtaining the third data from the website server according to the second data unit and caching the third data.
Step 202B, determining whether the data size of the third data is zero.
In step 203B, when the data amount of the third data is zero, it is determined that the page is the last page.
In step 204B, when the data amount of the third data is not zero, it is determined that the page is not the last page.
FIG. 2C is a flowchart illustrating a method for determining whether a page is a last page in the embodiment shown in FIG. 2. As shown in fig. 2C, the method includes the following steps.
Step 201C, obtaining the fourth data from the currently cached data according to the first data unit and displaying the fourth data in the page.
Step 202C, obtaining and caching the third data from the website server according to the second data unit.
Step 203C, determine whether the data size of the currently cached data is zero.
And step 204C, when the data volume of the currently cached data is zero, judging that the page is the last page.
In step 205C, when the data amount of the currently cached data is not zero, it is determined that the page is not the last page.
In the embodiment of the present invention, the second data unit may be a data amount larger than one page of data that can be displayed, or may be equal to or smaller than one page of data that can be displayed.
FIG. 3 is a flowchart illustrating a method for displaying data in a page-wise manner according to an embodiment of the present invention. The method is applied to the browser in the terminal equipment. In the embodiment of the invention, the data unit requested from the website server at each caching is the data volume of one page capable of displaying data, which is referred to as one page of data for short. When data is displayed each time, the data unit requested to the website server or the currently cached data is the data volume of the data which can be displayed in one page, which is referred to as one page of data for short. As shown in fig. 3, when the browser exposes data from a URL, the method includes the following steps.
Step 301, detecting that a page display event is triggered, and determining that a page is to be displayed. .
When a page is initialized, a page show event is detected. Alternatively, when the user operates the operation space for linking to the next page, it is detected that the page presentation event is triggered.
Step 302, judging whether the page is the first page, and executing step 303 when the page is the first page; otherwise, step 304 is performed.
In one embodiment of the invention, a page number value may be set and initialized to zero when preparing to present data from a URL. In the subsequent page display, each page of data is displayed, the page number value is increased by one.
In this embodiment, whether the page is the first page is determined by determining whether the page count value is zero. When the page value is zero, step 303 is performed. When the page count value is not zero, step 304 is performed. Or, in the embodiment of the present invention, the value of the page flag is set and initialized to be invalid, when the page is displayed, it is determined whether the value of the page flag is invalid, and if the value of the page flag is invalid, the value of the page flag is modified to be valid. And judging whether the page is the first page or not by judging whether the value of the page flag bit is invalid or not, and judging that the page is the first page when the value of the page flag bit is invalid.
Step 303, requesting the website server to acquire two pages of data, displaying one page of data, caching the rest of data, and executing step 306.
In an embodiment of the present invention, a page of data may be obtained from the website server and displayed, and then a page of data may be obtained from the website server and cached. When the page is displayed, the page number value is added by one, namely the current page number value is one.
And step 304, requesting to acquire a page of data from the currently cached data and displaying the page of data.
In this step, the page count value is incremented by one to obtain a new page count value.
Step 305, sending a data acquisition request to the website server, requesting to acquire a page of data.
In an embodiment of the present invention, after the operation of presenting the data in step 304 and the operation of the web server receiving the data obtaining request, the operation of obtaining the data from the database and sending the data to the browser may be executed in parallel.
Step 306, judging whether the current cached data is zero, and executing step 307 when the current cached data is zero; when the current cached data is not zero, step 308 is performed.
Step 307, determine that the page is the last page, determine that the next page is not ready to be displayed, and end the process.
In this embodiment, when the currently cached data is zero, it indicates that the data obtained from the website server in step 303 or step 305 is zero, that is, the data is not obtained.
In the embodiment of the present invention, the process may be directly ended when the page is determined to be the last page.
In step 308, it is determined that the page is not the last page, and a "next" button is displayed on the page. And when it is detected that the user clicks the "next page" button, step 301 is executed in response to the operation applied to the button by the user.
In the embodiment of the present invention, a description is given taking an example in which a page of data is requested to be cached every time caching is performed. In practical applications, it may also be requested to cache more than one page of data capable of showing data, for example, two pages, or it may also be requested to cache less than one page of data capable of showing data, for example, half page or one third page. In the embodiment of the present invention, when a page of data is requested to be obtained from the web server or the currently cached data, if the amount of data of the URL existing in the web server or the currently cached data is greater than or equal to the amount of the page of data, a page of data is obtained from the web server or the currently cached data; otherwise, the existing data of the URL is obtained from the website server or the currently cached data, and the data of the URL may be less than one page or may be zero.
FIG. 4 is a flowchart illustrating a method for displaying data in a page-wise manner according to an embodiment of the present invention. The method is applied to the browser in the terminal equipment. As shown in fig. 4, when the browser presents data from a URL, the method includes the following steps. In the embodiment of the invention, the data volume of the data which can be displayed on one page is requested from the website server by default when the data is cached every time, which is referred to as one page of data for short. And when the data is displayed, the data size of the data capable of being displayed on one page is requested to be acquired from the website server or the currently cached data.
At step 401, a page count value is established and initialized to zero.
At step 402, a page show event is detected to be triggered.
In embodiments of the present invention, when a page is initially loaded, it is detected that a page expose event is triggered. Alternatively, the page presentation event is detected to be triggered when the user clicks a "next page" button, triggering the page presentation event in response to the user's operation of the button.
In step 403, it is determined whether the page is the first page. When the page is the first page, go to step 404; otherwise, step 406 is performed.
Step 404, requesting a page of data from the website server and displaying, and requesting a page of data from the website server and caching.
Step 405, determine whether the data size of the current cached data is zero. If the data amount of the current cached data is zero, executing step 409; otherwise, step 413 is performed.
Step 406, comparing the data size of the current cached data with the data size of the data that can be displayed on a preset page. When the data size of the current cached data is larger than the data size of the data that can be displayed on the preset page, execute step 407; when the data amount of the currently cached data is smaller than the data amount of the data that can be displayed on the preset page, execute step 408; when the data amount of the currently cached data is equal to the data amount of the data that can be displayed in the preset page, step 410 is executed.
Step 407, report an error.
In this embodiment, each time of caching, the data amount of the data requested from the web server is the data amount of the data that can be displayed on one page, so the data amount of the cached data is not greater than the data amount of the data that can be displayed on the one page, and therefore when the data amount of the currently cached data is greater than the preset data amount of the data that can be displayed on the one page, it is determined that an error occurs.
And step 408, acquiring and displaying the current cached data.
In step 409, the page is determined to be the last page.
When the page is the last page, then the "next page" button is not presented.
At step 410, a page of data is requested from the web server and cached.
In step 411, it is determined whether the data amount of the data acquired from the web server is zero. When the data amount of the data acquired from the website server is zero, executing step 409; otherwise, step 412 is performed.
In step 412, a page of data is requested from the currently cached data and displayed.
In step 413, it is determined that the page is not the last page, and the "next" button is presented on the page. When it is detected that a page show event is triggered, step 402 is performed.
In the embodiment of the present invention, when a page of data is requested to be obtained from the web server or the currently cached data, if the amount of data of the URL existing in the web server or the currently cached data is greater than or equal to the amount of the page of data, a page of data is obtained from the web server or the currently cached data; otherwise, the existing data of the URL is obtained from the website server or the currently cached data, and the data of the URL may be less than one page or may be zero.
FIG. 5 is a flowchart illustrating a method for displaying data in a page-wise manner according to an embodiment of the present invention. The method is applied to the browser in the terminal equipment. As shown in fig. 5, when the browser exposes data from a URL, the method includes the following steps. In the embodiment of the invention, the data volume of the data which can be displayed on one page is requested to the website server by default when caching is performed each time, and the data volume of the data which can be displayed on one page is requested to be acquired when the data is displayed.
Steps 501 to 502 are the same as steps 401 to 402.
In step 503, it is determined whether the page is the first page. If the page is the first page, go to step 504; otherwise, step 506 is performed.
Step 504 requests a page of data from the web server and presents it, and requests a page of data from the web server and caches it.
Step 505, determine whether the data amount of the currently cached data is zero. If the data amount of the currently cached data is zero, execute step 509; otherwise, step 511 is performed.
At step 506, a page of data is requested from the web server and cached.
Step 507, determining whether the data volume of the data acquired from the web server is zero. If the data volume of the acquired data is zero, executing step 508; otherwise, step 510 is performed.
And step 508, acquiring and displaying the current cached data.
In step 509, it is determined that the page is the last page.
Step 510, a page of data is requested from the currently cached data, and the acquired data is displayed on the page.
Step 511. It is determined that the page is not the last page and a "next page" button is presented on the page.
In the embodiment of the present invention, when a page of data is requested to be obtained from the web server or the currently cached data, if the amount of data of the URL existing in the web server or the currently cached data is greater than or equal to the amount of the page of data, a page of data is obtained from the web server or the currently cached data; otherwise, the existing data of the URL is obtained from the website server or the currently cached data, and the data of the URL may be less than one page or may be zero.
FIG. 6 is a device for displaying data page by page according to an embodiment of the present invention. The apparatus is a browser, and includes:
the first judging module 601 is configured to, when it is determined that a page is to be displayed, judge whether the page is a first page;
a second obtaining module 602, configured to obtain, when the first determining module 601 determines that the page is a first page, first data from a website server according to a first data unit, and obtain second data from the website server according to a second data unit; when the first judging module 601 judges that the page is not the first page, third data is acquired from the website server according to the second data unit;
a third caching module 603, configured to obtain and cache the second data and the third data from the second obtaining module 602;
a fourth judging module 604, configured to, when the first judging module 601 judges that the page is the first page, judge whether the page is the last page according to the data amount of the second data; when the first determining module 601 determines that the page is not the first page, determining whether the page is the last page according to the data amount of the currently cached data and/or the data amount of the third data in the third caching module 603;
a fifth displaying module 605, configured to, when the first determining module 601 determines that the page is the first page, obtain the first data from the second obtaining module 602, and display the first data in the page; when the first determining module 601 determines that the page is not the first page, acquiring fourth data from the currently cached data in the third caching module 603 according to the first data unit and displaying the fourth data in the page; when the fourth judging module 604 judges that the page is not the last page, displaying an operation control for linking to the next page on the page; and
a sixth determining module 606, configured to determine to prepare to display a next page in response to an operation of the operation control by the user; when the fourth determining module 604 determines that the page is the last page, it is determined that the next page is not ready to be displayed;
when the second obtaining module 602 obtains data from the web server according to the first data unit or the second data unit, if the amount of data of the currently existing URL in the web server is greater than or equal to the first data unit or the second data unit, the second obtaining module 602 obtains the data of the first data unit or the second data unit from the web server, otherwise, the second obtaining module 602 obtains the data of the currently existing URL from the web server;
if the data amount of the currently cached data of the third caching module 603 is greater than or equal to the first data unit, the data amount of the fourth data acquired by the fifth presentation module 605 is equal to the first data unit, otherwise, the data amount of the fourth data is equal to the data amount of the currently cached data in the third caching module 603.
In an embodiment of the present invention, the second data unit is a data amount of which one page can display data. The apparatus further comprises:
a seventh determining module 607, configured to compare the data amount of the currently cached data in the third caching module 603 with the first data unit when the first determining module 601 determines that the page is not the first page;
the fourth determining module 604 is further configured to determine that the page is the last page when the seventh determining module 607 determines that the data amount of the currently cached data in the third caching module 603 is smaller than the first data unit; when the seventh determining module 607 determines that the data amount of the currently cached data in the third caching module 603 is equal to the first data unit, it determines whether the data amount of the third data is zero, and when the data amount of the third data is zero, it determines that the page is the last page; when the data amount of the third data is not zero, it is determined that the page is not the last page.
In an embodiment of the present invention, the second data unit is a data amount of data that can be displayed on one page, when the first determining module 601 determines that the page is not the first page, the fourth determining module 604 is further configured to determine whether the data amount of the third data is zero, and when the data amount of the third data is zero, determine that the page is the last page; when the data amount of the third data is not zero, it is determined that the page is not the last page.
In an embodiment of the present invention, when the first determining module 601 determines that the page is not the first page, the fourth determining module 604 is further configured to determine whether the data amount of the currently cached data in the third caching module 603 is zero after the fifth displaying module 605 displays the fourth data in the page and the third caching module 603 caches the third data; when the data volume of the current cached data is zero, judging that the page is the last page; and when the data volume of the current cached data is not zero, judging that the page is not the last page.
FIG. 7 is a block diagram of an apparatus for displaying data page by page according to an embodiment of the present invention. As shown in fig. 7, the apparatus may include: a processor 701, a non-volatile computer-readable memory 702, a display unit 703, a network communication interface 704. These components communicate over a bus 705.
In this embodiment, memory 702 has stored therein a number of program modules, including an operating system 706, a network communication module 707, and application programs 708.
The processor 701 may read various modules (not shown) included in the application program in the memory 702 to perform various functional applications of the apparatus for paging presentation data and data processing. The processor 701 in this embodiment may be one or multiple processors, and may be a CPU, a processing unit/module, an ASIC, a logic module, a programmable gate array, or the like.
Operating system 706 may be: windows operating system, Android operating system, or apple iPhone OS operating system.
The application programs 708 may include: data paging presentation module 709. The data page presentation module 709 may include a set of computer-executable instructions 709-1 and corresponding metadata and heuristics 709-2 formed by the various functional modules of the device shown in FIG. 6. These sets of computer-executable instructions may be executed by the processor 701 and perform the functions of the method illustrated in fig. 2-5 or the apparatus illustrated in fig. 6.
In the present embodiment, the network communication interface 704 cooperates with the network communication module 707 to perform transceiving of various network signals of the apparatus for displaying data in pages, such as sending a data acquisition request to a website server and receiving data from the website server.
The display unit 703 has a display panel for inputting and displaying related information.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The functional modules of the embodiments may be located in one terminal or network node, or may be distributed over a plurality of terminals or network nodes.
In addition, each of the embodiments of the present invention can be realized by a data processing device such as a data processing program executed by a computer. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like.
The invention therefore also provides a storage medium in which a data processing program is stored which is designed to carry out any one of the embodiments of the method according to the invention described above.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (7)

1. A method for displaying data in a page, which is applied to a browser in a terminal device, when displaying data from a uniform resource locator URL, the method comprising:
when determining that a page is to be displayed, judging whether the page is a first page;
when the page is a first page, acquiring first data from a website server according to a first data unit and displaying the first data in the page, acquiring second data from the website server according to a second data unit, caching the second data, and judging whether the page is a last page or not according to the data volume of the second data; when data is acquired from the website server according to the first data unit or the second data unit, if the amount of data of the URL currently existing in the website server is greater than or equal to the first data unit or the second data unit, acquiring the data of the first data unit or the second data unit from the website server, otherwise acquiring the data of the URL currently existing from the website server;
when the page is not the first page, acquiring third data from the website server according to the second data unit, judging whether the page is the last page according to the data volume of the current cached data and the data volume of the third data, acquiring fourth data from the current cached data according to the first data unit, and displaying the fourth data in the page; wherein if the data amount of the currently cached data is greater than or equal to the first data unit, the data amount of the fourth data is equal to the first data unit; otherwise, the data volume of the fourth data is equal to the data volume of the current cached data;
when the page is not the last page, displaying an operation control for linking to the next page on the page, so as to respond to the operation of the operation control by a user and determine that the next page is ready to be displayed;
when the page is the last page, determining that a next page is not ready to be displayed;
wherein, the second data unit is a data size of data which can be displayed on one page, and the judging whether the page is the last page according to the data size of the current cached data and the data size of the third data comprises:
when the data volume of the current cached data is smaller than the first data unit, judging that the page is the last page;
when the data volume of the currently cached data is equal to the first data unit, acquiring and caching the third data from the website server according to the second data unit, and judging whether the data volume of the third data is zero or not; when the data volume of the third data is zero, judging that the page is the last page; when the data amount of the third data is not zero, it is determined that the page is not the last page.
2. The method of claim 1, further comprising:
when a page is initially loaded, it is determined that the page is ready to be presented.
3. The method of claim 1, further comprising:
setting and initializing a page value of the page to a first value when data from a URL is to be presented, and adding one to the page value when the page is presented; the judging whether the page is a first page comprises: judging whether the page numerical value is the first numerical value or not, and judging that the page is the first page when the page numerical value is the first numerical value; or
When data from a URL is ready to be displayed, setting and initializing a value of a page flag bit to be invalid, when the page is displayed, judging whether the value of the page flag bit is invalid, if the value of the page flag bit is invalid, modifying the value of the page flag bit to be valid, and judging whether the page is a first page comprises the following steps: and judging whether the value of the page flag bit is invalid, and when the value of the page flag bit is invalid, judging that the page is the first page.
4. The method according to claim 1, wherein determining whether the page is a last page according to the data amount of the currently cached data and/or the data amount of the third data, and acquiring fourth data from the cached data according to the first data unit and displaying the fourth data in the page comprises:
acquiring the fourth data from the current cached data according to the first data unit and displaying the fourth data in the page;
acquiring and caching the third data from the website server according to the second data unit;
judging whether the data volume of the current cached data is zero or not;
when the data volume of the current cached data is zero, judging that the page is the last page;
and when the data volume of the current cached data is not zero, judging that the page is not the last page.
5. An apparatus for displaying data in a page, the apparatus being applied to a browser for displaying data from a Uniform Resource Locator (URL), the apparatus comprising:
the display device comprises a first judging module, a second judging module and a display module, wherein the first judging module is used for judging whether a page is a first page or not when the page is determined to be prepared to be displayed;
the second obtaining module is used for obtaining first data from a website server according to a first data unit and obtaining second data from the website server according to a second data unit when the first judging module judges that the page is the first page; when the first judging module judges that the page is not the first page, third data are obtained from the website server according to the second data unit;
a third cache module, configured to obtain and cache the second data and the third data from the second obtaining module;
the fourth judging module is used for judging whether the page is the last page or not according to the data volume of the second data when the first judging module judges that the page is the first page; when the first judging module judges that the page is not the first page, judging whether the page is the last page according to the data volume of the current cached data in the third caching module and the data volume of the third data;
the fifth display module is used for acquiring the first data from the second acquisition module and displaying the first data in the page when the first judgment module judges that the page is the first page; when the first judging module judges that the page is not the first page, acquiring fourth data from the current cached data in the third caching module according to the first data unit and displaying the fourth data in the page; when the fourth judging module judges that the page is not the last page, displaying an operation control for linking to the next page on the page; and
the sixth judging module is used for responding to the operation of the user on the operation control and determining that the next page is ready to be displayed; when the fourth judging module judges that the page is the last page, determining that the next page is not ready to be displayed;
the first data unit is a data amount of data which can be displayed on one page, the second data unit is a data amount of data which can be displayed on at least one page, when the second obtaining module obtains data from the website server according to the first data unit or the second data unit, if the data amount of the currently existing URL in the website server is larger than or equal to the first data unit or the second data unit, the second obtaining module obtains the data of the first data unit or the second data unit from the website server, otherwise, the second obtaining module obtains the data of the currently existing URL from the website server;
if the data volume of the currently cached data of the third caching module is greater than or equal to the first data unit, the data volume of the fourth data acquired by the fifth display module is equal to the first data unit, otherwise, the data volume of the fourth data is equal to the data volume of the currently cached data;
wherein the second data unit is a data size of which one page can display data, and the apparatus further comprises:
a seventh judging module, configured to compare the data amount of the currently cached data in the third caching module with the first data unit when the first judging module judges that the page is not the first page;
the fourth judging module is further configured to, when the seventh judging module judges that the data size of the currently cached data in the third caching module is smaller than the first data unit, judge that the page is the last page; when the seventh judging module judges that the data volume of the currently cached data in the third caching module is equal to the first data unit, judging whether the data volume of the third data is zero, and when the data volume of the third data is zero, judging that the page is the last page; when the data amount of the third data is not zero, it is determined that the page is not the last page.
6. The apparatus of claim 5, wherein when the first determining module determines that the page is not the first page,
the fourth determining module is further configured to determine whether the data size of the currently cached data in the third caching module is zero after the fifth displaying module displays the fourth data in the page and the third caching module caches the third data; when the data volume of the current cached data is zero, judging that the page is the last page; and when the data volume of the current cached data is not zero, judging that the page is not the last page.
7. A storage medium storing a data processing program comprising instructions that, when executed by a computing device, cause the computing device to perform the method of any of claims 1-4.
CN201610042253.4A 2016-01-22 2016-01-22 Method and device for displaying data in paging mode Active CN105740330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610042253.4A CN105740330B (en) 2016-01-22 2016-01-22 Method and device for displaying data in paging mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610042253.4A CN105740330B (en) 2016-01-22 2016-01-22 Method and device for displaying data in paging mode

Publications (2)

Publication Number Publication Date
CN105740330A CN105740330A (en) 2016-07-06
CN105740330B true CN105740330B (en) 2020-08-28

Family

ID=56246364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610042253.4A Active CN105740330B (en) 2016-01-22 2016-01-22 Method and device for displaying data in paging mode

Country Status (1)

Country Link
CN (1) CN105740330B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106919639A (en) * 2016-08-22 2017-07-04 阿里巴巴集团控股有限公司 A kind of processing method and processing device of data loading
CN106339508B (en) * 2016-10-25 2020-03-17 电子科技大学 WEB caching method based on paging
CN106789167A (en) * 2016-11-28 2017-05-31 努比亚技术有限公司 A kind of data processing method and server
CN106874010B (en) * 2017-02-28 2019-12-06 山东大学 Method for rapid page loading of ListView in Android system
CN107479887B (en) * 2017-08-11 2018-06-22 腾讯科技(深圳)有限公司 A kind of data display method, device and storage device
CN107590275B (en) * 2017-09-27 2021-05-14 北京时之砂科技有限公司 Data query method and device
CN110943970B (en) * 2019-10-09 2022-12-20 视联动力信息技术股份有限公司 Data request method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661459A (en) * 2009-10-19 2010-03-03 中国电信股份有限公司 Method for providing network document resources, platform thereof and system thereof
CN102411585A (en) * 2010-09-21 2012-04-11 厦门市美亚柏科信息股份有限公司 Webpage paging data pre-loading method and system
CN102902677A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Browser and browsing method thereof
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN105183764A (en) * 2015-07-29 2015-12-23 广州神马移动信息科技有限公司 Data paging method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9177077B2 (en) * 2012-04-13 2015-11-03 Apple Inc. Method for improving backward/forward performance between certain types of dynamic web pages

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661459A (en) * 2009-10-19 2010-03-03 中国电信股份有限公司 Method for providing network document resources, platform thereof and system thereof
CN102411585A (en) * 2010-09-21 2012-04-11 厦门市美亚柏科信息股份有限公司 Webpage paging data pre-loading method and system
CN102902677A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Browser and browsing method thereof
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN105183764A (en) * 2015-07-29 2015-12-23 广州神马移动信息科技有限公司 Data paging method and apparatus

Also Published As

Publication number Publication date
CN105740330A (en) 2016-07-06

Similar Documents

Publication Publication Date Title
CN105740330B (en) Method and device for displaying data in paging mode
US11055085B2 (en) Method, apparatus, and system for hot-deploying application
US11086962B2 (en) Webpage loading method, client and server
WO2017133499A1 (en) Webpage access method and device
EP2653987A1 (en) Displaying web pages without downloading static files
CN108090078B (en) Document online preview method and device, storage medium and electronic equipment
WO2017202255A1 (en) Page display method and apparatus, and client device
US9069876B2 (en) Memory caching for browser processes
CN106528587B (en) Page display method and device in composite webpage system
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
CN108334516B (en) Information pushing method and device
US20230033164A1 (en) Webpage image monitoring method and apparatus, electronic device, and computer-readable storage medium
CN111783005B (en) Method, device and system for displaying web page, computer system and medium
CN111078697B (en) Data storage method and device, storage medium and electronic equipment
EP2998885A1 (en) Method and device for information search
US20140331117A1 (en) Application-based dependency graph
US20140032652A1 (en) Web browser operation method and system
WO2024011899A1 (en) Widget loading method and apparatus, device, and storage medium
CN111367606A (en) Application page display method, device, terminal and medium
WO2023082813A1 (en) Information sharing method and apparatus, electronic device and storage medium
CN114116656B (en) Data processing method and related device
CN103139298A (en) Method for transmitting network data and device
US8402367B1 (en) Smart reload pages
KR20130103239A (en) Method, server and terminal for providing web browsing service having translation
CN108846141B (en) Offline cache loading method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant