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

Data paging method and device and mobile terminal Download PDF

Info

Publication number
CN111240650B
CN111240650B CN202010074070.7A CN202010074070A CN111240650B CN 111240650 B CN111240650 B CN 111240650B CN 202010074070 A CN202010074070 A CN 202010074070A CN 111240650 B CN111240650 B CN 111240650B
Authority
CN
China
Prior art keywords
page request
parameter
data
page number
home
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
CN202010074070.7A
Other languages
Chinese (zh)
Other versions
CN111240650A (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 data paging method, a device and a mobile terminal, which aim to find a more effective data paging implementation scheme, and the method comprises the following steps: s101: setting a start page number; transmitting a home page request, receiving home page request data and generating 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 true values, increasing the page number by one step length according to the preset step length, and sending a next page request; s104: receiving next page request data, and obtaining new first parameters and new second parameters; s105: repeating steps S103-S104; s106: when the second parameter is a false value and the page number is greater than the start page number, the page number is reduced by one step according to the preset step length, and steps S103 to S105 are repeatedly performed. 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 present invention relates to the field of mobile communications, and in particular, to a method and apparatus for paging data, and a mobile terminal.
Background
In android development projects, pull-down refreshing and pull-up loading are the most popular gesture actions in use. Meanwhile, since the length of the data list on the server is long, the pull-up loading cannot be completed by one time, and furthermore, if the data amount acquired at one time is too large to affect the processing speed, and the user cannot need to browse so much data at one time, the paging loading is also needed. However, most pull-down refreshing or pull-up loading libraries do not currently support page-related logic, and many page-related logic processes are required after the interface comes back for each use, and these operations are typically very similar. Therefore, development efficiency is reduced, errors can occur due to non-uniform paging logic, 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 data paging method, a device and a mobile terminal.
Scheme one:
a method for paging data is provided, the method for paging data includes the following steps:
s101: setting the page number of the 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier represents that the home page request is successfully ended when the data type of the home page request identifier is a true value;
S102: analyzing the first page request data to obtain a first parameter representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value, which indicates that the next page has data, and the second parameter is true value, which indicates that the network interface is successful;
s103: when the first parameter and the first page request identifier are true values, increasing the page number by one step length 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 indicating whether the next page of the next page has data and a new second parameter indicating whether a network interface is successful;
s105: repeating steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is larger 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.
Preferably, the step of sending a home page request and receiving the home page request data corresponding to the home page request includes the following steps:
Generating and sending a home page request based on the monitored pull-down refreshing instruction;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, the step of sending a home page request and receiving the home page request data corresponding to the home page request includes the following steps:
generating and sending a home page request based on the monitored command of clicking the preset control;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, when the first parameter and the first page request identifier are both true, 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 or not;
if yes, judging whether the home page request identifier is a true value or not;
if yes, the page number is increased by one step according to the preset step length.
Preferably, when the second parameter is a false value and the page number is greater than the start page number, the step of reducing the page number by one step according to the preset step length includes the following steps:
judging whether the second parameter is a false value or not;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step according to the preset step length.
Preferably, after S102, the method includes the following steps:
judging whether the first parameter is a true value or not;
if yes, recording the next page and the data.
Preferably, the generating the home page request identifier for indicating whether the home page request is successful includes the steps of:
judging whether the second parameter is a true value or not;
if yes, judging whether the page number is the initial page number;
if yes, the home page request identifier is set to be a true value.
Scheme II:
an apparatus for paging data is provided, the apparatus for paging data 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; 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier represents that the home page request is successfully ended when the data type of the home page request identifier is a true value;
the analyzing module is used for analyzing the first page request data to obtain a first parameter representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value, which indicates that the next page has data, and the second parameter is true value, which indicates that the network interface is successful;
The adding module is used for adding the page number by one step length according to the preset step length and sending a next page request when the first parameter and the first page request identifier are 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 representing whether the next page of the next page has data or not and a new second parameter representing whether the network interface is successful or not;
the repeating module is used for repeatedly executing the adding module and the receiving and analyzing module so as to display the data in a paging mode;
and the reducing module is used for reducing the page number by one step length according to the preset step length when the second parameter is a false value and the page number is larger than the initial page number, and repeatedly executing the adding module, the receiving analysis module and the repeating module.
Preferably, the home page module includes:
the first monitoring unit is used for generating and sending a home page request based on the 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 of clicking a 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 includes:
the first judging unit is used for judging whether the first parameter is a true value or not;
the second judging unit is used for judging whether the first page request identifier is a true value or not when the first parameter is the true value;
and the adding unit is used for adding the page number by one step length according to the preset step length when the head page request identifier is a true value.
Preferably, the reduction module includes:
a third judging unit, configured to judge whether the second parameter is a false value;
a fourth judging unit, configured to judge whether the page number is greater than the start page number when the second parameter is a false value;
and the reducing unit is used for reducing the page number by one step according to the preset step length when the page number is larger than the initial page number.
Preferably, the device for paging data includes a recording module, and the recording module 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 next page and the data when the first parameter is true.
Preferably, the home page module includes:
a sixth judging unit for judging whether the second parameter is true;
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 top page request identifier as a true value when the page number is the initial page number.
Scheme III:
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 applications configured to perform the method of data paging as set forth in any one of scheme one.
Compared with the prior art, the data paging method, the device and the mobile terminal have the following beneficial effects:
according to the data paging method, through setting of the first page request identifier for representing whether the first 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 paging related logic processing is realized, 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 invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart illustrating a method for paging data according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram illustrating an apparatus for paging data according to another embodiment of the present invention;
fig. 3 is a schematic block diagram of a mobile terminal according to still another embodiment of the present invention;
Detailed Description
In order to enable those skilled in the art to better understand the present invention, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present invention with reference to the accompanying drawings.
In some of the flows described in the specification and claims of the present invention and in the foregoing figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, the order of operations being 202, 204, etc., merely for distinguishing between the various operations, the order of the operations itself not representing any order of execution. In addition, 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" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
In one embodiment, the present invention provides a method of paging data that is applicable to the field of device-to-server interaction and device display, wherein the device is preferably a networking-capable electronic device such as a cell phone, a computer, a tablet computer, a smart watch, a personal digital assistant, etc.
Referring to fig. 1, fig. 1 is a flow chart illustrating a method for paging data according to an embodiment of the present invention, and as shown in fig. 1, the method for paging data according to an embodiment of the present invention includes steps S101 to S106, which are specifically as follows:
step S101: setting the page number of the first page as a starting page number according to a preset page number format; and sending a home page request, receiving home page request data corresponding to the home page request, and generating a home page request identifier representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier is a true value, so that 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 includes the steps of:
generating and sending a home page request based on the monitored pull-down refreshing instruction;
and receiving and displaying the home page request data corresponding to the home page request.
Preferably, the preset page number format is to arrange page numbers using arabic numerals, i.e. 1, 2, 3, etc., in which case the start page number is 1. It should be noted that the user may also use roman numerals such as I, II, iii, IV, V, vi, VII, etc. in implementations, and embodiments of the present invention are not limited in this respect.
In some embodiments, the android system can default to pushing the home page information when the application is opened, and the home page request in this way is generated for a command based on monitoring to click a preset control, which is specifically as follows:
generating and sending a home page request based on the monitored command of clicking the preset control;
and receiving and displaying the home page request data corresponding to the home page request.
Boolean type, also known as logical data type, is a type of data that has only two primary types of values: non-zero (typically 1 or-1) and zero, both equivalent to true and false values, respectively. In the Java language, the key that declares the Boolean type is Boolean, as long as both values: true and false. It should be noted that in the C language, the boolean type is a numeric type, and he has two values: 1 and 0. The Boolean type value in Java cannot be replaced by 1 and 0, and also cannot belong to the numerical type, and mathematical calculation or type conversion cannot be carried out between the Boolean type value and the numerical type such as integer type.
Illustratively: the first page request identifier is a refresh, and is specifically stated as follows:
/**
* Whether the first page request was successful
*/
private boolean refreshed;
The first page request is characterized as successfully ending when the first page request identifier refresh is true, and as failed.
In some embodiments, the device communicates with the 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 needed 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, and enters a syn_send state to wait for confirmation of the server side; second handshake: the server receives the SYN packet, and must confirm the SYN (ack=j+1) of the device, and simultaneously send a SYN packet (syn=k), that is, a syn+ack packet, where the server enters a syn_recv state; third handshake: the device side receives the syn+ack packet from the server side, and sends an acknowledgement packet ACK (ack=k+1) to the server side, and after the packet is sent, the device side and the server side enter an ESTABLISHED state, so as to complete 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 representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value indicating that the next page has data, and the second parameter is true value indicating that the network interface is successful.
In some embodiments, the first parameter is hasMore, and when its value is true, i.e., true, indicates that the next page has data, and its value is false, i.e., false, indicates that the next page has no data, it is specifically stated as follows:
/**
* Whether the next page has data (known from server interface response)
*/
private boolean hasMore=true;
The second parameter is isSuccess, and when the value is true, that is, true represents that the network interface is successful, and the value is false, that is, false represents that the network interface is failed, the declaration mode can refer to the first parameter hasMore, which is not described herein.
S103: when the first parameter and the first page request identifier are true values, increasing the page number by one step length 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 indicating whether the next page of the next page has data and a new second parameter indicating whether a network interface is successful;
S105: repeating steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is larger 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.
In some embodiments, increasing the page number by one step according to the preset step length when both the first parameter and the first page request identifier are true comprises the steps of:
judging whether the first parameter is a true value or not;
if yes, judging whether the first page request identifier is a true value;
if yes, the page number is increased by one step according to the preset step length.
In some embodiments, the preset step length is 1, i.e., 1 is added at a time.
Illustratively, when the first parameter hasMore and the first page request identifier refresh are both true, the page number is incremented by 1, i.e., 2, on the basis of the starting page number 1.
For user-friendly invocation, in Java, this step is preferably encapsulated within an 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 the I of the graphical user Interface (Graphical User Interface, GUI for short), and the Interface is an abstract class and a class which cannot be initialized.
In some embodiments, the implementation manner of the interface Ipage is preferably a paging interface default implementation class, and the specific implementation manner is as follows:
Figure BDA0002378005950000091
it should be noted that, the method next page () is a corresponding increment of one step, and the method hasMore () is whether the next page has data. Those skilled in the art may implement this step in other languages, and the embodiments of the present invention are not limited in this respect.
In some embodiments, 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 according to the preset step length comprises the steps of:
judging whether the second parameter is a false value or not;
if yes, judging whether the page number is larger than the initial page number;
if yes, the page number is reduced by one step according to the preset step length.
In some embodiments, the preset step length is 1, i.e., reduced by 1 at a time.
For example, when the second parameter isSuccess is false and the page number is 2, the page number is reduced by 1, that is, 1 is obtained. The purpose of this is to return page numbers when the data request fails, so as to avoid data confusion.
In Java, for user invocation purposes, this step is preferably also encapsulated within the interface Ipage,
public interface IPage{IPage finishLoad(boolean isSuccess);}。
in practice, the specific implementation manner may be a class default implementation manner by the paging interface, and in this regard, the present invention may be not limited to this aspect, and may be designed with reference to the source code.
In order to facilitate device recording, the embodiment of the present invention includes the following steps after S102:
judging whether the first parameter is a true value or not;
if yes, recording the next page and the data.
It is noted that in the generation of the home page request identifier, a second parameter is also used, i.e. the generation of the home page request identifier, which characterizes whether the home page request was successful, comprises the steps of:
judging whether the second parameter is a true value or not;
if yes, judging whether the page number is the initial page number;
if so, the home page request identifier is set to a true value.
Illustratively, when the second parameter isSuccess is true and the page number is 1, the home 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 simplicity of the procedure, the implementation reduces one step size and the first page request identifier to be fused together, and omits related variable declarations and the like, where the method finishLoad () is specifically as follows:
Figure BDA0002378005950000101
Figure BDA0002378005950000111
it should be noted that, those skilled in the art may also use other languages to implement the steps, which the embodiments of the present invention are not limited to.
Compared with the prior art, the data paging method has the following beneficial effects:
According to the data paging method, through setting of the first page request identifier for representing whether the first 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 paging related logic processing is realized, 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 a method for paging data according to another embodiment of the present invention, another embodiment of the present invention provides a device for paging data, the device for paging data includes:
a home page module 2001 for setting a page number of the home page as a start 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the home page request is successfully ended when the data type of the home page request identifier is a true value;
the parsing module 2002 is configured to parse the first page request data to obtain a first parameter indicating whether the next page has data and a second parameter indicating whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value indicating that the next page has data, and the second parameter is true value indicating that the network interface is successful;
An increasing module 2003, configured to increase the page number by one step according to the preset step length and send the next page request when the first parameter and the first page request identifier are both true;
a receiving parsing module 2004, configured to receive next page request data corresponding to a next page request, parse the next page request data to obtain a new first parameter indicating whether a next page of the next page has data and a new second parameter indicating whether the network interface is successful;
a repetition module 2005 for repeatedly executing the addition module 2003 and the reception parsing module 2004 to display the data page;
a reducing module 2006, configured to reduce the page number by one step according to the preset step length when the second parameter is a false value and the page number is greater than the start page number, and repeatedly execute the adding module 2003, the receiving parsing module 2004, and the repeating module 2005.
Preferably, the home module 2001 includes:
the first monitoring unit is used for generating and sending a home page request based on the 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, the home module 2001 includes:
the second monitoring unit is used for generating and sending a home page request based on a monitored instruction of clicking a 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 augmentation module 2003 includes:
the first judging unit is used for judging whether the first parameter is a true value or not;
the second judging unit is used for judging whether the first page request identifier is a true value or not when the first parameter is the true value;
and the adding unit is used for adding the page number by one step length according to the preset step length when the first page request identifier is a true value.
In some implementations, the reduction module 2006 includes:
the third judging unit is used for judging whether the second parameter is a false value or not;
a fourth judging unit 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 according to the preset step length when the page number is larger than the initial page number.
In some embodiments, an apparatus for paging data includes a recording module, the recording module including:
a fifth judging unit for judging whether the first parameter is true;
and the recording unit is used for recording the next page and the data when the first parameter is true.
In some embodiments, the home module 2001 includes:
A sixth judging unit for judging whether the second parameter is true;
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 top page request identifier as a true value when the page number is the initial page number.
Compared with the prior art, the device for paging data has the following beneficial effects:
according to the data paging device, through the arrangement of the home page module 2001, the analysis module 2002, the addition module 2003, the receiving analysis module 2004, the repetition module 2005 and the reduction module 2006, the paging related logic processing is realized, 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. 3, another embodiment of the present invention provides a mobile terminal based on the same inventive concept as a method for paging data. Fig. 3 is a block diagram showing a part of the structure of a mobile 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 (wireless fidelity, wiFi) module 1570, processor 1580, power supply 1590, and the like. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 3:
the RF circuit 1510 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 1580; in addition, the data of the design uplink is sent to the base station. Generally, RF circuitry 1510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low noise amplifier (Low NoiseAmplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 1510 may also communicate with networks and other devices through wireless communication. The wireless communications may use any communication standard or protocol including, but not limited to, global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), email, short message service (Short Messaging Service, SMS), and the like.
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 executing 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, phonebook, etc.) created according to the use of the handset, etc. In addition, 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 numerical or character information and generate key signal inputs related to user settings and function control of the handset. In particular, 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, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1531 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined 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 azimuth 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 detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 1580, and can receive and execute commands sent from the processor 1580. In addition, the touch panel 1531 may be implemented in various types such as resistive, capacitive, infrared, and 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 (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1540 may be used to display information input by a 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 alternatively, the display panel 1541 may be configured in the form of a liquid crystal display (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 thereon or thereabout, the touch operation is transferred to the processor 1580 to determine the type of touch event, and then the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of touch event. Although in fig. 3, the touch panel 1531 and the display panel 1541 are two separate components for implementing the input and input functions of the mobile phone, in some embodiments, the touch panel 1531 may be integrated with the display panel 1541 to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1541 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1541 and/or the backlight when the phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 1560, a speaker 1561, and a microphone 1562 may provide an audio interface between a user and a cell phone. The audio circuit 1560 may transmit the received electrical signal converted from audio data to the speaker 1561, and be converted into a sound signal by the speaker 1561 for output; on the other hand, the microphone 1562 converts the collected sound signals into electrical signals, which are received by the audio circuit 1560 for conversion into audio data, which is processed by the audio data output processor 1580 for transmission to, for example, another cellular phone via the RF circuit 1510 or for output to the memory 1520 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1570, so that wireless broadband Internet access is provided for the user. Although fig. 3 shows WiFi module 1570, it is understood that it is not a necessary component of a cell phone and may be omitted entirely as desired within the scope of 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 using various interfaces and lines, and performs various functions and processes data of the mobile phone by running or executing software programs and/or modules stored in the memory 1520 and calling data stored in the memory 1520, thereby performing overall monitoring of the mobile phone. In the alternative, processor 1580 may include one or more processing units; preferably, the processor 1580 can integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1580.
The handset further includes a power supply 1590 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1580 via a power management system so as to provide for the management of charging, discharging, and power consumption by the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In yet another embodiment of the present invention, the processor 1580 included in the terminal further has the following functions:
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 applications configured to:
s101: setting the page number of the 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier represents that the home page request is successfully ended when the data type of the home page request identifier is a true value;
s102: analyzing the first page request data to obtain a first parameter representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value, which indicates that the next page has data, and the second parameter is true value, which indicates that the network interface is successful;
S103: when the first parameter and the first page request identifier are true values, increasing the page number by one step length 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 indicating whether the next page of the next page has data and a new second parameter indicating whether a network interface is successful;
s105: repeating steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is larger 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.
In some embodiments, the sending the home page request and receiving the home page request data corresponding to the home page request include the steps of:
generating and sending a home page request based on the monitored pull-down refreshing instruction;
and receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, the sending the home page request and receiving the home page request data corresponding to the home page request include the steps of:
generating and sending a home page request based on the monitored command of clicking the preset control;
And receiving and displaying the home page request data corresponding to the home page request.
In some embodiments, when the first parameter and the first page request identifier are both true, 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 or not;
if yes, judging whether the home page request identifier is a true value or not;
if yes, the page number is increased by one step according to the preset step length.
Preferably, when the second parameter is a false value and the page number is greater than the start page number, the step of reducing the page number by one step according to the preset step length includes the following steps:
judging whether the second parameter is a false value or not;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step according to the preset step length.
In some embodiments, after S102, the method includes the steps of:
judging whether the first parameter is a true value or not;
if yes, recording the next page and the data.
In some embodiments, the generating a home page request identifier that characterizes whether the home page request was successful includes the steps of:
judging whether the second parameter is a true value or not;
If yes, judging whether the page number is the initial page number;
if yes, the home page request identifier is set to be a true value.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Compared with the prior art, the mobile terminal provided by the invention has the following beneficial effects:
according to the mobile terminal, through setting of the first page request identifier for representing whether the first 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 paging related logic processing is realized, the development efficiency is improved, errors caused by non-uniform paging logic are avoided, and the user experience is improved to a certain extent.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: read Only Memory (ROM), random access Memory (RAM, randomAccess Memory), magnetic or optical disk, and the like.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (15)

1. A method for paging data, the method comprising the steps of:
s101: setting the page number of the 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier represents that the home page request is successfully ended when the data type of the home page request identifier is a true value;
s102: analyzing the first page request data to obtain a first parameter representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value, which indicates that the next page has data, and the second parameter is true value, which indicates that the network interface is successful;
s103: when the first parameter and the first page request identifier are true values, increasing the page number by one step length 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 indicating whether the next page of the next page has data and a new second parameter indicating whether a network interface is successful;
S105: repeating steps S103-S104 to display the data in pages;
s106: and when the second parameter is a false value and the page number is larger 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.
2. The method for paging data according to claim 1, wherein the steps of transmitting a home page request and receiving the home page request data corresponding to the home page request include the steps of:
generating and sending a home page request based on the monitored pull-down refreshing instruction;
and receiving and displaying the home page request data corresponding to the home page request.
3. The method for paging data according to claim 1, wherein the steps of transmitting a home page request and receiving the home page request data corresponding to the home page request include the steps of:
generating and sending a home page request based on the monitored command of clicking the preset control;
and receiving and displaying the home page request data corresponding to the home page request.
4. The method for paging data as claimed in claim 1, wherein 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 values comprises the steps of:
Judging whether the first parameter is a true value or not;
if yes, judging whether the home page request identifier is a true value or not;
if yes, the page number is increased by one step according to the preset step length.
5. The method for paging data as claimed in claim 1, wherein when the second parameter is a false value and the page number is greater than the start page number, reducing the page number by one step according to a preset step length comprises the steps of:
judging whether the second parameter is a false value or not;
if yes, judging whether the page number is larger than the initial page number;
if yes, reducing the page number by one step according to the preset step length.
6. The method for paging data according to claim 1, wherein after said step S102, comprising the steps of:
judging whether the first parameter is a true value or not;
if yes, recording the next page and the data.
7. The method of paging data as claimed in claim 1, wherein said generating a home request identifier indicating whether a home request was successful comprises the steps of:
judging whether the second parameter is a true value or not;
if yes, judging whether the page number is the initial page number;
if yes, the home page request identifier is set to be a true value.
8. An apparatus for paging data, said apparatus 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; 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 representing whether the home page request is successful or not, wherein the data type of the home page request identifier is a Boolean type, and the data type of the home page request identifier represents that the home page request is successfully ended when the data type of the home page request identifier is a true value;
the analyzing module is used for analyzing the first page request data to obtain a first parameter representing whether the next page has data and a second parameter representing whether the network interface is successful; the data types of the first parameter and the second parameter are boolean types, the first parameter is true value, which indicates that the next page has data, and the second parameter is true value, which indicates that the network interface is successful;
the adding module is used for adding the page number by one step length according to the preset step length and sending a next page request when the first parameter and the first page request identifier are 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 representing whether the next page of the next page has data or not and a new second parameter representing whether the network interface is successful or not;
The repeating module is used for repeatedly executing the adding module and the receiving and analyzing module so as to display the data in a paging mode;
and the reducing module is used for reducing the page number by one step length according to the preset step length when the second parameter is a false value and the page number is larger than the initial page number, and repeatedly executing the adding module, the receiving analysis module and the repeating module.
9. The apparatus for paging data as claimed in claim 8, wherein the home module comprises:
the first monitoring unit is used for generating and sending a home page request based on the 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 paging data as claimed in claim 8, wherein the home module comprises:
the second monitoring unit is used for generating and sending a home page request based on a monitored instruction of clicking a 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 paging data as claimed in claim 8, wherein said adding module comprises:
the first judging unit is used for judging whether the first parameter is a true value or not;
The second judging unit is used for judging whether the first page request identifier is a true value or not when the first parameter is the true value;
and the adding unit is used for adding the page number by one step length according to the preset step length when the head page request identifier is a true value.
12. The apparatus for paging data as claimed in claim 8, wherein said reduction 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 the page number is greater than the start page number when the second parameter is a false value;
and the reducing unit is used for reducing the page number by one step according to the preset step length when the page number is larger than the initial page number.
13. The apparatus for paging data as claimed in claim 8, wherein the apparatus for paging data comprises a recording module, the recording module comprising:
a fifth judging unit, configured to judge whether the first parameter is a true value;
and the recording unit is used for recording the next page and the data when the first parameter is true.
14. The apparatus for paging data as claimed in claim 8, wherein the home module comprises:
A sixth judging unit for judging whether the second parameter is true;
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 top page request identifier as 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 applications configured to perform the method of data paging recited in any one 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 CN111240650A (en) 2020-06-05
CN111240650B true 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
CN111240650A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
WO2016150331A1 (en) Method and device for operating game client
CN104852885B (en) Method, device and system for verifying verification code
CN104093123B (en) The information-pushing method of application program, device and system, mobile terminal
WO2018126409A1 (en) Signaling transmission method and device
WO2017096909A1 (en) Data connection establishing method and apparatus
CN103634717A (en) Method, device and terminal equipment utilizing earphone to control
CN111309325B (en) Third party library reference method and device and mobile terminal
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
CN107317828B (en) File downloading method and device
CN107193551B (en) Method and device for generating image frame
CN111240650B (en) Data paging method and device and mobile terminal
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
JP6685538B2 (en) Application acceleration method and device
CN112261634B (en) Bluetooth transmission control method and device, terminal equipment and storage medium
CN112667868B (en) Data detection method and device
CN109799994B (en) Terminal component generation method and device
WO2017049930A1 (en) Resource usage method and terminal
CN112634885A (en) Voice wake-up method and device for cross-local area network
WO2019174583A1 (en) Method for transmitting synchronizing signal block, network device and user equipment
CN107315623B (en) Method and device for reporting statistical data
WO2015078409A1 (en) Method, device, terminal and system for collecting information
CN108307531B (en) Call control method, device, user terminal and computer readable storage medium
CN106358070B (en) Multimedia file uploading method and device
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