A page query method and device, electronic equipment and storage medium

By storing randomly shuffled page numbers in the cache, data can be retrieved directly from the cache list, solving the problem of low efficiency in random pagination queries in existing technologies, and achieving efficient random queries and improved user experience.

CN116244331BActive Publication Date: 2026-04-14CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-01-11
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, random pagination queries are inefficient because random sorting of the full dataset and storing massive amounts of data in temporary tables consume a lot of resources, resulting in low query efficiency.

Method used

By storing the page numbers after the pages have been randomly shuffled in the cache, reading the page numbers from the cache list and querying the data from the database, the random sorting of the full data and temporary table storage are avoided, and the random page data is obtained directly from the cache list.

Benefits of technology

It enables efficient random queries, improves query efficiency, reduces resource consumption, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244331B_ABST
    Figure CN116244331B_ABST
Patent Text Reader

Abstract

The application discloses a page query method and device, electronic equipment and storage medium, and belongs to the technical field of data processing. The method comprises the following steps: receiving a page query request sent by a terminal, wherein the page query request comprises a page identifier and a first page number; reading a second page number equal to the first page number from a cached list, wherein the list stores the page numbers of pages corresponding to the page identifier after the order of the pages is randomly disturbed; querying a plurality of pieces of data of the page on the second page number from a database; and sending the plurality of pieces of data to the terminal for display. In this way, when the terminal requests data of the page on the first page, the actual acquired data is the data of the page on the second page, and the data on the second page is not necessarily the data of the page on any page, so that the effect of randomly acquiring page data is achieved. The full-amount data on the page does not need to be randomly sorted, and the temporary table does not need to be used to store the massive data, so that the random query efficiency is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a page query method, apparatus, electronic device, and storage medium. Background Technology

[0002] In some page display scenarios, in order to achieve a better page display effect, it is desirable for the data on the page to have a certain degree of randomness.

[0003] In related technologies, to achieve random queries on a page, the database first uses its built-in random function to randomly sort all the data on the page, stores the sorting results in a temporary in-memory table, and then performs paginated queries on the temporary in-memory table. Since randomly sorting all the data requires scanning a large number of rows, consuming significant resources, this random query is inefficient. Furthermore, storing massive amounts of data in a temporary table itself is also inefficient. Summary of the Invention

[0004] This application provides a page query method, apparatus, electronic device, and storage medium to solve the problem of low query efficiency in implementing random pagination queries in related technologies.

[0005] In a first aspect, embodiments of this application provide a page query method, including:

[0006] The receiving terminal sends a page query request, which includes at least a page identifier and a first page number;

[0007] Read the second page number whose position number is equal to the first page number from the cached list. The list stores the page numbers of the pages corresponding to the page identifier after the order of the pages has been randomly shuffled.

[0008] Retrieve multiple records of the page at the second page number from the database;

[0009] The multiple data entries are sent to the terminal for display.

[0010] In some embodiments, the page query request further includes the number of items displayed per page, and also includes:

[0011] Before reading the second page number, whose position number is equal to the first page number, from the cached list, query the total number of data entries on the page corresponding to the page identifier;

[0012] The total number of pages for the page is determined based on the total number of data entries and the number of entries displayed per page;

[0013] Determine that the total number of pages is equal to the length of the list.

[0014] In some embodiments, before reading the page number at the position where the position number is equal to the page number from the cached list, the method further includes:

[0015] Confirm that the list is within its validity period.

[0016] In some embodiments, it also includes:

[0017] If it is determined that the total number of pages is not equal to the length of the list, or the list is not within its validity period, then the page numbers in the list are cleared.

[0018] The page numbers included in the total number of pages are randomly shuffled and stored in the list.

[0019] In some embodiments, the page numbers of the page, excluding the maximum page number, are randomly shuffled, and the maximum page number is stored at the end of the list.

[0020] In some embodiments, sending the plurality of data items to the terminal for display includes:

[0021] The multiple data entries are randomly shuffled and then sent to the terminal for display.

[0022] Secondly, embodiments of this application provide a page query device, including:

[0023] A receiving module is used to receive a page query request sent by a terminal, wherein the page query request contains at least a page identifier and a first page number;

[0024] The reading module is used to read the second page number, whose position number is equal to the first page number, from the cached list. The list stores the page numbers of the pages corresponding to the page identifier after the order of the pages has been randomly shuffled.

[0025] The query module is used to query multiple records of data for the page at the second pagination number from the database;

