Paging query processing method and device, server, medium and product

By intercepting paging query requests through the aspect-oriented programming tool, and reducing database full-table scans using the cache mechanism, it solves the problems of reduced response speed and increased database burden caused by frequent full-table scans in the existing technology, and achieves more efficient paging query processing.

CN119396880APending Publication Date: 2025-02-07CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411494364.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, full table scans are frequently performed on the database to obtain the total number of query data for paging query requests, resulting in a reduced response speed and an increased database burden.

Method used

Intercept paged query requests through the aspect-oriented programming tool, determine whether the query parameters contain the total number of query data parameters. If not, generate a unique identifier to obtain fast query or slow query cache conditions. If there is a cache, obtain query data from the cache. Total number, otherwise execute the query statement and save the result to cache, setting the expiration time.

Benefits of technology

It avoids frequent full table scanning, improves response speed, reduces database burden, and simplifies the development and maintenance of paging query requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396880A_ABST
    Figure CN119396880A_ABST
Patent Text Reader

Abstract

The invention provides a paging query processing method and device, a server, a medium and a product. Relates to the technical field of data processing. The method comprises the following steps: intercepting a paging query request through a section-oriented programming tool; if the query parameter does not contain the query data total quantity parameter, generating a unique identifier according to the query parameter; and according to the class name, the method name and the unique identifier, obtaining a fast query cache condition. If the fast query cache condition does not exist in the cache, obtaining a slow query cache condition according to the class name, the method name and the unique identifier; if the slow query cache condition does not exist in the cache, executing the query statement to obtain the query time and the total quantity of query data; obtaining a query type according to the query time; storing a cache condition corresponding to the query type and the total quantity of the query data into a cache, and setting expiration time of the total quantity of the query data; and outputting the total quantity of the query data of the paging query request. According to the method, the response speed is increased, and the database burden is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, device, server, medium and product for processing paging queries. Background Art

[0002] In web applications, paging query is a common way to display data, especially when dealing with large amounts of data. Paging query often involves a key step: obtaining the total amount of query data requested by the paging query so that paging display can be performed.

[0003] Currently, in the prior art, when a paging query request is received, a full table scan of the database is usually performed by executing a query statement to obtain the total amount of query data.

[0004] However, when the same paging query request is received multiple times, this method of the prior art needs to re-acquire the total amount of query data, resulting in frequent full table scans of the database, reducing the response speed and increasing the database burden. Summary of the invention

[0005] The present application provides a paging query processing method, device, server, medium and product to solve the problem of frequently performing full table scanning on the database, reducing the response speed and increasing the database burden in the prior art.

[0006] In a first aspect, the present application provides a method for processing paging queries, comprising: intercepting a paging query request through an aspect-oriented programming tool; wherein the paging query request includes a query parameter, a class name, a method name, and a query statement; determining whether the query parameter includes a total number of query data parameter; if it is determined that the query parameter does not include the total number of query data parameter, generating a unique identifier based on the query parameter; obtaining a fast query cache condition based on the class name, the method name, and the unique identifier, and determining whether the fast query cache condition exists in the cache; if it is determined that the fast query cache condition does not exist in the cache, obtaining a slow query cache condition based on the class name, the method name, and the unique identifier, and determining whether the slow query cache condition exists in the cache; if it is determined that the slow query cache condition does not exist in the cache, executing the query statement to obtain a query time and a total number of query data; obtaining a query type of the paging query request based on the query time; saving the cache condition and the total number of query data corresponding to the query type in the cache, and setting an expiration time for the total number of query data; wherein the cache is used to obtain the total number of query data from the cache based on the expiration time when obtaining the same paging query request; and outputting the total number of query data of the paging query request.

[0007] In a possible design, generating a unique identifier based on the query parameters includes: sorting the query parameters and assembling the sorted query parameters into a character string in a preset format; and performing hash processing on the character string in the preset format to generate a unique identifier.

[0008] In one possible design, the query type of the paging query request is obtained according to the query time, including: if the query time is less than a fast query time threshold, the query type of the paging query request is a fast query; if the query time is greater than a slow query time threshold, the query type of the paging query request is a slow query; wherein the slow query time threshold is greater than the fast query time threshold.

[0009] In a possible design, a quick query cache condition is obtained according to a class name, a method name, and a unique identifier, including: connecting the class name, the method name, and the unique identifier through a connector to obtain an initial quick query cache condition; adding a first identifier to the initial quick query cache condition, and connecting the first identifier and the initial quick query cache condition through a connector to obtain the quick query cache condition.

