CN111523066B - Data acquisition method and device - Google Patents

Data acquisition method and device Download PDF

Info

Publication number
CN111523066B
CN111523066B CN201910107469.8A CN201910107469A CN111523066B CN 111523066 B CN111523066 B CN 111523066B CN 201910107469 A CN201910107469 A CN 201910107469A CN 111523066 B CN111523066 B CN 111523066B
Authority
CN
China
Prior art keywords
data
paging
page
field value
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910107469.8A
Other languages
Chinese (zh)
Other versions
CN111523066A (en
Inventor
葛圆根
王丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910107469.8A priority Critical patent/CN111523066B/en
Publication of CN111523066A publication Critical patent/CN111523066A/en
Application granted granted Critical
Publication of CN111523066B publication Critical patent/CN111523066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data acquisition method and device, wherein the method comprises the following steps: the server receives a data acquisition request sent by the client, wherein the data acquisition request carries an original field value corresponding to the paging field; the server determines the paging data of the current page and the new field value corresponding to the paging field based on the original field value and preset paging configuration information; the server sends a request response to the client, wherein the request response comprises: paging data of the current page and a new field value corresponding to the paging field. In this way, the client achieves obtaining the paging data by sending the field value of the paging field which can be issued by the server to the server, so that the server can flexibly control the paging mechanism.

Description

Data acquisition method and device
Technical Field
The embodiment of the invention relates to the technical field of Internet, in particular to a data acquisition method and device.
Background
With the rapid development of internet technology, a large number of users can issue a large amount of dynamic information (feeds) on the internet, so that other users can also obtain a large amount of information stream (feeds stream) data such as dynamic news, friend dynamics and the like from the internet. For example, when a user refreshes the feeds stream data through clients such as social applications and information applications, the clients can acquire the feeds stream data from the server for display, and when the feeds stream data contains a plurality of records in the process of data acquisition, the server can perform paging processing on the feeds stream data, and then return corresponding paging data to the clients according to the request of the clients for browsing by the user.
Currently, the feeds stream paging process can be broadly divided into two types: the page number paging mode and the displacement paging mode, however, the page number paging mode requires that the client explicitly knows the page number, then the page number of the current page is sent to the server to obtain the paging data of the current page when data is obtained each time, the displacement paging mode requires that the client explicitly knows the ordering field, then the client determines the displacement value according to the ordering field and the last record of the previous page when data is obtained each time, and sends the displacement value to the server to obtain the paging data of the current page. It can be seen that the client and the server are strongly coupled in these two paging modes, so that the server cannot flexibly control the paging mechanism, for example, the server cannot flexibly switch from one paging mode to the other paging mode.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method, an apparatus, and a system for acquiring data, where a client obtains paging data by sending a field value of a paging field that can be issued by a server to the server, so that the server can flexibly control a paging mechanism.
In order to solve the technical problems, the embodiment of the invention provides the following technical scheme:
In a first aspect, an embodiment of the present invention provides a data acquisition method, applied to a server, where the method includes: receiving a data acquisition request sent by a client, wherein the data acquisition request carries an original field value corresponding to a paging field; based on the original field value and preset paging configuration information, determining paging data of a current page and a new field value corresponding to the paging field; transmitting a request response to the client, wherein the request response comprises: paging data of the current page and the new field value.
In a second aspect, an embodiment of the present invention provides a data acquisition method, applied to a server, where the method includes: obtaining modification data aiming at least one of a sorting field, a paging record number and a paging mode contained in preset paging configuration information; modifying the paging configuration information based on the modification data to obtain modified paging configuration information; receiving a data acquisition request sent by a client, wherein the data acquisition request carries a primary field value corresponding to a paging field, and the primary field value is a preset first character for representing first page data; determining the paging data of the current page and a new field value corresponding to the paging field based on the original field value and the modified paging configuration information; transmitting a request response to the client, wherein the request response comprises: paging data of the current page and the new field value.
In a third aspect, an embodiment of the present invention provides a data acquisition method, applied to a client, where the method includes: sending a data acquisition request to a server, wherein the data acquisition request carries an original field value corresponding to a paging field; receiving a request response sent by the server, wherein the request response comprises: paging data of a current page and a new field value corresponding to the paging field; rendering the paging data of the current page; it is determined whether the page data of the next page needs to be fetched based on the new field value.
In a fourth aspect, an embodiment of the present invention provides a data acquisition device, applied to a server, where the device includes: the receiving unit is used for receiving a data acquisition request sent by the client, wherein the data acquisition request carries an original field value corresponding to the paging field; a determining unit, configured to determine, based on the original field value and preset paging configuration information, paging data of a current page and a new field value corresponding to the paging field; a sending unit, configured to send a request response to the client, where the request response includes: paging data of the current page and the new field value.
In a fifth aspect, an embodiment of the present invention provides a data acquisition device, applied to a server, where the device includes: an obtaining unit, configured to obtain modification data for at least one of a sorting field, a number of paging records, and a paging mode included in preset paging configuration information; the modification unit is used for modifying the paging configuration information based on the modification data to obtain modified paging configuration information; the first receiving unit is used for receiving a data acquisition request sent by a client, wherein the data acquisition request carries a primary field value corresponding to a paging field, and the primary field value is a preset first character used for representing first page data; a first determining unit, configured to determine, based on the original field value and the modified paging configuration information, paging data of the current page and a new field value corresponding to the paging field; a first sending unit, configured to send a request response to the client, where the request response includes: paging data of the current page and the new field value.
In a sixth aspect, an embodiment of the present invention provides a data acquisition device, applied to a client, where the device includes: the sending unit is used for sending a data acquisition request to the server, wherein the data acquisition request carries an original field value corresponding to the paging field; the receiving unit is configured to receive a request response sent by the server, where the request response includes: paging data of a current page and a new field value corresponding to the paging field; a rendering unit for rendering the paged data of the current page; and the determining unit is used for determining whether paging data of the next page need to be acquired or not based on the new field value.
In a seventh aspect, an embodiment of the present invention provides a computer readable storage medium, where the storage medium includes a stored program, where the program, when executed, controls a device in which the storage medium is located to execute the steps of the data acquisition method described above.
In an eighth aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and at least one memory, bus connected to the processor; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke the program instructions in the memory to perform the steps of the data acquisition method described above.
According to the data acquisition method and device provided by the embodiment of the invention, after the server receives the data acquisition request which is sent by the client and is used for requesting to issue the paging data of the current page, the server can determine the paging data of the current page required by the client based on the original field value corresponding to the paging field carried in the data acquisition request and the preset paging configuration information, and determine the new field value corresponding to the paging field which needs to be issued to the client, and then the server can send the paging data of the current page and the new field value to the client as a request response, so that the client can conduct subsequent processing on the paging data of the current page and the new field value corresponding to the paging field. In this way, in the process of acquiring the paging data, the paging configuration information is completely controlled by the server, and the field value of the paging field can be issued to the client by the server, so that the server can flexibly configure the paging configuration information according to the service, such as a paging mode, and the server can flexibly control the paging mechanism.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flowchart illustrating a data acquisition method according to an embodiment of the present invention;
FIG. 2A is a second flowchart of a data acquisition method according to an embodiment of the present invention;
FIG. 2B is a flowchart illustrating a data acquisition method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a data acquisition method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data acquisition device according to an embodiment of the present invention;
FIG. 5 is a second schematic diagram of a data acquisition device according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a data acquisition device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The embodiment of the invention provides a data acquisition method which can be applied to a system comprising a server and a client. The client and the server can communicate data through a network.
Here, the server may be implemented by an electronic device having functions of data acquisition, transmission, processing, storage, and the like, for providing service support related to data acquisition to the client. For example, the server may be a social platform, an information platform, and the like. Here, the type of the server is not specifically limited in the embodiment of the present invention.
In practical applications, the client may be implemented by an Application (APP) on various forms of electronic devices. For example, the client may be an APP that has a feeds stream scene, such as a social application, a news information application, etc. on the electronic device. Here, the type of the client is not specifically limited in the embodiment of the present invention, and all clients that can access the server are within the scope of the embodiment of the present invention.
Specifically, the electronic device described in the embodiments of the present invention may be a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a personal digital assistant (PersonalDigital Assistant, PDA), a navigation device, a wearable device, a portable computer, or a fixed terminal such as a smart tv, a desktop computer, or the like. Here, the embodiment of the present invention is not particularly limited.
In practical application, the data acquisition method can be applied to various occasions where paging processing is required to be performed on a large amount of data in the data acquisition process, for example, a client needs to acquire a large amount of feeds stream data such as dynamic news, friend dynamics and the like from a server.
The data acquisition method provided by the embodiment of the invention is described below with reference to the above system.
Fig. 1 is a schematic flow chart of a data acquisition method in an embodiment of the present invention, and referring to fig. 1, the data acquisition method may include:
s101: the client sends a data acquisition request to the server, wherein the data acquisition request carries an original field value corresponding to the paging field.
The data acquisition request is used for requesting the server to issue paging data of the current page and a new field value corresponding to the paging field.
As an example, when a user refreshes feed stream data through a client such as a social application or an information application, the client sends a data acquisition request for requesting to issue paging data to the server, so as to request the server to issue the paging data of the current page and a new field value corresponding to the paging field to the client according to an original field value corresponding to the paging field.
Here, the paging field is set according to a general paging protocol agreed in advance.
In practical applications, in order to implement flexible paging processing, for example, switching the paging mode in the pre-stored paging configuration information from the page number paging mode to the displacement paging mode, switching the ordering field in the pre-stored paging configuration information from the ordering field 1 to the ordering field 2, switching the number of the paging records in the pre-stored paging configuration information from the first value to the second value, etc., a general paging protocol in which the server and the client perform the paging data interaction may be agreed, and specifically, the content of the general paging protocol may include: the paging field may be a preset first character for representing the first page data, a preset second character for representing the last page data, which is different from the preset first character, or a preset third character for representing other page data except the first page data and the last page data, according to the difference of the types of the paging data.
Then, based on the general paging protocol, when the client requests that the paging data of the current page issued by the server is the first page data, the original field value of the paging field sent to the server by the client is a default filled preset first character for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value of the paging field sent to the server by the client is the field value which is simultaneously returned to the client by the server in the process of issuing the previous page data to the client, namely, a preset third character used for representing other page data except the first page data and the last page data. It can be seen that the meaning of the paging field is almost transparent to the client, except that when the first page data is acquired, the field value of the paging field sent to the server by the client can be filled in the request parameter of the data acquisition request by default by the client, and in other cases, the field value of the paging field sent to the server by the client is sent to the client in advance by the server in the previous interaction process.
As an example, where the paging field is implemented by an offset field, the preset first character is implemented by character 0, and the preset second character is implemented by character-1, then the generic paging protocol content may include: an offset field, 0 represents the first page data, -1 represents the last page data. Wherein when the client requests the first page of data, the offset defaults to fill 0.
In addition, when the general paging protocol is designed, the paging field can be of a character string type, the field value of the paging field can be of a numerical value type or of a character string type, and the fact that the paging field can represent different meanings at the server side is ensured, so that the server side is convenient to flexibly control the paging mechanism, such as switching the paging mode and the like.
As an example, in a specific implementation process, S101 may include: the client obtains an initial data acquisition request; if the paging data of the current page is the first page data, adding a preset first character serving as an original field value corresponding to the paging field into the initial data acquisition request to obtain the data acquisition request, wherein the preset first character is a character which is preset with the server side and is used for representing the first page data.
S102: the server determines the paging data of the current page and a new field value corresponding to the paging field based on the original field value and preset paging configuration information;
Specifically, after receiving a data acquisition request of paging data, which is sent by a client and carries an original field value corresponding to a paging field, the server knows that the client requests to issue the paging data of the current page, and then, the server responds to the data acquisition request to acquire preset paging configuration information, and then determines the paging data of the current page requested by the client according to the original field value of the paging field sent by the client and the acquired paging configuration information, and determines a new field value corresponding to the paging field required to be returned to the client so as to indicate whether the paging book of the current page has the paging data of the next page to the client.
As an example, the above-described paging configuration information may include: ordering field, number of page records, and paging mode.
In practical applications, the paging control of the server is configurable, and page configuration information such as a sorting field, a paging record number, a paging mode and the like can be recorded in a certain storage mode. When a data acquisition request from a client is received, the paging configuration information is read from the storage space, where the sorting field refers to a field capable of sorting a plurality of records in the pre-stored information stream data. For example, when the information stream data is a merchandise display list including a plurality of merchandise records, the sorting field may be set to the creation time of the merchandise or the modification time of the merchandise, and of course, may be other fields capable of sorting the plurality of records in the information stream data, such as the merchandise name, etc. The embodiments of the present invention are not specifically limited herein for the type of the ordering field, and may be set by those skilled in the art according to the service requirements.
Here, the number of page records refers to the maximum number of records that can be displayed per page. For example, the number of page records may be set to 5, 10, and so on.
Here, the paging method refers to a method used by the server to perform paging processing on the information stream data. For example, the paging mode may be a page number paging mode or a displacement paging mode, and of course, may be other types of paging processing modes, where the type of paging mode configured by the server side in the embodiments of the present invention is not specifically limited.
S103: the server sends a request response to the client, wherein the request response comprises: paging data of the current page and a new field value corresponding to the paging field;
in practical application, based on the general paging protocol, when the client requests that the paging data of the current page issued by the server is the last page data, the server issues the paging data of the current page, and simultaneously sends a new field value of the paging field of the client to be a preset second character for representing the last page data; when the client requests that the paging data of the current page sent by the server is not the last page data, the server sends the paging data of the current page, and the new field value of the paging field sent to the client is a preset third character used for representing other page data except the first page data and the last page data, and the new field value can be sent to the server again when the client requests to send the next page data.
Specifically, after the server obtains the paging data of the current page requested by the client according to the original field value corresponding to the paging field and the preset paging configuration information and determines the new field value corresponding to the paging field, the server sends the paging data of the current page and the new field value corresponding to the paging field to the client as a request response, so that the client renders the paging data of the current page, and determines whether to obtain the paging data of the next page based on the new field value corresponding to the paging field returned by the server.
S104: the client renders paging data of the current page;
as an example, after the client receives the paging data of the current page requested by the client, the paging data of the current page is rendered for display to the user.
S105: the client determines whether the page data of the next page needs to be acquired based on the new field value corresponding to the page field.
As an example, after the client receives the new field value corresponding to the paging field issued by the server, the client may determine whether to acquire the paging data of the next page according to the new field value corresponding to the paging field. Specifically, when the field value corresponding to the paging field returned by the client receives the server is a preset second character for representing the last page of data, the client can determine that the current page of paging data requested by the client from the server is the last page of data in the information stream data, and at this time, the client can end to acquire the paging data. When the field value corresponding to the paging field returned by the client is not the preset second character, the client can determine that the paging data of the current page requested by the client from the server is not the last page data in the information stream data, that is, the paging data of the current page still has the paging data of the next page, and at this time, the client can continue to request the paging data of the next page by sending the new field value to the server.
As an example, in a specific implementation process, S105 may include: the client determines whether a new field value corresponding to the paging field is a preset second character, wherein the preset second character is used for representing the last page of data; if the client determines that the new field value is not the preset second character, determining that the paging data of the next page needs to be acquired, and sending a new data acquisition request for requesting to issue the paging data of the next page to the server by the client, wherein the new data acquisition request carries the new field value corresponding to the paging field; the client receives a new request response sent by the server, wherein the new request response comprises the following steps: the page data of the next page and the updated field value corresponding to the page field. And/or if the client determines that the new field value is the preset second character, determining that the server is not required to issue the paging data of the next page, and outputting preset reminding information for reminding that the paging data of the current page is the last page data.
Specifically, after the client receives the new field value corresponding to the paging field sent by the server, the server will determine whether the new field value returned by the server is a preset second character for representing the last page of data. Then, if the client determines that the new field value is the preset second character, the client determines that the paging data of the current page is the last page data, and at this time, the client can stop acquiring the paging data without requesting the server to issue the paging data of the next page, and output the preset reminding information to prompt the user that the paging data of the current page is the last page data, i.e. prompt the user that the last page has been recorded. If the client determines that the new field value is not the preset second character, the client may determine that the next page of data is still available after the current page, and then the client may transmit the new field value returned by the server to the server as the request parameter, at this time, the server may receive the new field value corresponding to the paging field sent by the client, and then use the new field value as the original field value, and restart to execute step S102 until the paging data of the current page is the last page of data.
Therefore, in the process that the server and the client perform the paging data interaction through the paging field configured based on the general paging protocol, the data acquisition request sent to the server by the client needs to carry the paging field set according to the general paging protocol and the field value corresponding to the paging field, and the request response sent to the client by the server needs to carry the paging data requested by the client and the field value corresponding to the paging field to be sent to the client, so that the client can acquire the paging data of the next page. In general, then, in the process of the server and the client performing the paging data interaction through the paging field configured based on the above-mentioned general paging protocol, there may be the following four interaction processes:
(1) When the paging data of the current page requested by the client to the server is the first page data, the client can default fill in the field value corresponding to the paging field as a preset first character.
(2) When the paging data of the current page requested by the client to the server is other page data than the first page data, the client may retransmit the preset third character, which is issued by the server and is used for representing other page data except the first page data and the last page data, to the server, that is, the field value of the paging field received by the client when the client requests the previous page data of the other page data.
(3) When the field value corresponding to the paging field returned by the client side is a preset second character, the paging data of the current page requested by the client side to the server side is indicated to be the last page data in the information stream data.
(4) When the field value corresponding to the paging field returned by the client side is not the preset second character, the paging data of the current page requested by the client side to the server side is indicated not to be the last page data in the information stream data. At this point, the client may continue to request the next page of data.
It should be understood that, although terms such as original and new may be used to describe the field values of the paging field transmitted by the server and the client during the data acquisition process in the embodiments of the present invention, these terms are only used to distinguish the same type of information as the field values of the paging field from each other, without departing from the scope of the present application, the original field value corresponding to the paging field refers to the field value sent by the client to the server, and the new field value corresponding to the paging field refers to the field value sent by the server to the client. Specifically, in the same interaction process, the new field value corresponding to the paging field returned to the client by the server is different from the original field value corresponding to the paging field sent to the server by the client. However, in the two adjacent interactions, the original field value transmitted to the server by the client in the last interaction may be the new field value returned to the client by the server in the previous interaction. For example, if the paging data of the current page acquired by the client in the previous interaction process still has the paging data of the next page, the client may perform the next interaction process with the server to acquire the paging data of the next page, and then in the next interaction process, the client may send the new field value issued by the server in the previous interaction process to the server again as the new original field value.
As can be seen from the above, in the process that the server and the client perform the paging data interaction through the paging field configured based on the general paging protocol, the meaning of the paging field is almost transparent for the client, when the client needs to acquire the paging data, the client only needs to send the default preset first character to the server as the field value corresponding to the paging field, or the client only needs to send the field value corresponding to the paging field issued by the server in the process of the data request again to the server in the next data request, so as to acquire the corresponding next page data. Therefore, the intervention of the client on the paging mechanism can be reduced, and then the core logic of the paging mechanism can be controlled by the server under the cooperation of the client, so that the server can switch the specific paging method without perception of the client, and further, the flexibility of the service can be realized. In addition, the server and the client are realized through the paging fields which are almost transparent to the client in the process of paging data interaction, and the server can configure the paging mode according to the service and set the corresponding preset paging strategy, so that the paging mechanism controlled by the server can be compatible with various paging modes, such as a compatible page number paging mode and a displacement paging mode.
Each step in the above-described data acquisition method is described below with specific examples.
In another embodiment of the present invention, in order to obtain the paging data of the current page requested by the client and determine the new field value corresponding to the paging field that needs to be issued to the client, the step S102 may include the following steps A1 to A2:
step A1: the server acquires a sorting field, a paging record number and a paging mode from preset paging configuration logic as paging configuration information;
step A2: the server end determines the paging data of the current page and the new field value corresponding to the paging field based on the ordering field, the paging record number, the paging mode and the original field value.
In practical application, the preconfigured paging configuration logic may be stored in a local storage space of the server side, or may be remotely stored in a cloud storage space. Here, the memory location where the preconfigured page configuration logic is located is not specifically limited in the embodiment of the present invention.
The following describes how the server obtains the paging data of the current page requested by the client and determines the new field value corresponding to the paging field to be issued to the client, taking the server as an example to configure the paging mode into the page number paging mode or the displacement paging mode.
In the implementation process, the step A2 may be implemented in two ways according to the paging mode, but is not limited to the following two ways.
In the first implementation manner, if the paging mode obtained by the server from the preset paging configuration logic is a page number paging mode, in a specific implementation process, the step A2 may include the following steps B1 to B3:
step B1: the server end determines the current page code number corresponding to the paging data of the current page based on the original field value corresponding to the paging field;
step B2: the server end determines the paging data of the current page based on the ordering field, the paging record number and the current page code number;
step B3: the server end determines a new field value corresponding to the paging field based on the current number of page codes and the number of paging records.
First, a description will be given of how the server determines the current page number corresponding to the page data of the current page when the paging mode is the page paging mode.
In other embodiments of the present invention, the following three cases may exist in the above step B1, but are not limited to the following cases, according to whether the paging data of the current page requested to be issued by the client is the first page data:
in the first case, when the paging data of the current page requested to be sent by the client is the first page data, the step B1 may include: the method comprises the steps that a server determines whether an original field value corresponding to a paging field is a preset first character or not, wherein the preset first character is used for representing first page data; if the original field value is determined to be the preset first character, the preset initial page code number is used as the current page code number corresponding to the paging data of the current page.
Specifically, when the server determines, based on the general paging protocol, that the original field value corresponding to the paging field sent by the client is the preset first character for representing the first page data, the server may determine that the paging data of the current page requested to be sent by the client is the first page data, so that the server may use the preset initial page code number as the page number corresponding to the paging data of the current page requested to be sent by the client.
Illustratively, the preset starting page number is different according to the preset page number counting mode. For example, when a natural number, i.e., 0, 1, 2, 3, etc., is used as the page code number, the preset start page code number may be 0; when a positive integer, i.e., 1, 2, 3, 4, etc., is used as the number of page codes, the preset starting number of page codes may be 1. Of course, the number of the preset initial page code may be other characters, which may be set by those skilled in the art according to practical application, and the embodiment of the present invention is not limited herein.
In the second case, when the paging data of the current page requested to be issued by the client is not the first page data, the step B1 may include: the method comprises the steps that a server determines whether an original field value corresponding to a paging field is a preset first character or not, wherein the preset first character is used for representing first page data; if the original field value is determined not to be the preset first character, the server inquires the target page code number corresponding to the original field value according to the corresponding relation between the pre-stored field value and the page number, and takes the target page code number as the current page code number.
Specifically, the corresponding relationship between the field value and the page number is pre-stored in the server, when the server determines, based on the general paging protocol, that the original field value corresponding to the paging field sent by the client is not the preset first character for representing the first page data, the server may determine that the paging data of the current page requested to be sent by the client is other page data except the first page data, and then, according to the corresponding relationship, the server may determine the target page number corresponding to the original field value as the current page number corresponding to the paging data of the current page requested to be sent by the client.
For example, the above-mentioned correspondence may be stored in the server in the form of a table, and then, as shown in table 1, the original field value corresponding to the paging field, i.e. 1, corresponds to the number of page codes of 2, that is, the number of current page codes corresponding to the paging data of the current page requested to be issued by the client is 2, that is, the client requests the server to issue the second page data.
Field value Page code number
0 1
1 2
2 3
... ...
N N+1
TABLE 1
Of course, the corresponding relationship between the field value and the page number may be other types and other values, which can be set by those skilled in the art, and the present invention is not limited in particular.
In the third case, taking the case that the page number is implemented by a positive integer counted from 1 and the field value is implemented by a positive integer as an example, when the page data of the current page requested to be issued by the client is not the first page data, the step B1 may include: the method comprises the steps that a server determines whether an original field value corresponding to a paging field is a preset first character or not, wherein the preset first character is used for representing first page data; if the original field value is determined not to be the preset first character, the original field value is used as the current page code number corresponding to the paging data of the current page.
Specifically, when the server determines, based on the above general paging protocol, that the original field value corresponding to the paging field sent by the client is not the preset first character for representing the first page data, then the server may determine that the paging data of the current page requested to be sent by the client is other page data except the first page data, then, since the number of page codes is implemented by a positive integer counted from 1, and the field value is also implemented by a positive integer, then the server may directly use the original field value as the number of current page codes corresponding to the paging data of the current page.
Of course, other cases may exist in addition to the three listed cases, to determine the number of current page codes corresponding to the paging data of the current page, for example, the first case and the second/third case are combined, and the embodiment of the present invention is not limited specifically herein.
Next, description is made on how the server obtains the page data of the current page when the paging mode is the page number paging mode.
As an example, in a specific implementation process, the step B2 may include: the server orders the pre-stored information stream data according to the ordering field to obtain ordered information stream data; determining a first record index corresponding to the paging data of the current page based on the paging record number and the current page code number; starting from the record pointed by the first record index in the sorted information stream data, and reading the record by taking the number of the inquired records as the target number to obtain the paging data of the current page.
In practical application, taking the specific page number as a positive integer counted from 1 and the recording index as an example counted from 0, then subtracting 1 from the current page number to obtain a difference value, and then multiplying the difference value by the paging recording number to obtain a product as the first recording index of the current page, that is, the first recording index= (the current page number-1 corresponding to the current page) of the current page.
Finally, the description is made on how the server determines the new field value corresponding to the paging field when the paging mode is the page paging mode.
In a specific implementation process, the step B3 may include the following steps C1 to C3:
step C1: the method comprises the steps that a server side obtains the total record number of pre-stored information stream data;
step C2: the server determines the total page number corresponding to the information stream data based on the total record number and the paging record number;
as an example, in a specific implementation process, the step C2 may include: the server determines whether the remainder obtained by dividing the total record number by the paging record number is equal to 0; if yes, dividing the total record number by the paging record number to obtain a quotient serving as the total page number; otherwise, the sum of the quotient obtained by dividing the total record number by the paging record number and 1 is taken as the total page number.
Specifically, when the total record number can divide the number of page records entirely, the total page number=total record number/page record number; when the total record number cannot divide the number of page records entirely, the total number of pages=total record number/number of page records+1.
It should be noted that, when the service corresponding to the information flow data provided by the server is a service with infrequent deletion and update operations, in order to save system resources, the server does not need to recalculate the total number of pages corresponding to the information flow data when the client acquires the paging data corresponding to the information flow data of the service each time, but the server can determine the total number of pages corresponding to the pre-stored information flow data by the total number of records corresponding to the pre-stored information flow data and the number of paging records set in the paging configuration logic in advance only when the paging data of the current page acquired by the client is the first page data, and store the total number of pages, so that the server can directly read when the subsequent client acquires the paging data of the next page. When the service corresponding to the information stream data provided by the server is the service with frequent deletion and update operations, in order to avoid the problem that the total page number calculated in advance is inaccurate because of the deletion and update operations of the user on the information stream data, the server needs to recalculate the total page number corresponding to the information stream data when the client acquires the paging data corresponding to the information stream data of the service each time.
Step C3: the server determines a new field value based on the current number of pages and the total number of pages.
As an example, in a specific implementation process, the above step C3 may include the following steps D1 to D3:
step D1: the service terminal determines whether the paging data of the current page is the last page data or not based on the current page code number and the total page number;
step D2: the server takes a preset second character as a new field value corresponding to the paging field;
wherein, preset the second character to be used for representing last page data.
Step D3: the server takes the character determined based on the current page code number as a new field value corresponding to the paging field.
Specifically, if the server determines that the paging data of the current page requested to be sent by the client is the last page, the server may execute step D2 to determine, according to the general paging protocol, the preset second character for representing the last page data as the new field value corresponding to the paging field; if the server determines that the paging data of the current page requested to be sent by the client is other page data except the last page data, the server may execute step D3 to determine the character determined based on the current number of page codes as a new field value corresponding to the paging field.
As an example, when the specific number of pages is implemented with a positive integer counted from 1, then, in the implementation process, the step D1 may include: the server judges whether the current page number is equal to the total page number; if yes, determining the paging data of the current page as the last page data; otherwise, it is determined that the paging data of the current page is not the last page data.
As an example, when the field value of the paging field and the page number are both implemented with a positive integer counted from 1, the current page number differs from the next page number by 1, and then the step D3 may include: the server takes the sum of the current page code number and 1 as a new field value corresponding to the paging field.
As an example, in a specific implementation process, the step D3 may include: the server determines the sum of the current page code number and 1 as the next page code number; inquiring a target field value corresponding to the next page number according to the corresponding relation between the prestored page number and the field value; and taking the target field value as a new field value corresponding to the paging field.
For example, the above-mentioned correspondence may be stored in the server in the form of a table, and then, taking the current page code number as 2 as an example, the next page code number is 3, and then, as shown in table 1, the next page code number, i.e. 3, corresponds to a field value of 2, that is, the server will issue a new field value of 2 to the paging field of the client.
In a second implementation manner, if the acquired paging mode of the server from the preset paging configuration logic is a displacement paging mode, in a specific implementation process, the step A2 may include the following steps E1 to E4:
step E1: the server determines whether the original field value corresponding to the paging field is a preset first character;
wherein, the first character is preset for representing the first page data.
Step E2: the server acquires the paging data of the current page from the pre-stored information stream data according to the ordering field and the paging record number, and determines a new field value corresponding to the paging field;
step E3: the server end determines a displacement value corresponding to paging data of the current page based on an original field value corresponding to the paging field;
as an example, the server may directly use the original field value corresponding to the paging field as the displacement value corresponding to the paging data of the current page.
Step E4: and the server determines the paging data of the current page and the new field value corresponding to the paging field according to the ordering field, the displacement value and the paging record number.
Specifically, if the server determines that the original field value corresponding to the paging field is the preset first character, the server may determine that the paging data of the current page requested to be issued by the client is the first page data, and at this time, the server may execute step E2 without adding a displacement condition, directly obtain the paging data of the current page from the pre-stored information stream data through the ordering field and the number of paging records, and determine the new field value corresponding to the paging field. If the server determines that the original field value corresponding to the paging field is not the preset first character, the server may determine that the paging data of the current page requested to be issued by the client is other page data except the first page data, and then, in order to obtain the paging data, a displacement condition needs to be added, then, the server may execute steps E3 to E4, firstly, determine a displacement value corresponding to the paging data of the current page based on the original field value corresponding to the paging field, and then, according to the displacement value, the sorting field and the number of paging records, obtain the paging data of the current page from the prestored information stream data, and determine a new field value corresponding to the paging field.
First, how the server obtains the paging data of the current page and determines the new field value corresponding to the paging field when the paging mode is the page paging mode and the paging data of the current page requested by the client is the first page data is described.
In a specific implementation process, the step E2 may be implemented by the following steps F1 to F4:
step F1: the server determines the sum of the paging record number and 1 as the query record number;
step F2: the server orders the pre-stored information stream data according to the ordering field to obtain ordered information stream data;
step F3: the server starts from the first record in the sorted information stream data, and reads the record by taking the number of the inquired records as the target number to obtain inquired paging data;
step F4: the server determines the paging data of the current page based on the queried paging data and the query record number, and determines a new field value corresponding to the paging field.
Next, how the server obtains the page data of the current page and determines the new field value corresponding to the page field when the page data of the current page requested by the client is other page data than the first page data is the page paging mode.
In the implementation process, in order to realize that when the deleting operation is performed on the current page of the data, the data is paged or stabilized by the displacement paging mode, one record needs to be acquired, and then the step E4 can be implemented by the following steps G1 to G4:
step G1: the server determines the sum of the paging record number and 1 as the query record number;
step G2: the server orders the pre-stored information stream data according to the ordering field to obtain ordered information stream data;
step G3: the server starts from the record pointed by the displacement value in the sorted information stream data, and reads the record by taking the number of the inquired records as the target number to obtain inquired paging data;
step G4: the server determines the paging data of the current page based on the queried paging data and the query record number, and determines a new field value corresponding to the paging field.
In other embodiments of the present invention, the step F4 or the step G4 may be implemented by the following steps H1 to H3:
step H1: the server determines the actual record number corresponding to the queried paging data;
step H2: the server compares the actual record number with the query record number;
Step H3: and the server determines the paging data of the current page according to the comparison result and the queried paging data, and determines a new field value corresponding to the paging field.
In a specific implementation, the above step H3 may exist, but is not limited to, the following two cases according to the comparison result.
In the first case, the step H3 may include: if the actual record number is equal to the query record number, the server takes other records except the last record in the queried paging data as the paging data of the current page; and taking the field value corresponding to the sorting field in the last record as a new field value corresponding to the paging field.
Specifically, in order to avoid the problem that the page is unstable due to deleting the last record in the page data of the current page by the user, when the actual record number corresponding to the page data queried by the server is equal to the query record number, that is, the sum of the page record number and 1, and the maximum record number that can be displayed by each page is the page record number, the server can determine that the next page data still exists after the page data of the current page requested to be issued by the client, at this time, the server can issue other records except the last record in the queried page data to the client as the page data of the current page, and issue the field value corresponding to the ordering field in the last record as the new field value corresponding to the page field to the client, so that the client resends the new field value to the server to request the server to issue the next page data.
For example, assume that the maximum number of records that can be displayed per page, i.e., the number of page records is 5, and that the page data queried by the server is sequentially record 1, record 2, record 3, record 4, record 5, and record 6. Thus, after the server sends record 1, record 2, record 3, record 4, and record 5 to the client, the user cannot see "record 6" because the server does not send "record 6" to the client, and thus the user cannot delete "record 6". Next, even if the user performs the deletion operation on "record 5" in "record 1, record 2, record 3, record 4, and record 5" displayed on the client, since the server side issues the field value corresponding to the sorting field in the last record, i.e., the "record 6", as the new field value corresponding to the paging field to the client side, when the client side requests the next page of data, the server side can query "record 6" according to the field value corresponding to the sorting field in "record 6", and further, the server side can obtain the paging data required by the client side from "record 6". Thus, the problem of unstable paging caused by deleting the last record in the paging data of the current page by the user can be avoided.
In the second case, the step H3 may include: if the actual record number is smaller than the query record number, the server takes all records in the queried paging data as the paging data of the current page; and taking a preset second character as a new field value corresponding to the paging field, wherein the preset second character is used for representing the last page of data.
Specifically, when the actual record count corresponding to the paging data queried by the server is smaller than the query record count, that is, the sum of the paging record count and 1, since the maximum record count that can be displayed by each page is the paging record count, the server can determine that there is no next page data after the paging data of the current page requested to be issued by the client, that is, the server can determine that the paging data of the current page requested to be issued by the client is the last page data, at this time, the server can issue all records in the queried paging data as the paging data of the current page to the client, and issue a preset second character for representing the last page data as a new field value corresponding to the paging field to the client, so that the client knows that the paging data of the current page requested by the client is the last page data, and further, the client finishes requesting to issue the paging data.
Thus, the interactive process of the client and the server for acquiring the paging data based on the paging field is completed.
As can be seen from the foregoing, in the data acquisition method provided by the embodiment of the present invention, after the server receives the data acquisition request sent by the client and used for requesting to issue the paging data of the current page, the server may acquire the paging data of the current page required by the client based on the original field value corresponding to the paging field carried in the data acquisition request and the pre-stored paging configuration information, determine the new field value corresponding to the paging field to be issued to the client, and then send the paging data of the current page and the new field value corresponding to the paging field to the client, so that the client can perform subsequent processing on the paging data of the current page and the new field value corresponding to the paging field. In this way, in the process of obtaining the paging data, the paging configuration information is completely controlled by the server, and the field value of the paging field can be issued to the client by the server, so that the server can flexibly configure the paging configuration information according to the service, such as the paging mode, and further, the server can flexibly switch from one paging mode to another paging mode.
Based on the same inventive concept, an embodiment of the present invention provides a data acquisition method, and fig. 2A is a second schematic flow chart of the data acquisition method in the embodiment of the present invention, as shown in fig. 2A, after S104, the data acquisition method may include:
s201: the client determines whether a new field value corresponding to the paging field is a preset second character;
the second character is preset and used for representing the last page of data;
specifically, after the client receives the new field value corresponding to the paging field issued by the server, the server executes S201 to determine whether the new field value returned by the server is a preset second character for representing the last page of data. After the client executes S201, if the client determines that the new field value corresponding to the paging field returned by the server is not the preset second character, which indicates that there is paging data of the next page, at this time, the client determines that the paging data of the next page needs to be acquired, S202-S203 may be executed, and the new field value is added as the original field value in the data acquisition request and is resent to the server, so as to request the server to issue the paging data of the next page and the updated field value; after the client executes S201, if the client determines that the new field value corresponding to the paging field returned by the server is the preset second character, which indicates that the paging data of the next page is not available, at this time, the client does not need to request the server to issue the paging data of the next page, and S204 may be executed to output the reminding information, so as to remind the user that the paging data of the next page is not available.
S202: the client sends a new data acquisition request for requesting to issue paging data of the next page to the server, wherein the new data acquisition request carries a new field value corresponding to the paging field;
s203: the server side sends a new request response to the client side, wherein the new request response comprises the following steps: the paging data of the next page and the updated field value corresponding to the paging field;
specifically, if the client determines that the new field value is not the preset second character, the client may determine that the next page of data is still after the current page, and then the client may transmit the new field value returned by the server to the server as a request parameter to request the server to issue the paging data of the next page and the updated field value corresponding to the paging field. Next, after the server receives the new field value corresponding to the paging field sent by the client, the server will use the new field value as the original field value, and continue to execute step S102 to determine the paging data of the next page and the field value corresponding to the paging field, then execute step S203 to send the paging data of the next page and the updated field value corresponding to the paging field to the client, finally, the client can use the updated field value as the new field value, continue to execute step S104, and continue to execute step S201 after step S104 until the server returns the last page of data to the client.
S204: and the client outputs reminding information.
Here, the reminder information is used to prompt the user that the paging data of the current page is the last page data.
The data acquisition method proposed in the embodiment of the present invention will be described below with specific examples.
Illustratively, the content in the generic paging protocol includes: the paging field is denoted as offset,0 represents the first page of data, and-1 represents the last page of data, and then, referring to fig. 2B, the interaction process between the client and the server for implementing data acquisition through the paging field may be briefly described as follows:
step 1, the client needs to request the server to issue paging data of the first page, and the client can send a data acquisition request carrying offset=0 to the server;
step2, after receiving the data acquisition request, the server acquires the sorting field, the number of the paging records (recorded as pageSize) and the adopted paging mode of the scene from the paging configuration logic. If the paging mode is a page number paging mode, the flow is switched to Step3.1-Step3.5; if the paging mode is a displacement paging mode, the flow is switched to Step4.1-Step4.5;
step3.1, the server judges whether the offset transmitted by the client is equal to 0, if the offset is equal to 0, the server determines that the page number of the paging data requested by the client is equal to the preset initial page number used for representing the first page, and if the offset is not equal to 0, the server determines that the page number of the paging data requested by the client is equal to the offset;
Step3.2, the server obtains page size record data corresponding to the page number from the pre-stored information stream data based on the ordering field according to the page number obtained by step3.1, and obtains the page data requested by the client;
step3.3, the server calculates the total page number according to the pageSize obtained from the paging configuration logic and the total record number of the information stream data;
step3.4, the server side checks whether the page number is equal to the total page number calculated by step3.3 according to the page number obtained by step3.1, if yes, the page data offset= -1 of the next page is not available, otherwise, the page data of the next page is available, and the offset = the page number of the next page, namely, the page number obtained by step3.1 is +1;
step3.5, the server returns the paging data acquired by step3.2 and the field value corresponding to the offset calculated by step3.4 to the client;
step4.1, the server judges whether the offset transmitted by the client is equal to 0, if the offset is equal to 0, determines that the paging data requested by the client is the first page data, and if the offset is not equal to 0, the displacement condition is required to be added, and the displacement value can be the offset;
step4.2, according to the displacement value of step4.1, acquiring pages+1 records from the pre-stored information stream data based on the ordering field, and obtaining the queried paging data;
Step4.3, calculating whether the actual record number of the queried paging data acquired by Step4.2 is smaller than pagesize+1 (i.e. the query record number), if so, indicating that no paging data of the next page exists, and if not, performing offset= -1, otherwise performing offset = the value of the ordering field in the pagesize+1 record, namely performing offset on the new field value which is equal to the value of the ordering field (acquired by Step 2) in the last record in the queried paging data;
step4.4, if the actual record number of the queried paging data acquired by step4.2 is equal to the pagesize+1, the paging data returned to the client by the server is a previous pageSize strip record, otherwise, all records of the query are returned;
step4.5, the server returns the field value corresponding to the offset calculated by step4.3 and the paging data determined by step4.4 to the client;
step5, after receiving a request response returned by the server, the client renders the paging data returned by the server into a page component to be displayed to a user, then judges whether offset returned by the server is equal to-1, if yes, the flow enters Step6, and if not, the flow enters Step7;
step6, the client outputs reminding information on the page to prompt the user that the last record is reached;
Step7, the client requests paging data of the next page, and transmits a field value corresponding to the offset returned by the offset=server as a parameter to the server. Then, the flow goes to the server Step2.
As can be seen from the above, in the process that the server and the client perform the paging data interaction through the paging field configured based on the general paging protocol, the meaning of the paging field is almost transparent for the client, when the client needs to acquire the paging data, the client only needs to send the default preset first character to the server as the field value corresponding to the paging field, or the client only needs to send the field value corresponding to the paging field issued by the server in the process of the data request again to the server in the next data request, so as to acquire the corresponding next page data. Therefore, the intervention of the client on the paging mechanism can be reduced, and the core logic of the paging mechanism can be controlled by the server under the cooperation of the client, so that the server can switch the specific paging method without perception of the client, and further, the flexibility of the service can be realized.
Based on the same inventive concept, an embodiment of the present invention provides a data acquisition method, and fig. 3 is a schematic flow chart of the data acquisition method in the embodiment of the present invention, and as shown in fig. 3, the data acquisition method may include:
s301: the server obtains modification data aiming at least one of a sorting field, a paging record number and a paging mode contained in preset paging configuration information;
specifically, in the process that the server and the client perform the paging data interaction through the paging field configured based on the above general paging protocol, the meaning of the paging field is almost transparent for the client, so when the service scene changes, the server may directly modify the pre-stored paging configuration information, for example, switch the paging mode in the pre-stored paging configuration information from the paging mode to the displacement paging mode, switch the sorting field in the pre-stored paging configuration information from the sorting field 1 to the sorting field 2, switch the number of the paging records in the pre-stored paging configuration information from the first value to the second value, and so on, where the server may obtain the modified data corresponding to at least one of the sorting field, the number of the paging records, and the paging mode.
For example, assume that the information stream data is a merchandise display list including a plurality of merchandise records, the server performs paging processing on the information stream data, and the server initially arranges the plurality of merchandise records in reverse order according to the creation time of the merchandise, where the ordering field set by the server is the creation time of the merchandise records. Next, when the service needs to change the scene into the arrangement according to the modification time of the commodity, the service is the core logic for controlling the paging mechanism by the server, so that the service only needs to modify the ordering field of the commodity record from the creation time to the modification time in the pre-stored paging configuration information, and the whole ordering logic is completed, thereby the service side flexibly switches the ordering field from the creation time to the modification time, and the client does not need to perform any modification, so that the service side is not aware.
S302: the server modifies the paging configuration information based on the modification data to obtain modified paging configuration information;
s303: the server receives a data acquisition request sent by the client, wherein the data acquisition request carries a primary field value corresponding to a paging field, and the primary field value is a preset first character for representing data of a first page;
S304: the server side responds to the data acquisition request, determines the paging data of the current page based on the original field value corresponding to the paging field and the modified paging configuration information, and determines a new field value corresponding to the paging field;
s305: the server sends a request response to the client, wherein the request response comprises: paging data of the current page and a new field value corresponding to the paging field.
Specifically, in the process that the server and the client interact with each other through the paging field configured based on the general paging protocol, after the server modifies the paging configuration information, in order to avoid unstable paging, the client needs to acquire the first page data corresponding to the information stream data again. Specifically, when the client needs to acquire paging data, the client only needs to send a default preset first character to the server as a field value corresponding to the paging field, so as to acquire the first page data, or the client only needs to send the field value corresponding to the paging field issued by the server in the process of the data request, and when the next data request is performed, the client resends the field value to the server so as to acquire the corresponding next page data. Therefore, under the cooperation of the client, the core logic of the paging mechanism can be controlled by the server, so that the server can switch the specific paging method without perception by the client, and further, the flexibility of the service can be realized.
In another embodiment of the present invention, when the server issues the paging data of the current page to the client and the new field value of the paging field issued by the server to the client is not the preset second character for representing the last page of data, at this time, the client may determine that there is still the next page of data after the received paging data of the current page, so the client may further resend the new field value of the paging field issued by the server to request the server to issue the paging data of the next page, and in the implementation process, after S305, if the new field value is not the preset second character for representing the last page of data, the method may further include: the server receives a new data acquisition request sent by the client, wherein the data acquisition request carries a new field value corresponding to the paging field; responding to a new data acquisition request, acquiring paging data of the next page based on a new field value corresponding to a paging field and modified paging configuration information, and determining an updated field value corresponding to the paging field; the server side sends a new request response to the client side, wherein the new request response comprises the following steps: the page data of the next page and the updated field value corresponding to the page field.
According to the above, the paging mechanism is controlled by the server, when the service scene changes and needs to change the paging configuration information such as the ordering field, the number of the paging records, the paging mode and the like, the client only needs to modify the pre-stored paging configuration information at the server, and the client does not need to modify any of the pre-stored paging configuration information.
Based on the same inventive concept, as an implementation of the above method, the embodiment of the present invention provides a data acquisition device, which may be applied to a server in practical application.
Fig. 4 is a schematic structural diagram of a data acquisition device according to an embodiment of the present invention, and referring to fig. 4, the device 40 may include: a receiving unit 401, configured to receive a data acquisition request sent by a client, where the data acquisition request carries an original field value corresponding to a paging field; a determining unit 402, configured to determine, based on the original field value and preset paging configuration information, paging data of a current page and a new field value corresponding to a paging field; a sending unit 403, configured to send a request response to the client, where the request response includes: paging data of the current page and a new field value.
In the embodiment of the invention, a determining unit is used for acquiring an ordering field, a paging record number and a paging mode from preset paging configuration logic as paging configuration information; based on the ordering field, the number of page records, the paging mode, and the original field value, the paging data of the current page and the new field value are determined.
In the embodiment of the invention, the determining unit is used for determining the current page number based on the original field value if the paging mode is a page number paging mode; determining paging data of the current page based on the ordering field, the paging record number and the current page code number; a new field value is determined based on the current number of page codes and the number of page records.
In the embodiment of the invention, a determining unit is used for determining whether the original field value is a preset first character, wherein the preset first character is used for representing first page data; if the original field value is determined to be the preset first character, the preset initial page code number is used as the current page code number.
In the embodiment of the invention, the determining unit is configured to query, if it is determined that the original field value is not the preset first character, a target page number corresponding to the original field value according to a correspondence between the pre-stored field value and the page number, and take the target page number as the current page number.
In the embodiment of the present invention, the determining unit is configured to, if it is determined that the original field value is not the preset first character, use the original field value as the current page code number corresponding to the paging data of the current page.
In the embodiment of the invention, a determining unit is used for acquiring the total record number of the pre-stored information stream data; determining the total page number corresponding to the information stream data based on the total record number and the paging record number; a new field value is determined based on the current number of pages and the total number of pages.
In the embodiment of the invention, a determining unit is used for determining whether the remainder obtained by dividing the total record number by the paging record number is equal to 0; if yes, dividing the total record number by the paging record number to obtain a quotient serving as the total page number; otherwise, the sum of the quotient obtained by dividing the total record number by the paging record number and 1 is taken as the total page number.
In the embodiment of the invention, a determining unit is used for determining whether paging data of a current page is data of a last page or not based on the number of codes of the current page and the total number of pages; if yes, taking a preset second character as a new field value, wherein the preset second character is used for representing the last page of data; otherwise, the character determined based on the current number of page codes is taken as a new field value.
In the embodiment of the invention, the determining unit is used for judging whether the number of the current page numbers is equal to the total page number; if yes, determining the paging data of the current page as the last page data; otherwise, determining that the paging data of the current page is not the last page data; and is further configured to use the sum of the current number of codes and 1 as a new field value corresponding to the paging field.
In the embodiment of the invention, a determining unit is used for determining the sum of the current page code number and 1 as the next page code number; inquiring a target field value corresponding to the next page number according to the corresponding relation between the prestored page number and the field value; and taking the target field value as a new field value corresponding to the paging field.
In the embodiment of the invention, a determining unit is used for ordering the pre-stored information stream data according to the ordering field to obtain the ordered information stream data; determining a first record index based on the number of paging records and the current number of page codes; starting from the record pointed by the first record index in the sorted information stream data, and reading the record by taking the number of the inquired records as the target number to obtain the paging data of the current page.
In the embodiment of the invention, the determining unit is used for determining whether the original field value is a preset first character or not if the paging mode is a displacement paging mode, wherein the preset first character is used for representing first page data; if yes, determining paging data and a new field value of the current page according to the ordering field and the paging record number; otherwise, determining a displacement value based on the original field value; and determining the paging data of the current page and the new field value according to the ordering field, the displacement value and the paging record number.
In the embodiment of the invention, a determining unit is used for determining the sum of the paging record number and 1 as the query record number; according to the sorting field, sorting the pre-stored information stream data to obtain sorted information stream data; starting from records pointed by displacement values in the sorted information stream data, and reading the records by taking the number of the inquired records as the target number to obtain inquired paging data; based on the queried page data and the number of query records, page data of the current page and a new field value are determined.
In the embodiment of the invention, a determining unit is used for determining the sum of the paging record number and 1 as the query record number; according to the sorting field, sorting the pre-stored information stream data to obtain sorted information stream data; starting from the first record in the sorted information stream data, and reading the record by taking the number of the inquired records as the target number to obtain inquired paging data; based on the queried page data and the number of query records, page data of the current page and a new field value are determined.
In the embodiment of the invention, the determining unit is used for determining the actual record number corresponding to the queried paging data; comparing the actual record number with the query record number; and determining the paging data of the current page and the new field value according to the comparison result and the queried paging data.
In the embodiment of the invention, the determining unit is used for taking other records except the last record in the queried paging data as the paging data of the current page if the actual record number is equal to the query record number; and taking the field value corresponding to the ordering field in the last record as a new field value.
In the embodiment of the invention, the determining unit is used for taking all records in the queried paging data as the paging data of the current page if the actual record number is smaller than the query record number; and taking the preset second character as a new field value, wherein the preset second character is used for representing the last page of data.
Based on the same inventive concept, as an implementation of the above method, the embodiment of the present invention provides a data acquisition device, which may be applied to a server in practical application.
Fig. 5 is a second schematic structural diagram of a data acquisition device according to an embodiment of the present invention, and referring to fig. 5, the device 50 may include: an obtaining unit 501, configured to obtain modification data for at least one of a sorting field, a number of paging records, and a paging mode included in preset paging configuration information; a modifying unit 502, configured to modify the page configuration information based on the modification data, and obtain modified page configuration information; a first receiving unit 503, configured to receive a data acquisition request sent by a client, where the data acquisition request carries a raw field value corresponding to a preset paging field, where the raw field value is a preset first character used to represent first page data; a first determining unit 504, configured to determine, based on the original field value and the modified paging configuration information, paging data of the current page and a new field value corresponding to the paging field; a first sending unit 505, configured to send a request response to the client, where the request response includes: paging data of the current page and a new field value.
In other embodiments of the present invention, the apparatus further comprises: the second receiving unit is used for receiving a new data acquisition request sent by the client if the new field value is not a preset second character for representing the last page of data, wherein the new field value is carried in the new data acquisition request; a second determining unit, configured to determine, based on the new field value and the modified paging configuration information, paging data of a next page and an updated field value corresponding to the paging field; the second sending unit is configured to send a new request response to the client, where the new request response includes: paging data of the next page and updated field values.
Based on the same inventive concept, as an implementation of the above method, the embodiment of the present invention provides a data acquisition device, which can be applied to a client in practical application.
Fig. 6 is a schematic diagram of a data acquisition device according to an embodiment of the present invention, and referring to fig. 6, the device 60 may include: a sending unit 601, configured to send a data acquisition request to a server, where the data acquisition request carries an original field value corresponding to a paging field; a receiving unit 602, configured to receive a request response sent by a server, where the request response includes: paging data of the current page and a new field value corresponding to the paging field; a rendering unit 603 for rendering the paged data of the current page; a determining unit 604, configured to determine whether the paging data of the next page needs to be acquired based on the new field value.
In the embodiment of the invention, a sending unit is used for obtaining an initial data acquisition request; if the paging data of the current page is the first page data, adding a preset first character serving as an original field value into the initial data acquisition request to obtain the data acquisition request, wherein the preset first character is used for representing the first page data.
In the embodiment of the invention, the determining unit is used for determining whether the new field value is a preset second character, and the preset second character is used for representing the last page of data; if the new field value is determined not to be the preset second character, determining that paging data of the next page needs to be acquired, and sending a new data acquisition request to the server, wherein the new data acquisition request carries the new field value; receiving a new request response sent by the server, wherein the new request response comprises the following steps: the page data of the next page and the updated field value corresponding to the page field.
In other embodiments of the present invention, the apparatus further comprises: and the output unit is used for outputting reminding information if the new field value is determined to be the preset second character and the paging data of the next page is determined not to be acquired.
Based on the same inventive concept, the embodiment of the invention provides electronic equipment. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and referring to fig. 7, the electronic device 70 includes: at least one processor 701; and at least one memory 702, bus 703 connected to the processor 701; wherein, the processor 701 and the memory 702 complete communication with each other through the bus 703; the processor 701 is configured to invoke program instructions in the memory 702 to perform the steps of the data acquisition method in one or more embodiments described above. Accordingly, based on the same inventive concept, the embodiments of the present invention further provide a processor, where the processor is configured to execute a program, and the program executes the steps of the data acquisition method in one or more embodiments.
The processor may be implemented by a central processing unit (Central Processing Unit, CPU), a microprocessor (Micro Processor Unit, MPU), a digital signal processor (Digital Signal Processor, DSP), or a field programmable gate array (Field Programmable Gate Array, FPGA), or the like. The Memory may include non-volatile Memory in a computer readable medium, random access Memory (Random Access Memory, RAM) and/or non-volatile Memory, etc., such as Read Only Memory (ROM) or Flash Memory (Flash RAM), the Memory including at least one Memory chip.
It should be noted that, in the embodiment of the present invention, if the data acquisition method in one or more embodiments described above is implemented in the form of a software functional module, and sold or used as a separate product, the data acquisition method may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the methods of the embodiments of the present invention.
Accordingly, based on the same inventive concept, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium includes a stored program, and when the program runs, controls a device where the storage medium is located to execute the steps of the data acquisition method in one or more embodiments.
It should be noted here that: the description of the above apparatus, electronic device or computer readable storage medium embodiments is similar to the description of the foregoing method embodiments, and has similar beneficial effects as the method embodiments, and for the technical details not disclosed in the apparatus, electronic device or computer readable storage medium embodiments of the present invention, please refer to the description of the method embodiments of the present invention, for convenience of reading, the details of the foregoing apparatus, electronic device or computer readable storage medium embodiments are not repeated one by one, but it should be clear that the foregoing apparatus, electronic device or computer readable storage medium can correspondingly implement all the details of the foregoing method embodiments.
It will be appreciated by those skilled in the art that 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, magnetic disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, etc.) 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include non-volatile memory in a computer-readable medium, RAM and/or non-volatile memory, etc., such as ROM or 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. The computer readable storage medium may be a ROM, a programmable read-Only Memory (PROM), an erasable programmable read-Only Memory (EPROM), an electrically erasable programmable read-Only Memory (EEPROM), a magnetic random access Memory (Ferromagnetic Random Access Memory, FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a read-Only optical disk; but also flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information which can be accessed by a computing device; but may also be various electronic devices such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above-mentioned memories. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that 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, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present invention and is not intended to limit the present invention. Various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are to be included in the scope of the claims of the present invention.

Claims (28)

1. A data acquisition method, applied to a server, the method comprising:
receiving a data acquisition request sent by a client, wherein the data acquisition request carries an original field value corresponding to a paging field, and when the client requests that paging data of a current page issued by the server be first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
based on the original field value and preset paging configuration information, determining the paging data of the current page and the new field value corresponding to the paging field includes: acquiring an ordering field, a paging record number and a paging mode from preset paging configuration logic as the paging configuration information; determining the paging data of the current page and the new field value based on the ordering field, the paging record number, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
Transmitting a request response to the client, wherein the request response comprises: paging data of the current page and the new field value.
2. The method of claim 1, wherein the determining the page data of the current page and the new field value based on the ordering field, the number of page records, the paging manner, and the original field value comprises:
if the paging mode is a page number paging mode, determining the current page number based on the original field value;
determining paging data of the current page based on the ordering field, the paging record number and the current page code number;
the new field value is determined based on the current number of page codes and the number of page records.
3. The method of claim 2, wherein determining the current number of codes based on the original field value comprises:
determining whether the original field value is a preset first character or not, wherein the preset first character is used for representing first page data;
and if the original field value is determined to be a preset first character, taking a preset initial page code number as the current page code number.
4. A method according to claim 3, characterized in that the method further comprises:
If the original field value is determined not to be the preset first character, inquiring a target page code number corresponding to the original field value according to the corresponding relation between the pre-stored field value and the page number, and taking the target page code number as the current page code number.
5. A method according to claim 3, characterized in that the method further comprises:
and if the original field value is determined not to be the preset first character, taking the original field value as the current page code number.
6. The method of claim 2, wherein the determining the new field value based on the current number of page codes and the number of page records comprises:
acquiring the total record number of the pre-stored information stream data;
determining the total page number corresponding to the information stream data based on the total record number and the paging record number;
the new field value is determined based on the current number of pages and the total number of pages.
7. The method of claim 6, wherein determining the total number of pages corresponding to the information stream data based on the total number of records and the number of paged records comprises:
determining whether a remainder obtained by dividing the total record number by the paging record number is equal to 0;
If yes, dividing the total record number by the paging record number to obtain a quotient serving as the total page number; otherwise, the sum of the quotient and 1 is taken as the total page number.
8. The method of claim 6, wherein the determining the new field value based on the current number of pages and the total number of pages comprises:
determining whether the paging data of the current page is the last page data based on the current page code number and the total page number;
if yes, taking a preset second character as the new field value, wherein the preset second character is used for representing the last page of data; otherwise, the character determined based on the current page code number is taken as the new field value.
9. The method of claim 8, wherein the determining whether the paged data for the current page is last page data based on the current number of pages and the total number of pages comprises:
judging whether the current page code number is equal to the total page number or not;
if yes, determining the paging data of the current page as the last page data; otherwise, determining that the paging data of the current page is not the last page data;
accordingly, the taking the character determined based on the current page code number as the new field value includes: and taking the sum of the current page code number and 1 as the new field value.
10. The method of claim 8, wherein said regarding the character determined based on the current number of codes as the new field value comprises:
determining the sum of the current page code number and 1 as the next page code number;
inquiring a target field value corresponding to the next page number according to the corresponding relation between the prestored page number and the field value;
and taking the target field value as the new field value.
11. The method of claim 2, wherein the determining the page data for the current page based on the ordering field, the page record number, and the current page code number comprises:
according to the sorting field, sorting the pre-stored information stream data to obtain sorted information stream data;
determining a first record index based on the number of paging records and the current number of page codes;
and starting from the record pointed by the first record index in the sorted information stream data, and reading the record by taking the number of the searched records as the target number to obtain the paging data of the current page.
12. The method of claim 1, wherein the determining the page data of the current page and the new field value based on the ordering field, the number of page records, the paging manner, and the original field value comprises:
If the paging mode is a displacement paging mode, determining whether the original field value is a preset first character, wherein the preset first character is used for representing first page data;
if yes, determining the paging data of the current page and the new field value according to the ordering field and the paging record number; otherwise, determining a displacement value based on the original field value; and determining the paging data of the current page and the new field value according to the ordering field, the displacement value and the paging record number.
13. The method of claim 12, wherein determining the page data of the current page and the new field value based on the ordering field, the displacement value, and the page record number comprises:
determining the sum of the paging record number and 1 as a query record number;
according to the sorting field, sorting the pre-stored information stream data to obtain sorted information stream data;
starting from records pointed by the displacement values in the sorted information stream data, and reading the records by taking the number of the inquired records as a target number to obtain inquired paging data;
and determining the paging data of the current page and the new field value based on the queried paging data and the query record number.
14. The method of claim 12, wherein determining the page data of the current page and the new field value based on the ordering field and the page record number comprises:
determining the sum of the paging record number and 1 as a query record number;
according to the sorting field, sorting the pre-stored information stream data to obtain sorted information stream data;
starting from the first record in the sorted information stream data, and reading the record by taking the number of the inquired records as the target number to obtain inquired paging data;
and determining the paging data of the current page and the new field value based on the queried paging data and the query record number.
15. The method of claim 13 or 14, wherein the determining the page data of the current page and the new field value based on the queried page data and the query record number comprises:
determining the actual record number corresponding to the queried paging data;
comparing the actual record number with the query record number;
and determining the paging data of the current page and the new field value according to the comparison result and the queried paging data.
16. The method of claim 15, wherein determining the page data of the current page and the new field value based on the comparison and the queried page data comprises:
if the actual record number is equal to the query record number, taking other records except the last record in the queried paging data as the paging data of the current page;
and taking a field value corresponding to the sorting field in the last record as the new field value.
17. The method of claim 15, wherein determining the page data of the current page and the new field value based on the comparison and the queried page data comprises:
if the actual record number is smaller than the query record number, taking all records in the queried paging data as the paging data of the current page;
and taking a preset second character as the new field value, wherein the preset second character is used for representing the last page of data.
18. A data acquisition method, applied to a server, the method comprising:
obtaining modification data aiming at least one of a sorting field, a paging record number and a paging mode contained in preset paging configuration information;
Modifying the paging configuration information based on the modification data to obtain modified paging configuration information;
receiving a data acquisition request sent by a client, wherein the data acquisition request carries an original field value corresponding to a paging field, and when the client requests that paging data of a current page issued by the server be first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
based on the original field value and the modified paging configuration information, determining the paging data of the current page and the new field value corresponding to the paging field includes: acquiring an ordering field, a paging record number and a paging mode from preset paging configuration logic as the paging configuration information; determining the paging data of the current page and the new field value based on the ordering field, the paging record number, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
Transmitting a request response to the client, wherein the request response comprises: paging data of the current page and the new field value.
19. The method of claim 18, wherein after said sending a request reply to said client, said method further comprises:
if the new field value is not a preset second character for representing the last page of data, receiving a new data acquisition request sent by the client, wherein the new data acquisition request carries the new field value;
determining paging data of a next page and an updated field value corresponding to the paging field based on the new field value and the modified paging configuration information;
sending a new request response to the client, wherein the new request response comprises: paging data of the next page and the updated field value.
20. A method for obtaining data, applied to a client, the method comprising:
sending a data acquisition request to a server, wherein the data acquisition request carries an original field value corresponding to a paging field, and when a client requests that paging data of a current page issued by the server be first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
Receiving a request response sent by the server, wherein the request response comprises: the method comprises the steps that the server obtains an ordering field, a paging record number and a paging mode from preset paging configuration logic as paging configuration information by the aid of paging data of a current page and a new field value corresponding to the paging field; determining based on the sorting field, the number of paging records, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
rendering the paging data of the current page;
it is determined whether paging data of a next page needs to be acquired based on the new field value.
21. The method of claim 20, wherein the sending the data acquisition request to the server includes:
Obtaining an initial data acquisition request;
and if the paging data of the current page is first page data, adding a preset first character serving as the original field value into the initial data acquisition request to obtain the data acquisition request, wherein the preset first character is used for representing the first page data.
22. The method of claim 20, wherein determining whether paging data of a next page needs to be fetched based on the new field value comprises:
determining whether the new field value is a preset second character, wherein the preset second character is used for representing the last page of data;
if the new field value is determined not to be the preset second character, determining that paging data of a next page needs to be acquired, and sending a new data acquisition request to the server, wherein the new data acquisition request carries the new field value;
receiving a new request response sent by the server, wherein the new request response comprises: and the paging data of the next page and the updated field value corresponding to the paging field.
23. The method of claim 22, wherein the method further comprises:
if the new field value is determined to be the preset second character, the paging data of the next page is determined not to be acquired, and the reminding information is output.
24. A data acquisition device, for application to a server, the device comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data acquisition request sent by a client, wherein the data acquisition request carries an original field value corresponding to a paging field, and when the client requests that the paging data of a current page issued by a server is first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
the determining unit is configured to determine, based on the original field value and preset paging configuration information, paging data of a current page and a new field value corresponding to the paging field, where the determining unit includes: acquiring an ordering field, a paging record number and a paging mode from preset paging configuration logic as the paging configuration information; determining the paging data of the current page and the new field value based on the ordering field, the paging record number, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
A sending unit, configured to send a request response to the client, where the request response includes: paging data of the current page and the new field value.
25. A data acquisition device, for application to a server, the device comprising:
an obtaining unit, configured to obtain modification data for at least one of a sorting field, a number of paging records, and a paging mode included in preset paging configuration information;
the modification unit is used for modifying the paging configuration information based on the modification data to obtain modified paging configuration information;
the first receiving unit is used for receiving a data acquisition request sent by a client, wherein the data acquisition request carries an original field value corresponding to a paging field, and when the client requests that the paging data of a current page issued by the server is first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
A first determining unit, configured to determine, based on the original field value and the modified paging configuration information, paging data of the current page and a new field value corresponding to the paging field, where the determining unit includes: acquiring an ordering field, a paging record number and a paging mode from preset paging configuration logic as the paging configuration information; determining the paging data of the current page and the new field value based on the ordering field, the paging record number, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
a first sending unit, configured to send a request response to the client, where the request response includes: paging data of the current page and the new field value.
26. A data acquisition device, for application to a client, the device comprising:
The device comprises a sending unit, a server and a client, wherein the sending unit is used for sending a data acquisition request to the server, the data acquisition request carries an original field value corresponding to a paging field, and when the client requests that the paging data of a current page issued by the server is first page data, the original field value is a preset first character used for representing the first page data; when the client requests that the paging data of the current page issued by the server is other page data except the first page data, the original field value is a preset third character used for representing other page data except the first page data and the last page data;
the receiving unit is configured to receive a request response sent by the server, where the request response includes: the method comprises the steps that the server obtains an ordering field, a paging record number and a paging mode from preset paging configuration logic as paging configuration information by the aid of paging data of a current page and a new field value corresponding to the paging field; determining based on the sorting field, the number of paging records, the paging mode and the original field value, wherein when the paging data of the current page issued by the client request server is the last page data, the new field value is a preset second character used for representing the last page data; when the paging data of the current page issued by the client side request server side is not the last page data, the new field value is a preset third character used for representing other page data except the first page data and the last page data;
A rendering unit for rendering the paged data of the current page;
and the determining unit is used for determining whether paging data of the next page need to be acquired or not based on the new field value.
27. A computer-readable storage medium, characterized in that the storage medium comprises a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the steps of the data acquisition method according to any one of claims 1 to 23.
28. An electronic device, the electronic device comprising:
at least one processor;
and at least one memory, bus connected to the processor;
the processor and the memory complete communication with each other through the bus; the processor being operative to invoke program instructions in the memory to perform the steps of the data acquisition method as claimed in any one of claims 1 to 23.
CN201910107469.8A 2019-02-02 2019-02-02 Data acquisition method and device Active CN111523066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910107469.8A CN111523066B (en) 2019-02-02 2019-02-02 Data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910107469.8A CN111523066B (en) 2019-02-02 2019-02-02 Data acquisition method and device

Publications (2)

Publication Number Publication Date
CN111523066A CN111523066A (en) 2020-08-11
CN111523066B true CN111523066B (en) 2023-06-30

Family

ID=71910333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910107469.8A Active CN111523066B (en) 2019-02-02 2019-02-02 Data acquisition method and device

Country Status (1)

Country Link
CN (1) CN111523066B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024026802A1 (en) * 2022-08-04 2024-02-08 Oppo广东移动通信有限公司 Data reporting method and apparatus, chip, storage medium, and computer program

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8952912B1 (en) * 2012-09-14 2015-02-10 Amazon Technologies, Inc. Selection of elements on paginated touch sensitive display
CN104484424A (en) * 2014-12-19 2015-04-01 浪潮通用软件有限公司 Establishing method for resource price information base of construction enterprise based on internet
CN104573035A (en) * 2015-01-16 2015-04-29 杭州犀照科技有限公司 Caching service method and device and news information obtaining method and system
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN107391773A (en) * 2017-09-15 2017-11-24 郑州云海信息技术有限公司 A kind of online text managemant method and apparatus
CN107622091A (en) * 2017-08-23 2018-01-23 阿里巴巴集团控股有限公司 A kind of data base query method and device
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
US8952912B1 (en) * 2012-09-14 2015-02-10 Amazon Technologies, Inc. Selection of elements on paginated touch sensitive display
CN104484424A (en) * 2014-12-19 2015-04-01 浪潮通用软件有限公司 Establishing method for resource price information base of construction enterprise based on internet
CN104573035A (en) * 2015-01-16 2015-04-29 杭州犀照科技有限公司 Caching service method and device and news information obtaining method and system
CN104850627A (en) * 2015-05-21 2015-08-19 北京京东尚科信息技术有限公司 Method and apparatus for performing paging display
CN107622091A (en) * 2017-08-23 2018-01-23 阿里巴巴集团控股有限公司 A kind of data base query method and device
CN107391773A (en) * 2017-09-15 2017-11-24 郑州云海信息技术有限公司 A kind of online text managemant method and apparatus
CN109241494A (en) * 2018-08-07 2019-01-18 平安科技(深圳)有限公司 Page processing method, system, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111523066A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN109347898B (en) Scene information sending method, scene information display method, server and mobile terminal
CN106031127B (en) Method and apparatus for management of applications
CN111046164A (en) Method and equipment for updating book to be read
CN105141672A (en) Method, device and system for data storage
CN111737221B (en) Data read-write method, device and equipment of cluster file system and storage medium
CN111158597A (en) Metadata reading method and device, electronic equipment and storage medium
CN111679790A (en) Remote software development storage space distribution method and device
CN112138376A (en) Cloud game archiving method and device and electronic equipment
CN110781386A (en) Information recommendation method and device, and bloom filter creation method and device
CN110968585A (en) Method, device and equipment for storing orientation column and computer readable storage medium
CN113419846A (en) Resource allocation method and device, electronic equipment and computer readable storage medium
CN111523066B (en) Data acquisition method and device
CN111414507A (en) Information display method, equipment, device and computer readable storage medium
CN111324310A (en) Data reading method and device and computer system
CN110659372A (en) Picture input and access method, device and equipment
US20150205641A1 (en) Data reading method, electronic device and storage medium
CN110765390A (en) Method and equipment for publishing shared information in social space
CN110474991A (en) Data push method, data-pushing device, electronic equipment and storage medium
CN103618961A (en) Method, system and browser for displaying video title
CN111026615B (en) Method and device for acquiring logical volume list, electronic equipment and storage medium
CN115269530A (en) Data synchronization method, electronic device and computer-readable storage medium
CN110971638B (en) Message processing method and device, electronic equipment and readable storage medium
CN112333462A (en) Live broadcast room page jumping method, returning device and electronic equipment
CN100498765C (en) Method and device for making electric newspaper printing plate
CN112685097B (en) Data processing method and device

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
GR01 Patent grant
GR01 Patent grant