Data query method and device applied to partition splitting process and electronic equipment

By receiving and processing query instructions during database partition splitting, and using the data boundaries of the destination partition and source partition for filtering or cutting, the problem of not being able to provide data query services during partition splitting is solved, and the service continuity and user experience are achieved. improve.

CN119166679APending Publication Date: 2024-12-20BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411252459.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

During the database partition splitting process, data query services cannot be provided, resulting in the user experience being affected.

Method used

By receiving split instructions, creating a destination partition and dividing data, and receiving and processing data query instructions during partition splitting, the data boundaries of the destination partition and source partition are filtered or cropped to ensure the continuity of the data query service.

Benefits of technology

It realizes the provision of data query services to the outside world during partition splitting, avoids the impact of user experience caused by the service cessation, and ensures the accuracy of query results and the normal progress of partition splitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166679A_ABST
    Figure CN119166679A_ABST
Patent Text Reader

Abstract

The invention provides a data query method and device applied to a partition splitting process and electronic equipment, and the method comprises the steps: receiving a splitting instruction for a source partition, creating at least one target partition, and dividing data in the source partition into the at least one target partition; if a data query instruction aiming at the source partition is received in the process of dividing the data in the source partition into the at least one target partition, referring to the data in the target partition which the data query instruction aims at, and executing the data query instruction on the basis of the data corresponding to the destination partition in the source partition, wherein the destination partition is targeted by the data query instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of database technology, and in particular, to a data query method and device, and an electronic device applied in a partition splitting process. Background Art

[0002] Both traditional Internet technology and emerging artificial intelligence technology rely on data support, especially artificial intelligence technologies such as machine learning that rely on big data, which makes databases increasingly important. In recent years, the amount of data in databases has been increasing, which has posed a great challenge to database management.

[0003] In a database, especially a distributed database, a data table can be divided into multiple partitions to achieve data balance, parallel processing and other effects. As the amount of data in a partition increases, it is often necessary to split the partition to prevent the amount of data in the partition from being too large. However, in related technologies, when a partition in the database is split, it is impossible to provide services such as data query, that is, it is necessary to wait until the partition split is completed before providing data query services to the outside world. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a data query method and device, and an electronic device applied in a partition splitting process.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a data query method applied in a partition splitting process is proposed, the method comprising:

[0007] receiving a split instruction for a source partition, creating at least one target partition, and dividing data in the source partition into the at least one target partition;

[0008] If a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition, the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction.

[0009] In one or more possible embodiments of the present specification, executing the data query instruction based on the data in the destination partition targeted by the data query instruction and the data in the source partition corresponding to the destination partition targeted by the data query instruction includes:

[0010] The data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction.

[0011] In one or more possible embodiments of the present specification, executing the data query instruction based on the data in the destination partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the destination partition targeted by the data query instruction includes:

[0012] In the case where the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range;

[0013] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and scan the data in the source partition and the data in the destination partition targeted by the data query instruction based on the scanning range to obtain the data within the scanning range;

[0014] The data query instruction is executed based on the data within the scanning range.

[0015] In one or more possible embodiments of the present specification, executing the data query instruction based on the data in the destination partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the destination partition targeted by the data query instruction includes:

[0016] In a case where the data table to which the source partition belongs is a local index table, generating a data filter based on a data boundary of a destination partition targeted by the data query instruction;

[0017] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain data not filtered out by the data filter;

[0018] The data query instruction is executed based on the data not filtered out by the data filter.

[0019] In one or more possible embodiments of the present specification, the acquiring the data in the source partition and the data in the destination partition targeted by the data query instruction, and filtering the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain the data not filtered by the data filter, includes:

[0020] The data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction, which are not filtered out by the data filter. The storage layer obtains the data in the source partition and the data in the target partition targeted by the data query instruction, and filters the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter.

[0021] In one or more possible embodiments of the present specification, filtering the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter includes:

[0022] For each data row in the data in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out; if the data row does not meet the filtering condition of the data filter, the data row is retained.

[0023] In one or more possible embodiments of the present specification, executing the data query instruction based on the data in the destination partition targeted by the data query instruction and the data in the source partition corresponding to the destination partition targeted by the data query instruction includes:

[0024] The data query instruction is executed based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

[0025] In one or more possible embodiments of this specification, the method further includes:

[0026] If all data in the source partition is partitioned, the source partition is deleted.

[0027] According to a second aspect of one or more embodiments of this specification, a data query device applied in a partition splitting process is provided, the device comprising:

