A kind of Pagination Display method, system and terminal deviceTechnical field
The invention belongs to field of computer technology more particularly to a kind of Pagination Display methods, system and terminal device.
Background technique
Front end refers to website front end part, operates in the end PC, and the webpage of user's browsing is presented on the browsers such as mobile terminal.Presently, there are two kinds of important front ends: mobile terminal and desktop end (end PC).It is past when mobile terminal obtains the data list of new one pageToward being to obtain data by the modes such as pull down or glide, in desktop end, ((end PC) is then to obtain number by providing page buttonAccording to.However for mobile terminal and desktop end both different paged data display methods, rear end needs to develop different processingBusiness has aggravated the code complexity of back-end processing business.
In conclusion current Pagination Display method presence needs after causing for different front ends setting different disposal businessThe problem for holding the code complexity of processing business high.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of Pagination Display method, system and terminal device, it is current to solvePagination Display method exist and need to cause the code of back-end processing business complicated for different front ends setting different disposal businessSpend high problem.
The first aspect of the present invention provides a kind of Pagination Display method, comprising:
Display operation instruction is obtained, the display operation instruction is return idsplay order or loaded and displayed instruction;
If display operation instruction to return to idsplay order, according to return idsplay order calculate the first data-bias toAmount and the first offset step;
Simultaneously display caching is obtained from data capsule according to the first data-bias vector and first offset stepData;
If display operation instruction is that loaded and displayed instructs, instructed according to loaded and displayed calculate the second data-bias toAmount and the second offset step;
Data are loaded to data capsule according to the second offset step described in the second data-bias vector sum.
The second aspect of the present invention provides a kind of Pagination Display system, comprising:
Instruction acquisition module, for obtaining display operation instruction, the display operation instruction is return idsplay order or addsCarry idsplay order;
Return computing module, if for display operation instruction to return to idsplay order, according to return idsplay orderCalculate the first data-bias vector and the first offset step;
Return to display module, for according to the first data-bias vector and first offset step from data capsuleIt is middle to obtain simultaneously display caching data;
Computing module is loaded, if being that loaded and displayed instructs for display operation instruction, is instructed according to loaded and displayedCalculate the second data-bias vector and the second offset step;
Loaded and displayed module, extremely for the load of the second offset step according to the second data-bias vector sum dataData capsule.
The third aspect of the present invention provides a kind of terminal device, including memory, processor and is stored in described depositIn reservoir and the computer program that can run on the processor, the processor realized when executing the computer program withLower step:
Display operation instruction is obtained, the display operation instruction is return idsplay order or loaded and displayed instruction;
If display operation instruction to return to idsplay order, according to return idsplay order calculate the first data-bias toAmount and the first offset step;
Simultaneously display caching is obtained from data capsule according to the first data-bias vector and first offset stepData;
If display operation instruction is that loaded and displayed instructs, instructed according to loaded and displayed calculate the second data-bias toAmount and the second offset step;
Data are loaded to data capsule according to the second offset step described in the second data-bias vector sum.
The fourth aspect of the present invention provides a kind of computer readable storage medium, and the computer readable storage medium is depositedComputer program is contained, the computer program performs the steps of when being executed by processor
Display operation instruction is obtained, the display operation instruction is return idsplay order or loaded and displayed instruction;
If display operation instruction to return to idsplay order, according to return idsplay order calculate the first data-bias toAmount and the first offset step;
Simultaneously display caching is obtained from data capsule according to the first data-bias vector and first offset stepData;
If display operation instruction is that loaded and displayed instructs, instructed according to loaded and displayed calculate the second data-bias toAmount and the second offset step;
Data are loaded to data capsule according to the second offset step described in the second data-bias vector sum.
A kind of Pagination Display method, system and terminal device provided by the invention are suitable for mobile terminal and table by oneThe data capsule at face end, it is data cached come real by data capsule according to the offset vector and offset step with current Visitor LocationThe display of existing paged data and the page return to display, have unified mobile terminal and desktop end Pagination Display mode, have reduced rear endThe complexity of the code of processing business, while the workload of front end response layout is reduced, it is aobvious to efficiently solve current pagingShow that method exists to need to cause the code complexity of back-end processing business is high to ask for different front ends setting different disposal businessTopic.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior artNeeded in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention someEmbodiment for those of ordinary skill in the art without any creative labor, can also be according to theseAttached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation process schematic diagram for Pagination Display method that the embodiment of the present invention one provides;
Fig. 2 is the implementation process schematic diagram of one step S103 of corresponding embodiment provided by Embodiment 2 of the present invention;
Fig. 3 is the implementation process schematic diagram for the one step S105 of corresponding embodiment that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for Pagination Display system that the embodiment of the present invention four provides;
Fig. 5 is the structural schematic diagram that display module 103 is returned in the corresponding embodiment four of the offer of the embodiment of the present invention five;
Fig. 6 is the structural schematic diagram of loaded and displayed module 105 in the corresponding embodiment four of the offer of the embodiment of the present invention six;
Fig. 7 is the schematic diagram for the terminal device that the embodiment of the present invention seven provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposedBody details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specificThe present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, system, electricityThe detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one:
As shown in Figure 1, present embodiments providing a kind of Pagination Display method, specifically include:
Step S101: obtaining display operation instruction, and the display operation instruction refers to return to idsplay order or loaded and displayedIt enables.
In a particular application, it is instructed by obtaining the display operation of user's input, instructing determination according to display operation is needThe data of new one page are loaded, or need to return the data of upper page.
In a particular application, pass through the display operation instruction that front end obtains user's input, it should be noted that user can be withBy gesture instruction as display operation instruction inputted, can also by key triggering command as display operation instruct intoRow input.
In a particular application, above-mentioned display operation instruction is returns to idsplay order or loaded and displayed instruction, if display operationInstruction then shows to need to return page up or upper several pages of data at this time, if display operation single instrction is to return to idsplay orderLoaded and displayed instruction, then show to need to load at this time lower one page or under several pages of data.
In one embodiment, for mobile terminal, above-mentioned return idsplay order includes but is not limited to that upper sliding operation refers toIt enables and slide instructs from left to right, above-mentioned loaded and displayed instruction includes but is not limited to downslide operational order and slides from right to leftDynamic operational order.For desktop end, above-mentioned return idsplay order includes but is not limited to that click page up key and click are worked asThe preceding page key of preceding page, above-mentioned loaded and displayed instruction include but is not limited to click lower one page key to press with the rear page for clicking current pageKey.
Step S102: if display operation instruction calculates first to return to idsplay order, according to idsplay order is returnedData-bias vector and the first offset step.
In a particular application, it when the display operation instruction got is returns to idsplay order, then needs aobvious according to returningShow that instruction calculates first the first offset step of data-bias vector sum when returning to display.It should be noted that calculating the first numberIt according to offset vector is determined according to current data offset vector.First offset step is needed according to return limitation instructionTo be determined.
In a particular application, when returning to idsplay order is upper sliding operational order or slide instruction from left to right, rootAccording to the distance of upper cunning absolute value or from left to right the absolute value of distance that slides calculates the first offset step.It needs to illustrateBe, there are proportionate relationship between the absolute value of above-mentioned distance and the first offset step, proportionality coefficient according to physical end parameter intoRow setting, it is without restriction herein.The first offset can be calculated according to preset proportionality coefficient and the sliding distance determinedStep-length.It just can determine that the first data-bias vector according to the first offset step and current data offset vector, specifically, currentThe first offset step is returned on the basis of data-bias vector obtains the first data-bias vector.
In a particular application, when return idsplay order be click page up button or click current page preceding page button come intoWhen row returns to display operation, the first offset step is determined according to the number of pages of return.It should be noted that the number of pages of above-mentioned return withThere are proportionate relationship between first offset step, proportionality coefficient is configured according to physical end, without restriction herein.According toCorresponding first offset step can be calculated in preset proportionality coefficient and the return number of pages determined, according to the first offset stepIt just can determine that the first data-bias vector with current data offset vector, specifically, on the basis of current data offset vectorIt returns to first and is not cheaply remembering the first data-bias vector.
Step S103: it is obtained simultaneously from data capsule according to the first data-bias vector and first offset stepDisplay caching data.
In a particular application, above-mentioned data capsule is suitable for mobile terminal and desktop end.It should be noted that mobile terminal refers toRefer to that the client software used on the mobile devices such as mobile phone, tablet computer, desktop end (end PC) are generally referred in computerThen the client software used above, data capsule are automatically created internal required object, are come by one data source of settingData are completed to show.
In a particular application, above-mentioned data capsule is the data capsule of stack-type structure, the top of the data capsule of stack-type structurePortion's data are exactly the latest data that current front end (mobile terminal or desktop end) is shown.
In a particular application, after the first offset step and the first data-bias vector is calculated, pass through data capsuleIt reads corresponding data cached in first the first offset step of data-bias vector sum, and data cached is loaded into what is readThe top of the data capsule of stack-type structure just can show corresponding data by the data capsule of stack-type structure, realize that return is aobviousShow.
Step S104: if display operation instruction is that loaded and displayed instructs, second is calculated according to loaded and displayed instructionData-bias vector and the second offset step.
In a particular application, it is that loaded and displayed instructs when the display operation got instructs, then needs according to loaded and displayedInstruction calculates second the second offset step of data-bias vector sum when load data.It should be noted that calculating the second dataOffset vector is determined according to current data offset vector, and the second offset step needs are carried out according to loaded and displayed instructionIt determines.
In a particular application, when loaded and displayed instruction is downslide operational order or slide instruction from right to left is rootAccording to the distance of downslide absolute value or from right to left the absolute value of distance that slides calculates the second offset step, need to illustrateBe, there are proportionate relationship between the absolute value of above-mentioned distance and the second offset step, proportionality coefficient according to physical end parameter intoRow setting, it is without restriction herein.Corresponding second offset can be calculated apart from absolute value with what is slided according to predetermined coefficientStep-length.It just can determine that the second data-bias vector according to the second offset step and current data offset vector, specifically, currentThe data that the second offset step is loaded on the basis of data-bias vector obtain the second data-bias vector.
In a particular application, when loaded and displayed instruction for click lower one page button or click the after page button of current page come intoWhen row loaded and displayed operates, the second offset step is determined according to the number of pages of load.It should be noted that the number of pages of above-mentioned load withThere are proportionate relationship between second offset step, proportionality coefficient is configured according to physical end parameter, without restriction herein.Corresponding second offset step can be calculated apart from absolute value with what is slided according to predetermined coefficient.According to the second offset step andCurrent data offset vector just can determine that the second data-bias vector, specifically, adding on the basis of current data offset vectorThe data for carrying the second offset step obtain the second data-bias vector.
Step S105: data to data are loaded according to the second offset step described in the second data-bias vector sum and are heldDevice.
In a particular application, it after the second offset step and the second data-bias vector is calculated, is taken by rear endThe data load requests for device transmission request of loading data of being engaged in, and corresponding data are obtained by back-end server, data are storedAt the top of the data capsule of stack-type structure, corresponding data just can be shown by the data capsule of stack-type structure, realize loadDisplay.
Pagination Display method provided in this embodiment is suitable for the data capsule of mobile terminal and desktop end, root by onePass through the data cached display to realize paged data of data capsule according to the offset vector and offset step with current Visitor LocationAnd the page returns to display, has unified mobile terminal and desktop end Pagination Display mode, has reduced the code of back-end processing businessComplexity, while the workload of front end response layout is reduced, it efficiently solves current Pagination Display method presence and needs needleThe problem for causing the code complexity of back-end processing business high different front ends setting different disposal business.
Embodiment two:
As shown in Fig. 2, in the present embodiment, the step S103 in embodiment one is specifically included:
Step S201: it is obtained according to first the first offset step of data-bias vector sum data cached.
In a particular application, it determines the need for passing through rear end by the total quantity of the accumulative returned data in front end firstServer is corresponding data cached to obtain.
In a particular application, by comparing the first offset step and return total amount of data, and then determine that acquisition is data cachedObject, be to obtain corresponding data cached by back-end server or corresponding caching number is obtained by data capsuleAccording to.
In one embodiment, above-mentioned steps S201 the following steps are included:
Step S2011: it obtains and returns to total amount of data;
Step S2012: if the return total amount of data is less than or equal to first offset step, pass through back-end servicesDevice load is data cached;
Step S2013: if the return total quantity is greater than the first offset step, caching number is read from data capsuleAccording to.
In a particular application, it is added up by front end and number of pages and has returned to total number, returned according to having returned to total number and determiningTotal quantity then shows that the data cached of data capsule is not enough to completely when returning to total quantity less than or equal to the first offset stepFoot this time returns to display operation, therefore loads corresponding data by back-end server and be buffered in data capsule, is returningWhen total quantity is greater than the first offset step, then show that data cached can satisfy of data capsule this time returns to display operation, becauseThis reads corresponding data cached shown by data capsule.
Step S202: the top of data capsule is emptied to the data of the first offset step.
Step S203: data cached be loaded at the top of data capsule that will acquire is shown.
In a particular application, after being blanked data capsule, then what be will acquire data cached be loaded into the data capsuleTop, it will be able to corresponding data are shown by the data capsule of stack-type structure, realize the display operation of returned data.
Embodiment three:
As shown in figure 3, in the present embodiment, the step S105 in embodiment one is specifically included:
Step S301: data are loaded from back-end server according to second the second offset step of data-bias vector sum.
In a particular application, the second offset vector is determined by the second offset step, and passes through front end rear end serverThe data for obtaining corresponding second offset vector and the second offset step are sent, corresponding newest number is downloaded by back-end serverAccording to,
In one embodiment, it when the second offset vector is 0, needs that newest data are obtained and loaded from rear end.
Step S302: by the top of the data buffer storage of load to data capsule.
In a particular application, corresponding data are loaded by back-end server, the data of load is stored in stack-type structureData capsule top, just can show corresponding data by the data capsule of stack-type structure, realize loaded and displayed.
Example IV:
As shown in figure 4, the present embodiment provides a kind of Pagination Display system 100, for executing the step of the method in embodiment oneSuddenly comprising instruction acquisition module 101, return computing module 102, return display module 103, load computing module 104 andLoaded and displayed module 105.
Instruction acquisition module 101 for obtaining display operation instruction, display operation instruction for return idsplay order orLoaded and displayed instruction.
If returning to computing module 102 for display operation instruction to return to idsplay order, refer to according to display is returnedIt enables and calculates the first data-bias vector and the first offset step.
Display module 103 is returned to be used to be held according to the first data-bias vector and first offset step from dataSimultaneously display caching data are obtained in device.
If loading computing module 104 for display operation instruction is that loaded and displayed instructs, referred to according to loaded and displayedIt enables and calculates the second data-bias vector and the second offset step.
Loaded and displayed module 105 loads data for the second offset step according to the second data-bias vector sumTo data capsule.
It should be noted that Pagination Display system provided in an embodiment of the present invention, as real with method shown in Fig. 1 of the present inventionIt applies example and is based on same design, bring technical effect is identical as embodiment of the method shown in Fig. 1 of the present invention, and particular content can be found inNarration in embodiment of the method shown in Fig. 1 of the present invention, details are not described herein again.
Therefore, a kind of Pagination Display system provided in this embodiment equally can be suitable for mobile terminal and table by oneThe data capsule at face end, it is data cached come real by data capsule according to the offset vector and offset step with current Visitor LocationThe display of existing paged data and the page return to display, have unified mobile terminal and desktop end Pagination Display mode, have reduced rear endThe complexity of the code of processing business, while the workload of front end response layout is reduced, it is aobvious to efficiently solve current pagingShow that method exists to need to cause the code complexity of back-end processing business is high to ask for different front ends setting different disposal businessTopic.
Embodiment five:
As shown in figure 5, in the present embodiment, the return display module 103 in example IV includes right for executing Fig. 2 instituteThe structure for the method and step in embodiment answered comprising data capture unit 201, data empty unit 202 and display is singleMember 203.
Data capture unit 201 is used to be obtained according to first the first offset step of data-bias vector sum data cached.
Data empty unit 202 for emptying the top of data capsule to the data of the first offset step.
Data cached be loaded at the top of data capsule that display unit 203 is used to will acquire is shown.
Embodiment six:
As shown in fig. 6, in the present embodiment, the loaded and displayed module 105 in example IV includes right for executing Fig. 3 instituteThe structure for the method and step in embodiment answered comprising loading unit 301 and cache unit 302.
Loading unit 301 is used to load number from back-end server according to second the second offset step of data-bias vector sumAccording to.
Cache unit 302 is used for the data buffer storage that will load to the top of data capsule.
Embodiment seven:
Fig. 7 is the schematic diagram for the terminal device that the embodiment of the present invention seven provides.As shown in fig. 7, the terminal of the embodiment is setStandby 7 include: processor 70, memory 71 and are stored in the meter that can be run in the memory 71 and on the processor 70Calculation machine program 72, such as program.The processor 70 realizes above-mentioned each picture processing side when executing the computer program 72Step in method embodiment, such as step S101 to S105 shown in FIG. 1.Alternatively, the processor 70 executes the computerThe function of each module/unit in the above system embodiment, such as the function of module 101 to 105 shown in Fig. 4 are realized when program 72.
Illustratively, the computer program 72 can be divided into one or more module/units, it is one orMultiple module/units are stored in the memory 71, and are executed by the processor 70, to complete the present invention.Described oneA or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used forImplementation procedure of the computer program 72 in the terminal device 7 is described.For example, the computer program 72 can be dividedIt is cut into command reception module, computing module is returned, returns to display module, load computing module and loaded and displayed module, each mouldBlock concrete function is as follows:
Instruction acquisition module, for obtaining display operation instruction, the display operation instruction is return idsplay order or addsCarry idsplay order;
Return computing module, if for display operation instruction to return to idsplay order, according to return idsplay orderCalculate the first data-bias vector and the first offset step;
Return to display module, for according to the first data-bias vector and first offset step from data capsuleIt is middle to obtain simultaneously display caching data;
Computing module is loaded, if being that loaded and displayed instructs for display operation instruction, is instructed according to loaded and displayedCalculate the second data-bias vector and the second offset step;
Loaded and displayed module, extremely for the load of the second offset step according to the second data-bias vector sum dataData capsule.
The terminal device 7 can be the calculating such as desktop PC, notebook, palm PC and cloud management serverEquipment.The terminal device may include, but be not limited only to, processor 70, memory 71.It will be understood by those skilled in the art thatFig. 7 is only the example of terminal device 7, does not constitute the restriction to terminal device 7, may include more more or fewer than illustratingComponent, perhaps combines certain components or different components, for example, the terminal device can also include input-output equipment,Network access equipment, bus etc..
Alleged processor 70 can be central processing unit (Central Processing Unit, CPU), can also beOther general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processorDeng.
The memory 71 can be the internal storage unit of the terminal device 7, such as the hard disk or interior of terminal device 7It deposits.The memory 71 is also possible to the External memory equipment of the terminal device 7, such as be equipped on the terminal device 7Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodgeDeposit card (Flash Card) etc..Further, the memory 71 can also both include the storage inside list of the terminal device 7Member also includes External memory equipment.The memory 71 is for storing needed for the computer program and the terminal deviceOther programs and data.The memory 71 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each functionCan unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by differentFunctional unit, module are completed, i.e., the internal structure of the system is divided into different functional unit or module, more than completingThe all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can alsoTo be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integratedUnit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function listMember, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.It is above-mentioned wirelessThe specific work process of unit in terminal, module, can refer to corresponding processes in the foregoing method embodiment, no longer superfluous hereinIt states.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodimentThe part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosureMember and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actuallyIt is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technicianEach specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceedThe scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed system/terminal device and method, it can be withIt realizes by another way.For example, system described above/terminal device embodiment is only schematical, for example, instituteThe division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such asMultiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.SeparatelyA bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, systemOr the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit for being set as separate part description may or may not be physically separated, and be set as singleThe component of member display may or may not be physical unit, it can and it is in one place, or may be distributed overIn multiple network units.Some or all of unit therein can be selected to realize this embodiment scheme according to the actual needsPurpose.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit, which is realized in the form of SFU software functional unit and is arranged, is independent product saleOr it in use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned realityThe all or part of the process in a method is applied, relevant hardware can also be instructed to complete by computer program, it is describedComputer program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved thatThe step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, the computer programCode can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable JieMatter may include: can carry the computer program code any entity or system, recording medium, USB flash disk, mobile hard disk,Magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that describedThe content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practiceSubtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal andTelecommunication signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned realityApplying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned eachTechnical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modifiedOr replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should allIt is included within protection scope of the present invention.