CN111240650A - Data paging method and device and mobile terminal - Google Patents

Data paging method and device and mobile terminal Download PDF

Info

Publication number
CN111240650A
CN111240650A CN202010074070.7A CN202010074070A CN111240650A CN 111240650 A CN111240650 A CN 111240650A CN 202010074070 A CN202010074070 A CN 202010074070A CN 111240650 A CN111240650 A CN 111240650A
Authority
CN
China
Prior art keywords
parameter
page request
data
page number
page
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.)
Granted
Application number
CN202010074070.7A
Other languages
Chinese (zh)
Other versions
CN111240650B (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.)
Shanghai Junzheng Network Technology Co Ltd
Original Assignee
Shanghai Junzheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Junzheng Network Technology Co Ltd filed Critical Shanghai Junzheng Network Technology Co Ltd
Priority to CN202010074070.7A priority Critical patent/CN111240650B/en
Publication of CN111240650A publication Critical patent/CN111240650A/en
Application granted granted Critical
Publication of CN111240650B publication Critical patent/CN111240650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • 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
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method, a device and a mobile terminal for data paging, aiming at finding a more effective implementation scheme for data paging, wherein the method comprises the following steps: s101: setting a starting page number; sending a home page request and receiving home page request data to generate a home page request identifier; s102: obtaining a first parameter and a second parameter; s103: when the first parameter and the first page request identifier are both true values, increasing a step length for the page number according to a preset step length, and sending a next page request; s104: receiving next page request data, and acquiring a new first parameter and a new second parameter; s105: repeatedly executing the steps S103-S104; s106: and when the second parameter is a false value and the page number is greater than the initial page number, reducing the page number by one step according to the preset step length, and repeatedly executing the steps S103-S105. The invention realizes the logic processing related to paging through the setting of the first page request identifier, the first parameter, the second parameter, the initial page number and the like.

Description

Data paging method and device and mobile terminal
Technical Field
The invention relates to the field of mobile communication, in particular to a data paging method, a data paging device and a mobile terminal.
Background
In the android development project, the pull-down refresh and the pull-up loading are the most popular gesture actions in current. Meanwhile, because the length of the data list on the server is very long, the pull-up loading cannot be completed at one time, and in addition, if the data amount obtained at one time is too large to influence the processing speed, and the user cannot browse the data at one time, the paging loading is also needed. However, most of the current pull-down flush or pull-up load libraries do not support paging-related logic, and each use requires many paging-related logic after the interface comes back, and these operations are usually similar. Therefore, the development efficiency is reduced, errors occur due to the fact that paging logic is not uniform, and user experience is reduced to a certain extent.
Disclosure of Invention
In order to find a more effective implementation scheme of data paging, the invention provides a method and a device for data paging and a mobile terminal.
The first scheme is as follows:
a method for data paging is provided, which comprises the following steps:
s101: setting the page number of a first page as a starting page number according to a preset page number format; sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request identifier indicates that the home page request is successfully ended;
s102: analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data exist in a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value;
s103: when the first parameter and the home page request identifier are both true values, increasing a step length for the page number according to a preset step length, and sending a next page request;
s104: receiving next page request data corresponding to the next page request, and analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
s105: repeatedly executing the steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is greater than the starting page number, reducing the page number by one step length according to a preset step length, and repeatedly executing the steps S103-S105.
Preferably, the sending a top page request and receiving top page request data corresponding to the top page request includes the following steps:
generating and sending a home page request based on the monitored pull-down refresh command;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, the sending a top page request and receiving top page request data corresponding to the top page request includes the following steps:
generating and sending a home page request based on a monitored instruction for clicking a preset control;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, when both the first parameter and the home page request identifier are true values, increasing the page number by one step according to a preset step length includes the following steps:
judging whether the first parameter is a true value;
if yes, judging whether the home page request identifier is a true value;
and if so, increasing the page number by one step length according to the preset step length.
Preferably, when the second parameter is a false value and the page number is greater than the starting page number, decreasing the page number by one step length according to a preset step length includes the following steps:
judging whether the second parameter is a false value;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step length according to the preset step length.
Preferably, after S102, the method includes the following steps:
judging whether the first parameter is a true value;
if yes, the page is recorded with data.
Preferably, the generating a home page request identifier representing whether the home page request is successful includes the following steps:
judging whether the second parameter is a true value;
if yes, judging whether the page number is a starting page number;
and if so, setting the home page request identifier to be a true value.
Scheme II:
an apparatus for data paging is provided, the apparatus for data paging comprising:
the home page module is used for setting the page number of the home page as a starting page number according to a preset page number format; sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request identifier indicates that the home page request is successfully ended;
the analysis module is used for analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data exist in a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value;
an increasing module, configured to increase a step size of a page number according to a preset step size length and send a next page request when the first parameter and the home page request identifier are both true values;
the receiving and analyzing module is used for receiving next page request data corresponding to the next page request, analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
the repeating module is used for repeatedly executing the adding module and the receiving and analyzing module so as to display the data in pages;
and the reducing module is used for reducing the page number by one step length according to the preset step length and repeatedly executing the increasing module, the receiving and analyzing module and the repeating module when the second parameter is a false value and the page number is greater than the initial page number.
Preferably, the home page module includes:
the first monitoring unit is used for generating and sending a home page request based on a monitored pull-down refreshing instruction;
and the first receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
Preferably, the home page module includes:
the second monitoring unit is used for generating and sending a home page request based on a monitored instruction for clicking the preset control;
and the second receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
Preferably, the adding module comprises:
a first determining unit, configured to determine whether the first parameter is a true value;
a second determining unit, configured to determine whether the home page request identifier is a true value when the first parameter is a true value;
and the increasing unit is used for increasing the page number by one step according to the preset step length when the home page request identifier is a true value.
Preferably, the reducing module comprises:
a third judging unit, configured to judge whether the second parameter is a false value;
a fourth judging unit, configured to judge whether a page number is greater than the starting page number when the second parameter is a false value;
and the reducing unit is used for reducing the page number by one step length according to the preset step length when the page number is greater than the initial page number.
Preferably, the apparatus for paging data includes a recording module, and the recording module includes:
a fifth determining unit, configured to determine whether the first parameter is a true value;
and the recording unit is used for recording the data of the next page when the first parameter is a true value.
Preferably, the home page module includes:
a sixth determining unit, configured to determine whether the second parameter is a true value;
a page number judging unit, configured to judge whether a page number is a start page number when the second parameter is a true value;
and the value setting unit is used for setting the first page request identifier to a true value when the page number is the initial page number.
The third scheme is as follows:
there is provided a mobile terminal including:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of data paging as recited in any of scenario one.
Compared with the prior art, the data paging method, the data paging device and the mobile terminal have the following beneficial effects:
according to the data paging method, the device and the system, the related logic processing of paging is realized through the settings of the head page request identifier for representing whether the head page request is successful, the first parameter for representing whether the next page has data, the second parameter for representing whether the network interface is successful, the initial page number and the like, the development efficiency is improved, errors caused by non-uniform paging logic are avoided, and the user experience is improved to a certain extent.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating a method for paging data according to an embodiment of the present invention;
FIG. 2 is a block diagram of a data paging apparatus according to another embodiment of the present invention;
fig. 3 is a schematic block diagram of a mobile terminal according to another embodiment of the present invention;
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel with the order in which they occur, the order of the operations being 202, 204, etc. merely to distinguish between various operations, the order of which does not itself represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In one embodiment, the present invention provides a method for data paging, which is applied in the field of device-server interaction and device display, wherein the device is preferably a network-enabled electronic device, such as a mobile phone, a computer, a tablet computer, a smart watch, a personal digital assistant, and the like.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for data paging according to an embodiment of the present invention, and as shown in fig. 1, the method for data paging according to an embodiment of the present invention includes steps S101 to S106, which are as follows:
step S101: setting the page number of a first page as a starting page number according to a preset page number format; the method comprises the steps of sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request is successfully ended.
In some embodiments, sending a home page request and receiving home page request data corresponding to the home page request comprises:
generating and sending a home page request based on the monitored pull-down refresh command;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, the default page number format is to use arabic numerals to program page numbers, i.e., 1, 2, 3, etc., in which case the starting page number is 1. It should be noted that the user may also use roman numeral formatting such as I, II, iii, IV, V, vi, VII, etc. in the specific implementation process, and the embodiment of the present invention is not limited thereto.
In some embodiments, the android system may default to push home page information when the application is opened, and the home page request in this manner is generated based on a monitored instruction for clicking a preset control, which is specifically as follows:
generating and sending a home page request based on a monitored instruction for clicking a preset control;
and receiving and displaying the home page request data corresponding to the home page request.
A boolean type, also known as a logical data type, is a type of data that has only two original types of values: non-zero (typically 1 or-1) and zero, which are equivalent to true and false values, respectively. In the Java language, the keyword declaring Boolean type is coolean, which has only two values: true and false. It should be noted that in C language, boolean type is a numeric type, and it has two values: 1 and 0. The Boolean type value in Java cannot be replaced by 1 and 0, does not belong to a numerical type, and cannot be subjected to mathematical calculation or type conversion with numerical types such as integer types.
The method comprises the following steps: the home page request identifier is refreshed, and the specific declaration mode is as follows:
/**
whether the first page request was successful
*/
private boolean refreshed;
When the home page request identifier refresh is true, the token home page request is successfully ended, and when false, the token home page request fails.
In some embodiments, a device communicates with a server using a three-way handshake protocol in sending a data request and receiving request response information corresponding to the data request.
The three-way handshake protocol refers to that three interactions are required between the server side and the device side in the preparation phase of sending data: first handshake: the device side SENDs a SYN packet (SYN j) to the server side, enters a SYN _ SEND state and waits for the confirmation of the server side; second handshake: the server receives the SYN packet, must confirm the SYN (ACK ═ j +1) of the device end, meanwhile it also sends a SYN packet (SYN ═ k), namely SYN + ACK packet, at this moment the server enters into SYN _ RECV state; third handshake: the equipment end receives the SYN + ACK packet of the server end, sends an acknowledgement packet ACK (ACK ═ k +1) to the server end, and after the sending of the acknowledgement packet ACK is finished, the equipment end and the server end enter an ESTABLISHED state to finish three-way handshake. After the connection is established, the device side and the server side can start data transmission.
Step S102: analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data is available on a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value.
In some embodiments, the first parameter is hasMore, and when the value is true, that is, true, the next page has data, and when the value is false, that is, false, the next page has no data, the following is specifically stated:
/**
whether there is data next page (known from server interface response)
*/
private boolean hasMore=true;
The second parameter is isSuccess, and when the value is true value, that is, true value, indicates that the network interface is successful, and when the value is false value, that is, false value, indicates that the network interface is failed, the declaration means may refer to the first parameter hasMore, which is not described herein again.
S103: when the first parameter and the home page request identifier are both true values, increasing a step length for the page number according to a preset step length, and sending a next page request;
s104: receiving next page request data corresponding to the next page request, and analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
s105: repeatedly executing the steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is greater than the starting page number, reducing the page number by one step length according to a preset step length, and repeatedly executing the steps S103-S105.
In some embodiments, increasing the page number by one step according to the preset step length when the first parameter and the home page request identifier are both true comprises the steps of:
judging whether the first parameter is a true value;
if yes, judging whether the home page request identifier is a true value;
if yes, the page number is increased by one step length according to the preset step length.
In some embodiments, the preset step length is 1, i.e., 1 is added each time.
Illustratively, when both the first parameter hasMore and the first page request identifier refreshed are true, the page number is increased by 1, i.e., 2, from the starting page number of 1.
In Java, for ease of user invocation, this step is preferably encapsulated within the interface Ipage,
the specific mode is as follows:
public interface IPage{IPage nextPage();}
the meaning of the Interface (Interface) is different from the Interface represented by I of a Graphical User Interface (GUI), and the Interface is an abstract class and is a class that cannot be initialized.
In some embodiments, the implementation manner of the interface Ipage is preferably a default implementation class of a paging interface, and the specific implementation manner is as follows:
Figure BDA0002378005950000091
it should be noted that the nextPage () is correspondingly increased by one step, and the hasMore () is whether there is any data in the next page. Those skilled in the art may implement the steps in other languages, and the embodiment of the present invention is not limited thereto.
In some embodiments, when the second parameter is a false value and the page number is greater than the starting page number, decreasing the page number by one step according to the preset step length comprises the following steps:
judging whether the second parameter is a false value;
if yes, judging whether the page number is larger than the initial page number;
if yes, the page number is reduced by one step length according to the preset step length.
In some embodiments, the preset step length is 1, i.e., 1 reduction at a time.
For example, when the second parameter isSuccess is false and the page number is 2, the page number is decreased by 1, that is, 1 is obtained. The purpose of this is to return the page number when the data request fails, so as to avoid data confusion.
In Java, for ease of user invocation, this step is preferably also encapsulated within the interface Ipage,
public interface IPage{IPage finishLoad(boolean isSuccess);}。
in practice, the specific implementation manner may also be a default implementation type of the paging interface, and for this, the source code may be referred to for design, which is not limited in the present invention.
In order to facilitate device recording, after S102, the embodiment of the present invention includes the following steps:
judging whether the first parameter is a true value;
if yes, the page is recorded with data.
It should be noted that, in the generation of the home page request identifier, the second parameter is also used, that is, the generation of the home page request identifier representing whether the home page request is successful includes the following steps:
judging whether the second parameter is a true value;
if yes, judging whether the page number is a starting page number;
if so, the home page request identifier is set to a true value.
Exemplarily, when the second parameter isSuccess is true and the page number is 1, the home page request identifier refresh is set to true.
In some embodiments, the method finishLoad () in the interface Ipage is implemented as follows, and it is required that, for program simplicity, the implementation merges the reduced one stride with the top page request identifier, and omits the related variable declaration, etc., and the method finishLoad () is specifically as follows:
Figure BDA0002378005950000101
Figure BDA0002378005950000111
it should be noted that, other languages may be adopted by those skilled in the art to implement the step, and the embodiment of the present invention is not limited thereto.
Compared with the prior art, the data paging method provided by the embodiment of the invention has the following beneficial effects:
according to the data paging method, the device and the system, the related logic processing of paging is realized through the settings of the head page request identifier for representing whether the head page request is successful, the first parameter for representing whether the next page has data, the second parameter for representing whether the network interface is successful, the initial page number and the like, the development efficiency is improved, errors caused by non-uniform paging logic are avoided, and the user experience is improved to a certain extent.
Referring to fig. 2, based on the same inventive concept as the method for data paging according to the embodiment of the present invention, another embodiment of the present invention provides a device for data paging, which includes:
a home page module 2001, configured to set a page number of a home page as a start page number according to a preset page number format; sending a first page request, receiving first page request data corresponding to the first page request, and generating a first page request identifier for representing whether the first page request is successful, wherein the data type of the first page request identifier is a Boolean type, and when the data type is a true value, the first page request is successfully ended;
the parsing module 2002 is configured to parse the first page request data to obtain a first parameter indicating whether data remains in a next page and a second parameter indicating whether a network interface is successful; the data types of the first parameter and the second parameter are both Boolean types, the first parameter indicates that data exist in the next page when the first parameter is a true value, and the second parameter indicates that the network interface is successful when the second parameter is a true value;
an increasing module 2003, configured to increase the page number by one step according to a preset step length and send a next page request when the first parameter and the home page request identifier are both true values;
a receiving and analyzing module 2004, configured to receive next page request data corresponding to the next page request, and analyze the next page request data to obtain a new first parameter indicating whether the next page of the next page has data and a new second parameter indicating whether the network interface is successful;
a repeating module 2005 for repeatedly executing the adding module 2003 and the receiving parsing module 2004 to page the data;
a decreasing module 2006, configured to decrease the page number by one step according to the preset step length and repeatedly execute the increasing module 2003, the receiving parsing module 2004, and the repeating module 2005 when the second parameter is a false value and the page number is greater than the starting page number.
Preferably, the home module 2001 includes:
the first monitoring unit is used for generating and sending a home page request based on a monitored pull-down refreshing instruction;
and the first receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, home module 2001 includes:
the second monitoring unit is used for generating and sending a home page request based on a monitored instruction for clicking the preset control;
and the second receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, the adding module 2003 includes:
a first determining unit, configured to determine whether the first parameter is a true value;
a second determining unit, configured to determine whether the home page request identifier is a true value when the first parameter is a true value;
and the increasing unit is used for increasing the page number by one step according to the preset step length when the first page request identifier is a true value.
In some embodiments, the reduction module 2006 includes:
a third judging unit, configured to judge whether the second parameter is a false value;
the fourth judging unit is used for judging whether the page number is larger than the initial page number when the second parameter is a false value;
and the reducing unit is used for reducing the page number by one step length according to the preset step length when the page number is greater than the initial page number.
In some embodiments, an apparatus for data paging includes a recording module that includes:
a fifth judging unit, configured to judge whether the first parameter is a true value;
and the recording unit is used for recording the data of the next page when the first parameter is a true value.
In some embodiments, home module 2001 includes:
a sixth determining unit, configured to determine whether the second parameter is a true value;
the page number judging unit is used for judging whether the page number is a starting page number or not when the second parameter is a true value;
and the value setting unit is used for setting the first page request identifier to a true value when the page number is the initial page number.
Compared with the prior art, the data paging device according to another embodiment of the present invention has the following advantages:
according to the data paging device in another embodiment of the present invention, through the settings of the home page module 2001, the parsing module 2002, the adding module 2003, the receiving parsing module 2004, the repeating module 2005, and the reducing module 2006, the logic processing related to paging is realized, so that not only is the development efficiency improved, but also errors caused by non-uniform paging logic are avoided, and the user experience is improved to a certain extent.
Referring to fig. 3, another embodiment of the present invention provides a mobile terminal based on the same inventive concept as the method for paging data according to the embodiment of the present invention. Fig. 3 is a block diagram illustrating a partial structure of a cellular phone related to a mobile terminal according to still another embodiment of the present invention. The mobile phone comprises: radio Frequency (RF) circuitry 1510, memory 1520, input unit 1530, display unit 1540, sensor 1550, audio circuitry 1560, wireless fidelity (WiFi) module 1570, processor 1580, and power supply 1590. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 3:
the RF circuit 1510 may be configured to receive and transmit signals during information transmission and reception or during a call, and in particular, receive downlink information of a base station and then process the received downlink information to the processor 1580; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuitry 1510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 1510 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
The memory 1520 may be used to store software programs and modules, and the processor 1580 performs various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 1520. The memory 1520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 1520 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 1530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on or near the touch panel 1531 using any suitable object or accessory such as a finger or a stylus) and drive corresponding connection devices according to a preset program. Alternatively, the touch panel 1531 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1580, and can receive and execute commands sent by the processor 1580. In addition, the touch panel 1531 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 1530 may include other input devices 1532 in addition to the touch panel 1531. In particular, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The Display unit 1540 may include a Display panel 1541, and optionally, the Display panel 1541 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1531 may cover the display panel 1541, and when the touch panel 1531 detects a touch operation on or near the touch panel 1531, the touch operation is transmitted to the processor 1580 to determine the type of the touch event, and then the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of the touch event. Although in fig. 3, the touch panel 1531 and the display panel 1541 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1531 and the display panel 1541 may be integrated to implement the input and output functions of the mobile phone.
The handset can also include at least one sensor 1550, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 1541 according to the brightness of ambient light and a proximity sensor that turns off the display panel 1541 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 1560, speaker 1561, and microphone 1562 may provide an audio interface between a user and a cell phone. The audio circuit 1560 may transmit the electrical signal converted from the received audio data to the speaker 1561, and convert the electrical signal into an audio signal by the speaker 1561 and output the audio signal; on the other hand, the microphone 1562 converts collected sound signals into electrical signals, which are received by the audio circuit 1560 and converted into audio data, which are processed by the audio data output processor 1580 and then passed through the RF circuit 1510 for transmission to, for example, another cellular phone, or for output to the memory 1520 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through a WiFi module 1570, and provides wireless broadband internet access for the user. Although fig. 3 shows WiFi module 1570, it is understood that it does not belong to the essential components of the handset and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1580 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1520 and calling data stored in the memory 1520, thereby integrally monitoring the mobile phone. Optionally, the processor 1580 may include one or more processing units; preferably, the processor 1580 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, and the like, and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor may not be integrated into the processor 1580.
The handset also includes a power supply 1590 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1580 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In another embodiment of the present invention, the processor 1580 included in the terminal further has the following functions:
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to:
s101: setting the page number of a first page as a starting page number according to a preset page number format; sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request identifier indicates that the home page request is successfully ended;
s102: analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data exist in a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value;
s103: when the first parameter and the home page request identifier are both true values, increasing a step length for the page number according to a preset step length, and sending a next page request;
s104: receiving next page request data corresponding to the next page request, and analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
s105: repeatedly executing the steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is greater than the starting page number, reducing the page number by one step length according to a preset step length, and repeatedly executing the steps S103-S105.
In some embodiments, the sending a top page request and receiving top page request data corresponding to the top page request includes:
generating and sending a home page request based on the monitored pull-down refresh command;
and receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, the sending a top page request and receiving top page request data corresponding to the top page request includes:
generating and sending a home page request based on a monitored instruction for clicking a preset control;
and receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, said increasing the page number by one step according to the preset step length when both the first parameter and the home page request identifier are true comprises:
judging whether the first parameter is a true value;
if yes, judging whether the home page request identifier is a true value;
and if so, increasing the page number by one step length according to the preset step length.
Preferably, when the second parameter is a false value and the page number is greater than the starting page number, decreasing the page number by one step length according to a preset step length includes the following steps:
judging whether the second parameter is a false value;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step length according to the preset step length.
In some embodiments, after S102, the method includes the following steps:
judging whether the first parameter is a true value;
if yes, the page is recorded with data.
In some embodiments, the generating a top page request identifier that characterizes whether the top page request was successful comprises the steps of:
judging whether the second parameter is a true value;
if yes, judging whether the page number is a starting page number;
and if so, setting the home page request identifier to be a true value.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Compared with the prior art, the mobile terminal of the other embodiment of the invention has the following beneficial effects:
in another embodiment of the present invention, a mobile terminal implements logic processing related to paging by setting a home page request identifier indicating whether a home page request is successful, a first parameter indicating whether a next page still has data, a second parameter indicating whether a network interface is successful, and a start page number, so that not only is development efficiency improved, but also errors caused by non-uniform paging logic are avoided, and user experience is improved to a certain extent.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, or the like.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. A method for data paging, the method comprising:
s101: setting the page number of a first page as a starting page number according to a preset page number format; sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request identifier indicates that the home page request is successfully ended;
s102: analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data exist in a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value;
s103: when the first parameter and the home page request identifier are both true values, increasing a step length for the page number according to a preset step length, and sending a next page request;
s104: receiving next page request data corresponding to the next page request, and analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
s105: repeatedly executing the steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is greater than the starting page number, reducing the page number by one step length according to a preset step length, and repeatedly executing the steps S103-S105.
2. The method for data paging as claimed in claim 1, wherein the sending a top page request and receiving top page request data corresponding to the top page request comprises the steps of:
generating and sending a home page request based on the monitored pull-down refresh command;
and receiving and displaying the home page request data corresponding to the home page request.
3. The method for paging data as claimed in claim 2, wherein the step of sending a top page request and receiving top page request data corresponding to the top page request comprises the steps of:
generating and sending a home page request based on a monitored instruction for clicking a preset control;
and receiving and displaying the home page request data corresponding to the home page request.
4. The method for data paging as claimed in claim 1, wherein the step of increasing the page number by one step according to a preset step length when the first parameter and the first page request identifier are both true comprises the steps of:
judging whether the first parameter is a true value;
if yes, judging whether the home page request identifier is a true value;
and if so, increasing the page number by one step length according to the preset step length.
5. The method for data paging as claimed in claim 1, wherein the step of decreasing the page number by one step according to a preset step length when the second parameter is a false value and the page number is greater than the starting page number comprises the steps of:
judging whether the second parameter is a false value;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step length according to the preset step length.
6. The method for paging data as claimed in claim 1, wherein after the S102, the method comprises the following steps:
judging whether the first parameter is a true value;
if yes, the page is recorded with data.
7. The method for data paging as claimed in claim 1, wherein the generating a top page request identifier characterizing whether the top page request is successful comprises the steps of:
judging whether the second parameter is a true value;
if yes, judging whether the page number is a starting page number;
and if so, setting the home page request identifier to be a true value.
8. An apparatus for data paging, the apparatus for data paging comprising:
the home page module is used for setting the page number of the home page as a starting page number according to a preset page number format; sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier for representing whether the home page request is successful, wherein the data type of the home page request identifier is a Boolean type, and when the data type is a true value, the home page request identifier indicates that the home page request is successfully ended;
the analysis module is used for analyzing the first page request data to obtain a first parameter for representing whether the next page has data and a second parameter for representing whether the network interface is successful; the data types of the first parameter and the second parameter are both boolean types, the first parameter indicates whether data exist in a next page when the first parameter is a true value, and the second parameter indicates that a network interface is successful when the second parameter is a true value;
an increasing module, configured to increase a step size of a page number according to a preset step size length and send a next page request when the first parameter and the home page request identifier are both true values;
the receiving and analyzing module is used for receiving next page request data corresponding to the next page request, analyzing the next page request data to obtain a new first parameter for representing whether the next page of the next page has data and a new second parameter for representing whether a network interface is successful;
the repeating module is used for repeatedly executing the adding module and the receiving and analyzing module so as to enable the data paging to be invisible;
and the reducing module is used for reducing the page number by one step length according to the preset step length and repeatedly executing the increasing module, the receiving and analyzing module and the repeating module when the second parameter is a false value and the page number is greater than the initial page number.
9. The apparatus for data paging as claimed in claim 8, wherein the home page module comprises:
the first monitoring unit is used for generating and sending a home page request based on a monitored pull-down refreshing instruction;
and the first receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
10. The apparatus for data paging as claimed in claim 9, wherein the home page module comprises:
the second monitoring unit is used for generating and sending a home page request based on a monitored instruction for clicking the preset control;
and the second receiving and displaying unit is used for receiving and displaying the home page request data corresponding to the home page request.
11. The apparatus for data paging as claimed in claim 8, wherein the increasing module comprises:
a first determining unit, configured to determine whether the first parameter is a true value;
a second determining unit, configured to determine whether the home page request identifier is a true value when the first parameter is a true value;
and the increasing unit is used for increasing the page number by one step according to the preset step length when the home page request identifier is a true value.
12. The apparatus for data paging as claimed in claim 8, wherein the reducing module comprises:
a third judging unit, configured to judge whether the second parameter is a false value;
a fourth judging unit, configured to judge whether a page number is greater than the starting page number when the second parameter is a false value;
and the reducing unit is used for reducing the page number by one step length according to the preset step length when the page number is greater than the initial page number.
13. The apparatus for data paging as claimed in claim 8, wherein the apparatus for data paging comprises a logging module comprising:
a fifth determining unit, configured to determine whether the first parameter is a true value;
and the recording unit is used for recording the data of the next page when the first parameter is a true value.
14. The apparatus for data paging as claimed in claim 8, wherein the home page module comprises:
a sixth determining unit, configured to determine whether the second parameter is a true value;
a page number judging unit, configured to judge whether a page number is a start page number when the second parameter is a true value;
and the value setting unit is used for setting the first page request identifier to a true value when the page number is the initial page number.
15. A mobile terminal, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method for paging data as recited in any of claims 1-7.
CN202010074070.7A 2020-01-22 2020-01-22 Data paging method and device and mobile terminal Active CN111240650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074070.7A CN111240650B (en) 2020-01-22 2020-01-22 Data paging method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074070.7A CN111240650B (en) 2020-01-22 2020-01-22 Data paging method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN111240650A true CN111240650A (en) 2020-06-05
CN111240650B CN111240650B (en) 2023-06-30