[0028] A splitting module, configured to receive a splitting instruction for a source partition, create at least one destination partition, and divide the data in the source partition into the at least one destination partition;

[0029] A query module, for, if a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition, executing the data query instruction based on reference to the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction.

[0030] In one or more possible embodiments of the present specification, the query module is used to:

[0031] The data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction.

[0032] In one or more possible embodiments of the present specification, the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, be used to:

[0033] In the case where the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range;

[0034] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and scan the data in the source partition and the data in the destination partition targeted by the data query instruction based on the scanning range to obtain the data within the scanning range;

[0035] The data query instruction is executed based on the data within the scanning range.

[0036] In one or more possible embodiments of the present specification, the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, be used to:

[0037] In a case where the data table to which the source partition belongs is a local index table, generating a data filter based on a data boundary of a destination partition targeted by the data query instruction;

[0038] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain data not filtered out by the data filter;

[0039] The data query instruction is executed based on the data not filtered out by the data filter.

[0040] In one or more possible embodiments of the present specification, the query module is used to obtain the data in the source partition and the data in the target partition targeted by the data query instruction, and filter the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter, and when the data not filtered out by the data filter is obtained, it is used to:

[0041] The data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction, which are not filtered out by the data filter. The storage layer obtains the data in the source partition and the data in the target partition targeted by the data query instruction, and filters the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter.

[0042] In one or more possible embodiments of the present specification, when the query module is used to filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter, it is used to:

[0043] For each data row in the data in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out; if the data row does not meet the filtering condition of the data filter, the data row is retained.

[0044] In one or more possible embodiments of the present specification, the query module is used to:

[0045] The data query instruction is executed based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

[0046] In one or more possible embodiments of the present specification, the device further includes a deletion module, configured to:

[0047] If all data in the source partition is partitioned, the source partition is deleted.

[0048] According to a third aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.

[0049] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0050] processor;

[0051] a memory for storing processor-executable instructions;

[0052] The processor implements the method as described in the first aspect by running the executable instructions.

[0053] According to a fifth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0054] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0055] The data query method provided in the embodiment of the present specification is applied to the partition splitting process. By receiving a splitting instruction for a source partition, at least one destination partition is created, and the data in the source partition is divided into the at least one destination partition and is in the process of partition splitting. If a data query instruction for the source partition is received during this process, the data query instruction can be executed based on the data in the destination partition targeted by the data query instruction and the data in the source partition corresponding to the destination partition targeted by the data query instruction, thereby providing data query services to the outside during the partition splitting process, avoiding affecting the user experience due to service suspension, that is, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a structural diagram of a distributed database provided by an exemplary embodiment.

[0057] Figure 2 It is a flowchart of a data query method applied in a partition splitting process provided by an exemplary embodiment.

[0058] Figure 3 The diagram is a logical diagram of transaction processing during a partition splitting process provided by an exemplary embodiment.

[0059] Figure 4It is a processing logic diagram of a data query instruction provided by an exemplary embodiment.

[0060] Figure 5 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0061] Figure 6 It is a block diagram of a data query device applied in a partition splitting process provided by an exemplary embodiment. DETAILED DESCRIPTION

[0062] 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 one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0063] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0064] In the related art, during the partition splitting process, the source partition stops serving, and the destination partition is not visible to the outside, and thus cannot provide services to the outside; only after the partition splitting is completed and the destination partition is visible to the outside can data query and other services be provided to the outside.

[0065] Based on the technical problems mentioned in the background technology, at least one embodiment of the present specification provides a data query method applied in the process of partition splitting. The method can provide data query services to the outside during the process of partition splitting. It can not only ensure the accuracy of the query results of the data query service, but also will not affect the normal progress of the partition splitting, thereby avoiding affecting the user experience due to the suspension of data query services during the partition splitting process.

[0066] This method can be applied to Figure 1 The distributed database based on the LSM-Tree storage engine, or other types of databases are shown.

[0067] Please refer to the attached Figure 2 , which exemplarily shows the process of the data query method applied in the partition splitting process, including steps S201 to S203.

[0068] In step S201, a split instruction for a source partition is received, at least one target partition is created, and data in the source partition is divided into the at least one target partition.

[0069] Exemplarily, multiple destination partitions are constructed according to the number of destination partitions indicated in the split instruction. For example, if the split instruction indicates that the source partition is to be split into two destination partitions, then two destination partitions are constructed.

