CN111241436A - Data request processing method and device, terminal equipment and storage medium - Google Patents

Data request processing method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111241436A
CN111241436A CN201911424730.3A CN201911424730A CN111241436A CN 111241436 A CN111241436 A CN 111241436A CN 201911424730 A CN201911424730 A CN 201911424730A CN 111241436 A CN111241436 A CN 111241436A
Authority
CN
China
Prior art keywords
page
page number
data
request
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911424730.3A
Other languages
Chinese (zh)
Inventor
刘贺
蒋国强
于飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201911424730.3A priority Critical patent/CN111241436A/en
Publication of CN111241436A publication Critical patent/CN111241436A/en
Pending legal-status Critical Current

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/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a data request processing method, a data request processing device, terminal equipment and a storage medium. The method comprises the following steps: receiving a data request aiming at a target page sent by a client, wherein the data request comprises a request page number; acquiring a query page number of the data request according to the request page number and the actual total page number of the target page; and acquiring list data according to the query page number, and returning the list data to the client. The method and the device solve the technical problems that the existing data request processing scheme is easy to return contents with high repeatability within a period of time, so that the exposure rate of the page contents is unbalanced, a user feels dull on the site contents, and the user retention rate is reduced, and achieve the dynamic change of the data received by the client, so that the exposure balance of all parts of the contents in the page is improved, and the beneficial effects of the user retention rate are achieved.

Description