Family

ID=70866129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074070.7A Active CN111240650B (en) 2020-01-22 2020-01-22 Data paging method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN111240650B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299854A (en) * 2008-06-19 2008-11-05 中兴通讯股份有限公司 Mobile terminal and data maintenance method thereof
CN102404244A (en) * 2010-09-17 2012-04-04 腾讯科技(深圳)有限公司 Device, system and method for realizing private message function on twitter
CN106445927A (en) * 2015-08-04 2017-02-22 北京京东金融科技控股有限公司 Data paging querying method and device
CN106844689A (en) * 2017-01-23 2017-06-13 北京皮尔布莱尼软件有限公司 A kind of paged data synchronous method, apparatus and system
CN107317855A (en) * 2017-06-21 2017-11-03 努比亚技术有限公司 A kind of data cache method, data request method and server
CN110442406A (en) * 2018-05-02 2019-11-12 天津京东深拓机器人科技有限公司 The method and paging control, electronic equipment of paging control processing data
CN110597859A (en) * 2019-09-06 2019-12-20 天津车之家数据信息技术有限公司 Method and device for querying data in pages

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299854A (en) * 2008-06-19 2008-11-05 中兴通讯股份有限公司 Mobile terminal and data maintenance method thereof
CN102404244A (en) * 2010-09-17 2012-04-04 腾讯科技(深圳)有限公司 Device, system and method for realizing private message function on twitter
CN106445927A (en) * 2015-08-04 2017-02-22 北京京东金融科技控股有限公司 Data paging querying method and device
CN106844689A (en) * 2017-01-23 2017-06-13 北京皮尔布莱尼软件有限公司 A kind of paged data synchronous method, apparatus and system
CN107317855A (en) * 2017-06-21 2017-11-03 努比亚技术有限公司 A kind of data cache method, data request method and server
CN110442406A (en) * 2018-05-02 2019-11-12 天津京东深拓机器人科技有限公司 The method and paging control, electronic equipment of paging control processing data
CN110597859A (en) * 2019-09-06 2019-12-20 天津车之家数据信息技术有限公司 Method and device for querying data in pages