[0026] The sending module is used to send the multiple data items to the terminal for display.

[0027] In some embodiments, the page query request further includes the number of items displayed per page, and also includes a checking module for:

[0028] Before reading the second page number, whose position number is equal to the first page number, from the cached list, query the total number of data entries on the page corresponding to the page identifier;

[0029] The total number of pages for the page is determined based on the total number of data entries and the number of entries displayed per page;

[0030] Determine that the total number of pages is equal to the length of the list.

[0031] In some embodiments, an inspection module is also included, for:

[0032] Before reading the page number at the position where the position number is equal to the page number from the cached list, determine that the list is within its validity period.

[0033] In some embodiments, the inspection module is further configured to:

[0034] If it is determined that the total number of pages is not equal to the length of the list, or the list is not within its validity period, then the page numbers in the list are cleared.

[0035] The page numbers included in the total number of pages are randomly shuffled and stored in the list.

[0036] In some embodiments, the page numbers of the page, excluding the maximum page number, are randomly shuffled, and the maximum page number is stored at the end of the list.

[0037] In some embodiments, the sending module is specifically used for:

[0038] The multiple data entries are randomly shuffled and then sent to the terminal for display.

[0039] Thirdly, embodiments of this application provide an electronic device, including: at least one processor, and a memory communicatively connected to the at least one processor, wherein:

[0040] The memory stores instructions that can be executed by at least one processor to enable the at least one processor to perform the page query method described above.

[0041] Fourthly, embodiments of this application provide a storage medium in which, when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to execute any of the above-described page query methods.

[0042] Fifthly, embodiments of this application provide a computer program product that, when invoked and executed by an electronic device, causes the electronic device to execute any of the above-described page query methods.

[0043] In this embodiment, a page query request is received from a receiving terminal. The request includes at least a page identifier and a first page number. A second page number, whose position number equals the first page number, is read from a cached list. The list stores page numbers of the page corresponding to the page identifier after random shuffling. Multiple data entries for the page at the second page number are retrieved from the database and sent to the terminal for display. Thus, when the terminal requests data for the first page, it actually retrieves data for the second page. The data for the second page is not necessarily from any specific page, exhibiting a degree of randomness, thereby achieving the effect of randomly retrieving page data. Since it is not necessary to randomly sort all the data on the page or use a temporary table to store massive amounts of data, the random query efficiency is high. Attached Figure Description

[0044] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0045] Figure 1 This is a schematic diagram illustrating an application scenario of a page query method provided in an embodiment of this application;

[0046] Figure 2 A flowchart illustrating a page query method provided in this application embodiment;

[0047] Figure 3 A flowchart illustrating yet another page query method provided in this application embodiment;

[0048] Figure 4 This is a schematic diagram of the structure of a page query device provided in an embodiment of this application;

[0049] Figure 5 This is a schematic diagram of the hardware structure of an electronic device for implementing a page query method, provided in an embodiment of this application. Detailed Implementation

[0050] To address the problem of low query efficiency in implementing random pagination queries in related technologies, embodiments of this application provide a page query method, apparatus, electronic device, and storage medium.

[0051] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Unless otherwise specified, the embodiments and features described herein can be combined with each other. Furthermore, the acquisition, storage, use, and processing of data in the embodiments of this application comply with the relevant provisions of national laws and regulations.

[0052] In some marketing campaigns, ranking lists often appear, sorted according to certain rules, to display the ranking of data such as videos and financial products. The higher the ranking, the more exposure opportunities it receives. Additionally, during campaign planning, to ensure more promotional content is seen by users, a random recommendation section may be added, where relevant content is randomly retrieved and displayed to users. When the recommended content is extensive, pagination may be necessary, creating a need for paginated random search functionality.

[0053] To simultaneously achieve random sorting and pagination, this application provides a page query method. This method utilizes a cached list to store page numbers after the page order has been randomly shuffled. When a terminal requests data on the first page, it reads the second page number, whose position number equals the first page number, from the list. Then, it queries the database for multiple records of data on the second page and sends them to the terminal. Thus, when the terminal requests data on the first page, it actually retrieves data from the second page, and the data on the second page may not necessarily be from any specific page, achieving the effect of randomly retrieving page data. Since it avoids randomly sorting all the data and storing massive amounts of data in temporary tables, the random query efficiency is high.

[0054] After introducing the inventive concept of this application, the application scenarios of the embodiments of this application will be described.

