WO2019041500A1 - 分页的实现方法、装置、计算机设备及存储介质 - Google Patents

分页的实现方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2019041500A1
WO2019041500A1 PCT/CN2017/107991 CN2017107991W WO2019041500A1 WO 2019041500 A1 WO2019041500 A1 WO 2019041500A1 CN 2017107991 W CN2017107991 W CN 2017107991W WO 2019041500 A1 WO2019041500 A1 WO 2019041500A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
server
keyword
sorting
received
Prior art date
Application number
PCT/CN2017/107991
Other languages
English (en)
French (fr)
Inventor
包晓华
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019041500A1 publication Critical patent/WO2019041500A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method, an apparatus, a computer device, and a storage medium for implementing paging.
  • the local terminal device sends a data request to the peer server, and after the peer server receives the data request of the local end, the content of the request is determined by the peer server. Perform search, sorting, etc., and then send the sorted result to the local end for display.
  • the local end will send a data request to the server again, and the server needs to respond again.
  • a method, an apparatus, a computer device, and a storage medium for implementing paging are provided.
  • a method for implementing paging comprising:
  • the keyword is sent to the server;
  • the data includes data queried by the server according to the keyword, and when the size of the data is within the load range of the application end, the data includes all data queried by the server;
  • the sorted data is paged.
  • a paging implementation device comprising:
  • a keyword sending module configured to send the keyword to the server when receiving the keyword of the input data query
  • a data receiving module configured to receive data sent by the server, where the data includes data queried by the server according to the keyword, and when the size of the data is within the load range of the application end, the data includes all the queries queried by the server. data;
  • a sorting module configured to sort all the received data according to the sorting rule according to the received sorting rule
  • a quantity acquisition module for obtaining a preset quantity of data displayed on one page
  • the paging module is configured to page the sorted data when the preset number is less than the number of received data.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by one or more processors such that the one or more processors perform the steps of: receiving Send the keyword to the server when the keyword of the input data query is entered;
  • the data includes data queried by the server according to the keyword, and when the size of the data is within the load range of the application end, the data includes all data queried by the server;
  • One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving input data When the keyword is queried, the keyword is sent to the server;
  • the data includes data queried by the server according to the keyword, and when the size of the data is within the load range of the application end, the data includes all data queried by the server;
  • FIG. 1 is a flow chart of a method for implementing paging according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for implementing paging according to another embodiment of the present application.
  • FIG. 3 is a flowchart of a method for implementing paging according to still another embodiment of the present application.
  • FIG. 4 is a block diagram showing an exemplary structure of a paging implementation device according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram showing the internal structure of a computer device according to an embodiment of the present application.
  • first, second and the like are used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another.
  • first determining element may be referred to as a second determining element without departing from the scope of the invention, and similarly, the second determining element may be referred to as a first determining element.
  • Both the first judging element and the second judging element are judging elements, but they are not the same judging element.
  • FIG. 1 is a flowchart of a method for implementing paging according to an embodiment of the present application.
  • a method for implementing paging according to an embodiment of the present application which can be applied to, for example, a PC personal computer or a mobile terminal, is described in detail with reference to FIG.
  • the terminal device such as a tablet computer includes the following steps S101 to S105.
  • the input operation of the keyword is generally performed by a user, and the keyword is a basis for querying data by the peer server, and the user can input a keyword that needs to be searched in the browser.
  • S102 Receive data sent by the server, where the data includes data that is queried by the server according to the keyword.
  • the data includes all data queried by the server.
  • the data includes all the data queried by the server according to the keyword, and the data that is received only in the load range of the application end in the step S102 may have the following two implementation methods:
  • the first is to receive the data returned by the server, and determine whether the size of the data sent back by the server is within the load range of the application end. If yes, the data returned by the server is received, and when the data is sent back by the server. When the size exceeds the load range of the application, there are two kinds of processing. In one mode, one method is to reject the data sent by the server, and the other method is to return the overloaded information to the server, so that the server sends the queried data segment to the local end, according to the embodiment. As an example, the size of the data for each segment is the maximum load that the application can withstand.
  • the second is to pre-store the pre-stored maximum load value corresponding to the terminal device on the server side.
  • the server side queries the data that meets the requirements, it is determined whether the queried data is within the maximum load range of the corresponding terminal device. If yes, the queried data is all sent to the corresponding terminal device at one time. Otherwise, the queried data is segmented, and the size of each piece of data does not exceed the maximum load that the corresponding terminal device can bear.
  • the load range of the application end is 0M to 10M, where M represents “mega”, and specifically may be set to 8M.
  • the collation rules in the step include, but are not limited to, sorting according to the time when the data is accessed, sorting according to the number of times the data is accessed, and the distance from the location of the application end according to the location marked by the data resource. Sort, sort by multiple sorts, and more.
  • the sorting step is to sort all the received data, that is, to perform a full row, and the sorting step is performed by the application end.
  • the above data may be video data, commodity data of a transaction, picture data, audio data, or the like.
  • the method of implementing paging according to an embodiment of the present application may be employed as long as it is a solution that needs to be queried, accessed, and sorted by the network.
  • the amount of data displayed in one page can be set by the user himself or herself in the setting item, or can be set in advance by the programmer.
  • a usage scenario of the number of data displayed in one page for example, the user can set the maximum data displayed by one entry in one page in the browser setting item, of course, if the user can According to your own needs, the browser needs to be provided to the user. Corresponding setting permissions.
  • the user can set the number of retrieved patent items displayed on one page.
  • you can also set the number of items or businesses displayed on a page in your browser.
  • the preset number of data displayed in one page may be ten, fifteen, twenty, and the like.
  • the number of sorted data is 57. If the preset number of data displayed in one page obtained by the above step S104 is ten, the sorted data needs to be performed. Pagination, according to a usage scenario of the embodiment, the sorted 57 data can be divided into six pages, the first five pages each page ten data, the sixth page contains seven data, and the first page is displayed in front of the first page. The data of ten stores the remaining page numbers and the data corresponding to the page numbers. In one embodiment, the remaining page numbers and the data displayed corresponding to each page number and the order in which the data is displayed may be cached.
  • the method for implementing the paging provided in this embodiment sends a keyword of the data query to the server, instructs the server to perform data query according to the keyword, and sends the queried data to the local end as soon as possible, so that
  • the local device can sort all the received data, and display the sorted data in a paged manner, so that the user reduces the number of interactions between the local end and the peer server when querying the data, and reduces the number of times the server needs to respond to the local data multiple times.
  • FIG. 2 is a flowchart of a method for implementing paging according to another embodiment of the present application.
  • the method for implementing paging according to another embodiment of the present application including the type of data and the sorting, is described in detail below with reference to FIG. 2 .
  • the method includes the above steps S103-S105.
  • step S101 further includes: sending the type of the data and the sorting basis to the server.
  • step S102 of receiving the data sent by the server the data includes data that is searched by the server according to the type of the data and carries the sorting basis.
  • step S101 further includes the following step S201:
  • step S202 is further as the following step S202:
  • S202 Receive data sent by the server, where the data includes data that is queried by the server according to the type of the data and carries the sorting basis. When the size of the data is within the load range of the application end, the data includes the server. All data queried.
  • the basis for the ranking includes the amount of access to the data and/or the time of the most recent access.
  • the sorting is based on the data automatically obtained according to the sorting rule input by the user.
  • the sorting rule input by the user in the above step S301 is that the keyword is sorted from near to far according to the time of the last accessed time.
  • the sorting basis included in the data may be the last time the data is carried in the query.
  • the keyword includes The sorting basis may be the number of times the history carried by the data carried by the query is accessed.
  • the sorting basis included in the keyword needs to carry the time when the data was last accessed and the number of times of history visited.
  • FIG. 3 is a flowchart of a method for implementing paging according to still another embodiment of the present application.
  • a method for implementing paging according to still another embodiment of the present application is described in detail below with reference to FIG. 3. As shown in FIG. 3, the method includes In addition to the above steps S101 to S105, the following steps S301 and S302 are further included.
  • the received data is organized into a key value, and the received data is organized into a key-value, and the received data is stored in a database in the form of a key-value. Due to the fast query speed of the distributed storage system corresponding to the key-value Large amount of data, high concurrency support, very suitable for querying through the primary key, if you do not need to send the received data to the other end, and the received data is at least one of the following: numbers, characters, English characters, punctuation, The received data can be stored as a key value.
  • the received data can be organized into an array. Since the data stored in the form of an array can realize continuous storage of the storage interval, the data stored in the data form saves storage space if the application end is receiving. When the data sent to the server is no longer needed to send the data to the other end, the received data can be organized into an array.
  • the received data may also be organized into a large object (large object, lob), and the large object is an organization of data, which is a data type in the Oracle database, due to the large object.
  • the data stored in the form is not easily lost in the process of data transmission.
  • the received data can be organized into large objects for storage, so that during the transmission process. There will be no data loss or missing problems to ensure the quality of the transmission.
  • the user can organize the received data into a corresponding form according to the actual needs and the type of the received data, so as to facilitate the subsequent operation process.
  • the post-organizational data may be stored in a cache of the browser, including but not limited to an IE browser, a Firefox browser, a Google browser, a migratory browser, and the like.
  • the user can organize the received data according to the actual processing requirements of the data, so as to facilitate the subsequent processing flow.
  • the display speed of the page can be improved, the time required to wait for the page switching is further reduced, and the processing efficiency of the data is improved.
  • the labels of the foregoing steps S101 to S302 are not used to limit the sequence of the steps in the embodiment, and the numbers of the steps are only for the convenience of referring to the labels of the steps when describing the steps.
  • steps S301 and S302 above The steps of the step S103 may be performed before the step of the step S103, as long as the order of execution of the respective steps does not affect the logical relationship of the embodiment, that is, it is within the scope of the claimed application.
  • FIG. 4 is a block diagram showing an exemplary structure of a paging implementation device according to an embodiment of the present application.
  • the paging implementation device 10 according to an embodiment of the present application is described in detail below with reference to FIG. 4, as shown in FIG. include:
  • the keyword sending module 11 is configured to send the keyword to the server when receiving the keyword of the input data query
  • the data receiving module 12 is configured to receive data sent by the server, where the data includes data queried by the server according to the keyword, and when the size of the data is within the load range of the application end, the data includes the query by the server. All data;
  • the sorting module 13 is configured to sort all the received data according to the sorting rule according to the received sorting rule
  • the quantity obtaining module 14 is configured to acquire a preset quantity of data displayed in one page
  • the paging module 15 is configured to page the sorted data when the preset quantity is less than the quantity of the received data.
  • the keyword received by the keyword sending module is generally input or selected by the user, and the keyword is the basis for querying the data by the peer server, and the user can input the keyword that needs to be searched in the browser.
  • the data received by the data receiving module includes all data queried by the server according to the keyword, and the data receiving module further includes:
  • the first determining unit is configured to: when receiving the data returned by the server, determine whether the size of the data sent back by the server is within the load range of the application end, and if yes, receive the data returned by the server, when the server returns When the size of the sent data exceeds the load range of the application end, the data sent by the server is refused, or the overloaded information is returned to the server, so that the server sends the queried data segment to the application end.
  • the size of the data of each segment is the maximum load that the application end can bear.
  • a preset module configured to pre-store a pre-stored value of a maximum load corresponding to the terminal device on the server side;
  • the second judging unit is configured to: when the server side queries the data that meets the requirement, determine whether the queried data is within the range of the maximum load of the corresponding terminal device, and if yes, send the queried data all at once To the corresponding terminal device, otherwise, the queried data is segmented, and the size of each piece of data does not exceed the maximum load that the corresponding terminal device can bear.
  • the load range of the application end is 0M to 10M, and specifically may be set to 8M.
  • the sorting module may be configured to sort according to the time when the data is accessed, sort by the number of times the data is accessed, and sort according to the location of the location of the data resource according to the location marked by the data resource. Comprehensive sorting according to multiple sorting criteria, and so on.
  • the sorting module sorts all the received data, that is, it is a full row.
  • the above data may be video data, commodity data of a transaction, picture data, audio data, or the like.
  • the method of implementing paging according to an embodiment of the present application may be employed as long as it is a solution that needs to be queried, accessed, and sorted by the network.
  • the amount of data displayed in one page can be set by the user himself or herself in the setting item, or can be set in advance by the programmer.
  • the user can set the maximum data displayed by a certain item on one page in the browser setting item.
  • the browser needs to provide the browser. Give the user the corresponding set permissions.
  • the number of data sorted by the sorting module is 57, and the number of preset data displayed in one page obtained by the data acquiring module is ten, and then The sorted data is paged.
  • the sorting module can divide the sorted 57 data into six pages, the first five pages of ten data per page, and the sixth page containing seven data. The top ten data is displayed on one page, and the remaining page numbers and the data corresponding to the page number are stored. In one embodiment, the remaining page numbers and The data displayed corresponding to each page number and the order in which the data is displayed are cached.
  • the keyword includes a type of data and a basis for sorting
  • the keyword sending module is specifically configured to:
  • the basis of the sorting includes the accessed amount of the data and/or the time of the most recent access
  • the data received by the data receiving module includes data that is queried by the server according to the type of the data and carries the sorting basis.
  • the basis for this sorting includes the amount of access to the data and/or the time of the most recent visit.
  • the sorting is based on the data automatically acquired according to the sorting rule input by the user.
  • the sorting rule received by the sorting module is included in the keyword when sorting from near to far according to the time of the last accessed time from the current time.
  • the sorting basis may be the last time the data is carried by the query.
  • the sorting rule received by the sorting module sorts according to the number of times the history is accessed
  • the sorting basis included in the keyword may be a query. The number of times the data is carried is visited.
  • the sorting basis included in the keyword needs to carry the time when the data was last accessed and the number of times of history visited.
  • the paging implementation device further includes:
  • An organization module for organizing received data into key values or arrays or large objects
  • a cache module for storing post-organization data in a cache.
  • the received data is organized into a key value by the organization module to organize the received data into a key-value, and the received data is stored in a database in the form of a key-value. Because the distributed storage system corresponding to the key-value has fast query speed, large amount of data storage, and high concurrency support, it is very suitable for querying through the primary key. If the received data does not need to be sent to other terminals, and the received data is as follows: At least one of: numbers, characters, English characters, punctuation, can store the received data as a key value.
  • the received data is organized into an array by the organization module, and since the data stored in the form of an array can realize continuous storage of the storage interval, the data is stored in the form of data.
  • the stored data saves storage space. If the application does not need to send the data to other terminals after receiving the queried data sent by the server, the received data can be organized into an array.
  • the received data can also be organized into large objects (large objects, lobs), because the data stored in the form of large objects is not easily lost during data transmission, when the user needs to After the received data is processed and sent to other terminals, the received data can be organized into large objects for storage, so that data loss or missing problems do not occur during the transmission process, and the transmission quality is guaranteed.
  • large objects large objects, lobs
  • the user can organize the received data into a corresponding form according to the actual needs and the type of the received data, so as to facilitate the subsequent operation process.
  • the cache module may store the organized data in a cache of the browser, where the browser includes but is not limited to an IE browser, a Firefox browser, a Google browser, a browsing browser, and the like. .
  • first and second in the first judging unit and the second judging unit are only to distinguish the two judging units, and are not used to limit which judging unit has higher priority or other restrictions. significance.
  • each module included in the paging implementation device may be implemented in whole or in part by software, hardware or a combination thereof.
  • each module in the paged implementation device may be a program segment for implementing a corresponding function.
  • the paging implementation device provided by the embodiment sends a data query keyword to the server, instructs the server to perform data query according to the keyword, and sends the queried data to the application end as soon as possible, so that The application can sort all the received data and display the sorted data in a page-by-page manner, so that when the user queries the data, the number of interactions between the application end and the peer server is reduced, and the server needs to respond to the data of the application end multiple times.
  • the paging implementation device described above can be implemented in the form of a computer readable instruction that can be executed on a computer device as shown in FIG.
  • a computer apparatus comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor implementing the computer readable instructions to implement the Paging implementation.
  • a computer apparatus comprising a memory and one or more processors having stored therein computer readable instructions that, when executed by one or more processors, cause one or more The processor performs the following steps: when receiving the keyword of the input data query, sending the keyword to the server; receiving the data sent by the server, the data includes the data queried by the server according to the keyword, when the size of the data is at the load of the application end Within the scope, the data includes all data queried by the server; according to the received sorting rules, all the received data are sorted according to the sorting rule; the preset number of data displayed in one page is obtained; and when preset The sorted data is paged when the number is less than the amount of data received.
  • the keyword includes a type of data and a basis for sorting
  • the one or more processors perform the step of transmitting the keyword to the server, including: sending the type and sorting basis of the data to the server; and receiving the server
  • the data includes data that the server queries according to the type of the data and carries the sorted basis.
  • the basis for the ordering includes the amount of access to the data and/or the time of the most recent access.
  • the one or more processors after the one or more processors perform the step of receiving data transmitted by the server, the one or more processors further perform the following steps:
  • the load on the application side ranges from 0M to 10M.
  • the keyword when the keyword of the data query is received, the keyword is sent to the server, so that the server performs data query according to the keyword, and sends all the data that is queried to the application.
  • the application end determines whether the size of the data sent by the server is within the processing capability of the application end when receiving the data, and if so, receives all the data sent by the server and sorts all the received data, and then The application side performs full-row data to be paged.
  • This solution saves the response time of multiple data requests and the waiting time of the user by receiving as much data as possible in one data request and performing full-row display.
  • the server since the sorting step is performed on the application side, the server does not need to sort the queried data, which reduces the load on the server side and improves the efficiency of page display after sorting.
  • FIG. 5 is a schematic diagram of an internal structure of a computer device according to an embodiment of the present application, which may be a server.
  • the computer device includes a processor coupled through a system bus, a non-volatile storage medium, an internal memory, an input device, a display screen, and a network interface.
  • the non-volatile storage medium of the computer device can store an operating system and computer readable instructions, which when executed, can cause the processor to perform a paging implementation method of various embodiments of the present application, For specific implementation of the method, reference may be made to the specific content of each embodiment in FIG. 1 to FIG. 3, and details are not described herein again.
  • the processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device.
  • the internal memory can store computer readable instructions that, when executed by the processor, cause the processor to perform a paged implementation.
  • the input device of the computer device is used for input of various parameters, the display screen of the computer device is used for display, and the network interface of the computer device is used for network communication.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • Non-volatile memories can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • one or more non-volatiles storing computer readable instructions are provided The readable storage medium, when executed by one or more processors, causes one or more processors to perform the steps of: transmitting a keyword to a server when receiving a keyword of the entered data query; receiving the server
  • the data sent includes the data that the server queries according to the keyword.
  • the data includes all the data queried by the server; according to the received sorting rule, all the received data are Sorting rules are sorted; the preset number of data displayed in one page is obtained; and when the preset number is less than the number of received data, the sorted data is paged.
  • the keyword includes a type of data and a basis for sorting
  • the one or more processors perform the step of transmitting the keyword to the server, including: sending the type and sorting basis of the data to the server; and receiving the server
  • the data includes data that the server queries according to the type of the data and carries the sorted basis.
  • the basis for the ordering includes the amount of access to the data and/or the time of the most recent access.
  • the one or more processors after the one or more processors perform the step of receiving data transmitted by the server, the one or more processors further perform the steps of: organizing the received data into a key value or an array or a large object; The organized data is stored in the cache.
  • the load on the application side ranges from 0M to 10M.
  • all or part of the processes in the foregoing embodiment methods may be completed by instructing related hardware by computer readable instructions, which may be stored in a computer readable storage medium.
  • the computer readable instructions may be stored in a storage medium of a computer system and executed by at least one processor in the computer system to implement a flow comprising an embodiment of the methods as described above.
  • the storage medium includes, but is not limited to, a magnetic disk, a USB flash drive, an optical disk, a read-only memory (ROM), and the like.
  • the keyword when the keyword of the data query is received, the keyword is sent to the server, so that the server performs data query according to the keyword, and sends all the data that is queried to the application end, and the application end receives the data.
  • the server By determining whether the size of the data sent by the server is in the application Within the processing capability of the terminal, if yes, it receives all the data sent by the server and sorts all the received data, and then displays the data after the full row in the application end, and the solution receives the data in one request.
  • the sorting step is performed on the application side, no server-side query is required. Sorting the data reduces the load on the server side and improves the efficiency of paging after sorting.

Landscapes

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

Abstract

一种分页的实现方法,包括:接收到输入的数据查询的关键字时,将该关键字发送给服务器(S101);接收该服务器发送的数据,该数据包括该服务器根据该关键字查询到的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据(S102);根据接收的排序规则,对接收到的全部数据按照该排序规则进行排序(S103);获取在一个页面中显示的数据的预设的数量(S104);及当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页(S105)。

Description

分页的实现方法、装置、计算机设备及存储介质
本申请要求于2017年08月28日提交中国专利局、申请号为2017107520369、发明名称为“分页的实现方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及分页的实现方法、装置、计算机设备及存储介质。
背景技术
在传统的页面展示的实现方法,尤其是排序展示的实现方法中,首先是由本端终端设备向对端服务器发送数据请求,对端服务器接收本端的数据请求之后,由对端服务器依据请求的内容进行查找、排序等操作,然后将排序的结果发送给本端进行显示,当用户点击下一页按钮时,本端会再次向服务器端发送数据请求,服务器需要再次进行响应。
传统技术方案的缺陷在我们浏览网页的时候就可以发现,经常会遇到这样的情况,当我们需要查询符合输入要求的信息时,一页中会优先显示排在前面的信息,当我们点击选择下一页时,需要等待一段时间网页页面才会将下一页的内容进行显示,这中间的时间就是本端在向服务器发送数据请求、服务器的处理及响应时间,当同时有很多客户端在向服务器发送请求时,这种方案一方面给服务器带来了较大的负担,另一方面与服务器的多次交互多次响应也增加了用户等待的时间。
发明内容
根据本申请的各种实施例,提供了一种分页的实现方法、装置、计算机设备及存储介质。
一种分页的实现方法,该方法包括:
接收到输入的数据查询的关键字时,将该关键字发送给服务器;
接收该服务器发送的数据,该数据包括该服务器根据该关键字查询到的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据;
根据接收的排序规则,对接收到的全部数据按照该排序规则进行排序;
获取在一个页面中显示的数据的预设的数量;及
当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
一种分页的实现装置,该装置包括:
关键字发送模块,用于接收到输入的数据查询的关键字时,将该关键字发送给服务器;
数据接收模块,用于接收该服务器发送的数据,该数据包括该服务器根据该关键字查询到的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据;
排序模块,用于根据接收的排序规则,对接收到的全部数据按照该排序规则进行排序;
数量获取模块,用于获取在一个页面中显示的数据的预设的数量;及
分页模块,用于当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收到输入的数据查询的关键字时,将关键字发送给服务器;
接收服务器发送的数据,数据包括服务器根据关键字查询到的数据,当数据的大小在应用端的负荷范围之内时,数据包括服务器查询到的全部数据;
根据接收的排序规则,对接收到的全部数据按照排序规则进行排序;
获取在一个页面中显示的数据的预设的数量;及
当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。计算机可读指令
一个或多个存储有计算机可读指令的非易失性可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收到输入的数据查询的关键字时,将关键字发送给服务器;
接收服务器发送的数据,数据包括服务器根据关键字查询到的数据,当数据的大小在应用端的负荷范围之内时,数据包括服务器查询到的全部数据;
根据接收的排序规则,对接收到的全部数据按照排序规则进行排序;
获取在一个页面中显示的数据的预设的数量;及
当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。计算机可读指令
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据本申请的一个实施例的分页的实现方法流程图;
图2为根据本申请的另一实施例的分页的实现方法流程图;
图3为根据本申请的又一实施例的分页的实现方法流程图;
图4为根据本申请的一个实施例的分页的实现装置的示范性结构框图;
图5为根据本申请的一个实施例的计算机设备的内部结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本发明所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语的限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本发明的范围的情况下,可以将第一判断元件称为第二判断元件,且类似地,可将第二判断元件称为第一判断元件。第一判断元件和第二判断元件两者都是判断元件,但其不是同一判断元件。
图1为根据本申请的一个实施例的分页的实现方法流程图,下面结合图1来详细描述根据本申请的一个实施例的分页的实现方法,该方法可应用于诸如PC个人电脑、移动终端、平板电脑之类的终端设备,如图1所示,该方法包括以下步骤S101~S105。
S101、接收到输入的数据查询的关键字时,将该关键字发送给服务器。
根据本实施例的一个示例,该关键字的输入操作一般由用户来执行,该关键字为对端服务器查询数据的依据,用户可以在浏览器中输入需要查找的关键字。
S102、接收该服务器发送的数据,该数据包括该服务器根据该关键字查询到的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据。
根据本实施例的一个示例,该数据包括服务器根据该关键字查询到的全部数据,该步骤S102中只接收在应用端的负荷范围之内的数据可以有以下两种实现方法:
其一是当接收到服务器返回查询到的数据时,判断服务器端回发的数据的大小是否在应用端的负荷范围之内,若是,则接收服务器端返回的数据,当服务器端回发的数据的大小超过应用端的负荷范围时,也可以有两种处理 方式,其中的一种方法是拒绝接收服务器端发送的数据,另一种方法是向服务器端返回超负荷的信息,以使得服务器端将查询到的数据分段发送给本端,根据本实施例的一个示例,每段的数据的大小为应用端可以承受的最大负荷。
其二是预先在服务器端存储预存的与终端设备对应的最大负荷的数值,在服务器端在查询到满足要求的数据时,判断查询到的数据是否在对应的终端设备的最大负荷的范围之内,若是,则将查询到的数据一次性全部发送给对应的终端设备,否则,对查询到的数据进行分段,每段数据的大小不超过对应的终端设备能够承受的最大负荷。
根据本实施例的另一示例,上述应用端的负荷范围为0M~10M,其中,M表示“兆”,具体可以设置为8M。
S103、根据接收的排序规则,对接收到的全部数据按照该排序规则进行排序。
根据本实施例的一个示例,该步骤中的排序规则包括但不限于按数据被访问的时间进行排序、按数据被访问的次数进行排序、按照该数据资源所标记的位置距离应用端位置的远近进行排序、按照多种排序依据进行综合排序等等。
在该步骤中,排序步骤是对接收到的所有数据进行排序,即做全排,该排序步骤是由应用端执行。
根据本实施例的另一示例,上述的数据可以是视频数据、交易的商品数据、图片数据、音频数据等等。只要是需要通过网络查询、访问以及需要做排序处理的方案都可以采用根据本申请的实施例提供的分页的实现方法。
S104、获取在一个页面中显示的数据的预设的数量。
在其中的一个实施例中,在一个页面中显示的数据的数量可以由用户自己在设置项中进行设置,也可以由程序员预先进行统一的设置。
在该步骤中,在一个页面中显示的数据的数量的一个使用场景例如,用户可以在浏览器设置项中设置某一个条目在一页中显示的最大数据,当然,如果在浏览器中用户可以根据自己的需要进行预设需要该浏览器提供给用户 对应的设置权限。
在其中的一个使用场景中,例如我们在做专利检索的事务时,在有些浏览器中,用户可以自己设置在一个页面中显示的检索出来的专利的项数,我们在淘宝购物搜索商品时,也可以自己在浏览器中设置一个页面中显示出来的商品或者商家的个数。
根据本实施例的一个示例,上述预设的在一个页面中显示的数据的数量可以是十个、十五个、二十个等等。
S105、当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
根据本实施例的一个使用场景例如,排序后的数据的数量有57个,通过上述步骤S104获取的预设的在一个页面中显示的数据的数量为十个,则需要对排序后的数据进行分页,根据本实施例的一个使用场景中,可以将排序后的57个数据分成六页,前五页每页十个数据,第六页包含七个数据,在第一页中显示排在前十的数据,将剩余的页码以及该页码对应显示的数据进行存储,在一个实施例中,可以将剩余的页码以及与每个页码对应显示的数据以及数据显示的顺序进行缓存。
本实施例提供的分页的实现方法通过向服务器端发送数据查询的关键字,指示服务器根据该关键字进行数据查询,并将查询到的数据尽可能多的一次性都发送给本端,以使得本端可以对接收到的所有数据进行排序,并将排序后的数据分页显示,使得用户在查询数据时,减少了本端与对端服务器的交互次数,减少了服务器需要多次响应本端的数据请求的响应时间,且用户在使用本实施例提供的分页的实现方法时,由于排序及分页步骤已经提前做好了,用户在点击下一页按钮进行页面切换时,系统的响应时间会非常快,减少了用户的等待时间,提高了分页排序的效率。
图2为根据本申请的另一实施例的分页的实现方法流程图,下面结合图2来详细描述根据本申请的另一实施例的分页的实现方法,上述关键字包括数据的类型以及排序的依据,如图2所示,该方法在包括上述步骤S103~S105 的基础上,上述步骤S101进一步包括:将所述数据的类型及排序依据发送给服务器。其中,所述接收所述服务器发送的数据的步骤S102中,所述的数据包括所述服务器根据所述数据的类型查询到的且携带有所述排序依据的数据。
在其中的一个实施例中,该步骤S101进一步包括以下步骤S201:
S201、接收到输入的数据查询的类型以及排序的依据时,将该数据的类型以及排序的依据发送给服务器。
上述步骤S202进一步为以下步骤S202:
S202、接收该服务器发送的数据,该数据包括该服务器根据该数据的类型查询到的且携带有该排序依据的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据。
根据本实施例的一个示例,该排序的依据包括该数据的被访问量和/或最近一次被访问的时间。该排序的依据根据用户输入的排序规则自动获取的数据,例如,用户在上述步骤S301中输入的排序规则为按照最近一次被访问的时间距离当前时间的由近到远进行排序时,该关键字中包含的排序依据可以是查询的数据携带的最近一次被访问的时间,当用户在上述步骤S301中输入的排序规则为按照历史被访问次数由多到少进行排序时,该关键字中包含的排序依据可以是查询的数据携带的历史被访问的次数。在另一个示例中,当需要对查询到的数据进行综合排序时,该关键字中包含的排序依据需要同时携带该数据最近一次被访问的时间以及被访问的历史次数。
图3为根据本申请的又一实施例的分页的实现方法流程图,下面结合图3来详细描述根据本申请的又一实施例的分页的实现方法,如图3所示,该方法在包括上述步骤S101~S105的基础上,还包括以下步骤S301和S302。
S301、将接收的数据组织成关键字值或数组或大对象。
根据本实施例的一个示例,该步骤中的将接收的数据组织成关键字数值即将接收的数据组织成key-value,将接收到的数据以键值(key-value)的形式存储在数据库中,由于key-value对应的分布式存储系统查询速度快、存放 数据量大、支持高并发,非常适合通过主键进行查询,如果不需要将接收到的数据发送给其它端,且接收的数据为以下情况中的至少一种:数字、字符、英文字符、标点,可以将接收到的数据存储为关键字值。
在另一个实施例中,可以将接收的数据组织成数组,由于以数组的形式进行存储的数据可以实现存储区间的连续存储,所以以数据形式存储的数据十分节省存储空间,如果应用端在接收到服务器端发送的查询到的数据后不再需要将这些数据发送给其它端时,则可以将接收的数据组织成数组。
在其它实施例中,还可以将接收到的数据组织成大对象((large object,lob),上述大对象为数据的一种组织方式,是Oracle数据库中的一种数据类型,由于以大对象形式存储的数据在数据传输的过程中不容易丢失,当用户需要将接收到的数据处理后发送给其它端时,可以将接收到的数据组织成大对象进行存储,以使得在传输的过程中不会出现数据丢失或者缺失的问题,保证传输质量。
在实际使用场景中,用户可以根据实际的需求以及接收到的数据的类型对接收到的数据组织成对应的形式,以便于后续的操作流程。
S302、将组织后的数据存储在缓存中。
根据本实施例的一个示例,可以将组织后的数据存储在浏览器的缓存中,其中的浏览器包括但不限于IE浏览器、火狐浏览器、谷歌浏览器、遨游浏览器等等。
本实施例通过提供将接收到的数据重新组织成关键字值或数组或大对象的方式,使得用户可以根据对数据的实际处理需求对接收到的数据进行对应的组织,以便于后续的处理流程,本实施例通过将组织后的数据存储在缓存中可以提高页面的显示速度,进一步减少在进行页面切换时需要等待的时间,提高数据的处理效率。
根据本实施例的一个示例,上述步骤S101~S302的标号并不用于限定本实施例中各个步骤的先后顺序,各个步骤的编号只是为了使得描述各个步骤时可以通用引用该步骤的标号进行便捷的指代,例如上述步骤S301和S302 可以在S103的步骤之前,也可以在步骤S103的步骤之后,只要各个步骤执行的顺序不影响本实施例的逻辑关系即表示在本申请请求保护的范围之内。
图4为根据本申请的一个实施例的分页的实现装置的示范性结构框图,下面结合图4来详细描述根据本申请的一个实施例的分页的实现装置10,如图4所示,该装置包括:
关键字发送模块11,用于接收到输入的数据查询的关键字时,将该关键字发送给服务器;
数据接收模块12,用于接收该服务器发送的数据,该数据包括该服务器根据该关键字查询到的数据,当该数据的大小在应用端的负荷范围之内时,该数据包括该服务器查询到的全部数据;
排序模块13,用于根据接收的排序规则,对接收到的全部数据按照该排序规则进行排序;
数量获取模块14,用于获取在一个页面中显示的数据的预设的数量;
分页模块15,用于当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
在其中的一个实施例中,关键字发送模块接收到的关键字一般由用户来输入或者选择,该关键字为对端服务器查询数据的依据,用户可以在浏览器中输入需要查找的关键字。
在另一实施例中,该数据接收模块接收到的数据包括服务器根据该关键字查询到的全部数据,该数据接收模块还包括:
第一判断单元,用于当接收到服务器返回查询到的数据时,判断服务器端回发的数据的大小是否在应用端的负荷范围之内,若是,则接收服务器端返回的数据,当服务器端回发的数据的大小超过应用端的负荷范围时,拒绝接收服务器端发送的数据,或向服务器端返回超负荷的信息,以使得服务器端将查询到的数据分段发送给应用端。根据本实施例的一个示例,每段的数据的大小为应用端可以承受的最大负荷。
还可以通过在服务器端设置预设模块和第二判断单元来控制接收到的数 据不超过应用端的最大负荷。
预设模块,用于预先在服务器端存储预存的与终端设备对应的最大负荷的数值;
第二判断单元,用于在服务器端在查询到满足要求的数据时,判断查询到的数据是否在对应的终端设备的最大负荷的范围之内,若是,则将查询到的数据一次性全部发送给对应的终端设备,否则,对查询到的数据进行分段,每段数据的大小不超过对应的终端设备能够承受的最大负荷。
根据本实施例的另一示例,上述应用端的负荷范围为0M~10M,具体可以设置为8M。
根据本实施例的另一示例,上述排序模块可以用于按数据被访问的时间进行排序、按数据被访问的次数进行排序、按照该数据资源所标记的位置距离应用端位置的远近进行排序、按照多种排序依据进行综合排序等等。
该排序模块是对接收到的所有数据进行排序,即做全排。
根据本实施例的另一示例,上述的数据可以是视频数据、交易的商品数据、图片数据、音频数据等等。只要是需要通过网络查询、访问以及需要做排序处理的方案都可以采用根据本申请的实施例提供的分页的实现方法。
在其中的一个实施例中,在一个页面中显示的数据的数量可以由用户自己在设置项中进行设置,也可以由程序员预先进行统一的设置。
在其中的一个实施例中,用户可以在浏览器设置项中设置某一个条目在一页中显示的最大数据,当然,如果在浏览器中用户可以根据自己的需要进行预设需要该浏览器提供给用户对应的设置权限。
根据本实施例的一个使用场景例如,通过排序模块进行排序后的数据的数量有57个,通过上述数据获取模块获取的预设的在一个页面中显示的数据的数量为十个,则需要对排序后的数据进行分页,根据本实施例的一个使用场景,该排序模块可以将排序后的57个数据分成六页,前五页每页十个数据,第六页包含七个数据,在第一页中显示排在前十的数据,将剩余的页码以及该页码对应显示的数据进行存储,在一个实施例中,可以将剩余的页码以及 与每个页码对应显示的数据以及数据显示的顺序进行缓存。
根据本实施例的另一个实施例,该关键字包括数据的类型以及排序的依据,该关键字发送模块具体用于:
将该数据的类型及排序依据发送给服务器,该排序的依据包括该数据的被访问量和/或最近一次被访问的时间;
该数据接收模块接收的数据包括该服务器根据该数据的类型查询到的且携带有该排序依据的数据。
该排序的依据包括该数据的被访问量和/或最近一次被访问的时间。该排序的依据根据用户输入的排序规则自动获取的数据,例如,通过排序模块接收的排序规则为按照最近一次被访问的时间距离当前时间的由近到远进行排序时,该关键字中包含的排序依据可以是查询的数据携带的最近一次被访问的时间,当通过排序模块接收到的排序规则为按照历史被访问次数由多到少进行排序时,该关键字中包含的排序依据可以是查询的数据携带的历史被访问的次数。在另一个示例中,当需要对查询到的数据进行综合排序时,该关键字中包含的排序依据需要同时携带该数据最近一次被访问的时间以及被访问的历史次数。
在一个实施例中,该分页的实现装置还包括:
组织模块,用于将接收的数据组织成关键字值或数组或大对象;
缓存模块,用于将组织后的数据存储在缓存中。
在其中的一个实施例中,通过组织模块将接收的数据组织成关键字数值即将接收的数据组织成key-value,将接收到的数据以键值(key-value)的形式存储在数据库中,由于key-value对应的分布式存储系统查询速度快、存放数据量大、支持高并发,非常适合通过主键进行查询,如果不需要将接收到的数据发送给其它端,且接收的数据为以下情况中的至少一种:数字、字符、英文字符、标点,可以将接收到的数据存储为关键字值。
在另一个实施例中,通过组织模块将接收的数据组织成数组,由于以数组的形式进行存储的数据可以实现存储区间的连续存储,所以以数据形式存 储的数据十分节省存储空间,如果应用端在接收到服务器端发送的查询到的数据后不再需要将这些数据发送给其它端时,则可以将接收的数据组织成数组。
在其它实施例中,还可以通过组织模块将接收到的数据组织成大对象((large object,lob),由于以大对象形式存储的数据在数据传输的过程中不容易丢失,当用户需要将接收到的数据处理后发送给其它端时,可以将接收到的数据组织成大对象进行存储,以使得在传输的过程中不会出现数据丢失或者缺失的问题,保证传输质量。
在实际使用场景中,用户可以根据实际的需求以及接收到的数据的类型对接收到的数据组织成对应的形式,以便于后续的操作流程。
根据本实施例的一个示例,该缓存模块可以将组织后的数据存储在浏览器的缓存中,其中的浏览器包括但不限于IE浏览器、火狐浏览器、谷歌浏览器、遨游浏览器等等。
其中上述第一判断单元及第二判断单元中的“第一”和“第二”的意义仅在于将两个判断单元加以区分,并不用于限定哪个判断单元的优先级更高或者其它的限定意义。
其中,该分页的实现装置中包括的各个模块可全部或部分通过软件、硬件或其组合来实现。在一个实施例中,该分页的实现装置中的各个模块可以是用于实现对应功能的程序段。
本实施例提供的分页的实现装置通过向服务器端发送数据查询的关键字,指示服务器根据该关键字进行数据查询,并将查询到的数据尽可能多的一次性都发送给应用端,以使得应用端可以对接收到的所有数据进行排序,并将排序后的数据分页显示,使得用户在查询数据时,减少了应用端与对端服务器的交互次数,减少了服务器需要多次响应应用端的数据请求的响应时间,且用户在使用本实施例提供的分页的实现方法时,由于排序及分页步骤已经提前做好了,用户在点击下一页按钮进行页面切换时,系统的响应时间会非常快,减少了用户的等待时间,提高了分页排序的效率。
上述分页的实现装置可以实现为一种计算机可读指令的形式,计算机可读指令可以在如图5所示的计算机设备上运行。
根据本申请的一个实施例提供的计算机设备,该计算机设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,该处理器执行该计算机可读指令时实现上述分页的实现方法。
在一个实施例中,提供了一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收到输入的数据查询的关键字时,将关键字发送给服务器;接收服务器发送的数据,数据包括服务器根据关键字查询到的数据,当数据的大小在应用端的负荷范围之内时,数据包括服务器查询到的全部数据;根据接收的排序规则,对接收到的全部数据按照排序规则进行排序;获取在一个页面中显示的数据的预设的数量;及当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
在一个实施例中,关键字包括数据的类型以及排序的依据,一个或多个处理器执行将关键字发送给服务器的步骤,包括:将数据的类型及排序依据发送给服务器;及接收服务器发送的数据的步骤中,数据包括服务器根据数据的类型查询到的且携带有排序依据的数据。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,排序的依据包括数据的被访问量和/或最近一次被访问的时间。
在一个实施例中,一个或多个处理器执行接收服务器发送的数据的步骤之后,一个或多个处理器还执行以下步骤:
将接收的数据组织成关键字值或数组或大对象;及
将组织后的数据存储在缓存中。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,应用端的负荷范围为0M~10M。
本实施例通过在接收到数据查询的关键字时,将该关键字发送给服务器,以供服务器根据该关键字进行数据查询,并将查询到的全部数据发送给应用 端,应用端在接收数据时通过判断服务器端发送的数据的大小是否为在应用端的处理能力之内,若是,则接收服务器发来的全部数据并对接收的全部数据进行排序,然后再将在应用端进行全排后的数据进行分页显示,本方案通过在一次数据请求中接收尽可能多的数据并进行全排显示,一方面节省了多次数据请求的响应时间及用户的等待请求的时间,另一方面由于排序步骤是在应用端进行的,不需要服务器端对查询到的数据进行排序,降低了服务器端的负荷,提高了排序后分页显示的效率。
图5为根据本申请的一个实施例的计算机设备的内部结构示意图,该计算机设备可以为服务器。参照图5,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、内存储器、输入装置、显示屏和网络接口。
其中,该计算机设备的非易失性存储介质可存储操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行本申请各实施例的一种分页的实现方法,该方法的具体实现过程可参考图1至3各实施例的具体内容,在此不再赘述。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该内存储器中可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种分页的实现方法。计算机设备的输入装置用于各个参数的输入,计算机设备的显示屏用于进行显示,计算机设备的网络接口用于进行网络通信。
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性 可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收到输入的数据查询的关键字时,将关键字发送给服务器;接收服务器发送的数据,数据包括服务器根据关键字查询到的数据,当数据的大小在应用端的负荷范围之内时,数据包括服务器查询到的全部数据;根据接收的排序规则,对接收到的全部数据按照排序规则进行排序;获取在一个页面中显示的数据的预设的数量;及当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
在一个实施例中,关键字包括数据的类型以及排序的依据,一个或多个处理器执行将关键字发送给服务器的步骤,包括:将数据的类型及排序依据发送给服务器;及接收服务器发送的数据的步骤中,数据包括服务器根据数据的类型查询到的且携带有排序依据的数据。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,排序的依据包括数据的被访问量和/或最近一次被访问的时间。
在一个实施例中,一个或多个处理器执行接收服务器发送的数据的步骤之后,一个或多个处理器还执行以下步骤:将接收的数据组织成关键字值或数组或大对象;及将组织后的数据存储在缓存中。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,应用端的负荷范围为0M~10M。
根据本实施例的一个示例,上述实施例方法中的全部或部分流程,可以通过计算机可读指令来指令相关的硬件来完成,所述计算机可读指令可存储于一计算机可读取存储介质中,如本申请实施例中,该计算机可读指令可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各方法的实施例的流程。该存储介质包括但不限于磁碟、优盘、光盘、只读存储记忆体(Read-Only Memory,ROM)等。
本实施例通过在接收到数据查询的关键字时,将该关键字发送给服务器,以供服务器根据该关键字进行数据查询,并将查询到的全部数据发送给应用端,应用端在接收数据时通过判断服务器端发送的数据的大小是否为在应用 端的处理能力之内,若是,则接收服务器发来的全部数据并对接收的全部数据进行排序,然后再将在应用端进行全排后的数据进行分页显示,本方案通过在一次数据请求中接收尽可能多的数据并进行全排显示,一方面节省了多次数据请求的响应时间及用户的等待请求的时间,另一方面由于排序步骤是在应用端进行的,不需要服务器端对查询到的数据进行排序,降低了服务器端的负荷,提高了排序后分页显示的效率。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种分页的实现方法,包括:
    接收到输入的数据查询的关键字时,将所述关键字发送给服务器;
    接收所述服务器发送的数据,所述数据包括所述服务器根据所述关键字查询到的数据,当所述数据的大小在应用端的负荷范围之内时,所述数据包括所述服务器查询到的全部数据;
    根据接收的排序规则,对接收到的全部数据按照所述排序规则进行排序;
    获取在一个页面中显示的数据的预设的数量;及
    当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
  2. 根据权利要求1所述的方法,其特征在于,所述关键字包括数据的类型以及排序的依据,所述将所述关键字发送给服务器,包括:
    将所述数据的类型及排序依据发送给服务器;及
    所述接收所述服务器发送的数据的步骤中,所述数据包括所述服务器根据所述数据的类型查询到的且携带有所述排序依据的数据。
  3. 根据权利要求2所述的方法,其特征在于,所述排序的依据包括所述数据的被访问量和/或最近一次被访问的时间。
  4. 根据权利要求1所述的方法,其特征在于,在所述接收所述服务器发送的数据之后,还包括:
    将接收的数据组织成关键字值或数组或大对象;及
    将组织后的数据存储在缓存中。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述应用端的负荷范围为0M~10M。
  6. 一种分页的实现装置,所述装置包括:
    关键字发送模块,用于接收到输入的数据查询的关键字时,将所述关键字发送给服务器;
    数据接收模块,用于接收所述服务器发送的数据,所述数据包括所述服务器根据所述关键字查询到的数据,当所述数据的大小在应用端的负荷范围 之内时,所述数据包括所述服务器查询到的全部数据;
    排序模块,用于根据接收的排序规则,对接收到的全部数据按照所述排序规则进行排序;
    数量获取模块,用于获取在一个页面中显示的数据的预设的数量;及
    分页模块,用于当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
  7. 根据权利要求6所述的装置,其特征在于,所述关键字包括数据的类型以及排序的依据,所述关键字发送模块具体用于:
    将所述数据的类型及排序依据发送给服务器;及
    所述数据接收模块接收的数据包括所述服务器根据所述数据的类型查询到的且携带有所述排序依据的数据。
  8. 根据权利要求7所述的装置,其特征在于,所述排序的依据包括所述数据的被访问量和/或最近一次被访问的时间。
  9. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    组织模块,用于将接收的数据组织成关键字值或数组或大对象;及
    缓存模块,用于将组织后的数据存储在缓存中。
  10. 根据权利要求6至9中任一项所述的装置,其特征在于,所述应用端的负荷范围为0M~10M。
  11. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收到输入的数据查询的关键字时,将所述关键字发送给服务器;
    接收所述服务器发送的数据,所述数据包括所述服务器根据所述关键字查询到的数据,当所述数据的大小在应用端的负荷范围之内时,所述数据包括所述服务器查询到的全部数据;
    根据接收的排序规则,对接收到的全部数据按照所述排序规则进行排序;
    获取在一个页面中显示的数据的预设的数量;及
    当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述关键字包括数据的类型以及排序的依据,所述一个或多个处理器执行所述将所述关键字发送给服务器的步骤,包括:
    将所述数据的类型及排序依据发送给服务器;及
    所述接收所述服务器发送的数据的步骤中,所述数据包括所述服务器根据所述数据的类型查询到的且携带有所述排序依据的数据。
  13. 根据权利要求12所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,所述排序的依据包括所述数据的被访问量和/或最近一次被访问的时间。
  14. 根据权利要求11所述的计算机设备,其特征在于,所述一个或多个处理器执行所述接收所述服务器发送的数据的步骤之后,所述一个或多个处理器还执行以下步骤:
    将接收的数据组织成关键字值或数组或大对象;及
    将组织后的数据存储在缓存中。
  15. 根据权利要求11至14中任一项所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,所述应用端的负荷范围为0M~10M。
  16. 一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收到输入的数据查询的关键字时,将所述关键字发送给服务器;
    接收所述服务器发送的数据,所述数据包括所述服务器根据所述关键字查询到的数据,当所述数据的大小在应用端的负荷范围之内时,所述数据包括所述服务器查询到的全部数据;
    根据接收的排序规则,对接收到的全部数据按照所述排序规则进行排序;
    获取在一个页面中显示的数据的预设的数量;及
    当预设的数量小于接收到的数据的数量时,对排序后的数据进行分页。
  17. 根据权利要求16所述的存储介质,其特征在于,所述关键字包括数据的类型以及排序的依据,所述一个或多个处理器执行所述将所述关键字发送给服务器的步骤,包括:
    将所述数据的类型及排序依据发送给服务器;及
    所述接收所述服务器发送的数据的步骤中,所述数据包括所述服务器根据所述数据的类型查询到的且携带有所述排序依据的数据。
  18. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,所述排序的依据包括所述数据的被访问量和/或最近一次被访问的时间。
  19. 根据权利要求16所述的存储介质,其特征在于,所述一个或多个处理器执行所述接收所述服务器发送的数据的步骤之后,所述一个或多个处理器还执行以下步骤:
    将接收的数据组织成关键字值或数组或大对象;及
    将组织后的数据存储在缓存中。
  20. 根据权利要求16至19中任一项所述的存储介质,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,所述应用端的负荷范围为0M~10M。
PCT/CN2017/107991 2017-08-28 2017-10-27 分页的实现方法、装置、计算机设备及存储介质 WO2019041500A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710752036.9A CN107679077B (zh) 2017-08-28 2017-08-28 分页的实现方法、装置、计算机设备及存储介质
CN201710752036.9 2017-08-28

Publications (1)

Publication Number Publication Date
WO2019041500A1 true WO2019041500A1 (zh) 2019-03-07

Family

ID=61134563

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107991 WO2019041500A1 (zh) 2017-08-28 2017-10-27 分页的实现方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN107679077B (zh)
WO (1) WO2019041500A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509529A (zh) * 2018-03-14 2018-09-07 武汉斗鱼网络科技有限公司 数据分页排序方法、装置及可读存储介质
CN108664304A (zh) * 2018-05-03 2018-10-16 广州腾讯科技有限公司 应用程序处理方法、装置、存储介质和计算机设备
CN109885729B (zh) * 2019-02-20 2021-07-20 北京奇艺世纪科技有限公司 一种显示数据的方法、装置及系统
CN111026962B (zh) * 2019-12-03 2023-09-22 泰康保险集团股份有限公司 层级关系查询响应时间降低方法、服务器和用户前端
CN112306604B (zh) * 2020-08-21 2022-09-23 海信视像科技股份有限公司 一种传输文件的进度显示方法及显示设备
CN114238458A (zh) * 2022-02-23 2022-03-25 国网北京市电力公司 数据查询方法、其装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000611A (zh) * 2006-08-29 2007-07-18 曾文均 利用互联网为公众提供和查询信息的方法
CN103218443A (zh) * 2013-04-22 2013-07-24 中山大学 一种面向博客网页的网页检索系统及方法
CN103678576A (zh) * 2013-12-11 2014-03-26 华中师范大学 基于动态语义分析的全文检索系统
CN104063523A (zh) * 2014-07-21 2014-09-24 焦点科技股份有限公司 一种电子商务搜索评分与排名的方法及系统
CN105760457A (zh) * 2016-02-05 2016-07-13 成都康赛信息技术有限公司 一种基于MongoDB的数据分页优化方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046807B (zh) * 2006-03-31 2010-04-14 华为技术有限公司 存储数据已读信息的方法及装置
CN102591969A (zh) * 2011-12-31 2012-07-18 北京百度网讯科技有限公司 基于用户历史行为提供搜索结果的方法及服务器
CN104216902B (zh) * 2013-05-31 2018-10-02 西门子公司 一种基于服务器分页的分页数据装载方法、装置和系统
CN105468652A (zh) * 2014-09-12 2016-04-06 北大方正集团有限公司 一种检索排序方法及系统
CN106202411A (zh) * 2016-07-11 2016-12-07 北京搜狗科技发展有限公司 一种搜索结果展示方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000611A (zh) * 2006-08-29 2007-07-18 曾文均 利用互联网为公众提供和查询信息的方法
CN103218443A (zh) * 2013-04-22 2013-07-24 中山大学 一种面向博客网页的网页检索系统及方法
CN103678576A (zh) * 2013-12-11 2014-03-26 华中师范大学 基于动态语义分析的全文检索系统
CN104063523A (zh) * 2014-07-21 2014-09-24 焦点科技股份有限公司 一种电子商务搜索评分与排名的方法及系统
CN105760457A (zh) * 2016-02-05 2016-07-13 成都康赛信息技术有限公司 一种基于MongoDB的数据分页优化方法

Also Published As

Publication number Publication date
CN107679077A (zh) 2018-02-09
CN107679077B (zh) 2020-03-24

Similar Documents

Publication Publication Date Title
WO2019041500A1 (zh) 分页的实现方法、装置、计算机设备及存储介质
JP6152226B2 (ja) キャッシュクエリ要求の生成
WO2017215175A1 (zh) 页面处理方法、装置、终端及服务器
US11157576B2 (en) Method, system and terminal for performing search in a browser
CN108255952B (zh) 数据加载方法、装置、存储介质及电子设备
US10061806B2 (en) Presenting previously selected search results
US11775575B2 (en) Systems and methods of performing searches within a text input application
CN107329976B (zh) 网页分页方法、装置、计算机设备及计算机可读存储介质
WO2019233095A1 (zh) 一种信息展示方法及其终端设备、网络设备
CN107315753B (zh) 跨多数据库的分页方法和装置
RU2693193C1 (ru) Автоматизированное извлечение информации
CN109885729B (zh) 一种显示数据的方法、装置及系统
US9798779B2 (en) Obtaining desired web content for a mobile device
JP2022106948A (ja) 情報表示方法、装置、電子機器、記憶媒体およびコンピュータプログラム
CN113656737A (zh) 网页内容展示方法、装置、电子设备以及存储介质
CN112016017A (zh) 确定特征数据的方法和装置
CN111078736A (zh) 一种数据聚合处理方法、装置、终端及存储介质
US10044804B2 (en) Enabling users to specify an electronic resource for viewing based on prior accessed electronic resources
CN112631752B (zh) 一种基于操作优先度的列表操作方法及装置
CN113268279B (zh) 一种数据处理方法及装置
CN115687376A (zh) 数据处理方法、装置、电子设备及存储介质
CN114547395A (zh) 搜索方法及装置
CN117390313A (zh) 页面处理方法、装置、计算机设备、存储介质和产品
CN117828208A (zh) 显示目标页面图像元素切换方法、装置、设备及介质
CN116775186A (zh) 页面数据处理方法、装置、计算机设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 29.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17923296

Country of ref document: EP

Kind code of ref document: A1