[0070] Exemplarily, after receiving the split instruction, the source partition can be stopped from writing and the unfinished data write instruction in the source partition can be executed; and after waiting for the memory table (Memtable) in the source partition to be frozen and flushed to the disk to form an ordered string table (SSTable), the data in the source partition can be divided into the at least one destination partition, or after waiting for the memory table (Memtable) in the source partition to be frozen, the data in the source partition can be divided into the at least one destination partition. It should be understood that if the source partition is stopped from writing and then a data write instruction is received, it can be forwarded to the corresponding destination partition for execution.

[0071] Exemplarily, according to the mapping relationship between the data indicated in the split instruction and the destination partition, each data in the source partition is respectively divided into the corresponding destination partition, for example, each data in the source partition is respectively copied (duplicated) to the corresponding destination partition. For example, a source partition with a key range of [1,100) is split into a destination partition 1 with a key range of [1,50) and a destination partition 2 with a key range of [51,100). Then, in this step, the data in the source partition in the key range [1,50) can be divided into the destination partition 1, and the data in the source partition in the key range [51,100) can be divided into the destination partition 2.

[0072] It should be understood that if all data in the source partition is partitioned, the source partition will be deleted.

[0073] In step S202, if a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition, the data query instruction is executed based on reference to the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction.

[0074] Among them, the source partition stops external services after starting the partition split, including data writing services and data query services. When the partition split is not completed, the destination partition does not have all the corresponding data (that is, the data that the destination partition should store after the partition split is completed), so it is necessary to refer to the data in the source partition.

[0075] It should be understood that the stop writing of the source partition has ended when the data query instruction is received in this step. For example, the source partition ends the stop writing after freezing the memory table, then this step can execute the data query instruction based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction, and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction. For another example, the source partition ends the stop writing after freezing the memory table and flushing it to the disk to form an ordered string table, then this step can execute the data query instruction based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction, and the data in the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

[0076] Please refer to the attached Figure 3 , which exemplarily shows the transaction processing logic diagram in the partition splitting process of this specification. The old transaction (old trans) of the client data table scan (Client Table Scan) will be sent to the source partition (Old Partition (Parent)) of the database node for processing before the partition splitting; and the source partition (Old Partition (Parent)) begins to split (split) into two destination partitions (New Partition (Daughter)). The new transaction (new trans) of the client data table scan (Client Table Scan) will be partition-cut during the partition splitting process, that is, it will be sent to the corresponding destination partition (New Partition (Daughter)) in the database node. However, the destination partition (NewPartition (Daughter)) does not have all the corresponding data, so it is necessary to obtain the missing data (get new partition data) from the source partition (Old Partition (Parent)) and refer to the data in the destination partition (New Partition (Daughter)) and the obtained data to process the above new transaction (new trans).

[0077] The data query method provided in the embodiment of the present specification is applied to the partition splitting process. By receiving a splitting instruction for a source partition, at least one destination partition is created, and the data in the source partition is divided into the at least one destination partition and is in the process of partition splitting. If a data query instruction for the source partition is received during this process, the data query instruction can be executed based on the data in the destination partition targeted by the data query instruction and the data in the source partition corresponding to the destination partition targeted by the data query instruction, thereby providing data query services to the outside during the partition splitting process, avoiding affecting the user experience due to service suspension, that is, improving the user experience.

[0078] In some embodiments of the present disclosure, step S202 may be performed in the following manner: executing the data query instruction based on the data in the destination partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the destination partition targeted by the data query instruction.

[0079] Specifically, the above execution method provided in this embodiment can be completed according to the following optional examples.

[0080] Optional Example 1

[0081] First, when the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range. The primary key of the global index table is ordered, and the data boundary of the target partition in the partition splitting is also represented by the primary key, so the data range of the source partition can be partition-clipped based on the data boundary (i.e., the left and right boundaries) of the target partition to obtain a scanning range.

[0082] Next, the data in the source partition and the data in the destination partition targeted by the data query instruction are obtained, and the data in the source partition and the data in the destination partition targeted by the data query instruction are scanned based on the scanning range to obtain the data within the scanning range. For example, if the source partition stops writing after freezing the memory table, the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction, as well as the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction are scanned based on the scanning range; or, if the source partition stops writing after freezing the memory table and flushing it to the disk to form an ordered string table, the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction, as well as the data in the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction are scanned based on the scanning range.

[0083] Finally, the data query instruction is executed based on the data within the scanning range.

[0084] Optional Example 2

[0085] First, in the case where the data table to which the source partition belongs is a local index table, a data filter is generated based on the data boundary of the destination partition targeted by the data query instruction.

[0086] The data rows in the local index table are sorted by non-primary keys, that is, the primary keys are out of order, so partition pruning cannot be performed directly in the manner of the above optional example 1. The data filter may be an expression for representing a filtering condition.

[0087] Next, the data in the source partition and the data in the destination partition targeted by the data query instruction are obtained, and the data in the source partition and the data in the destination partition targeted by the data query instruction are filtered based on the data filter to obtain data not filtered by the data filter.

[0088] Exemplarily, the data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction that are not filtered out by the data filter, wherein the storage layer obtains the data in the source partition and the data in the target partition targeted by the data query instruction, and filters the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter. By pushing the data filter down to the storage layer so that the storage layer completes the data filtering and only returns the data corresponding to the target partition to the SQL execution layer, the amount of data transmission and the occupation of the data transmission channel can be reduced.

[0089] Whether it is the storage layer or the SQL execution layer, when obtaining the data in the source partition and the data in the target partition targeted by the data query instruction, if the source partition stops writing after freezing the memory table, then the data in the memory table and the ordered string table of the target partition targeted by the data query instruction, as well as the data in the memory table and the ordered string table of the source partition are obtained; if the source partition stops writing after freezing the memory table and flushing it to the disk to form an ordered string table, then the data in the memory table and the ordered string table of the target partition targeted by the data query instruction, as well as the data in the ordered string table of the source partition are obtained.

[0090] Whether it is the storage layer or the SQL execution layer, when filtering the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter, for each data row in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out, and if the data row does not meet the filtering condition of the data filter, the data row is retained.

[0091] Finally, the data query instruction is executed based on the data not filtered out by the data filter.

[0092] Please refer to the attached Figure 4 , which exemplarily shows the logical relationship between the processing methods provided by the above examples.

[0093] When scanning a partition in a data table (table scan), determine whether the partition is undergoing partition splitting (partition is splitting). If partition splitting is not occurring, directly scan the partition (scan partition) and output (output). If partition splitting is occurring, determine whether the data table to which the partition belongs is a local index (is local index). If it is not a local index, directly perform partition pruning (cut scan range), and scan the source partition and the destination partition based on the scan range obtained after partition pruning (scan src / dst partitions) for output (output); if it is a local index, obtain the data of the source partition and the destination partition (get src / dst partitions), and perform scan and filter (scan and filter) for output (output).

[0094] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other tasks. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0095] Please refer to Figure 6 The data query device used in the partition splitting process can be applied to Figure 5 The device shown in the figure can realize the technical solution of this specification. The data query device applied in the partition splitting process can include:

[0096] The split module 601 is used to receive a split instruction for a source partition, create at least one destination partition, and divide the data in the source partition into the at least one destination partition;

[0097] The query module 602 is used to execute the data query instruction based on the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction, if a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition.

[0098] In one or more possible embodiments of the present specification, the query module is used to:

[0099] The data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction.

[0100] In one or more possible embodiments of the present specification, the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, be used to:

[0101] In the case where the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range;

[0102] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and scan the data in the source partition and the data in the destination partition targeted by the data query instruction based on the scanning range to obtain the data within the scanning range;

[0103] The data query instruction is executed based on the data within the scanning range.

[0104] In one or more possible embodiments of the present specification, the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, be used to:

[0105] In a case where the data table to which the source partition belongs is a local index table, generating a data filter based on a data boundary of a destination partition targeted by the data query instruction;

[0106] Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain data not filtered out by the data filter;

[0107] The data query instruction is executed based on the data not filtered out by the data filter.

[0108] In one or more possible embodiments of the present specification, the query module is used to obtain the data in the source partition and the data in the target partition targeted by the data query instruction, and filter the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter, and when the data not filtered out by the data filter is obtained, it is used to:

[0109] The data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction, which are not filtered out by the data filter. The storage layer obtains the data in the source partition and the data in the target partition targeted by the data query instruction, and filters the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter.

[0110] In one or more possible embodiments of the present specification, when the query module is used to filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter, it is used to:

[0111] For each data row in the data in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out; if the data row does not meet the filtering condition of the data filter, the data row is retained.

[0112] In one or more possible embodiments of the present specification, the query module is used to:

[0113] The data query instruction is executed based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

[0114] In one or more possible embodiments of the present specification, the device further includes a deletion module, configured to:

[0115] If all data in the source partition is partitioned, the source partition is deleted.

[0116] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0117] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0118] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0119] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0120] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0121] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0122] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0123] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0124] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0125] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A data query method applied in a partition splitting process, the method include: receiving a split instruction for a source partition, creating at least one target partition, and dividing data in the source partition into the at least one target partition; If a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition, the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction.