[0055] Figure 1 This is an application scenario diagram of a page query method provided in an embodiment of this application, including a terminal 100 and a server 200.

[0056] Terminal 100 can be any smart device such as a smartphone, tablet, or portable personal computer. Various apps can be installed on terminal 100. For example, in this embodiment, the app installed on terminal 100 can be a video application. Users can upload videos through the app, and the app can also receive and display videos recommended and approved by server 200 for users to browse and watch.

[0057] Server 200 can provide various network services to terminal 100. For different applications on terminal 100, server 200 can be regarded as a backend server providing corresponding network services. For example, in this embodiment of the application, server 200 can receive videos uploaded by terminal 100, review the videos, and return the review results. For another example, server 200 can recommend various approved videos to terminal 100 for users to watch.

[0058] Among them, server 200 can be a single server, a server cluster consisting of several servers, or a cloud computing center.

[0059] Specifically, server 200 may include processor 210 (Center Processing Unit, CPU), memory 220, input device 230 and output device 240, etc. Input device 230 may include keyboard, mouse, touch screen, etc., and output device 240 may include display device, such as liquid crystal display (LCD), cathode ray tube (CRT), etc.

[0060] The memory 220 may include read-only memory (ROM) and random access memory (RAM), and provides the processor 210 with program instructions and data stored in the memory 220. In this embodiment, the memory 220 may be used to store the program of any video review method in this embodiment.

[0061] The processor 210 invokes program instructions stored in the memory 220, and the processor 210 executes the steps of any page query method in the embodiments of this application according to the obtained program instructions.

[0062] Terminal 100 and server 200 are connected via the Internet to enable communication between them. Optionally, the Internet uses standard communication technologies and / or protocols. The Internet is typically the Internet, but can also be any network, including but not limited to any combination of Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, wired or wireless networks, private networks or virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0063] It is worth noting that the application architecture diagrams in this application are for the purpose of more clearly illustrating the technical solutions in this application, and do not constitute a limitation on the technical solutions provided in this application, nor are they limited to video. For other application architectures and business applications, as long as there is a need for random pagination queries, the technical solutions provided in this application are also applicable to similar problems.

[0064] After introducing the application scenarios of the embodiments of this application, the page query method proposed in this application will be described below with specific embodiments.

[0065] Figure 2 A flowchart illustrating a page query method provided in this application embodiment, which can be applied to... Figure 1 The method includes the following steps in the server.

[0066] In step 201, a page query request is sent by the receiving terminal, and the page query request contains at least a page identifier and a first page number.

[0067] The page identifier indicates which page the terminal is currently requesting data from, and the first page number indicates which page the terminal is currently requesting data from.

[0068] In step 202, the second page number, whose position number is equal to the first page number, is read from the cached list. The list stores the page numbers of the pages corresponding to the page identifiers after the page numbers have been randomly shuffled.

[0069] Suppose a page contains 5 paginations, numbered 1, 2, 3, 4, and 5. And suppose that these pagination numbers are randomly shuffled in a certain order, resulting in the sequence 2, 5, 4, 1, and 3. Then, the data stored in the cached list would be {2, 5, 4, 1, 3}.

[0070] If the first page number is 1, then the second page number read from the cache with a position number equal to 1 is 2; if the first page number is 2, then the second page number read from the cache with a position number equal to 2 is 5; if the first page number is 3, then the second page number read from the cache with a position number equal to 3 is 4, and so on.

[0071] In step S203, multiple records of data on the second page number are retrieved from the database.

[0072] In step S204, the queried data is sent to the terminal for display.

[0073] In some embodiments, the order of multiple queried data entries can be randomly shuffled before being sent to the terminal. This way, even if the query involves multiple data entries on the same page, the different display order of these data entries on the page can give the user the experience of finding new data, thereby further enhancing the randomness of the page query.

[0074] Figure 3 A flowchart illustrating another page query method provided in this application embodiment, which can be applied to... Figure 1 The method includes the following steps in the server.

[0075] In step 301, a page query request is received from the terminal. The page query request includes a page identifier, a first page number, and the number of items displayed per page.

[0076] In step 302, the total number of data entries on the page corresponding to the page identifier is queried.

[0077] In step 303, the total number of pages is determined based on the total number of data entries and the number of entries displayed per page.

[0078] In step 304, it is determined whether the list corresponding to the page identifier in the cache is within the validity period. If yes, proceed to step 305; otherwise, proceed to step 306.

