HK1241069A - Method and device for paging data query - Google Patents
Method and device for paging data query Download PDFInfo
- Publication number
- HK1241069A HK1241069A HK18100314.9A HK18100314A HK1241069A HK 1241069 A HK1241069 A HK 1241069A HK 18100314 A HK18100314 A HK 18100314A HK 1241069 A HK1241069 A HK 1241069A
- Authority
- HK
- Hong Kong
- Prior art keywords
- data
- page
- queried
- inquired
- query
- Prior art date
Links
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for querying paged data.
Background
With the rapid development of internet information technology, the data volume of various network application systems is increased, and many technical difficulties to be overcome are faced when processing mass data, such as storage of mass data, update of data, display of data, and the like.
In the aspect of data display of mass data, when a user queries data by clicking a website link, the browser needs a long time to load data because the data amount stored in the background of the server is huge, the browser often only can display blank pages to the user during data loading, and the long waiting time brings extremely poor use experience to the user.
In the prior art, in order to avoid the above problems that may be encountered when displaying massive data, a paging query technique is often adopted, that is, data to be displayed is divided into a plurality of pages, each page displays a certain data amount, and a system searches and positions data to be displayed currently according to the data amount and query page number displayed by each page and displays the data to a user.
The paging inquiry technology is adopted to inquire the data in a certain data table, because the data in the data table can be updated at any time, therefore, when the client sends the paging inquiry request to the back-end server, the back-end server responds to the received paging inquiry request, and will perform two inquiry operations to respectively inquire the data in the specified page to be inquired by the client in the paging inquiry request of this time and the total number of data contained in the data table during the inquiry of this time, further, the total number of pages that can be displayed on the client side of the data table can be judged according to the total number of data in the current data table and the number of data contained in each page, and determines whether the page corresponding to the paging inquiry request is the last page according to the inquiry page number contained in the current paging inquiry request, that is, whether or not the page can be turned backward after the page corresponding to the paging inquiry request is displayed.
Due to the adoption of the existing paging query technology, when paging query is performed, a back-end server needs to perform access twice to a data storage module (such as a database) for storing data, and the maximum access times allowed by the data storage module in unit time are often fixed, so that the existing paging query technology is adopted, a large number of access resources of the data storage module are occupied when paging query is performed, the processing speed of the server on a request is influenced, and the processing efficiency of the server is reduced.
Therefore, how to reduce the occupation of the server access resources when performing paging query becomes a problem to be solved in the prior art.
Disclosure of Invention
The embodiment of the application provides a method and a device for paging data query, which are used for solving the problem that in the prior art, when paging data query is carried out, a server needs to access a database for multiple times, a large number of access resources are occupied, and the processing efficiency of the server is low.
The method for paging data query provided by the embodiment of the application comprises the following steps:
sending an inquiry request of paging data to a server, wherein the inquiry request is used for requesting inquiry of initial data of a page to be inquired and first quantity of data behind the initial data, and the first quantity is the sum of the maximum data number which can be displayed on the page to be inquired and a preset number;
receiving query result data sent by a server;
and determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data.
The embodiment of the application also provides a method for querying the paged data, which comprises the following steps:
receiving an inquiry request of paging data sent by a client, wherein the inquiry request is used for requesting to inquire data which takes the initial data of a page to be inquired as the start and takes the quantity of the data as the maximum displayable data of the page to be inquired;
calculating the number of data to be queried according to the query request, and querying according to the number of the data to be queried to obtain query result data; the number of the data to be inquired is the sum of the maximum number of the data which can be displayed on the page to be inquired and a preset number;
determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data;
and sending feedback data to the client, wherein the feedback data comprises information for determining whether the page to be inquired can be turned over.
The device for querying the paged data provided by the embodiment of the application comprises:
the query request sending unit is used for sending a query request of paging data to a server, wherein the query request is used for requesting to query data of a first quantity starting from initial data of a page to be queried, and the first quantity is the sum of the maximum data number which can be displayed on the page to be queried and a preset number;
the query result receiving unit is used for receiving query result data sent by the server;
and the page turning determining unit is used for determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data.
The embodiment of the present application further provides a device for querying paged data, including:
the query request receiving unit is used for receiving a query request of paging data sent by a client, wherein the query request is used for requesting to query data which takes the initial data of a page to be queried as the start data and takes the quantity as the maximum displayable data number of the page to be queried;
the query unit is used for calculating the number of the data to be queried according to the query request and querying according to the number of the data to be queried to obtain query result data; the number of the data to be inquired is the sum of the maximum number of the data which can be displayed on the page to be inquired and a preset number;
the page turning determining unit is used for determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data;
and the data feedback unit is used for sending feedback data to the client, wherein the feedback data comprises information used for determining whether the page to be inquired can be turned over.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
the technical scheme of the embodiment of the application determines a first amount of data starting from the initial data of the page to be queried according to the paging data query request when the data of the paging data is queried, the first quantity is the sum of the maximum data number which can be displayed on the page to be inquired and the preset number, that is, when inquiring, the number of the data which is actually inquired is larger than the maximum data number which can be displayed on the page to be inquired, and then the page to be inquired can be determined whether to be turned over or not by comparing the data number of the inquiry result data with the data number which can be displayed on the page to be inquired, in the process, only one access to the database is needed according to the data query request, so that compared with the prior art, the access to the database in the paging data query process is reduced, the occupation of the server on the database access resources is saved, and the processing efficiency of the server is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic specific flowchart of a method for querying paged data according to an embodiment of the present disclosure;
fig. 2 is a schematic specific flowchart of a method for querying paged data according to an embodiment of the present disclosure;
fig. 3 is a schematic view illustrating a page display effect according to an embodiment of the present application;
fig. 4 is a schematic view illustrating a page display effect according to an embodiment of the present application;
fig. 5 is a schematic specific flowchart of another method for paging data query according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for querying paged data according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of another apparatus for paging data query according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some 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.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
The embodiment of the application provides a method for paging data query, which is used for solving the problem that in the prior art, when paging data query is carried out, a server needs to access a database for multiple times, a large number of access resources are occupied, and the processing efficiency of the server is low.
The execution main body of the method for paging data query provided by the embodiment of the present application may be, but is not limited to, at least one of an intelligent terminal device such as a mobile phone, a tablet Computer, a Personal Computer (PC), and a smart television. In addition, the execution subject of the method may also be an Application (APP) itself running on the smart terminal.
For convenience of description, the following description will be made of an embodiment of the method, taking a smart phone as an example of an execution subject of the method. It is understood that the implementation of the method in a smart phone is merely an exemplary illustration and should not be construed as a limitation of the method.
The specific implementation flow diagram of the method is shown in fig. 1, and mainly comprises the following steps:
step 11, sending a paging data query request to a server;
the query request is used for requesting query of a first quantity of data starting from initial data of a page to be queried, and the first quantity is the sum of the maximum data number which can be displayed on the page to be queried and a preset number.
It should be noted that, in order to reduce the query pressure of the server, the first number is usually only one to two more than the maximum number of data displayable on the page to be queried, and the preset number is generally one to two. In an embodiment, the preset number may be smaller than the maximum number of data displayable on the page to be queried, but the embodiment is not limited thereto, and the preset number may also be larger than the maximum number of data displayable on the page to be queried, which can also achieve the technical object of the embodiment, but the preset number is smaller than the maximum number of data displayable on the page to be queried is a preferred embodiment.
The page to be queried is a page that a user desires to display by the smart phone, and in order to display the page to be queried to the user, the smart phone needs to send a query request to the server to obtain data of the page to be queried, and then generates the page to be queried according to the data returned by the server. It should be noted that the page to be queried may be a page next to a currently displayed page of the smartphone, or may also be a specified page that the user desires to display by the smartphone. For example, taking a third page of a data table currently being browsed by a user as an example, when the user clicks a next page, the smart phone is triggered to send a query request to the server, and at this time, the page to be queried is a fourth page that is a page subsequent to the currently displayed third page; when a user inputs the tenth page in the designated area and clicks to jump, the smart phone is also triggered to send a query request to the server, and the page to be queried is the tenth page designated to be queried by the user.
In daily use, a user can set different font sizes for the smart phone according to own use habits, and the different font sizes can directly influence the number of data pieces which can be displayed on each page in the display page of the smart phone. For example, the smartphone supports a user to set fonts of three sizes, i.e., "large", "medium", and "small", and when the user sets the font of the smartphone to "large", each page of the smartphone display page may display 50 characters, and when the user sets the font of the smartphone to "small", each page of the smartphone display page may display 100 characters. Therefore, due to the setting of the user, the number of data pieces which can be displayed in the display pages of different smart phones is different.
Therefore, in order to enable the server to determine the initial data of the query requested by the smartphone and the number of pieces of data of the query requested by the smartphone according to the query request of the paging data sent by the smartphone, the query request often needs to include information for determining the initial data in the page to be queried and information for determining the number of pieces of data included in the page to be queried.
In one embodiment, the query request of the paged data sent by the smartphone to the server in the embodiment of the present application may include, but is not limited to, the following three types:
type 1: the query request comprises an identifier of initial data and an identifier of end data of data to be queried;
it should be noted that the data stored in the database are often arranged according to a designated sequence, and when the smartphone displays the data, the smartphone also acquires the data from the database according to the storage sequence of the data in the database and generates a display page to be displayed to the user. For example, taking the currently displayed page of the smartphone as the first page, and 20 pieces of data can be displayed in the page, the smartphone may send an inquiry request to the server, so that the server sequentially queries backwards from the first piece of data stored in the database according to the storage order to obtain twenty pieces of data in total. The server may determine from which data in the database the query request starts according to the identifier of the starting data in the query request, and calculate the number of data to be queried according to the identifier of the starting data and the identifier of the ending data, and further perform data query in the database according to the calculated number of data to be queried starting from the determined starting data.
It should be further noted that, in order to achieve the purpose that when performing paging data query, the server can determine whether the page to be queried can be turned over only by accessing the database once, the number of pieces of data to be queried in the query request sent by the smartphone to the server is greater than the maximum number of pieces of data that can be displayed on the page to be queried, and therefore, the identifier of the tail data included in the query request is often different from the identifier of the last piece of data that can be actually displayed on the page to be queried. Assuming that the page to be queried is a first page, the page to be queried can display 20 pieces of data, the identifier of the initial data which can be actually displayed on the page to be queried is "1", the identifier of the ending data which can be actually displayed is "20", when a query request is sent to the server, the number of pieces of data which are requested to be queried by the smartphone is increased by 1 compared with the number of pieces of data which can be displayed on the page to be queried, the identifier of the initial data contained in the query request sent to the server by the smartphone is "1", and the identifier of the ending data is "21".
Type 2: the query request comprises the page number of the page to be queried, the maximum data number which can be displayed on the page to be queried and the number of the data to be queried;
the server can determine the page number of the page to be queried according to the page number of the page to be queried in the received query request, further calculate the number of data contained in the page before the page to be queried according to the page number of the page before the page to be queried and the maximum number of data displayable on the page to be queried, take the next piece of data of the last piece of data contained in the page before the page to be queried as the initial data of the data to be queried, and further perform data query according to the number of the data to be queried by taking the determined initial data as the initial data in the database.
For example, if the page number of the page to be queried is 10 th page, the maximum number of data pieces that can be displayed on the page to be queried is 20, and the number of data pieces to be queried is 21, then the page number before the page to be queried may be determined to be 9 th page, and then 180 pieces of data included in the page before the page to be queried may be calculated, and then the last piece of data included in the 9 th page is 180 th data stored in the database, then the start data of the 10 th page may be determined to be 181 th data stored in the database, and then the server may query the database for the 21 pieces of data from 181 th to 201 th.
Type 3: the query request comprises an identifier of initial data of a page to be queried and the number of data to be queried;
when the query request directly includes the identifier of the start data of the page to be queried and the number of the pieces of data to be queried, the server may directly query the number of the pieces of data to be queried in the database from the start data corresponding to the identifier of the start data according to the identifier of the start data included in the query request.
The information contained in the paging data query request sent to the server by the smart phone is not specifically limited, as long as the server can determine the initial data requested to be queried and the number of pieces of data requested to be queried according to the received query request.
Step 12, receiving query result data sent by a server;
the server responds to the query request sent by the smart phone through the execution step 11, accesses a database storing data to be queried, queries the data in the database according to the initial data determined in the query request and the number of pieces of data requested to be queried, and returns the queried data to the smart phone.
It should be noted here that, due to the relationship between the storage order of the initial data in the page to be queried in the database and the number of pieces of data stored in the database, the server may not be able to query the database for the same number of pieces of data as the number of pieces of data to be queried. For example, 1000 pieces of data are stored in the database altogether, the identifier of the initial data of the query request in the query request sent by the smartphone to the server is "980", the identifier indicates that the initial data of the query is 980 th data stored in the database, the number of the data of the query request is 21, and only 20 pieces of data arranged after the 980 th data of the initial data in the database are available, so that the server can only query 20 pieces of data from the database, but cannot query 21 pieces of data, and return the queried 20 pieces of data to the smartphone.
And step 13, determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data.
As can be seen from the foregoing, by executing step 11, the number of pieces of data requested to be queried by the smartphone is greater than the maximum number of pieces of data displayable on the page to be queried, and if there are other pages behind the page to be queried, according to the query request, the number of pieces of data actually queried by the server in the database is the sum of the maximum number of pieces of data displayable on the page to be queried and the number of pieces of data of the preset number included in the next page of the page to be queried. Obviously, when the server can inquire the data with the same number as the data to be inquired in the database, the server indicates that the next page is behind the page to be inquired; when the server cannot inquire the data with the same number as the data to be inquired in the database, the number of the data after the page to be inquired is smaller than the preset number, and when the number of the inquired data is smaller than the maximum number of the data which can be displayed on the page to be inquired, the server indicates that no next page is behind the page to be inquired.
Therefore, in an embodiment, the smartphone may determine whether there is a next page after the page to be queried by comparing the number of pieces of query result data obtained by performing step 12 with the maximum number of pieces of data displayable on the page to be queried, that is, whether the page to be queried can be turned over.
In the embodiment of the present application, by performing step 13, there are two results:
results a: when the number of the data of the query result data is larger than the maximum number of the data which can be displayed on the page to be queried, determining that the page to be queried can be turned over;
and when the page to be queried is determined to be page turnable, the smart phone generates the page to be queried according to a preset page layout protocol and received query result data returned by the server, and at the moment, a second amount of data can be displayed in the generated page to be queried, wherein the second amount of data is the maximum displayable data number of the page to be queried.
Specifically, the smartphone can select data, which is the same as the maximum number of data displayable on the page to be queried, from query result data returned by the server in sequence as data to be displayed on the page to be queried.
Meanwhile, after the smart phone displays the data of the page to be inquired, the smart phone can also generate a virtual key for triggering a page turning-down instruction so as to prompt the user that the next page is behind the currently displayed page.
Results b: and when the number of the data of the query result data is less than or equal to the maximum number of the data which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
When the page to be queried is determined not to be turned, the smart phone generates the page to be queried according to a preset page layout protocol and received query result data returned by the server, and because the number of the query result data returned by the server at the moment is less than the maximum displayable data number of the page to be queried, in this case, a third number of data can be displayed in the generated page to be queried, wherein the third number is the number of the data of the query result data returned by the server.
The following description will be given in detail by taking an example that when a user uses a mobile phone to query data, the mobile phone sends a query request of paging data to a server to obtain the data, and generates and displays a page to be queried according to the obtained data, where a specific flowchart of the method is shown in fig. 2, and the method mainly includes the following steps:
step a: a user sends a paging data query request to a server through a smart phone;
the query request comprises an identifier of initial data of a page to be queried and the number of pieces of data to be queried, and the number of pieces of data to be queried is the sum of the maximum number of pieces of data which can be displayed on the page to be queried and a preset number.
Step b: the server responds to the received query request, accesses the database and returns query result data obtained by querying from the database to the smart phone;
step c: the smart phone judges whether the page to be inquired can be turned according to the number of the received data of the inquiry result data, when the page to be inquired is judged to be turned, the step d is executed, and when the page to be inquired is judged not to be turned, the step e is executed;
specifically, the smart phone can judge whether the next page is behind the page to be queried or not, namely whether the page to be queried can be turned over or not by comparing the number of the data pieces of the obtained query result data with the maximum number of the data pieces displayable on the page to be queried, and when the number of the data pieces of the query result data is greater than the maximum number of the data pieces displayable on the page to be queried, determining that the page to be queried can be turned over; and when the number of the data pieces of the query result data is less than or equal to the maximum number of the data pieces which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
Step d: the smart phone generates a display interface of a page to be inquired according to a preset page layout protocol and received inquiry result data returned by the server, the number of data pieces which can be displayed in the generated display interface of the page to be inquired is the maximum number of data pieces which can be displayed by the page to be inquired, the display effect of the display interface of the smart phone is shown in figure 3, the maximum number of data pieces which can be displayed is displayed in the figure, and page turning icons are displayed to prompt a user that data exists behind the user.
Step e: the smart phone generates a display interface of a page to be queried according to a preset page layout protocol and received query result data returned by the server, wherein the number of the query result data returned by the server is less than the maximum number of data displayable on the page to be queried, under the condition, the number of the data which can be displayed in the generated display interface of the page to be queried is the number of the data of the query result data returned by the server, the display effect of the display interface of the smart phone is shown in figure 4, the queried data is displayed in the figure, and a page turning icon is not provided, so that a user is prompted that no data exists behind the user.
By adopting the method for paging data query provided in embodiment 1 of the present application, when performing data query of paging data, according to a paging data query request sent from a client to a server, a first amount of data starting from the starting data of a page to be queried can be determined, where the first amount is a sum of a maximum number of data displayable on the page to be queried and a preset number, that is, when the server performs query in response to the paging data query request sent from the client, the number of actually queried data is greater than the maximum number of data displayable on the page to be queried, and query result data obtained by querying is returned to the client, and the client can determine whether the page to be queried can be turned over by comparing the number of data of the query result data with the number of data displayable on the page to be queried, because the server only needs to access a database once in response to the data query request sent from the client in the process, compared with the prior art, the method has the advantages that the access to the database in the paging data query process is reduced, the occupation of the server on the database access resources is saved, and the processing efficiency of the server is improved.
Example 2
The foregoing embodiment 1 describes the inventive concept of the present application in detail by using a smart phone as an execution subject, and the inventive concept of the present application can also be implemented on a server side. The server may be a server of a shopping website, a server of a music website, a server of a reading website, etc. In order to better understand the technical features, means and effects of the present application, the following further description is provided for a method for performing a subject-based server paging data query of the present application, thereby forming a further embodiment of the present application.
The embodiment of the application provides a method for paging data query, which is used for solving the problem that in the prior art, when paging data query is carried out, a server needs to access a database for multiple times, a large number of access resources are occupied, and the processing efficiency of the server is low. The specific flow diagram of the method is shown in fig. 5, and mainly comprises the following steps:
step 21, receiving a paging data query request sent by a client;
the query request sent by the client is used for requesting to query data which is started from the initial data of the page to be queried and has the quantity of the data which is the maximum data number capable of being displayed on the page to be queried.
It should be noted that the client may send the following three types of query requests to the server:
type a: the query request comprises an identifier of initial data and an identifier of end data of a page to be queried;
type b: the query request comprises the page number of the page to be queried and the maximum data number which can be displayed by the page to be queried;
type c: the query request comprises the identification of the initial data of the page to be queried and the maximum data number which can be displayed by the page to be queried.
Step 22: calculating the number of data to be queried according to the query request, and querying according to the number of the data to be queried to obtain query result data;
and calculating the number of data to be queried according to the query request, and querying according to the number of the data to be queried to obtain query result data.
Specifically, when the query request received by the server is of type a, calculating the number of data to be queried according to the query request, specifically, the calculating may include: calculating the maximum data number which can be displayed on the page to be inquired according to the mark of the initial data and the mark of the end data of the page to be inquired; and taking the sum of the calculated maximum data number which can be displayed on the page to be inquired and a preset number as the number of the data to be inquired. The preset number is generally smaller than the maximum number of data pieces of the page to be queried.
Step 23: determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data;
specifically, when the number of pieces of query result data is greater than the maximum number of pieces of data displayable on the page to be queried, it may be determined that the page to be queried may be turned over.
And when the number of the data pieces of the query result data is less than or equal to the maximum number of the data pieces which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
And step 24, sending feedback data to the client, wherein the feedback data comprises information for determining whether the page to be inquired can be turned over.
It should be noted that, according to the paging data query method provided in the embodiment of the present application, only the query logic of the server needs to be modified and updated by the background staff, and the client does not need to be updated, that is, the client installed on the mobile phone does not need to be updated by the user, so that the paging data query method is relatively easy to accept by the user.
By adopting the method for paging data query provided in embodiment 2 of the present application, when performing data query on paging data, according to a paging data query request sent from a client to a server, it can be determined that data to be queried starts with start data of a page to be queried, and the quantity of the data to be queried is the sum of the maximum data number displayable on the page to be queried and a preset number. That is, when the server queries in response to a query request of paging data sent by the client, the number of data pieces actually queried is greater than the maximum number of data pieces displayable on the page to be queried. The server returns the inquired inquiry result data to the client, and then the client can determine whether the page to be inquired can be turned over by comparing the number of the data of the inquiry result data with the number of the data which can be displayed on the page to be inquired.
Example 3
The embodiment of the application provides a device for paging data query, which is used for solving the problem that in the prior art, when paging data query is carried out, a server needs to access a database for multiple times, a large number of access resources are occupied, and the processing efficiency of the server is low. The device can be a user terminal such as a smart phone. The specific structural diagram of the device is shown in fig. 6, and the device comprises: an inquiry request transmitting unit 31, an inquiry result receiving unit 32, and a page turning determining unit 33.
The query request sending unit 31 is configured to send a query request of paging data to a server, where the query request is used to request to query a first amount of data starting from start data of a page to be queried, and the first amount is a sum of a maximum number of data that can be displayed on the page to be queried and a preset number;
a query result receiving unit 32, configured to receive query result data sent by the server;
a page turning determining unit 33, configured to determine whether the page to be queried can be turned over according to the number of data pieces of the query result data.
In an embodiment, the page turning determining unit 33 is specifically configured to: if the number of the data of the query result data is larger than the maximum number of the data which can be displayed on the page to be queried, determining that the page to be queried can be turned over; and if the number of the data pieces of the query result data is less than or equal to the maximum number of the data pieces which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
In one embodiment, the preset number is smaller than the maximum number of data displayable on the page to be queried.
In one embodiment, the apparatus further comprises a display unit for: when the page turning determining unit 33 determines that the page to be queried can be turned over, displaying a second amount of data on the page to be queried, where the second amount is the maximum number of data that can be displayed on the page to be queried; when the page turning determining unit 33 determines that the page to be queried cannot be turned, a third amount of data is displayed on the page to be queried, where the third amount is the number of data of the query result data.
In one embodiment, the page to be queried is a page next to the current page or a specified query page.
By adopting the paging data query device provided by the embodiment of the application, when paging data is queried, the number of actually queried data is larger than the maximum displayable number of the page to be queried, the queried result data is returned to the client, and then the client can compare the number of the queried result data with the displayable number of the page to be queried to determine whether the page to be queried can be turned over.
Example 4
The embodiment of the application provides a device for paging data query, which is used for solving the problem that in the prior art, when paging data query is carried out, a server needs to access a database for multiple times, a large number of access resources are occupied, and the processing efficiency of the server is low. The apparatus may be a server. The specific structural diagram of the device is shown in fig. 7, and the device comprises: an inquiry request receiving unit 41, an inquiry unit 42, a page turning determination unit 43, and a data feedback unit 44.
The query request receiving unit 41 is configured to receive a query request of paging data sent by a client, where the query request is used to request to query data which starts with start data of a page to be queried and is equal to the maximum number of data that can be displayed by the page to be queried;
the query unit 42 is configured to calculate the number of pieces of data to be queried according to the query request, and perform query according to the number of pieces of data to be queried to obtain query result data; the number of the data to be inquired is the sum of the maximum number of the data which can be displayed on the page to be inquired and a preset number;
a page turning determining unit 43, configured to determine whether the page to be queried can be turned over according to the number of data pieces of the query result data;
a data feedback unit 44, configured to send feedback data to the client, where the feedback data includes information used to determine whether the page to be queried can be turned over.
In one embodiment, the query request includes: the query unit is specifically configured to: calculating the maximum data number which can be displayed on the page to be inquired according to the mark of the initial data and the mark of the end data of the page to be inquired; and taking the sum of the calculated maximum data number which can be displayed on the page to be inquired and a preset number as the number of the data to be inquired.
In one embodiment, the query request includes: the page number of the page to be inquired and the maximum data number which can be displayed on the page to be inquired are obtained; or, the query request includes: the page query method comprises the steps of identifying the initial data of the page to be queried and the maximum number of data which can be displayed on the page to be queried.
In one embodiment, the preset number is smaller than the maximum number of data pieces of the page to be queried.
By adopting the paging data query device provided by the embodiment of the application, when paging data is queried, the number of actually queried data is larger than the maximum displayable data number of the page to be queried, the queried result data is returned to the client, and then the client can determine whether the page to be queried can be turned over by comparing the number of the queried result data with the displayable data number of the page to be queried.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
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.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 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 (18)
1. A method of paging data queries, comprising:
sending an inquiry request of paging data to a server, wherein the inquiry request is used for requesting to inquire data of a first quantity starting from initial data of a page to be inquired, and the first quantity is the sum of the maximum data number which can be displayed on the page to be inquired and a preset number;
receiving query result data sent by a server;
and determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data.
2. The method as claimed in claim 1, wherein determining whether the page to be queried is page turnable according to the number of data pieces of the query result data specifically comprises:
if the number of the data of the query result data is larger than the maximum number of the data which can be displayed on the page to be queried, determining that the page to be queried can be turned over;
and if the number of the data pieces of the query result data is less than or equal to the maximum number of the data pieces which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
3. The method of claim 1, wherein the predetermined number of pieces is less than a maximum number of pieces of data displayable by the page to be queried.
4. The method of claim 1, wherein if it is determined that the page to be queried is pageable, the method further comprises:
displaying a second amount of data on the page to be inquired, wherein the second amount is the maximum data number which can be displayed on the page to be inquired;
if the page to be inquired is determined not to be turned, the method further comprises the following steps:
and displaying a third amount of data on the page to be queried, wherein the third amount is the number of the data of the query result data.
5. The method of claim 1, wherein the page to be queried is a next page of a current page or a specified query page.
6. A method of paging data queries, comprising:
receiving an inquiry request of paging data sent by a client, wherein the inquiry request is used for requesting to inquire data which takes the initial data of a page to be inquired as the start and takes the quantity of the data as the maximum displayable data of the page to be inquired;
calculating the number of data to be queried according to the query request, and querying according to the number of the data to be queried to obtain query result data; the number of the data to be inquired is the sum of the maximum number of the data which can be displayed on the page to be inquired and a preset number;
determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data;
and sending feedback data to the client, wherein the feedback data comprises information for determining whether the page to be inquired can be turned over.
7. The method of claim 6, wherein the query request comprises: the mark of the initial data and the mark of the end data of the page to be inquired;
correspondingly, the calculating the number of the data to be queried according to the query request includes:
calculating the maximum data number which can be displayed on the page to be inquired according to the mark of the initial data and the mark of the end data of the page to be inquired;
and taking the sum of the calculated maximum data number which can be displayed on the page to be inquired and a preset number as the number of the data to be inquired.
8. The method of claim 6, wherein the query request comprises: the page number of the page to be inquired and the maximum data number which can be displayed on the page to be inquired are obtained; or, the query request includes: the page query method comprises the steps of identifying the initial data of the page to be queried and the maximum number of data which can be displayed on the page to be queried.
9. The method of claim 6, wherein the predetermined number is less than a maximum number of data pieces of the page to be queried.
10. An apparatus for paging data queries, comprising:
the query request sending unit is used for sending a query request of paging data to a server, wherein the query request is used for requesting to query data of a first quantity starting from initial data of a page to be queried, and the first quantity is the sum of the maximum data number which can be displayed on the page to be queried and a preset number;
the query result receiving unit is used for receiving query result data sent by the server;
and the page turning determining unit is used for determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data.
11. The apparatus of claim 10, wherein the page flip determination unit is specifically configured to:
if the number of the data of the query result data is larger than the maximum number of the data which can be displayed on the page to be queried, determining that the page to be queried can be turned over;
and if the number of the data pieces of the query result data is less than or equal to the maximum number of the data pieces which can be displayed on the page to be queried, determining that the page to be queried cannot be turned.
12. The apparatus of claim 10, wherein the predetermined number of pieces is less than a maximum number of pieces of data displayable by the page to be queried.
13. The apparatus of claim 10, further comprising a display unit to:
when the page turning determining unit determines that the page to be inquired can be turned over, displaying a second quantity of data on the page to be inquired, wherein the second quantity is the maximum data quantity which can be displayed on the page to be inquired;
and when the page turning determining unit determines that the page to be inquired cannot be turned, displaying a third amount of data on the page to be inquired, wherein the third amount is the number of the data of the inquiry result data.
14. The apparatus of claim 10, wherein the page to be queried is a next page of a current page or a specified query page.
15. An apparatus for paging data queries, comprising:
the query request receiving unit is used for receiving a query request of paging data sent by a client, wherein the query request is used for requesting to query data which takes the initial data of a page to be queried as the start data and takes the quantity as the maximum displayable data number of the page to be queried;
the query unit is used for calculating the number of the data to be queried according to the query request and querying according to the number of the data to be queried to obtain query result data; the number of the data to be inquired is the sum of the maximum number of the data which can be displayed on the page to be inquired and a preset number;
the page turning determining unit is used for determining whether the page to be inquired can be turned over according to the number of the data of the inquiry result data;
and the data feedback unit is used for sending feedback data to the client, wherein the feedback data comprises information used for determining whether the page to be inquired can be turned over.
16. The apparatus of claim 15, wherein the query request comprises: the mark of the initial data and the mark of the end data of the page to be inquired;
a query unit for: calculating the maximum data number which can be displayed on the page to be inquired according to the mark of the initial data and the mark of the end data of the page to be inquired;
and taking the sum of the calculated maximum data number which can be displayed on the page to be inquired and a preset number as the number of the data to be inquired.
17. The apparatus of claim 15, wherein the query request comprises: the page number of the page to be inquired and the maximum data number which can be displayed on the page to be inquired are obtained; or, the query request includes: the page query method comprises the steps of identifying the initial data of the page to be queried and the maximum number of data which can be displayed on the page to be queried.
18. The apparatus of claim 15, wherein the predetermined number is less than a maximum number of data pieces of the page to be queried.
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK1241069A1 HK1241069A1 (en) | 2018-06-01 |
| HK1241069A true HK1241069A (en) | 2018-06-01 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11204915B2 (en) | Blockchain-based data storage and query method and device | |
| CN111639289B (en) | Webpage loading method and device | |
| CN107038041B (en) | Data processing method, error code dynamic compatibility method, device and system | |
| CN107016045A (en) | A kind of method and device of paged data inquiry | |
| CN106598972B (en) | Information display method and device and intelligent terminal | |
| CN106484726B (en) | A page display method and device | |
| CN106990979A (en) | A kind of configuration information update method, system, client and server | |
| CN105824830A (en) | Page displaying method, client and equipment | |
| CN110647704A (en) | Page updating method, device and equipment | |
| CN106970872B (en) | Information point burying method and device | |
| CN106528889B (en) | A kind of information search method and terminal | |
| CN107402953A (en) | A kind of method for page jump and device | |
| CN111414207A (en) | A page construction method, device and device | |
| CN108710630A (en) | A kind of page navigation method, device and equipment | |
| WO2021143371A1 (en) | Method, apparatus, and device for generating applet page | |
| CN111538667A (en) | Page testing method and device | |
| CN110263050B (en) | Data processing methods, devices, equipment and storage media | |
| CN108664191B (en) | System access method and device | |
| CN111752431B (en) | Information display method and device | |
| CN110262749B (en) | Webpage operation method, device, container, equipment and medium | |
| CN117041980B (en) | A network element management method, device, storage medium and electronic equipment | |
| CN111796881A (en) | Method and device for loading form components | |
| HK1241069A1 (en) | Method and device for paging data query | |
| HK1241069A (en) | Method and device for paging data query | |
| CN118051943A (en) | Data access processing method and device |