[0010] In a possible design, a slow query cache condition is obtained according to a class name, a method name, and a unique identifier, including: connecting the class name, the method name, and the unique identifier through a connector to obtain an initial slow query cache condition; adding a second identifier to the initial slow query cache condition, and connecting the second identifier and the initial slow query cache condition through a connector to obtain the slow query cache condition.

[0011] In a possible design, after determining whether there is a fast query cache condition in the cache, the method further includes: if it is determined that there is a fast query cache condition in the cache, executing a query statement to obtain a total amount of query data requested by the paging query.

[0012] In a possible design, it is determined whether a slow query cache condition exists in the cache, and then the method further includes: if it is determined that the slow query cache condition exists in the cache, obtaining the total amount of query data of the paging query request from the cache.

[0013] In a second aspect, the present application provides a paging query processing device, comprising:

[0014] The interception module is used to intercept paging query requests through aspect-oriented programming tools; the paging query requests include query parameters, class names, method names and query statements.

[0015] The first judgment module is used to judge whether the query parameters include a total number of query data parameters.

[0016] The generating module is used to generate a unique identifier according to the query parameters if it is determined that the query parameters do not contain the total number of query data parameters.

[0017] The first acquisition module is used to obtain the quick query cache condition according to the class name, method name and unique identifier, and determine whether the quick query cache condition exists in the cache.

[0018] The second judgment module is used to obtain the slow query cache condition according to the class name, method name and unique identifier if it is determined that the fast query cache condition does not exist in the cache, and to judge whether the slow query cache condition exists in the cache.

[0019] The second acquisition module is used to execute the query statement if it is determined that there is no slow query cache condition in the cache, and obtain the query time and the total amount of query data.

[0020] The third acquisition module is used to acquire the query type of the paging query request according to the query time.

[0021] The saving module is used to save the cache conditions and the total number of query data corresponding to the query type into the cache, and set the expiration time of the total number of query data; wherein the cache is used to obtain the total number of query data from the cache according to the expiration time when obtaining the same paging query request.

[0022] The output module is used to output the total number of query data requested by the paging query.

[0023] In a third aspect, an embodiment of the present application provides a server, comprising: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the paging query processing method described in the first aspect and various possible designs of the first aspect.

[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the paging query processing method described in the first aspect and various possible designs of the first aspect is implemented.

[0025] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the paging query processing method described in the first aspect and various possible designs of the first aspect.

[0026] The processing method, device, server, medium and product of paging query provided by the present application, when receiving a paging query request, if the query parameters do not contain the total number of query data parameters, then determine whether there is a fast query cache condition or a slow query cache condition in the cache, if neither exists, then obtain the total number of query data through the query statement. The query type of the paging query request is obtained according to the query time, and the cache conditions and the total number of query data corresponding to the query type are saved in the cache, and the expiration time of the total number of query data is set. When the same paging query request is received, the total number of query data is obtained from the cache according to the expiration time, avoiding frequent full table scans of the database, thereby improving the response speed and reducing the burden on the database. In addition, the development and maintenance of paging query requests are simplified through aspect-oriented programming tools. Therefore, it is possible to solve the problem of frequent full table scans of the database, reducing the response speed and increasing the burden on the database in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0028] Figure 1 A schematic diagram of an application scenario of a method for processing paging queries provided in an embodiment of the present application;

[0029] Figure 2 A flowchart of a method for processing paging queries provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram of the structure of a paging query processing device provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present application.

[0032] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0033] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0034] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0035] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0036] In Web applications, paging query is a common way to display data, especially when dealing with large amounts of data. Paging query often involves a key step: obtaining the total amount of query data requested by the paging query in order to display it in pages. Currently, in the prior art, when a paging query request is received, the database is usually scanned in its entirety by executing a query statement to obtain the total amount of query data. However, when this method of the prior art receives the same paging query request multiple times, it is necessary to re-obtain the total amount of query data, resulting in frequent full-table scans of the database, which reduces the response speed and increases the database burden.

[0037] In response to the above technical problems, the present application proposes the following technical concept: Considering that when the same paging query request is received multiple times, it is necessary to re-acquire the total number of query data, resulting in frequent full table scans of the database, reducing the response speed and increasing the database burden. The inventor thought of saving the total number of query data in the cache, judging whether there are fast query cache conditions or slow cache query conditions in the cache. If neither exists, it means that the total number of query data is not saved in the cache, and then the query type of the paging query request is determined according to the request time of the paging query request. The cache conditions and the total number of query data corresponding to the query type are saved in the cache, and the expiration time of the total number of query data is set. The cache is used to obtain the total number of query data from the cache according to the expiration time when obtaining the same paging query request to avoid frequent full table scans of the database, thereby improving the response speed and reducing the database burden.