[0079] The list stores the page numbers of the pages corresponding to the page identifiers after the page order has been randomly shuffled.

[0080] By setting an expiration date for the list, the page numbers can be shuffled after the expiration date, and the page number order in the list can be updated. This allows data requested by a user on the same page to be randomly assigned to data on different pages, further improving the randomness of page queries.

[0081] In step 305, it is determined whether the total number of pages is equal to the length of the list. If not, proceed to step 306; if yes, proceed to step 308.

[0082] When the total number of pages equals the length of the list, it can be determined that the data on the page has not changed within the current validity period, and data can be queried based on the current list; when the total number of pages does not equal the length of the list, it can be determined that the data on the page has changed within the current validity period, and the list needs to be updated in time before data can be queried.

[0083] In step S306, the page numbers in the list are cleared.

[0084] In step S307, the page numbers included in the total number of pages are randomly shuffled and stored in a list.

[0085] In step 308, the second page number, whose position number is equal to the first page number, is read from the cached list.

[0086] In step S309, multiple records of data on the second page number are retrieved from the database.

[0087] In step S310, the queried data is sent to the terminal for display.

[0088] Furthermore, considering that for paginated pages, if the last pagination is randomly selected prematurely when it is not full of data, it may lead to a poor user experience. Therefore, during each randomization, only the pagination numbers (excluding the maximum pagination number) are randomly selected, and the maximum pagination number is stored at the end of the list. This ensures that the last pagination is indeed retrieved when the terminal requests data at the maximum pagination number, thus preventing the last pagination from being randomly selected prematurely.

[0089] The solutions of the embodiments of this application will be described below with reference to specific examples.

[0090] The solution in this application includes the following steps:

[0091] Step 1: Each time the server queries data on a specific page in the terminal, it uses an SQL statement to count the total number of data entries on that page. If the total number of data entries is 0, it returns a message to the terminal indicating that the page is empty; otherwise, it proceeds to Step 2.

[0092] The second step is to calculate the total number of pages using the formula: Total number of pages = ((Total number of data entries - 1) / Number of entries displayed per page) + 1. The number of entries displayed per page can be sent to the server by the terminal during the query.

[0093] If the current cache does not contain a list corresponding to a page, a new list corresponding to the page can be created in the cache, and the page numbers from 1 to the total number of pages can be randomly shuffled and inserted into the list corresponding to the page.

[0094] If the list corresponding to the currently cached page is not within its validity period, the page numbers from 1 to the total number of pages can be randomly shuffled, and then the randomly ordered page numbers can be inserted into the list to update the page number order in the list. In this way, when a validity period ends, the list will store new randomly shuffled page numbers, thereby achieving randomness in the query results through the randomness of the page numbers.

[0095] If the list corresponding to the currently cached page is still valid, the calculated total number of pages can be compared with the length of the list. If they are equal, proceed to step three; if they are not equal, the list can be cleared, and then the page numbers from 1 to the latest total number of pages can be shuffled and inserted into the list before proceeding to step three. To ensure atomicity, deletion and insertion operations can be implemented using Lua scripts.

[0096] Because the database may add or delete data on a page, the total number of pages and the list length may differ in different queries. Assuming the calculated total number of pages is 5 and the list length is 3, we can first delete the original page numbers in the list, then randomly shuffle the numbers 1 to 5 and store them again in the cached list.

[0097] Third, when querying, the terminal will pass in a pagination number to indicate which page of data is being retrieved. To achieve randomness in the query results, a pagination number can be retrieved from the cached list as the actual page number to be queried. Then, the data at that retrieved pagination number can be retrieved from the database.

[0098] Suppose the data stored in the list is {5, 2, 1, 4, 3}, and suppose that when a user queries the data on the page, they want to see the first three pages of data. That is, the terminal sends three page numbers, pageNo (page number variable) 1, 2, and 3, to the server. Based on these three page numbers, the server can retrieve list[0], list[1], and list[2] from the cached list (note: the list order starts from 0, which just satisfies the formula for retrieving list[pageNo-1]), thus obtaining the three page numbers 5, 2, and 1. After that, the database can be queried based on these three page numbers. In the end, the user actually gets the data from the three pages 5, 2, and 1.

[0099] Fourth, since the total number of pages remains constant within a validity period, different queries will return the same page number data. To further enhance the randomness of the query results, after retrieving the data for each page from the database, the server can use a sorting function to shuffle the data on that page before sending it to the terminal. This way, even if users access data on the same page number, the different display order of the data on the page will give users different impressions of the query results, thus further enhancing the randomness of the query results.

[0100] For example, if two users access data on pages 5, 2, and 1 within a given period, the results they see will be different because a random function is used to shuffle the data on each page.

[0101] Furthermore, in paginated queries, the actual number of items displayed on the last page is less than or equal to the number of items displayed per page. When the data volume is relatively small, if users are randomly assigned the last page number when querying the first few pages, it will negatively impact the user experience. Therefore, it can be stipulated that only the page numbers of all pages except the last page are randomly shuffled each time, and the page number of the last page is used as the last element of the list. This ensures that users actually receive the data from the last page when querying, avoiding the possibility of the last page number being randomly assigned prematurely. Moreover, this method is applicable to both click-based and swipe-based pagination pages, offering good versatility.

[0102] In this embodiment, random sorting and pagination are implemented simultaneously. Random query results are not stored in a temporary in-memory table, and the inefficient database random function is avoided from being used to randomly sort all the data, thus saving storage space and improving the user's query experience.

[0103] When the method provided in the embodiments of this application is implemented in software, hardware, or a combination of software and hardware, the electronic device may include multiple functional modules, and each functional module may include software, hardware, or a combination thereof.

[0104] Based on the same technical concept, this application also provides a page query device. The principle of the page query device in solving the problem is similar to that of the page query method described above. Therefore, the implementation of the page query device can refer to the implementation of the page query method, and the repeated parts will not be described again.

[0105] Figure 4 This is a schematic diagram of a page query device provided in an embodiment of the present application, including a receiving module 401, a reading module 402, a query module 403, and a sending module 404.

[0106] The receiving module 401 is used to receive a page query request sent by the terminal, wherein the page query request includes at least a page identifier and a first page number;

[0107] The reading module 402 is used to read the second page number whose position number is equal to the first page number from the cached list, wherein the list stores the page numbers of the pages corresponding to the page identifier after the order of the pages is randomly shuffled;

[0108] Query module 403 is used to query multiple data entries of the page at the second page number from the database;

[0109] The sending module 404 is used to send the multiple data items to the terminal for display.

[0110] In some embodiments, the page query request further includes the number of items displayed per page, and also includes a checking module 405, used for:

[0111] Before reading the second page number, whose position number is equal to the first page number, from the cached list, query the total number of data entries on the page corresponding to the page identifier;

[0112] The total number of pages for the page is determined based on the total number of data entries and the number of entries displayed per page;

[0113] Determine that the total number of pages is equal to the length of the list.

[0114] In some embodiments, an inspection module 405 is further included, for:

[0115] Before reading the page number at the position where the position number is equal to the page number from the cached list, determine that the list is within its validity period.

[0116] In some embodiments, the inspection module 405 is further configured to:

[0117] If it is determined that the total number of pages is not equal to the length of the list, or the list is not within its validity period, then the page numbers in the list are cleared.

[0118] The page numbers included in the total number of pages are randomly shuffled and stored in the list.

[0119] In some embodiments, the page numbers of the page, excluding the maximum page number, are randomly shuffled, and the maximum page number is stored at the end of the list.

[0120] In some embodiments, the sending module 404 is specifically used for:

[0121] The multiple data entries are randomly shuffled and then sent to the terminal for display.

[0122] The module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, other division methods are possible. Furthermore, the functional modules in each embodiment of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. Coupling between modules can be achieved through interfaces, typically electrical communication interfaces, but mechanical interfaces or other types of interfaces are also possible. Therefore, modules described as separate components may or may not be physically separate; they can be located in one place or distributed across different locations on the same or different devices. The integrated modules described above can be implemented in hardware or as software functional modules.

[0123] Having introduced the page query method and apparatus according to exemplary embodiments of this application, we will now introduce an electronic device according to another exemplary embodiment of this application.

[0124] In some possible implementations, the electronic device of this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the methods described above according to the various exemplary embodiments of this application.

[0125] The following reference Figure 5 To describe an electronic device 130 implemented according to this embodiment of the present application. Figure 5 The electronic device 130 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0126] like Figure 5 As shown, the electronic device 130 is presented in the form of a general-purpose electronic device. The components of the electronic device 130 may include, but are not limited to: at least one processor 131, at least one memory 132, and a bus 133 connecting different system components (including memory 132 and processor 131).

[0127] Bus 133 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.

[0128] The memory 132 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1321 and / or cache memory 1322, and may further include read-only memory (ROM) 1323.

[0129] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0130] Electronic device 130 can also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with electronic device 130, and / or with any device that enables electronic device 130 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 135. Furthermore, electronic device 130 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 136. As shown, network adapter 136 communicates with other modules used in electronic device 130 via bus 133. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0131] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 132 including instructions, which can be executed by a processor 131 to complete the page query method described above. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0132] In an exemplary embodiment, a computer program product is also provided, which, when invoked and executed by an electronic device, causes the electronic device to perform any of the exemplary methods provided in this application.

[0133] Furthermore, computer program products may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0134] The program product used for page query in the embodiments of this application may be a CD-ROM and include program code, and may run on a computing device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0135] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0136] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency (RF), or any suitable combination thereof.

[0137] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0138] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0139] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0140] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0141] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0142] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0143] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0144] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0145] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, then this application also includes such modifications and variations.

Claims

1. A page query method, characterized in that, include: The terminal receives a page query request, which includes at least a page identifier and a first page number. The page identifier indicates which page the terminal is requesting to retrieve data from, and the first page number indicates which page the terminal is requesting to retrieve data from. Read the second page number whose position number is equal to the first page number from the cached list. The list stores the page numbers of the page corresponding to the page identifier after the order is randomly shuffled. The randomly shuffled order consists of the page numbers of the page except for the maximum page number. The maximum page number is stored at the end of the list. Retrieve multiple records of the page at the second page number from the database; The multiple data entries are sent to the terminal for display, thereby achieving the effect of randomly obtaining page data.

2. The method as described in claim 1, characterized in that, The page query request also includes the number of items displayed per page, and further includes: Before reading the second page number, whose position number is equal to the first page number, from the cached list, query the total number of data entries on the page corresponding to the page identifier; The total number of pages for the page is determined based on the total number of data entries and the number of entries displayed per page; Determine that the total number of pages is equal to the length of the list.

3. The method as described in claim 1, characterized in that, Before reading the page number at the position where the position number is equal to the page number from the cached list, the process also includes: Confirm that the list is within its validity period.

4. The method as described in claim 2 or 3, characterized in that, Also includes: If it is determined that the total number of pages is not equal to the length of the list, or the list is not within its validity period, then the page numbers in the list are cleared. The page numbers included in the total number of pages are randomly shuffled and stored in the list.

5. The method as described in claim 1, characterized in that, Sending the multiple data entries to the terminal for display includes: The multiple data entries are randomly shuffled and then sent to the terminal for display.

6. A page query device, characterized in that, include: The receiving module is used to receive a page query request sent by the terminal. The page query request includes at least a page identifier and a first page number. The page identifier is used to indicate which page the terminal is requesting to obtain data on, and the first page number is used to indicate which page the terminal is requesting to obtain data on. The reading module is used to read the second page number whose position number is equal to the first page number from the cached list. The list stores the page numbers of the page corresponding to the page identifier after the order is randomly shuffled. The randomly shuffled order consists of the page numbers of the page except for the maximum page number. The maximum page number is stored at the end of the list. The query module is used to query multiple records of data for the page at the second pagination number from the database; The sending module is used to send the multiple data items to the terminal for display, so as to achieve the effect of randomly obtaining page data.

7. The apparatus as claimed in claim 6, characterized in that, The page query request also includes the number of items displayed per page, and includes a checking module for: Before reading the second page number, whose position number is equal to the first page number, from the cached list, query the total number of data entries on the page corresponding to the page identifier; The total number of pages for the page is determined based on the total number of data entries and the number of entries displayed per page; Determine that the total number of pages is equal to the length of the list.

8. The apparatus as claimed in claim 6, characterized in that, It also includes an inspection module for: Before reading the page number at the position where the position number is equal to the page number from the cached list, determine that the list is within its validity period.

9. The apparatus as claimed in claim 7 or 8, characterized in that, The inspection module is also used for: If it is determined that the total number of pages is not equal to the length of the list, or the list is not within its validity period, then the page numbers in the list are cleared. The page numbers included in the total number of pages are randomly shuffled and stored in the list.

10. The apparatus as claimed in claim 6, characterized in that, The sending module is specifically used for: The multiple data entries are randomly shuffled and then sent to the terminal for display.

11. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to said at least one processor, wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-5.

12. A storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-5.

13. A computer program product, characterized in that, When a computer program product is invoked and executed by an electronic device, the electronic device performs the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data paging method and apparatus

    CN105183764A