2. The data query method applied to the partition splitting process according to claim 1, wherein the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction, include: The data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction.

3. The data query method applied to the partition splitting process according to claim 2, wherein the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, include: In the case where the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range; Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and scan the data in the source partition and the data in the destination partition targeted by the data query instruction based on the scanning range to obtain the data within the scanning range; The data query instruction is executed based on the data within the scanning range.

4. The data query method applied to the partition splitting process according to claim 2, wherein the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, include: In a case where the data table to which the source partition belongs is a local index table, generating a data filter based on a data boundary of a destination partition targeted by the data query instruction; Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain data not filtered out by the data filter; The data query instruction is executed based on the data not filtered out by the data filter.

5. According to the data query method applied to the partition splitting process of claim 4, the data in the source partition and the data in the target partition targeted by the data query instruction are obtained, and the data in the source partition and the data in the target partition targeted by the data query instruction are filtered based on the data filter to obtain the data not filtered by the data filter, include: The data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction, which are not filtered out by the data filter. The storage layer obtains the data in the source partition and the data in the target partition targeted by the data query instruction, and filters the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter.

6. The data query method applied to the partition splitting process according to claim 4 or 5, wherein the data in the source partition and the data in the target partition targeted by the data query instruction are filtered based on the data filter. include: For each data row in the data in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out; if the data row does not meet the filtering condition of the data filter, the data row is retained.

7. The data query method applied to a partition splitting process according to claim 1, wherein the data query instruction is executed based on the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction, include: The data query instruction is executed based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

8. The data query method applied to the partition splitting process according to claim 1, wherein the method further include: If all data in the source partition is partitioned, the source partition is deleted.

9. A data query device used in a partition splitting process, the device include: A splitting module, configured to receive a splitting instruction for a source partition, create at least one destination partition, and divide data in the source partition into the at least one destination partition; A query module, for, if a data query instruction for the source partition is received during the process of dividing the data in the source partition into the at least one target partition, executing the data query instruction based on reference to the data in the target partition targeted by the data query instruction and the data in the source partition corresponding to the target partition targeted by the data query instruction.

10. The data query device used in the partition splitting process according to claim 9, wherein the query module is used to: The data query instruction is executed based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction.

11. The data query device used in a partition splitting process according to claim 10, wherein the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, to: In the case where the data table to which the source partition belongs is a global index table, the data range of the source partition is clipped based on the data boundary of the target partition targeted by the data query instruction to obtain a scanning range; Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and scan the data in the source partition and the data in the destination partition targeted by the data query instruction based on the scanning range to obtain the data within the scanning range; The data query instruction is executed based on the data within the scanning range.

12. The data query device used in a partition splitting process according to claim 10, wherein the query module is used to, when executing the data query instruction based on the data in the target partition targeted by the data query instruction and the result of filtering the data in the source partition based on the data boundary of the target partition targeted by the data query instruction, to: In a case where the data table to which the source partition belongs is a local index table, generating a data filter based on a data boundary of a destination partition targeted by the data query instruction; Acquire the data in the source partition and the data in the destination partition targeted by the data query instruction, and filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter to obtain data not filtered out by the data filter; The data query instruction is executed based on the data not filtered out by the data filter.

13. The data query device used in the partition splitting process according to claim 12, wherein the query module is used to obtain the data in the source partition and the data in the target partition targeted by the data query instruction, and filter the data in the source partition and the data in the target partition targeted by the data query instruction based on the data filter, and when the data not filtered out by the data filter is obtained, it is used to: The data filter is sent to the storage layer to obtain the data in the source partition returned by the storage layer and the data in the target partition targeted by the data query instruction that are not filtered out by the data filter. in, The storage layer obtains the data in the source partition and the data in the destination partition targeted by the data query instruction, and filters the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter.

14. The data query device used in a partition splitting process according to claim 12 or 13, wherein when the query module is used to filter the data in the source partition and the data in the destination partition targeted by the data query instruction based on the data filter, it is used to: For each data row in the data in the source partition and the data in the target partition targeted by the data query instruction, if the data row meets the filtering condition of the data filter, the data row is filtered out; if the data row does not meet the filtering condition of the data filter, the data row is retained.

15. The data query device used in the partition splitting process according to claim 9, wherein the query module is used to: The data query instruction is executed based on the data in the memory table and the ordered string table of the destination partition targeted by the data query instruction and the data in the memory table and the ordered string table of the source partition corresponding to the destination partition targeted by the data query instruction.

16. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.

17. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by running the executable instructions.

18. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Data query method and apparatus used in partition splitting process, and electronic device

    WO2026052116A1