[0038] Figure 1 Schematic diagram of an application scenario of the paging query processing method provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes: a server 101 and a display terminal 102 .

[0039] The server 101 is used to output the total amount of query data of the paging query request to the display terminal 102; the display terminal 102 is used to display the total amount of query data of the paging query request.

[0040] The server 101 may be a single server or a cluster consisting of multiple servers.

[0041] refer to Figure 1 , the server 101 intercepts the paging query request through the aspect-oriented programming tool. Determine whether the query parameter contains the total number of query data parameters. If not, obtain the fast query cache condition and determine whether the fast query cache condition exists in the cache; if it is determined that the fast query cache condition does not exist in the cache, obtain the slow query cache condition and determine whether the slow query cache condition exists in the cache; if it is determined that the slow query cache condition does not exist in the cache, execute the query statement to obtain the query time and the total number of query data; obtain the query type of the paging query request according to the query time; save the cache condition and the total number of query data corresponding to the query type to the cache, and set the expiration time of the total number of query data; output the total number of query data of the paging query request to the display terminal 102 for display.

[0042] Figure 2 This is a flowchart of a method for processing paging queries provided in an embodiment of the present application. The execution subject of this embodiment may be Figure 1 The server in the embodiment shown may also be other devices with similar functions, and this embodiment is not particularly limited here. Figure 2 As shown, the method includes:

[0043] S201: intercepting a paging query request through an aspect-oriented programming tool; wherein the paging query request includes query parameters, class name, method name and query statement.

[0044] In this embodiment, the ListCount annotation and the corresponding ListCountAspect aspect implementation are defined through the Aspect Oriented Programming (AOP) tool. The @ListCount annotation is added to the interface method that needs to perform paging query, so that AOP can intercept the call of the paging query request.

[0045] S202: Determine whether the query parameters include a total number of query data parameters.

[0046] Optionally, if it is determined that the query parameters include a total number of query data parameters, the total number of query data is directly returned.

[0047] S203: If it is determined that the query parameters do not include the total number of query data parameters, a unique identifier is generated according to the query parameters.

[0048] In this embodiment, if it is determined that the query parameters do not include the total number of query data parameters, a unique identifier is generated according to the query parameters except for the paging parameters in the query parameters.

[0049] Specifically, the query parameters are sorted, and the sorted query parameters are assembled into a character string in a preset format; the character string in the preset format is hashed to generate a unique identifier.

[0050] Optionally, the character string in the preset format may be a character string in JSON format.

[0051] Optionally, a hash process is performed on a character string in a preset format using Message-Digest Algorithm 5 (MD5) to generate a unique identifier.

[0052] S204: Obtain a quick query cache condition according to the class name, method name and unique identifier, and determine whether the quick query cache condition exists in the cache.

[0053] Specifically, the class name, method name and unique identifier are connected through a connector to obtain an initial quick query cache condition; a first identifier is added to the initial quick query cache condition, and the first identifier and the initial quick query cache condition are connected through a connector to obtain the quick query cache condition.

[0054] Optionally, the connector is a colon; the first identifier is flag.

[0055] In this embodiment, the class name, method name and unique identifier are connected by a connector, and the obtained initial quick query cache condition is "class name: method name: unique identifier"; the first identifier is added to the initial quick query cache condition, and the first identifier and the initial quick query cache condition are connected by a connector, and the obtained quick query cache bar is "flag: class name: method name: unique identifier".

[0056] Optionally, the cache can be Redis.

[0057] S205: If it is determined that the fast query cache condition does not exist in the cache, a slow query cache condition is obtained according to the class name, the method name and the unique identifier, and it is determined whether the slow query cache condition exists in the cache.

[0058] Specifically, the process of obtaining the slow query cache condition is: connecting the class name, the method name and the unique identifier through a connector to obtain the initial slow query cache condition; adding a second identifier to the initial slow query cache condition, and connecting the second identifier and the initial slow query cache condition through a connector to obtain the slow query cache condition.

[0059] Optionally, the connector is a colon; and the second identifier is count.

[0060] In this embodiment, the class name, method name and unique identifier are connected by a connector, and the obtained initial slow query cache condition is "class name: method name: unique identifier"; a second identifier is added to the initial slow query cache condition, and the second identifier and the initial fast query cache condition are connected by a connector, and the obtained slow query cache entry is "count: class name: method name: unique identifier".

[0061] S206: If it is determined that there is no slow query cache condition in the cache, the query statement is executed to obtain the query time and the total amount of query data.

[0062] S207: Obtain the query type of the paging query request according to the query time.

[0063] Specifically, if the query time is less than the fast query time threshold, the query type of the paging query request is a fast query; if the query time is greater than the slow query time threshold, the query type of the paging query request is a slow query; wherein the slow query time threshold is greater than the fast query time threshold.

[0064] Optionally, the fast query time threshold can be set to 500 milliseconds, and the slow query time threshold can be set to 2 seconds. If the query time is less than 500 milliseconds, the query type of the paging query request is a fast query; if the query time is greater than 2 seconds, the query type of the paging query request is a slow query.

[0065] Optionally, if the query time is greater than a fast query time threshold and less than a slow query time threshold, the query type of the paging query request is a normal query.

[0066] Optionally, for ordinary queries, the total number of query data is obtained from the database through query statements. When the paging query requests are too frequent or the concurrency increases, causing the database performance to deteriorate, the paging query strategy can be dynamically adjusted according to the actual situation, from directly obtaining the total number of query data from the database to a slow query strategy.

[0067] S208: Save the cache condition corresponding to the query type and the total amount of query data into the cache, and set the expiration time of the total amount of query data; wherein the cache is used to obtain the total amount of query data from the cache according to the expiration time when obtaining the same paging query request.

[0068] In this embodiment, if the query type is a fast query, the fast query cache condition and the total number of queries are saved in the cache, and the expiration time of the total number of query data is set. If the query type is a slow query, the slow query cache condition and the total number of queries are saved in the cache, and the expiration time of the total number of query data is set.

[0069] Optionally, if the query type is a quick query, the expiration time of the total amount of query data can be set to 6 hours; if the query type is a slow query, the expiration time of the total amount of query data can be set to 60 seconds.

[0070] Optionally, when the same paging query request is received, if there is a fast query cache condition in the cache, the database is directly queried within the expiration time to ensure the real-time nature of the total amount of queried data, and the expiration time of the total amount of queried data in the cache is updated; if there is no fast query cache condition in the cache, but there is a slow query cache condition, the total amount of queried data is read from the cache first to reduce full table scanning in the database.

[0071] S209: Output the total number of query data of the paging query request.

[0072] Optionally, the total amount of query data in the paging query request may be sent to a display terminal, so that the display terminal displays the total amount of query data.

[0073] In summary, when a paging query request is received, if the query parameters do not contain the total number of query data parameters, it is determined whether there are fast query cache conditions or slow query cache conditions in the cache. If neither exists, it means that the cache does not save the total number of query data, and the total number of query data is obtained through the query statement. The query type of the paging query request is obtained according to the query time, and the cache conditions and the total number of query data corresponding to the query type are saved in the cache, and the expiration time of the total number of query data is set. When the same paging query request is received, the total number of query data is obtained from the cache according to the expiration time to avoid frequent full table scans of the database, thereby improving the response speed and reducing the burden on the database. In addition, the development and maintenance of paging query requests are simplified through aspect-oriented programming tools.

[0074] Based on the above embodiment, in this embodiment, the situation where there is a fast query cache condition in the cache is introduced. The execution subject of this embodiment can be Figure 1 The server in the embodiment shown may also be other devices with similar functions, and this embodiment is not particularly limited here. The details are as follows:

[0075] If it is determined that the fast query cache condition exists in the cache, the query statement is executed to obtain the total number of query data requested by the paging query.

[0076] Optionally, if it is determined that there is a fast query cache condition in the cache, it indicates that the paging query request is a fast query. Since there is a fast query cache condition in the cache and the expiration time of the total number of query data corresponding to the fast query cache condition is set, the total number of query data is directly obtained from the database within the expiration time, and the expiration time of the total number of query data in the cache is updated.

[0077] In summary, if it is determined that there is a fast query cache condition in the cache, it means that the paging query request is a fast query, the query time is short, and the total amount of query data is obtained from the database within the expiration time to ensure the real-time nature of the total amount of query data.

[0078] Based on the above embodiment, in this embodiment, the situation that there is no fast query cache condition in the cache, but there is a slow query cache condition is introduced. The execution subject of this embodiment can be Figure 1 The server in the embodiment shown may also be other devices with similar functions, and this embodiment is not particularly limited here. The details are as follows:

[0079] If it is determined that a slow query cache condition exists in the cache, the total number of query data for the paging query request is obtained from the cache.

[0080] In this embodiment, if there is no fast query cache condition in the cache, but there is a slow query cache condition, it indicates that the paging query request is a slow query. Since there is a slow query cache condition in the cache, and the expiration time of the total number of query data corresponding to the slow query cache condition is set, the total number of query data is preferentially obtained from the cache within the expiration time to avoid full table scanning in the database.

[0081] In summary, if it is determined that there is a slow query cache condition in the cache, it means that the paging query request is a slow query and the query time is long. Obtaining the total number of query data from the cache can avoid full table scanning in the database, thereby improving the response speed and reducing the database burden.

[0082] Figure 3 A schematic diagram of the structure of a paging query processing device provided in an embodiment of the present application. Figure 3 As shown, the paging query processing device includes: an interception module 301, a first judgment module 302, a generation module 303, a first acquisition module 304, a second judgment module 305, a second acquisition module 306, a third acquisition module 307, a storage module 308 and an output module 309.

[0083] The interception module 301 is used to intercept the paging query request through the aspect-oriented programming tool; wherein the paging query request includes query parameters, class name, method name and query statement.

[0084] The first determination module 302 is used to determine whether the query parameters include a total number of query data parameters.

[0085] The generating module 303 is configured to generate a unique identifier according to the query parameters if it is determined that the query parameters do not include the total number of query data parameters.

[0086] The first acquisition module 304 is used to obtain a fast query cache condition according to the class name, the method name and the unique identifier, and determine whether the fast query cache condition exists in the cache.

[0087] The second judgment module 305 is used to obtain the slow query cache condition according to the class name, method name and unique identifier if it is determined that the fast query cache condition does not exist in the cache, and to judge whether the slow query cache condition exists in the cache.

[0088] The second acquisition module 306 is used to execute the query statement to obtain the query time and the total amount of query data if it is determined that there is no slow query cache condition in the cache.

[0089] The third acquisition module 307 is used to acquire the query type of the paging query request according to the query time.

[0090] The saving module 308 is used to save the cache conditions and the total amount of query data corresponding to the query type into the cache, and set the expiration time of the total amount of query data; wherein the cache is used to obtain the total amount of query data from the cache according to the expiration time when obtaining the same paging query request.

[0091] The output module 309 is used to output the total amount of query data of the paging query request.

[0092] In a possible design, the generation module 303 is specifically used to: sort the query parameters and assemble the sorted query parameters into a character string in a preset format; and perform hash processing on the character string in the preset format to generate a unique identifier.

[0093] In one possible design, the third acquisition module 307 is specifically used to: if the query time is less than the fast query time threshold, the query type of the paging query request is a fast query; if the query time is greater than the slow query time threshold, the query type of the paging query request is a slow query; wherein the slow query time threshold is greater than the fast query time threshold.

[0094] In a possible design, the first acquisition module 304 is specifically used to: connect the class name, the method name and the unique identifier through a connector to obtain an initial quick query cache condition; add a first identifier to the initial quick query cache condition, and connect the first identifier and the initial quick query cache condition through a connector to obtain the quick query cache condition.

[0095] In one possible design, the second judgment module 305 is specifically used to: connect the class name, the method name and the unique identifier through a connector to obtain an initial slow query cache condition; add a second identifier to the initial slow query cache condition, and connect the second identifier and the initial slow query cache condition through a connector to obtain the slow query cache condition.

[0096] In a possible design, the paging query processing device also includes: a fourth acquisition module, which is used to execute the query statement if it is determined that the fast query cache condition exists in the cache, and obtain the total amount of query data requested by the paging query.

[0097] In a possible design, the paging query processing device also includes: a fifth acquisition module, which is used to obtain the total amount of query data requested by the paging query from the cache if it is determined that a slow query cache condition exists in the cache.

[0098] The paging query processing device provided in the embodiment of the present application can be used to execute the technical solution of the paging query processing method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0099] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. Each module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0100] Figure 4 This is a schematic diagram of the structure of the server provided in the embodiment of the present application. Figure 4 As shown, the server may include: a transceiver 401 , a processor 402 , and a memory 403 .

[0101] The processor 402 executes the computer-executable instructions stored in the memory, so that the processor 402 executes the solution in the above embodiment. The processor 402 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0102] The memory 403 is connected to the processor 402 via a system bus and completes communication between them. The memory 403 is used to store computer program instructions.

[0103] The system bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries).

[0104] The memory may include random access memory (RAM) and may also include non-volatile memory (VNM).

[0105] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the technical solution of the processing method for paging query in the above embodiment.

[0106] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer execution instructions are executed by a processor, the technical solution for the processing method of paging query in the above embodiment is implemented.

[0107] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the paging query processing method in the above embodiment can be implemented.

[0108] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0109] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0110] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0111] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0112] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0113] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0114] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing paging queries, characterized in that: Applicable to servers, including: By using an aspect-oriented programming tool, a paging query request is intercepted; wherein the paging query request includes query parameters, class name, method name and query statement; Determine whether the query parameters include a total number of query data parameters; If it is determined that the query parameters do not include a total number of query data parameters, generating a unique identifier according to the query parameters; Obtaining a quick query cache condition according to the class name, the method name and the unique identifier, and determining whether the quick query cache condition exists in the cache; If it is determined that the fast query cache condition does not exist in the cache, obtaining a slow query cache condition according to the class name, the method name and the unique identifier, and determining whether the slow query cache condition exists in the cache; If it is determined that the slow query cache condition does not exist in the cache, executing the query statement to obtain the query time and the total amount of query data; According to the query time, obtaining the query type of the paging query request; The cache condition corresponding to the query type and the total amount of query data are saved in the cache, and an expiration time of the total amount of query data is set; wherein the cache is used to obtain the total amount of query data from the cache according to the expiration time when obtaining the same paging query request; Output the total amount of query data of the paging query request.

2. The method according to claim 1, characterized in that: The generating a unique identifier according to the query parameter includes: Sorting the query parameters, and assembling the sorted query parameters into a character string in a preset format; The character string in the preset format is hashed to generate the unique identifier.

3. The method according to claim 1, characterized in that The obtaining the query type of the paging query request according to the query time includes: If the query time is less than the fast query time threshold, the query type of the paging query request is fast query; If the query time is greater than a slow query time threshold, the query type of the paging query request is a slow query; wherein the slow query time threshold is greater than the fast query time threshold.

4. The method according to claim 1, characterized in that: The obtaining of a quick query cache condition according to the class name, the method name and the unique identifier includes: Connect the class name, the method name and the unique identifier through a connector to obtain an initial quick query cache condition; A first identifier is added to the initial quick query cache condition, and the first identifier and the initial quick query cache condition are connected by the connector to obtain the quick query cache condition.

5. The method according to claim 1, characterized in that The obtaining of the slow query cache condition according to the class name, the method name and the unique identifier includes: Connect the class name, the method name and the unique identifier through a connector to obtain an initial slow query cache condition; A second identifier is added to the initial slow query cache condition, and the second identifier and the initial slow query cache condition are connected through the connector to obtain the slow query cache condition.

6. The method according to any one of claims 1 to 5, characterized in that: After determining whether there is a quick query cache condition in the cache, the method further includes: If it is determined that the fast query cache condition exists in the cache, the query statement is executed to obtain the total amount of query data of the paging query request.

7. The method according to any one of claims 1 to 5, characterized in that: The determining whether there is a slow query cache condition in the cache further includes: If it is determined that the slow query cache condition exists in the cache, the total amount of query data of the paging query request is obtained from the cache.

8. A paging query processing device, characterized in that: Applicable to servers, including: An interception module is used to intercept a paging query request through an aspect-oriented programming tool; wherein the paging query request includes a query parameter, a class name, a method name, and a query statement; A first judgment module, used to judge whether the query parameter includes a total number of query data parameters; A generating module, configured to generate a unique identifier according to the query parameters if it is determined that the query parameters do not include a total number of query data parameters; A first acquisition module, configured to obtain a quick query cache condition according to the class name, the method name and the unique identifier, and determine whether the quick query cache condition exists in the cache; A second judgment module is used to obtain a slow query cache condition according to the class name, the method name and the unique identifier, and judge whether the slow query cache condition exists in the cache if it is determined that the fast query cache condition does not exist in the cache; A second acquisition module is used to execute the query statement to obtain the query time and the total amount of query data if it is determined that the slow query cache condition does not exist in the cache; A third acquisition module, used to acquire the query type of the paging query request according to the query time; A saving module, used to save the cache condition corresponding to the query type and the total amount of query data into the cache, and set an expiration time for the total amount of query data; wherein the cache is used to obtain the total amount of query data from the cache according to the expiration time when obtaining the same paging query request; The output module is used to output the total amount of query data of the paging query request.

9. A server, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.