Also Published As

Publication number Publication date
CN111240650B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
WO2015090248A1 (en) Server overload protection method and device
CN104852885B (en) Method, device and system for verifying verification code
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
CN104238893B (en) A kind of method and apparatus that video preview picture is shown
JP6910300B2 (en) A method for displaying chat history records and a device for displaying chat history records
WO2014166266A1 (en) File scanning method and system, client and server
CN111273955B (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN112749074B (en) Test case recommending method and device
CN113050863A (en) Page switching method and device, storage medium and electronic equipment
CN109660445B (en) Message processing method, device and storage medium
JP2016540270A (en) Method and apparatus for playing media data on a terminal
CN109739409B (en) Batch processing method and device and terminal equipment
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN104378339B (en) A kind of communication means and device using agency agreement
CN106230919B (en) File uploading method and device
CN111143580B (en) Multimedia data storage method and device, storage medium and electronic equipment
CN109799994B (en) Terminal component generation method and device
CN111240650A (en) Data paging method and device and mobile terminal
CN107315623B (en) Method and device for reporting statistical data
WO2015078409A1 (en) Method, device, terminal and system for collecting information
CN106657278B (en) Data transmission method and device and computer equipment
CN105988801B (en) Method and device for displaying annotation information
CN106358070B (en) Multimedia file uploading method and device
CN112199049B (en) Fingerprint storage method, fingerprint storage device and terminal
CN111405649B (en) Information transmission method and device and mobile terminal

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