Data request processing method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data request processing method and apparatus, a terminal device, and a storage medium.
Background
The Web application program is a network-based application program, and a user does not need to install any special program, only uses a browser to access a server, and can realize a business process by browsing a webpage. The rise of the internet has led to the rapid development of Web applications, and the data volume of Web applications has also increased.
However, when a user accesses a certain page several times in a short time, the list data displayed by default is generally the same, and especially at the initial stage of online of the site, the new content adding speed is slow, and the phenomenon lasts for a longer period of time. Therefore, the user feels boring to the site contents, and the retention rate of the user is reduced; if the user loads more data without manual pull-up, the original data which is not seen by the user is difficult to actively display, and part of the content is repeatedly displayed for multiple times, so that the exposure rate of the list content is seriously unbalanced.
Disclosure of Invention
Embodiments of the present invention provide a data request processing method and apparatus, a terminal device, and a storage medium, so as to solve the problems that list data displayed each time in the existing data request processing scheme is generally the same, exposure rate of list contents is low, and users are prone to feel boring on site contents, which results in a reduction in user retention rate.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a data request processing method, including:
receiving a data request aiming at a target page sent by a client, wherein the data request comprises a request page number;
acquiring a query page number of the data request according to the request page number and the actual total page number of the target page;
and acquiring list data according to the query page number, and returning the list data to the client.
Optionally, the step of obtaining the query page number of the data request according to the request page number and the actual total page number of the target page includes:
obtaining a remainder of the request page number divided by the actual total page number;
in response to the remainder being a non-zero value, taking the remainder as a lookup page number for the data request;
and in response to the remainder being zero, taking the actual total page number as a query page number of the data request.
Optionally, before the step of obtaining the query page number of the data request according to the request page number and the actual total page number of the target page, the method further includes:
and acquiring the actual total page number of the target page according to the total data number and the single page display number of the target page.
Optionally, the step of obtaining the actual total page number of the target page according to the total number of data of the target page and the number of single-page display pieces includes:
and acquiring the ratio of the total number of the data to the number of the single-page display pieces, and acquiring the minimum integer larger than the ratio as the actual total page number of the target page.
Optionally, the step of obtaining list data according to the query page number and returning the list data to the client includes:
acquiring the offset of the list data according to the query page number and the number of single page display pieces of the target page;
and acquiring the list data according to the offset and the number of the single-page display pieces, and returning the list data to the client.
Optionally, the request page number is reset in a cycle of preset time periods, and the request page number is incremented as the number of data requests of the client to the target page increases within each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
In a second aspect, an embodiment of the present invention provides a data request processing apparatus, including:
the data request acquisition module is used for receiving a data request aiming at a target page sent by a client, wherein the data request comprises a request page number;
the query page number obtaining module is used for obtaining the query page number of the data request according to the request page number and the actual total page number of the target page;
and the list data returning module is used for acquiring list data according to the query page number and returning the list data to the client.
Optionally, the query page number obtaining module includes:
the remainder submodule is used for acquiring the remainder of the requested page number divided by the actual total page number;
the first query page number acquisition submodule is used for responding to the fact that the remainder is a nonzero value, and taking the remainder as the query page number of the data request;
and the second inquiry page number obtaining submodule is used for responding to the remainder being zero and taking the actual total page number as the inquiry page number of the data request.
Optionally, the method further comprises:
and the actual total page number obtaining module is used for obtaining the actual total page number of the target page according to the total data number and the single page display number of the target page.
Optionally, the actual total page number obtaining module is further configured to obtain a ratio between the total number of data and the number of single-page display pieces, and obtain a minimum integer greater than the ratio as the actual total page number of the target page.
Optionally, the list data returning module includes:
the offset obtaining submodule is used for obtaining the offset of the list data according to the query page number and the number of single-page display pieces of the target page;
and the list data query submodule is used for acquiring the list data according to the offset and the number of the single-page display pieces and returning the list data to the client.
Optionally, the request page number is reset in a cycle of preset time periods, and the request page number is incremented as the number of data requests of the client to the target page increases within each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
In a third aspect, an embodiment of the present invention additionally provides a terminal device, including: memory, a processor and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the data request processing method as described above.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the data request processing method as described above.
In the embodiment of the invention, a data request aiming at a target page sent by a client is received, wherein the data request comprises a request page number; acquiring a query page number of the data request according to the request page number and the actual total page number of the target page; and acquiring list data according to the query page number, and returning the list data to the client. The technical problems that the existing data request processing scheme is easy to return contents with high repeatability within a period of time, so that the exposure rate of page contents is unbalanced, a user feels dull on site contents, and the user retention rate is reduced are solved, and the dynamic change of data received by a client is realized, so that the balance of the exposure rate of the page contents is improved, and the beneficial effect of the user retention rate is achieved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive labor.
FIG. 1 is a flow chart of the steps of a data request processing method in an embodiment of the present invention;
FIG. 2 is a flow chart of steps in another method of processing a data request in an embodiment of the invention;
FIG. 3 is a schematic structural diagram of a data request processing apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another data request processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of a terminal device in the 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 some, not all, embodiments of the present invention. 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.
Referring to fig. 1, a flowchart illustrating steps of a data request processing method according to an embodiment of the present invention is shown.
Step 110, receiving a data request for a target page sent by a client, where the data request includes a request page number.
In practical application, when a list page is displayed, the number of pieces of list data that can be displayed on each page is limited, for example, only 30 pieces of list data can be displayed on each page, and so on, and then when a user sends a data request for a target page to a server through a client, the server will generally return to a default initial page, and if new data is not generated in the target page in a short time or the speed of adding new content is slow, it is easy to happen that data returned by accessing the server each time is substantially the same if the user accesses the target page through the client multiple times.
In the embodiment of the present invention, in order to avoid the above problem, when the client sends a data request for a target page, a request page number of the current request may be carried in the data request. The request page number may not be a fixed value, and may also be a fixed value according to a requirement, which is not limited in this embodiment of the present invention. In addition, in the embodiment of the present invention, a user accessing a target page through a client may set a request page number in each data request in a customized manner, or may set a request page number included in a data request sent by the current access according to parameters such as an access frequency of the client for the target page, and the like, and a corresponding relationship between the request page and the access frequency may also be set in a customized manner according to a requirement, which is not limited in the embodiments of the present invention.
And step 120, acquiring the query page number of the data request according to the request page number and the actual total page number of the target page.
In practical applications, data in the target page may be updated at irregular time, or data changes such as adding or deleting list data may occur. For example, it is assumed that the target page is a news listing page, the news listing data contained in the target page may be updated at any time, and the target page may contain a plurality of pieces of news listing data, but when the target page is displayed, the number of pieces of the news listing data that can be displayed at most per page is limited, for example, 30 pieces of data can be displayed at most per page, and for the target page, the target page may be split into one or more pages according to the number of pieces of the news listing data that can be displayed at most per page and the total number of pieces of the news listing data contained in the current target page, and each page corresponds to a corresponding page number, which may also represent the sequence of the corresponding page in the target page.
Moreover, since the data request is sent by the client, the client and/or a user of the client may not determine the total number of data pieces contained in the target page before controlling the client to send the data request, that is, may not know the actual total page number of the target page, and the request page number in the data request sent by the client may exceed the value range of the actual total page number of the target page, then the list data currently requested by the client may not be found directly according to the request page, so that the client may not display the list data in time, and normal access experience of the user is affected.
Therefore, in the embodiment of the present invention, after the data request sent by the client is obtained, the actual query page number of the corresponding data request may be obtained according to the request page number in the currently received data request and the actual total page number of the target page requested by the currently received data request.
For example, the sizes of the request page number and the actual total page number of the target page may be compared, if the request page number is less than or equal to the actual total page number, the request page number may be directly used as the current query page number, and if the request page number is greater than the actual total page number, the request page number may be adjusted to be within a value range of the actual total page number according to a preset adjustment policy. The adjustment strategy can be set by user according to the requirement, and the embodiment of the invention is not limited.
For example, the adjustment policy may be set to subtract a preset value N from the request page number, so that the adjusted request page number is smaller than the actual total page number, and the value of N may be such that the adjusted request page number is smaller than the minimum value of the actual total page number, and then the adjusted request page number may be used as the query page number, and so on. The preset data can be set by self according to the requirement, and the embodiment of the invention is not limited.
After receiving a data request, a server of a target page cannot directly use a request page to perform data query, and because the server is a page identifier set by a client in an incremental manner and the like, the numerical value may be larger than the actual total page, and therefore, a query page needs to be calculated according to the request page and the actual total page.
For example, assuming that the actual total page number of the target page is 4 pages, the requested page number of the current request is equal to 5, and is greater than the actual total page number of the target page, the actual queried page number may be obtained by a method of obtaining the requested page number% of the actual total page number as the queried page number, and the like. Where% represents the remainder operation.
Step 130, obtaining list data according to the query page number, and returning the list data to the client.
After the current actual query page number of the client is determined, the list data which the client currently requests to access can be further obtained according to the query page number, and then the corresponding list data is returned to the client.
Specifically, the list data included in the query page number may be retrieved from all the list data of the target page according to the query page number, and then the retrieved list data may be returned to the client.
For example, assuming that the target page is a news listing page, assuming that the total number of actual pages of the news listing page is 10 pages, and the currently determined query page number is 3, all news data contained in the 3 rd page of the target page may be acquired as current listing data and returned to the client.
After receiving the list data, the client may display the corresponding list data. For example, assuming that the news listing data included in page 3 of the target page is 30 pieces of news data, the client may receive the corresponding 30 pieces of news data at this time.
Moreover, as mentioned above, the list data received by the client may be only part of the data in the target page, if the user also wishes to browse other content, the user may request to update the page by pulling up and down the slider, and at this time, after receiving the page refresh request sent by the client, the corresponding page data may also be further returned to the client according to the page refresh request.
For example, assuming that the client currently presents 30 pieces of news data in page 3, if the client user pulls up the slider, the list data in the subsequent pages of the target page may be sequentially requested to the client, but the list data currently presented in the client may be between two pages. For example, when the client pulls the slider bar between page 3 and page 4, the client may request all the news data in page 3 and page 4, but may display part of the news data in page 3 and part of the news data in page 4, and the total number of the displayed pieces may still be 30.
In the embodiment of the invention, a data request aiming at a target page sent by a client is received, wherein the data request comprises a request page number; acquiring a query page number of the data request according to the request page number and the actual total page number of the target page; and acquiring list data according to the query page number, and returning the list data to the client. Therefore, dynamic change of feedback data received by the client is realized, and further, the balance of the page content exposure rate and the user retention rate of the corresponding page are improved.
Referring to fig. 2, in the embodiment of the present invention, the step 120 may further include:
step 121, obtaining a remainder of the requested page number divided by the actual total page number;
step 122, in response to the remainder being a nonzero value, taking the remainder as a query page number of the data request;
and step 123, in response to the remainder being zero, taking the actual total page number as a query page number of the data request.
In the embodiment of the present invention, in order to quickly obtain the query page number of the data request according to the request page number and the actual total page number of the target page, the remainder of the request page number divided by the actual total page number may be directly obtained. If the remainder is zero, in order to avoid that the accurate list data cannot be queried, the current query page number can be set as the actual total page number, that is, the list data contained in the last page of the target page is used as the list data currently requested by the client and returned to the corresponding client; and if the remainder is a non-zero value, the corresponding remainder can be directly used as the query page number of the data request.
Referring to fig. 2, in the embodiment of the present invention, before the step 120, the method may further include:
and 140, acquiring the actual total page number of the target page according to the total data number and the single-page display number of the target page.
As described above, in practical applications, data content contained in a target page may be updated, but the number of data pieces that can be displayed in each page, that is, the number of single-page display pieces, is generally relatively fixed, and therefore, in the embodiment of the present invention, in order to improve accuracy of an actual total page number, the actual total page number of the target page may be obtained according to the total number of data currently contained in the target page and the number of single-page display pieces.
The corresponding relation between the actual total page number and the total number of data currently contained in the target page and the number of single-page display pieces of the target page can be set in a user-defined manner according to requirements, and the embodiment of the invention is not limited.
In addition, in the embodiment of the present invention, in order to improve the accuracy of the actual total page number and avoid wasting time, the step 140 may be executed to update the actual total page number by a predetermined period of time. The preset time period can be set by user according to requirements, and the embodiment of the invention is not limited. For example, the predetermined period of time may be set to 24 hours, or the like.
Optionally, in an embodiment of the present invention, the step 140 may further include: and acquiring the ratio of the total number of the data to the number of the single-page display pieces, and acquiring the minimum integer larger than the ratio as the actual total page number of the target page.
In practical applications, since the maximum number of data pieces that can be contained in each page, that is, the number of single-page display pieces, is relatively fixed, for the last page in the target page, if the total number of list data currently contained in the target page is not an integer multiple of the number of single-page display pieces, the number of list data contained in the last page may be less than the number of single-page display pieces at this time, but it is still a page. Therefore, in the embodiment of the present invention, the ratio of the total number of data to the number of single-page display pieces may be obtained, and the minimum integer greater than the ratio is obtained as the actual total page number of the target page.
Referring to fig. 2, in an embodiment of the present invention, the step 130 may further include:
step 131, obtaining the offset of the list data according to the query page number and the number of single page display pieces of the target page;
and step 132, obtaining the list data according to the offset and the number of the single-page display pieces, and returning the list data to the client.
In practical applications, for a server corresponding to a target page, all list data included in the recorded target page may not identify a page to which each list data belongs, but all list data included in the target page is recorded in any available manner such as a queue, a list, a stack, and the like. At this time, in order to accurately obtain the list data corresponding to the query page number, the offset of the list data to be currently obtained may be obtained according to the current query page number and the number of single-page display pieces of the target page, and then the corresponding list data may be obtained according to the offset and the number of single-page display pieces, and the list data is returned to the client.
In the embodiment of the present invention, the offset may be obtained in any available manner, and the list data is queried, which is not limited in this embodiment of the present invention.
For example, the calculation formula of the offset amount may be set as: int Offset ═ (PageNum 1) × PageSize, where Int denotes the data type "long integer" in the code, Offset denotes the Offset, PageNum denotes the query page number, and PageSize denotes the number of single page presentation pieces.
In addition, the list data may also be acquired by the following query statement: select from Table limit $ { Offset }, $ { PageSize }.
Optionally, in this embodiment of the present invention, the request page is reset in a preset time period, and the request page is incremented as the number of data requests of the client to the target page increases in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
In the embodiment of the present invention, in order to facilitate a user to browse different contents in a target page when the user accesses the target page multiple times within a certain time through a client, a preset time period may be set as a period, a request page number included in a data request for the target page sent by the same client in each period is increased with an increase in the number of data requests for the target page by the corresponding client, and in order to avoid that the request page number is continuously increased, which is likely to affect the accuracy of data search and causes an excessive calculation amount, the request page number may be set to be reset with the preset time period as the period, and then the request page number is increased with an increase in the number of data requests for the target page by the client in each preset time period.
Where the initial value of the requested page number may be set to 1 and incremented from 1, then at each reset the requested page number may be reset to the initial value. Of course, in the embodiment of the present invention, the initial value may also be set to other values according to requirements, and the embodiment of the present invention is not limited thereto.
In addition, the correspondence between the increment of the request page number and the number of data requests may also be preset according to the requirement, and the embodiment of the present invention is not limited. For example, the request page number may be directly set as the value of the data request times, at this time, if the client accesses the target page for the first time in any period, the request page number in the data request is 1, and if the client accesses the target page for the nth time in any period, the request page number in the data request is N, and so on.
Further, in the embodiment of the present invention, in order to determine a specific value of a request page number in a data request for accessing a target page, the request page number included in the data request for the target page sent each time may be recorded in the local of the client, so that when the data request is sent again currently, the request page number included in the data request for the target page sent last time, that is, the historical request page number of the target page sent last time by the client, may be obtained from the local of the client, and then the sum of the historical request page number of the previous time and a preset value is used as the request page number included in the data request this time. The preset value can be set by self according to the requirement, for example, the preset value can be set to be 1, and the like.
It should be noted that, if the client locally records the request page number included in the data request for the target page sent each time, when the client has multiple user identifiers, the user identifier associated with each sent data request for the target page may be recorded at the same time, so that before the data request for the target page is sent this time, according to the user identifier currently logged in by the client, the request page number included in the data request for the target page sent last time by the corresponding client is obtained from the recorded historical request page number, so as to determine the specific value of the request page number included in the data request for the target page sent this time. For example, as described above, the sum of the previous historical request page number and the preset value may be used as a specific value of the request page number included in the current data request. Therefore, when different users send data requests aiming at the target page through the same client, the respective request page numbers can be determined according to the own access records of the users without mutual interference, and the exposure rate of page data and the retention rate of the users are further improved.
In the embodiment of the invention, the remainder of the request page number divided by the actual total page number is obtained; in response to the remainder being a non-zero value, taking the remainder as a lookup page number for the data request; and in response to the remainder being zero, taking the actual total page number as a query page number of the data request. Therefore, the acquisition efficiency of the query page number and the accuracy of the acquired query page number are improved, the balance of the data exposure rate in the target page is further improved, and the overall data exposure rate of the page is enhanced.
Moreover, in the embodiment of the present invention, the actual total page number of the target page may also be obtained according to the total number of data of the target page and the number of display pieces of a single page. And acquiring the ratio of the total number of the data to the number of the single-page display pieces, and acquiring the minimum integer larger than the ratio as the actual total page number of the target page. Therefore, the accuracy of the actual total page number and the convenience for acquiring the actual total page number can be improved, the balance of the data exposure rate in the target page is improved, and the overall data exposure rate of the page is enhanced.
In addition, in the embodiment of the present invention, the offset of the list data may also be obtained according to the number of the query page and the number of single page display pieces of the target page; and acquiring the list data according to the offset and the number of the single-page display pieces, and returning the list data to the client. Therefore, the accuracy of the list data of the client can be returned, the balance of the data exposure rate in the target page is improved, and the overall data exposure rate of the page is enhanced.
Further, in the embodiment of the present invention, the request page number is reset in a preset time period, and the request page number is incremented with the increase of the number of data requests of the client to the target page in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client. Therefore, the list data returned each time is displayed to the user in a circulating mode, the effect of dynamic change of the data displayed by accessing the target page each time is achieved, and the data exposure rate is enhanced.
Referring to fig. 3, a schematic structural diagram of a data request processing apparatus in an embodiment of the present invention is shown.
The data request processing device of the embodiment of the invention comprises: a data request acquisition module 210, a query page number acquisition module 220 and a list data return module 230.
The functions of the modules and the interaction relationship between the modules are described in detail below.
A data request obtaining module 210, configured to receive a data request for a target page sent by a client, where the data request includes a request page number;
a query page number obtaining module 220, configured to obtain a query page number of the data request according to the request page number and the actual total page number of the target page;
the list data returning module 230 is configured to obtain list data according to the query page number, and return the list data to the client.
In the embodiment of the invention, a data request aiming at a target page sent by a client is received, wherein the data request comprises a request page number; acquiring a query page number of the data request according to the request page number and the actual total page number of the target page; and acquiring list data according to the query page number, and returning the list data to the client. Therefore, dynamic change of feedback data received by the client is realized, and further, the balance of the page content exposure rate and the user retention rate of the corresponding page are improved.
Referring to fig. 4, in the embodiment of the present invention, the query page number obtaining module 220 further includes:
a remainder sub-module 221, configured to obtain a remainder of the requested page number divided by the actual total page number;
a first query page number obtaining sub-module 222, configured to respond to that the remainder is a nonzero value, and take the remainder as a query page number of the data request;
and a second query page number obtaining sub-module 223, configured to, in response to the remainder being zero, take the actual total page number as the query page number of the data request.
Referring to fig. 4, in the embodiment of the present invention, the apparatus may further include:
and an actual total page number obtaining module 240, configured to obtain an actual total page number of the target page according to the total number of data of the target page and the number of single-page display pieces.
Optionally, in this embodiment of the present invention, the actual total page number obtaining module 240 is further configured to obtain a ratio between the total number of data and the number of single-page display pieces, and obtain a minimum integer greater than the ratio as the actual total page number of the target page.
Referring to fig. 4, in the embodiment of the present invention, the list data returning module 230 may further include:
the offset obtaining sub-module 231 is configured to obtain an offset of the list data according to the query page number and the number of single-page display pieces of the target page;
and the list data query submodule 232 is configured to obtain the list data according to the offset and the number of the single-page display pieces, and return the list data to the client.
Optionally, in this embodiment of the present invention, the request page is reset in a preset time period, and the request page is incremented as the number of data requests of the client to the target page increases in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
In the embodiment of the invention, the remainder of the request page number divided by the actual total page number is obtained; in response to the remainder being a non-zero value, taking the remainder as a lookup page number for the data request; and in response to the remainder being zero, taking the actual total page number as a query page number of the data request. Therefore, the acquisition efficiency of the query page number and the accuracy of the acquired query page number are improved, the balance of the data exposure rate in the target page is further improved, and the overall data exposure rate of the page is enhanced.
Moreover, in the embodiment of the present invention, the actual total page number of the target page may also be obtained according to the total number of data of the target page and the number of display pieces of a single page. And acquiring the ratio of the total number of the data to the number of the single-page display pieces, and acquiring the minimum integer larger than the ratio as the actual total page number of the target page. Therefore, the accuracy of the actual total page number and the convenience for acquiring the actual total page number can be improved, the balance of the data exposure rate in the target page is improved, and the overall data exposure rate of the page is enhanced.
In addition, in the embodiment of the present invention, the offset of the list data may also be obtained according to the number of the query page and the number of single page display pieces of the target page; and acquiring the list data according to the offset and the number of the single-page display pieces, and returning the list data to the client. Therefore, the accuracy of the list data of the client can be returned, the balance of the data exposure rate in the target page is improved, and the overall data exposure rate of the page is enhanced.
Further, in the embodiment of the present invention, the request page number is reset in a preset time period, and the request page number is incremented with the increase of the number of data requests of the client to the target page in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client. Therefore, the list data returned each time is displayed to the user in a circulating mode, the effect of dynamic change of the data displayed by accessing the target page each time is achieved, and the data exposure rate is enhanced.
The data request processing apparatus provided in the embodiment of the present invention can implement each process implemented in the method embodiments of fig. 1 to fig. 2, and is not described here again to avoid repetition.
EXAMPLE five
Fig. 5 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention.
The terminal device 300 includes but is not limited to: radio frequency unit 301, network module 302, audio output unit 303, input unit 304, sensor 305, display unit 306, user input unit 307, interface unit 308, memory 309, processor 310, and power supply 311. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 5 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 301 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 310; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 301 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides the user with wireless broadband internet access through the network module 302, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 303 may convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output as sound. Also, the audio output unit 303 may also provide audio output related to a specific function performed by the terminal device 300 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
The input unit 304 is used to receive audio or video signals. The input Unit 304 may include a Graphics Processing Unit (GPU) 3041 and a microphone 3042, and the Graphics processor 3041 processes image data of a still picture or video obtained by an image capturing apparatus (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 306. The image frames processed by the graphic processor 3041 may be stored in the memory 309 (or other storage medium) or transmitted via the radio frequency unit 301 or the network module 302. The microphone 3042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 301 in case of the phone call mode.
The terminal device 300 further comprises at least one sensor 305, such as light sensors, motion sensors and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 3061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 3061 and/or a backlight when the terminal device 300 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 305 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 306 is used to display information input by the user or information provided to the user. The Display unit 306 may include a Display panel 3061, and the Display panel 3061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 307 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 307 includes a touch panel 3071 and other input devices 3072. The touch panel 3071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 3071 (e.g., operations by a user on or near the touch panel 3071 using a finger, a stylus, or any suitable object or attachment). The touch panel 3071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 310, and receives and executes commands sent by the processor 310. In addition, the touch panel 3071 may be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 307 may include other input devices 3072 in addition to the touch panel 3071. Specifically, the other input devices 3072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein.
Further, the touch panel 3071 may be overlaid on the display panel 3061, and when the touch panel 3071 detects a touch operation on or near the touch panel, the touch operation is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 provides a corresponding visual output on the display panel 3061 according to the type of the touch event. Although in fig. 5, the touch panel 3071 and the display panel 3061 are implemented as two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 3071 and the display panel 3061 may be integrated to implement the input and output functions of the terminal device, which is not limited herein.
The interface unit 308 is an interface for connecting an external device to the terminal apparatus 300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 308 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 300 or may be used to transmit data between the terminal apparatus 300 and an external device.
The memory 309 may be used to store software programs as well as various data. The memory 309 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 309 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 310 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 309 and calling data stored in the memory 309, thereby performing overall monitoring of the terminal device. Processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 310.
Terminal device 300 may also include a power supply 311 (e.g., a battery) for providing power to various components, and preferably, power supply 311 may be logically connected to processor 310 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
In addition, the terminal device 300 includes some functional modules that are not shown, and are not described in detail here.
Preferably, an embodiment of the present invention further provides a terminal device, including: the processor 310, the memory 309, and a computer program stored in the memory 309 and capable of running on the processor 310, where the computer program, when executed by the processor 310, implements the processes of the data request processing method embodiment, and can achieve the same technical effects, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the data request processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, 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.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (14)

1. A method for processing a data request, comprising:
receiving a data request aiming at a target page sent by a client, wherein the data request comprises a request page number;
acquiring a query page number of the data request according to the request page number and the actual total page number of the target page;
and acquiring list data according to the query page number, and returning the list data to the client.
2. The method of claim 1, wherein the step of obtaining the query page number of the data request according to the request page number and the actual total page number of the target page comprises:
obtaining a remainder of the request page number divided by the actual total page number;
in response to the remainder being a non-zero value, taking the remainder as a lookup page number for the data request;
and in response to the remainder being zero, taking the actual total page number as a query page number of the data request.
3. The method according to claim 1 or 2, wherein before the step of obtaining the query page number of the data request according to the request page number and the actual total page number of the target page, the method further comprises:
and acquiring the actual total page number of the target page according to the total data number and the single page display number of the target page.
4. The method according to claim 3, wherein the step of obtaining the actual total page number of the target page according to the total number of data and the number of single-page display pieces of the target page comprises:
and acquiring the ratio of the total number of the data to the number of the single-page display pieces, and acquiring the minimum integer larger than the ratio as the actual total page number of the target page.
5. The method according to claim 3, wherein the step of obtaining the list data according to the query page number and returning the list data to the client comprises:
acquiring the offset of the list data according to the query page number and the number of single page display pieces of the target page;
and acquiring the list data according to the offset and the number of the single-page display pieces, and returning the list data to the client.
6. The method according to claim 1, wherein the request page number is reset in a cycle of preset time periods, and the request page number is increased as the number of data requests of the client to the target page increases in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
7. A data request processing apparatus, comprising:
the data request acquisition module is used for receiving a data request aiming at a target page sent by a client, wherein the data request comprises a request page number;
the query page number obtaining module is used for obtaining the query page number of the data request according to the request page number and the actual total page number of the target page;
and the list data returning module is used for acquiring list data according to the query page number and returning the list data to the client.
8. The apparatus of claim 7, wherein the query page number obtaining module comprises:
the remainder submodule is used for acquiring the remainder of the requested page number divided by the actual total page number;
the first query page number acquisition submodule is used for responding to the fact that the remainder is a nonzero value, and taking the remainder as the query page number of the data request;
and the second inquiry page number obtaining submodule is used for responding to the remainder being zero and taking the actual total page number as the inquiry page number of the data request.
9. The apparatus of claim 7 or 8, further comprising:
and the actual total page number obtaining module is used for obtaining the actual total page number of the target page according to the total data number and the single page display number of the target page.
10. The apparatus according to claim 9, wherein the actual total page number obtaining module is further configured to obtain a ratio between the total number of data pieces and the number of single-page display pieces, and obtain a minimum integer greater than the ratio as the actual total page number of the target page.
11. The apparatus of claim 9, wherein the list data return module comprises:
the offset obtaining submodule is used for obtaining the offset of the list data according to the query page number and the number of single-page display pieces of the target page;
and the list data query submodule is used for acquiring the list data according to the offset and the number of the single-page display pieces and returning the list data to the client.
12. The apparatus according to claim 7, wherein the request page number is reset in a period of a preset time period, and the request page number is incremented as the number of data requests of the client to the target page increases in each preset time period; the request page number is the sum of the historical request page number and a preset numerical value of the previous target page locally recorded by the client.
13. A terminal device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the data request processing method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the data request processing method according to any one of claims 1 to 6.
CN201911424730.3A 2019-12-31 2019-12-31 Data request processing method and device, terminal equipment and storage medium Pending CN111241436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911424730.3A CN111241436A (en) 2019-12-31 2019-12-31 Data request processing method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911424730.3A CN111241436A (en) 2019-12-31 2019-12-31 Data request processing method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111241436A true CN111241436A (en) 2020-06-05

Family

ID=70863871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911424730.3A Pending CN111241436A (en) 2019-12-31 2019-12-31 Data request processing method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111241436A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685200A (en) * 2020-12-31 2021-04-20 百果园技术(新加坡)有限公司 List data processing method, device, medium and equipment
CN114528063A (en) * 2022-04-21 2022-05-24 苏州万店掌网络科技有限公司 Page display method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831121A (en) * 2011-06-15 2012-12-19 阿里巴巴集团控股有限公司 Method and system for extracting webpage information
US20130117644A1 (en) * 2007-03-17 2013-05-09 Anmol Dhawan Generating and printing target page numbers over links while printing documents or web pages
CN103778135A (en) * 2012-10-18 2014-05-07 厦门雅迅网络股份有限公司 Method for distribution storage and paging querying of real-time data
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN107609041A (en) * 2017-08-16 2018-01-19 北京五八信息技术有限公司 List page generation method and device
CN108710683A (en) * 2018-05-21 2018-10-26 珠海横琴盛达兆业科技投资有限公司 A method of repeating crawl paged content after avoiding network connection failure
CN109241494A (en) * 2018-08-07 2019-01-18 平安科技(深圳)有限公司 Page processing method, system, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130117644A1 (en) * 2007-03-17 2013-05-09 Anmol Dhawan Generating and printing target page numbers over links while printing documents or web pages
CN102831121A (en) * 2011-06-15 2012-12-19 阿里巴巴集团控股有限公司 Method and system for extracting webpage information
CN103778135A (en) * 2012-10-18 2014-05-07 厦门雅迅网络股份有限公司 Method for distribution storage and paging querying of real-time data
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN107609041A (en) * 2017-08-16 2018-01-19 北京五八信息技术有限公司 List page generation method and device
CN108710683A (en) * 2018-05-21 2018-10-26 珠海横琴盛达兆业科技投资有限公司 A method of repeating crawl paged content after avoiding network connection failure
CN109241494A (en) * 2018-08-07 2019-01-18 平安科技(深圳)有限公司 Page processing method, system, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685200A (en) * 2020-12-31 2021-04-20 百果园技术(新加坡)有限公司 List data processing method, device, medium and equipment
CN112685200B (en) * 2020-12-31 2024-03-08 百果园技术(新加坡)有限公司 List data processing method, device, medium and equipment
CN114528063A (en) * 2022-04-21 2022-05-24 苏州万店掌网络科技有限公司 Page display method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111143005B (en) Application sharing method, electronic equipment and computer readable storage medium
CN108984066B (en) Application icon display method and mobile terminal
CN110109604B (en) Application interface display method and mobile terminal
CN109189303B (en) Text editing method and mobile terminal
CN108196781B (en) Interface display method and mobile terminal
CN111163449B (en) Application sharing method, first electronic device and computer-readable storage medium
CN111199424A (en) Advertisement putting method and device, terminal equipment and storage medium
CN111142679A (en) Display processing method and electronic equipment
CN111241436A (en) Data request processing method and device, terminal equipment and storage medium
CN110851219A (en) Information processing method and electronic equipment
CN108429805B (en) File downloading processing method, sending terminal and receiving terminal
CN108491143B (en) Object movement control method and mobile terminal
CN108491125B (en) Operation control method of application store and mobile terminal
CN108021315B (en) Control method and mobile terminal
CN111261128B (en) Screen brightness adjusting method and electronic equipment
CN111061407B (en) Video program operation control method, electronic device, and storage medium
CN111190528B (en) Brush display method, electronic equipment and storage medium
CN112612552A (en) Application program resource loading method and device, electronic equipment and readable storage medium
CN110099170B (en) Picture deleting method and mobile terminal
CN109902232B (en) Display control method and terminal
CN109144860B (en) Operation method for control object and terminal equipment
CN109240531B (en) Touch data sampling compensation method and device, mobile terminal and storage medium
CN110928616A (en) Shortcut icon management method and electronic equipment
CN111142998A (en) Sharing method of background application and electronic equipment
CN110851042A (en) Interface display method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination