CN112527824A - Paging query method, paging query device, electronic equipment and computer-readable storage medium - Google Patents

Paging query method, paging query device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN112527824A
CN112527824A CN201910873707.6A CN201910873707A CN112527824A CN 112527824 A CN112527824 A CN 112527824A CN 201910873707 A CN201910873707 A CN 201910873707A CN 112527824 A CN112527824 A CN 112527824A
Authority
CN
China
Prior art keywords
target data
paging
query
data partition
paging query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910873707.6A
Other languages
Chinese (zh)
Other versions
CN112527824B (en
Inventor
陈兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201910873707.6A priority Critical patent/CN112527824B/en
Publication of CN112527824A publication Critical patent/CN112527824A/en
Application granted granted Critical
Publication of CN112527824B publication Critical patent/CN112527824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a paging query method, a paging query device, electronic equipment and a computer readable storage medium, and relates to the technical field of data processing. The method and the device receive the paging query request, respond to the paging query request, divide the target database into a plurality of data partitions according to the total amount of data contained in the target database, then query in each data partition according to the paging query condition to obtain a first target data partition, finally summarize each first target data partition to obtain a second target data partition, and query in the second target data partition to obtain target data meeting the paging query condition. The data partitions are adaptively divided according to the total amount of data contained in the target database, so that the number of the data partitions which can be queried in parallel is increased, and the query efficiency is improved; meanwhile, a window function is not needed in the query process, and data, not the id of the data, is directly acquired during query, so that the query time is saved, and the query efficiency is improved.

Description

Paging query method, paging query device, electronic equipment and computer-readable storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a paging query method, a paging query device, electronic equipment and a computer-readable storage medium.
Background
The development of the big data industry is well-trained now, and the nation also supports the development of the big data industry. In the big data development application, a lot of technologies are needed to support the processing of a large amount of data, and spark is one of the technologies, and is one of the most widely used technologies in enterprises at present.
Spark SQL is a Spark module, and is mainly used for processing structured data, and when the amount of data returned after query is large, paging operation is required, and there are two common paging schemes:
the ROW _ NUMBER method and the query _ then _ fetch method. The main disadvantages of both schemes are that they are time consuming and long, especially when the data size is large, and the structured SQL query statement is cumbersome.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, an electronic device and a computer-readable storage medium for paging inquiry, so as to solve the above problems.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a paging query method, where the paging query method includes:
receiving a paging query request, wherein the paging query request comprises a target database and paging query conditions;
responding to the paging query request, and dividing the target database into a plurality of data partitions according to the total amount of data contained in the target database;
inquiring in each data partition according to the paging inquiry condition to obtain a first target data partition;
and summarizing each first target data partition to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition.
In a second aspect, an embodiment of the present invention provides a paging query apparatus, where the paging query apparatus includes:
the device comprises a request receiving module, a paging query module and a paging query module, wherein the request receiving module is used for receiving a paging query request, and the paging query request comprises a target database and paging query conditions;
the data dividing module is used for responding to the paging query request and dividing the target database into a plurality of data partitions according to the total amount of data contained in the target database;
the data query module is used for querying each data partition according to the paging query condition to obtain a first target data partition;
the data query module is further configured to collect each first target data partition to obtain a second target data partition, and query in the second target data partition to obtain target data meeting the paging query condition.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the paging query method provided in the foregoing embodiment.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the paging query method provided in the foregoing embodiment.
According to the paging query method, the paging query device, the electronic device and the computer-readable storage medium provided by the embodiment of the invention, the paging query request is received, the paging query request is responded, the target database is divided into a plurality of data partitions according to the total amount of data contained in the target database, then a first target data partition is obtained by querying in each data partition according to paging query conditions, finally, each first target data partition is summarized to obtain a second target data partition, and target data meeting the paging query conditions are obtained by querying in the second target data partition. The data partitions are adaptively divided according to the total amount of data contained in the target database, so that the number of the data partitions which can be queried in parallel is increased, and the query efficiency is improved; meanwhile, a window function is not needed in the query process, and data, not the id of the data, is directly acquired during query, so that the query time is saved, and the query efficiency is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a block schematic diagram of an electronic device provided by an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a paging query method according to an embodiment of the present invention.
Fig. 3 shows a detailed flowchart of S203 in fig. 2.
Fig. 4 shows a detailed flowchart of S204 in fig. 2.
Fig. 5 is a functional block diagram of a paging query apparatus according to an embodiment of the present invention.
Icon: 100-an electronic device; 110-a memory; 120-a processor; 130-a communication unit; 200-paging inquiry means; 210-a request receiving module; 220-a data partitioning module; 230-data query module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the prior art, the page lookup is usually implemented by using a ROW _ NUMBER function and a query _ then _ fetch. If the ROW _ NUMBER function is adopted to realize paging query, a window function is required to be matched with the ROW _ NUMBER function during query, each queried record is sequentially numbered, and then the NUMBER is subjected to conditional query to finally obtain an expected target record. However, the method needs to use a window function, so that a shuffle operation is necessarily performed once during the execution of the spark task, the whole time consumption is at least dozens of seconds, the retrieval efficiency is low, and the performance requirement of SQL retrieval cannot be met.
The query _ then _ fetch divides a single query into two parts to be executed: and in the query stage, condition matching and field sorting are carried out, and the id field and the sorting field of the Top N data set of each node are collected to a result collection end. And in the catch stage, the summarized ids are reordered to directly obtain a target id set, and a complete result set is obtained according to the target id set. The paging query is divided into two steps, which is time-consuming, so that the retrieval efficiency is low, and the performance requirement of SQL retrieval cannot be met.
In view of the above, the present invention provides a method, an apparatus, an electronic device and a computer-readable storage medium for paging inquiry, so as to solve the above problems.
Fig. 1 is a block diagram of an electronic device 100. The electronic device 100 includes a memory 110, a processor 120, and a communication unit 130. The elements of the memory 110, the processor 120 and the communication unit 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The memory 110 is used to store programs or data. The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 120 is used to read/write data or programs stored in the memory 110 and perform corresponding functions.
The communication unit 130 is configured to establish a communication connection between the electronic apparatus 100 and another communication terminal through the network, and to transmit and receive data through the network.
It should be noted that a database is built on the electronic device 100, so that the user can manage the data in the file.
It should be understood that the structure shown in fig. 1 is only a schematic structural diagram of the electronic device 100, and the electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
First embodiment
The invention provides a paging query method, which is applied to the electronic device 100. Please refer to fig. 2, which is a flowchart illustrating a paging query method according to the present invention. The paging query method comprises the following steps:
s201, receiving a paging inquiry request.
The paging query request includes a target database and paging query conditions. The target database contains target data and once the target database is determined, the total amount of data contained by the target database can be determined.
In an alternative embodiment, the paging query condition includes a filter sub-condition, a sort sub-condition, a paging code, and a number of paging query strips. Wherein the screening sub-conditions are used for screening data from the target database; the sorting sub-condition is used for sorting the screened data; the paging code and the number of paging query are used to obtain the target data from the sorted data.
Preferably, a unique field or a multi-field structure is adopted as the sorting sub-condition, so as to avoid random confusion of the sorting result, and the paging query has no practical meaning.
S202, responding to the paging query request, and dividing the target database into a plurality of data partitions according to the total amount of data contained in the target database.
Generally, the more total amount of data contained in the target database, the more data partitions are partitioned. In an alternative embodiment, the amount of data contained in each data partition may be preset; therefore, the number of the data partitions which can be obtained by dividing can be determined on the premise of determining the total data amount and the data amount contained in each partition.
It can be understood that the target database is divided into a plurality of data partitions according to the total amount of data contained in the target database, so that the parallelism of paging queries is adaptive to the total amount of data. Specifically, the more the total amount of data is, the more the data partitions are, so that the higher the parallelism of the paging query is, the higher the query efficiency is.
S203, inquiring in each data partition according to the paging inquiry condition to obtain a first target data partition.
Please refer to fig. 3, which is a flowchart illustrating the process of S203. The S203 includes:
s2031, data meeting the screening sub-conditions are inquired from each data partition.
The screening sub-conditions comprise screening fields, and data meeting the screening sub-conditions can be screened from each data partition according to the screening fields. For example, the filter sub-condition is 2019.8.20-2019.8.22, so that data storage records in 2019.8.20-2019.8.22 time range need to be queried in each data partition.
S2032, sorting the data meeting the screening sub-condition in each data partition according to the sorting sub-condition to obtain a transition data partition.
For example, the screened data is sorted according to time, so as to obtain a transition data partition.
S2033, extracting a preset number of data of each transition data partition to generate a first target data partition.
The preset number is determined according to the paging number and the number of paging inquiry strips; specifically, the pre-set number is paging code + number of paging query. For example, the paging inquiry command is limit k offset z (meaning that the first z records are skipped and the last k records are obtained), where z is the paging number and the number of paging inquiry is k. Thus, the preset number N is k + z. That is, the first N data in the transition data partition are extracted to form a first target data partition.
It should be noted that the number of data partitions is the same as the number of first target data partitions. That is, TOP N data satisfying the condition are obtained from each data partition, and a first target data partition is formed.
And S204, summarizing each first target data partition to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition.
Referring to fig. 4, the process of querying the second target data partition to obtain the target data includes:
s2041, sorting the second target data partitions according to the sorting sub-conditions.
It should be noted that the sorting process of S2041 is similar to the sorting process of S2032, and is not described herein again.
And S2042, inquiring the sorted second target data partition according to the paging number and the paging inquiry number to obtain target data.
Specifically, if the page lookup command is limit k offset z, the first z records of the sorted second target data partition are skipped, and the next k records are obtained as the target data.
The following describes an implementation process of the paging query method provided by the present invention with reference to a simple operation. For example, the target database is data within 1-20, the sorting sub-conditions are from small to large, the paging number is 2, and the number of paging queries is 2. Then in an alternative embodiment, the 20 data may be divided into 4 data partitions, and each data partition is [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20], respectively. Thus, the first data partition resulting from each data partition is [1, 2, 3, 4], [6, 7, 8, 9], [11, 12, 13, 14], [16, 17, 18, 19], and the second data partition resulting after aggregation is [1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19 ]. Thus, the final obtained target data is [3, 4 ].
In addition, according to whether other task requests associated with the paging query request exist, the paging query method provided by the invention further comprises the following steps:
and if no other task request related to the paging query request exists, summarizing each first target data partition at the result collection end to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition.
If other task requests related to the paging query request exist, summarizing each first target data partition at the task execution end to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition so as to execute other task requests based on the target data.
Other task requests associated with the paging query request may refer to: a task request that depends on the results of the paging query request is required at execution time. That is, when other tasks need to be executed, the second target data partition is directly summarized on the task execution end, and target data are obtained, so that other tasks can be continuously executed; and if other task requests do not need to be executed, namely the paging query request is the last node, summarizing the second target data partition at the result collection end to obtain the target data.
The paging query method provided by the invention can adaptively divide the data partitions according to the total amount of data contained in the target database, increase the number of the data partitions capable of being queried in parallel and improve the query efficiency. Meanwhile, because a window function is not needed in the query process, shuffle operation is avoided, data is directly acquired instead of id of the data during query, the fetch step is also reduced, the query time is also saved, and the query efficiency is improved.
In order to perform the corresponding steps in the above embodiments and various possible manners, an implementation manner of the paging inquiry apparatus 200 is given below, and optionally, the paging inquiry apparatus 200 may adopt the device structure of the electronic device 100 shown in fig. 1. Further, referring to fig. 5, fig. 5 is a functional block diagram of a paging query apparatus 200 according to an embodiment of the present invention. It should be noted that the basic principle and the technical effects of the paging inquiry apparatus 200 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and reference may be made to the corresponding contents in the above embodiments. The paging inquiry apparatus 200 includes: a request receiving module 210, a data partitioning module 220, and a data querying module 230.
The request receiving module 210 is configured to receive a paging query request.
It is understood that in an alternative embodiment, the request receiving module 210 may be configured to execute S201.
The data dividing module 220 is configured to respond to the paging query request and divide the target database into a plurality of data partitions according to the total amount of data included in the target database.
It is to be appreciated that in an alternative embodiment, the data partitioning module 220 can be configured to perform S202.
The data query module 230 is configured to query each data partition according to the paging query condition to obtain a first target data partition.
Specifically, the data query module 230 is configured to query the data satisfying the screening sub-condition from each data partition, sort the data satisfying the screening sub-condition in each data partition according to the sorting sub-condition to obtain transition data partitions, and then extract a preset number of data in each transition data partition to generate the first target data partition.
It is understood that in an alternative embodiment, the data query module 230 may be configured to perform steps S203, S2031, S2032, and S2033.
The data query module 230 is further configured to summarize each first target data partition to obtain a second target data partition, and query in the second target data partition to obtain target data meeting the paging query condition.
Specifically, the data query module 230 is configured to rank the second target data partitions according to the ranking sub-condition, and query the ranked second target data partitions according to the paging number and the number of paging query pieces to obtain the target data.
It is understood that in an alternative embodiment, the data query module 230 may be configured to perform steps S203, S2041, S2042, and S2043.
Alternatively, the modules may be stored in the memory 110 shown in fig. 1 in the form of software or Firmware (Firmware) or be fixed in an Operating System (OS) of the electronic device 100, and may be executed by the processor 120 in fig. 1. Meanwhile, data, codes of programs, and the like required to execute the above-described modules may be stored in the memory 110.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by the processor 120, implements the paging query method provided in the foregoing embodiment.
In summary, the paging query method, the apparatus, the electronic device, and the computer-readable storage medium provided in the embodiments of the present invention receive the paging query request, respond to the paging query request, divide the target database into a plurality of data partitions according to the total amount of data included in the target database, query each data partition according to the paging query condition to obtain a first target data partition, summarize each first target data partition to obtain a second target data partition, and query each second target data partition to obtain target data meeting the paging query condition. The data partitions are adaptively divided according to the total amount of data contained in the target database, so that the number of the data partitions which can be queried in parallel is increased, and the query efficiency is improved; meanwhile, a window function is not needed in the query process, and data, not the id of the data, is directly acquired during query, so that the query time is saved, and the query efficiency is improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A paging query method, comprising:
receiving a paging query request, wherein the paging query request comprises a target database and paging query conditions;
responding to the paging query request, and dividing the target database into a plurality of data partitions according to the total amount of data contained in the target database;
inquiring in each data partition according to the paging inquiry condition to obtain a first target data partition;
and summarizing each first target data partition to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition.
2. The paging query method as claimed in claim 1, wherein the step of summarizing each of the first target data partitions to obtain a second target data partition, and querying the second target data partition to obtain target data satisfying the paging query condition comprises:
if no other task request related to the paging query request exists, summarizing each first target data partition at a result collection end to obtain a second target data partition, and querying in the second target data partition to obtain target data meeting the paging query condition.
3. The paging query method as claimed in claim 1, wherein the step of summarizing each of the first target data partitions to obtain a second target data partition, and querying the second target data partition to obtain target data satisfying the paging query condition comprises:
if other task requests related to the paging query request exist, summarizing each first target data partition to obtain a second target data partition at a task execution end, and querying in the second target data partition to obtain target data meeting the paging query condition so as to execute the other task requests based on the target data.
4. The method for paging inquiry according to any one of claims 1 to 3, wherein the paging inquiry conditions include a filter sub-condition, a sorting sub-condition, a paging code and a number of paging inquiry pieces, and the step of inquiring in each of the data partitions according to the paging inquiry conditions to obtain the first target data partition comprises:
querying data meeting the screening sub-condition from each data partition;
sorting the data meeting the screening sub-condition in each data partition according to the sorting sub-condition to obtain a transition data partition;
and extracting a preset number of data of each transition data partition to generate the first target data partition, wherein the preset number is determined according to the paging number and the number of paging inquiry pieces.
5. The paging query method as claimed in claim 4, wherein the step of querying the second target data partition for target data satisfying the paging query condition comprises:
sorting the second target data partition according to the sorting sub-condition;
and querying the sorted second target data partition according to the paging number and the paging query number to obtain the target data.
6. A paging inquiry apparatus, comprising:
the device comprises a request receiving module, a paging query module and a paging query module, wherein the request receiving module is used for receiving a paging query request, and the paging query request comprises a target database and paging query conditions;
the data dividing module is used for responding to the paging query request and dividing the target database into a plurality of data partitions according to the total amount of data contained in the target database;
the data query module is used for querying each data partition according to the paging query condition to obtain a first target data partition;
the data query module is further configured to collect each first target data partition to obtain a second target data partition, and query in the second target data partition to obtain target data meeting the paging query condition.
7. The paging query device as claimed in claim 6, wherein the data query module is configured to, if there is no other task request associated with the paging query request, aggregate each of the first target data partitions at a result collection end to obtain a second target data partition, and query the second target data partition to obtain target data that meets the paging query condition.
8. The paging query device as claimed in claim 6, wherein the data query module is configured to, if there are other task requests associated with the paging query request, aggregate each of the first target data partitions at a task execution end to obtain a second target data partition, and query the second target data partition to obtain target data meeting the paging query condition, so as to execute the other task requests based on the target data.
9. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement the paging query method of any one of claims 1-5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the paging query method according to any one of claims 1 to 5.
CN201910873707.6A 2019-09-17 2019-09-17 Paging query method, paging query device, electronic equipment and computer-readable storage medium Active CN112527824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910873707.6A CN112527824B (en) 2019-09-17 2019-09-17 Paging query method, paging query device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910873707.6A CN112527824B (en) 2019-09-17 2019-09-17 Paging query method, paging query device, electronic equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN112527824A true CN112527824A (en) 2021-03-19
CN112527824B CN112527824B (en) 2023-04-18

Family

ID=74974386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910873707.6A Active CN112527824B (en) 2019-09-17 2019-09-17 Paging query method, paging query device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN112527824B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113946725A (en) * 2021-12-20 2022-01-18 飞狐信息技术(天津)有限公司 Paging query method and device, storage medium and electronic equipment
WO2024046352A3 (en) * 2022-09-02 2024-04-18 顺丰科技有限公司 Data query method and apparatus, and computer device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093500A1 (en) * 2009-01-21 2011-04-21 Google Inc. Query Optimization
US20120039536A1 (en) * 2010-08-10 2012-02-16 Xerox Corporation Optical character recognition with two-pass zoning
CN103678408A (en) * 2012-09-21 2014-03-26 阿里巴巴集团控股有限公司 Method and device for inquiring data
CN107103032A (en) * 2017-03-21 2017-08-29 中国科学院计算机网络信息中心 The global mass data paging query method sorted is avoided under a kind of distributed environment
CN107193822A (en) * 2016-03-14 2017-09-22 阿里巴巴集团控股有限公司 For the method for paging query, device and equipment
CN108647347A (en) * 2018-05-14 2018-10-12 中国平安财产保险股份有限公司 Pagination Display method, user equipment, storage medium and device
CN109359060A (en) * 2018-10-24 2019-02-19 北京奇虎科技有限公司 Data pick-up method, apparatus calculates equipment and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093500A1 (en) * 2009-01-21 2011-04-21 Google Inc. Query Optimization
US20120039536A1 (en) * 2010-08-10 2012-02-16 Xerox Corporation Optical character recognition with two-pass zoning
CN103678408A (en) * 2012-09-21 2014-03-26 阿里巴巴集团控股有限公司 Method and device for inquiring data
CN107193822A (en) * 2016-03-14 2017-09-22 阿里巴巴集团控股有限公司 For the method for paging query, device and equipment
CN107103032A (en) * 2017-03-21 2017-08-29 中国科学院计算机网络信息中心 The global mass data paging query method sorted is avoided under a kind of distributed environment
CN108647347A (en) * 2018-05-14 2018-10-12 中国平安财产保险股份有限公司 Pagination Display method, user equipment, storage medium and device
CN109359060A (en) * 2018-10-24 2019-02-19 北京奇虎科技有限公司 Data pick-up method, apparatus calculates equipment and computer storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
戴草帽的路飞: "java用多线程批次查询大量数据(Callable返回数据)方式", 《HTTPS://BLOG.CSDN.NET》 *
曹红兵: "基于多线程和分页技术的数据库查询", 《科技信息(科学教研)》 *
李爱武: "《融会贯通 从Oracle 12c到SQL Server 2016》", 31 December 2016, 北京邮电大学出版 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113946725A (en) * 2021-12-20 2022-01-18 飞狐信息技术(天津)有限公司 Paging query method and device, storage medium and electronic equipment
CN113946725B (en) * 2021-12-20 2022-03-01 飞狐信息技术(天津)有限公司 Paging query method and device, storage medium and electronic equipment
WO2024046352A3 (en) * 2022-09-02 2024-04-18 顺丰科技有限公司 Data query method and apparatus, and computer device and storage medium

Also Published As

Publication number Publication date
CN112527824B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN110321344B (en) Information query method and device for associated data, computer equipment and storage medium
CN111046034B (en) Method and system for managing memory data and maintaining data in memory
US8108411B2 (en) Methods and systems for merging data sets
US7644107B2 (en) System and method for batched indexing of network documents
EP2812815B1 (en) Web page retrieval method and device
AU2017243870B2 (en) "Methods and systems for database optimisation"
US7895171B2 (en) Compressibility estimation of non-unique indexes in a database management system
CN103207919A (en) Method and device for quickly inquiring and calculating MangoDB cluster
CN108228799B (en) Object index information storage method and device
CN112612827B (en) Database paging query method and device, computer equipment and storage medium
US7519636B2 (en) Key sequenced clustered I/O in a database management system
CN112527824B (en) Paging query method, paging query device, electronic equipment and computer-readable storage medium
CN104731945A (en) Full-text searching method and device based on HBase
CN114116762A (en) Offline data fuzzy search method, device, equipment and medium
CN106649385B (en) Data reordering method and device based on HBase database
CN112445833B (en) Data paging query method, device and system of distributed database
CN111858607A (en) Data processing method and device, electronic equipment and computer readable medium
CN113849499A (en) Data query method and device, storage medium and electronic device
CN111797095A (en) Index construction method and JSON data query method
CN109101595B (en) Information query method, device, equipment and computer readable storage medium
CN116132448A (en) Data distribution method based on artificial intelligence and related equipment
US20100268723A1 (en) Method of partitioning a search query to gather results beyond a search limit
CN113656438B (en) Data query method and device for data tree
CN114996552A (en) Data acquisition method and terminal
CN111143340B (en) Data processing method and device, server and client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant