Partition management method and device for short write stop duration, electronic equipment and storage medium

The partition management method and device address prolonged write-stop times in database partitioning by freezing the source partition's memory table and utilizing target partitions for immediate service provision, enhancing user experience and efficiency.

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

Patent Information

Application Number
CN202411252466.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

Existing database partitioning processes, such as partition splitting and merging, result in prolonged write-stop times due to the need for flushing memory tables to disk, leading to poor user experience.

Method used

A partition management method and device that freezes the memory table of a source partition during structural changes, creates target partitions, and executes data queries and writes based on the memory and ordered string tables of both source and target partitions, thereby reducing the write-stop time.

Benefits of technology

The method significantly shortens the write-stop duration by allowing the destination partition to provide services immediately after the memory table freeze, improving user experience and efficiency during partition splitting or merging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166062A_ABST
    Figure CN119166062A_ABST
Patent Text Reader

Abstract

The invention provides a partition management method and device with short write stop duration, electronic equipment and a storage medium, and the method comprises the following steps: receiving a structure change instruction for a source partition, freezing a memory table of the source partition, and creating at least one target partition, the structure change instruction comprises a partition splitting instruction or a partition merging instruction; and if a data query instruction aiming at the source partition is received, executing the data query instruction on the basis of referring to the memory table and the ordered character string table of the source partition and the corresponding target partition. According to the method, when the source partition is subjected to partition splitting or partition merging, the source partition is in the write stopping state only in the memory table freezing process of the source partition, the write stopping duration is greatly shortened compared with the duration that the memory table of the source partition is flashed to a disk in the related technology, and therefore the use experience of a user is improved.
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 partition management method and device with short write-stop time, an electronic device, and a storage medium. Background Art

[0002] Databases can store and manage data, such as adjusting the data storage structure, writing data, and querying data. In order to adapt to the rapid development of the Internet, the forms and functions of databases have become increasingly diverse in recent years. For example, new database forms such as distributed databases have gradually emerged, and databases have gradually acquired data balancing functions such as partition splitting and partition merging.

[0003] In the related art, during the process of partition splitting or partition merging, the source partition stops providing external services, and the destination partition needs to wait for the memory table of the source partition to be flushed to the disk and then provide external services by referring to the data on the source partition disk. That is, the partition is in a stop-writing state during the period when the memory table of the source partition is flushed to the disk. The duration of the stop-writing state is relatively long, resulting in a poor user experience. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a partition management method and device with a short write-stop time, an electronic device, and a storage medium.

[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 partition management method with a short write-stop duration is proposed, the method comprising:

[0007] receiving a structural change instruction for a source partition, freezing a memory table of the source partition, and creating at least one target partition, wherein the structural change instruction includes a partition splitting instruction or a partition merging instruction;

[0008] If a data query instruction for the source partition is received, the data query instruction is executed based on reference to the memory table and the ordered string table of the source partition and the corresponding target partition.

[0009] In one or more embodiments of this specification, before creating at least one destination partition, the method further includes:

[0010] The execution of the instruction to write the data that was not completed when the memory table of the source partition was frozen is completed.

[0011] In one or more embodiments of this specification, after creating at least one destination partition, the method further includes:

[0012] Commit the structure change transaction for the source partition.

[0013] In one or more embodiments of this specification, before freezing the memory table of the source partition, the method further includes:

[0014] The state of the source partition is modified to the source partition state.

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

[0016] If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

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

[0018] If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

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

[0020] If a data write instruction for the source partition is received when the memory table of the source partition is frozen and the source partition is in a non-source partition state, a new memory table is created and the data indicated by the data write instruction is written into the new memory table.

[0021] In one or more embodiments of the present specification, when the structure change instruction is a partition splitting instruction, executing the data query instruction based on referring to the memory table and the ordered string table of the source partition and the corresponding target partition includes:

[0022] The data query instruction is executed based on the filtering results of the memory table and the ordered string table of the source partition and the corresponding memory table and the ordered string table of the destination partition.

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

[0024] The data in the source partition is divided into corresponding destination partitions.

[0025] In one or more 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 partition management device with a short write-stop duration is provided, the device comprising:

[0028] A write stop module, configured to receive a structural change instruction for a source partition, freeze a memory table of the source partition, and create at least one target partition, wherein the structural change instruction includes a partition splitting instruction or a partition merging instruction;

[0029] The query module is used for executing the data query instruction for the source partition based on the memory table and the ordered string table of the source partition and the corresponding destination partition if the data query instruction for the source partition is received.

[0030] In one or more embodiments of this specification, the write stop module is further used for:

[0031] Before creating at least one destination partition, the data write instruction that was not completed when the memory table of the source partition was frozen is executed.

[0032] In one or more embodiments of this specification, the write stop module is further used for:

[0033] After creating at least one destination partition, a structure change transaction for the source partition is committed.

[0034] In one or more embodiments of this specification, the write stop module is further used for:

[0035] Before freezing the memory table of the source partition, the state of the source partition is modified to a source partition state.

[0036] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0037] If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

[0038] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0039] If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

[0040] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0041] If a data write instruction for the source partition is received when the memory table of the source partition is frozen and the source partition is in a non-source partition state, a new memory table is created and the data indicated by the data write instruction is written into the new memory table.

[0042] In one or more embodiments of this specification, when the structure change instruction is a partition splitting instruction, the query module is used to:

[0043] The data query instruction is executed based on the filtering results of the memory table and the ordered string table of the source partition and the corresponding memory table and the ordered string table of the destination partition.

[0044] In one or more embodiments of this specification, the device further includes a partitioning module, configured to:

[0045] The data in the source partition is divided into corresponding destination partitions.

[0046] In one or more embodiments of this 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 partition management method with short write-off time provided in the embodiment of this specification, if a partition splitting instruction, partition merging instruction or other structural change instruction for the source partition is received, the memory table of the source partition is frozen, and at least one destination partition is created; further, if a data query instruction for the source partition is received, the data query instruction is executed based on the memory table and ordered string table of the source partition and the corresponding destination partition. In other words, when the source partition is partition split or partition merged, the source partition stops providing external services, and the destination partition only needs to wait for the memory table of the source partition to be frozen before it can provide external services by referencing the memory table and ordered string table of the source partition, that is, the partition is only in a write-off state during the freezing process of the memory table of the source partition, and the write-off time is greatly shortened compared to the time for the memory table of the source partition to be written to the disk in the related art, thereby 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 partition management method with short write-stop duration provided by an exemplary embodiment.

[0058] Figure 3 It is a schematic diagram of partition splitting and partition merging provided by an exemplary embodiment.

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

[0060] Figure 5 It is a block diagram of a partition split management device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0061] 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.

[0062] 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.

[0063] Based on the technical problems mentioned in the background technology, at least one embodiment of this specification provides a partition management method with short downtime. This method can shorten the downtime of the partition during partition structure changes such as partition splitting and partition merging, thereby avoiding the downtime of too long in the process and affecting the user experience.

[0064] This method can be applied to Figure 1 The distributed database based on LSM-Tree storage engine is shown.

[0065] Please refer to the attached Figure 2 , which exemplarily shows the process of the partition management method with short write-stop time, including steps S201 to S203.

[0066] In step S201, a structural change instruction for a source partition is received, a memory table of the source partition is frozen, and at least one target partition is created, wherein the structural change instruction includes a partition splitting instruction or a partition merging instruction.

[0067] Please refer to the attached Figure 3 If the structural change instruction is a partition splitting instruction, there are multiple source partitions and one destination partition; if the structural change instruction is a partition merging instruction, there is one source partition and multiple destination partitions. It should be noted that the source partition mentioned in this specification is only a partition in the distributed database. It is only because the partition splitting or partition merging has occurred in most of the embodiments of this specification that the partition is referred to as the source partition, but the reference is not specific, but refers to any partition in the distributed database; moreover, for the sake of coherence and consistency of the description, in the embodiments of this specification where the partition has not undergone partition splitting and partition merging, the partition is also referred to as the source partition, but this does not have any restrictive effect.

[0068] Freezing the memory table (MemTable) of the source partition means that the memory table no longer receives data writing instructions.

[0069] Preferably, before freezing the memory table of the source partition, the method further comprises: modifying the state of the source partition to a source partition state.

[0070] Preferably, before creating at least one destination partition, the data write instruction that was not completed when the memory table of the source partition was frozen can be executed to complete.

[0071] Preferably, after creating at least one destination partition, the method further comprises: submitting a structural change transaction for the source partition. The submission of the structural change transaction indicates that the stop writing of the partition splitting or partition merging has ended, and the destination partition can provide data query, data writing and other services to the outside.

[0072] It should be understood that after the structural change transaction is committed, subsequent operations of partition splitting or partition merging can be performed, namely: the data in the source partition is divided into the corresponding destination partition; if all the data in the source partition has been divided, the source partition is deleted. Among them, when the data in the source partition is divided into the corresponding destination partition, the data in the source partition can be copied (replicated) to the corresponding destination partition. For example, the data in the ordered string table of the source partition is copied to the corresponding destination partition; the data in the frozen memory table of the source partition is copied to the corresponding destination partition, or the data of the frozen memory table is flushed to the disk of the source partition and then copied to the corresponding destination partition.

[0073] In step S202, if a data query instruction for the source partition is received, the data query instruction is executed based on reference to the memory table and the ordered string table (SSTable) of the source partition and the corresponding target partition.

[0074] After the source partition starts partition splitting or partition merging, it stops providing external services, including data writing services and data query services. When partition splitting or partition merging is not completed, there is no corresponding data in the destination partition (that is, the data that the destination partition should store after the partition splitting or partition merging is completed), so it is necessary to refer to the data in the source partition, that is, the data in the frozen memory table and the data in the ordered string table on the disk.

[0075] The corresponding target partition refers to the target partition where the data targeted by the data query instruction is located after the partition splitting or partition merging is completed.

[0076] Further, in the case where the structural change instruction is a partition splitting instruction, the data stored in the destination partition after the partition splitting is completed is part of the data of the source partition, that is, when executing the data query instruction, there is no need to reference all the data of the source partition, but only part of the data, that is, the data query instruction can be executed based on the filtering results of the memory table and the ordered string table of the source partition, and the corresponding memory table and the ordered string table of the destination partition, wherein the filtering results of the memory table and the ordered string table of the source partition can be the result of filtering the memory table and the ordered string table of the source partition according to the data range of the corresponding destination partition.

[0077] The partition management method with short write-stop time provided in the embodiments of the present specification is that when the source partition is split or merged, the source partition stops providing external services, and the destination partition only needs to wait for the memory table of the source partition to be frozen before it can provide external services by referencing the memory table and ordered string table of the source partition, that is, the partition is only in a write-stop state during the freezing process of the memory table of the source partition, and the write-stop time is greatly shortened compared to the time it takes for the memory table of the source partition to be flushed to the disk in the related art, thereby improving the user experience.

[0078] In some embodiments of the present disclosure, the method further comprises:

[0079] If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

[0080] Among them, the submission of the structure change transaction indicates that the stop writing of the partition splitting or partition merging has ended, and the target partition can provide data writing services to the outside. It can be seen that in this method, the partition where the partition splitting or partition merging occurs only stops writing when the memory table is frozen. The stop writing time is greatly shortened compared with the time it takes to flush the memory table of the source partition to the disk in the related technology, thereby improving the user experience.

[0081] In some embodiments of the present disclosure, the method further comprises:

[0082] If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

[0083] After the memory table of the source partition is frozen, it is necessary to wait for the execution of the data write instructions that have occurred but not completed on the memory table to be completed and the structural change transaction to be committed. This time is relatively short, so the data write instructions in this embodiment do not need to be rolled back or rejected, and it is sufficient to directly wait for the structural change transaction to be committed. After submission, the data indicated by the data write instruction can be written to the corresponding destination partition in the manner provided in the above embodiment.

[0084] In some embodiments of the present disclosure, the method further comprises:

[0085] If a data write instruction for the source partition is received when the memory table of the source partition is frozen and the source partition is in a non-source partition state, a new memory table is created and the data indicated by the data write instruction is written into the new memory table.

[0086] In this embodiment, the state of the source partition is not the source partition state, indicating that the source partition has not undergone partition splitting or partition merging, that is, the memory table of the source partition is frozen in a normal state, such as freezing and flushing after the amount of data in the memory table reaches a preset threshold. Therefore, in this case, you only need to create a new memory table and write data to the new memory table.

[0087] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, 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 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 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.

[0088] Please refer to Figure 5 The partition management device with short write-stop time can be applied to Figure 4 In the device shown in the figure, the technical solution of this specification is implemented. The partition management device with short write-stop time may include:

[0089] The write stop module 501 is used to receive a structure change instruction for a source partition, freeze the memory table of the source partition, and create at least one target partition, wherein the structure change instruction includes a partition splitting instruction or a partition merging instruction;

[0090] The query module 502 is configured to, if a data query instruction for the source partition is received, execute the data query instruction based on reference to the memory table and the ordered string table of the source partition and the corresponding target partition.

[0091] In one or more embodiments of this specification, the write stop module is further used for:

[0092] Before creating at least one destination partition, the data write instruction that was not completed when the memory table of the source partition was frozen is executed.

[0093] In one or more embodiments of this specification, the write stop module is further used for:

[0094] After creating at least one destination partition, committing a structure change transaction for the source partition.

[0095] In one or more embodiments of this specification, the write stop module is further used for:

[0096] Before freezing the memory table of the source partition, the state of the source partition is modified to a source partition state.

[0097] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0098] If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

[0099] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0100] If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

[0101] In one or more embodiments of this specification, the device further includes a writing module, which is used to:

[0102] If a data write instruction for the source partition is received when the memory table of the source partition is frozen and the source partition is in a non-source partition state, a new memory table is created and the data indicated by the data write instruction is written into the new memory table.

[0103] In one or more embodiments of this specification, when the structure change instruction is a partition splitting instruction, the query module is used to:

[0104] The data query instruction is executed based on the filtering results of the memory table and the ordered string table of the source partition and the corresponding memory table and the ordered string table of the destination partition.

[0105] In one or more embodiments of this specification, the device further includes a partitioning module, configured to:

[0106] The data in the source partition is divided into corresponding destination partitions.

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

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

[0109] 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.

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

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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.

[0115] 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.

[0116] 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.

[0117] 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".

[0118] 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 partition management method with short write-stop duration, the method comprising: receiving a structural change instruction for a source partition, freezing a memory table of the source partition, and creating at least one target partition, wherein the structural change instruction includes a partition splitting instruction or a partition merging instruction; If a data query instruction for the source partition is received, the data query instruction is executed based on reference to the memory table and the ordered string table of the source partition and the corresponding target partition.

2. The partition management method with short write-stop duration according to claim 1, before creating at least one destination partition, the method further comprises: The execution of the instruction to write the data that was not completed when the memory table of the source partition was frozen is completed.

3. The partition management method with short write-stop duration according to claim 2, after creating at least one destination partition, the method further comprises: Commit the structure change transaction for the source partition.

4. The partition management method with short write-stop duration according to claim 3, before freezing the memory table of the source partition, the method further comprises: The state of the source partition is modified to the source partition state.

5. The partition management method of short write-stop duration according to claim 4, further comprising: If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

6. The partition management method of short write-stop duration according to claim 4, further comprising: If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

7. The partition management method of short write-stop duration according to claim 4, further comprising: If a data write instruction for the source partition is received when the memory table of the source partition is frozen and the source partition is in a non-source partition state, a new memory table is created and the data indicated by the data write instruction is written into the new memory table.

8. The partition management method with short write-stop duration according to claim 1, wherein when the structure change instruction is a partition splitting instruction, executing the data query instruction based on reference to the memory table and the ordered string table of the source partition and the corresponding target partition comprises: The data query instruction is executed based on the filtering results of the memory table and the ordered string table of the source partition and the corresponding memory table and the ordered string table of the destination partition.

9. The partition management method of short write-stop duration according to claim 1, further comprising: The data in the source partition is divided into corresponding destination partitions.

10. The partition management method of short write-stop duration according to claim 1, further comprising: If all data in the source partition is partitioned, the source partition is deleted.

11. A partition management device with short write-stop duration, the device comprising: A write stop module, configured to receive a structural change instruction for a source partition, freeze a memory table of the source partition, and create at least one target partition, wherein the structural change instruction includes a partition splitting instruction or a partition merging instruction; The query module is used for executing the data query instruction for the source partition based on the memory table and the ordered string table of the source partition and the corresponding destination partition if the data query instruction for the source partition is received.

12. The partition management device with short write-stop duration according to claim 11, wherein the write-stop module is further used for: Before creating at least one destination partition, the data write instruction that was not completed when the memory table of the source partition was frozen is executed.

13. The partition management device with short write-stop duration according to claim 12, wherein the write-stop module is further used for: After creating at least one destination partition, a structure change transaction for the source partition is committed.

14. The partition management device with short write-stop duration according to claim 13, wherein the write-stop module is further configured to: Before freezing the memory table of the source partition, the state of the source partition is modified to a source partition state.

15. The partition management device with short write-stop duration according to claim 14, further comprising a writing module, configured to: If a data write instruction is received for the source partition when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction has been committed, the data write instruction is sent to the corresponding target partition, and the target partition writes the data indicated by the data write instruction into the memory table of the target partition.

16. The partition management device with short write-stop duration according to claim 14, further comprising a writing module, configured to: If a data write instruction for the source partition is received when the memory table of the source partition is frozen, the state of the source partition is the source partition state, and the structure change transaction is not committed, wait for the structure change transaction to be committed.

17. The partition management device with short write-stop duration according to claim 11, wherein when the structure change instruction is a partition splitting instruction, the query module is used to: The data query instruction is executed based on the filtering results of the memory table and the ordered string table of the source partition and the corresponding memory table and the ordered string table of the destination partition.

18. 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 10.

19. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 10 by running the executable instructions.

20. 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 10.

Citation Information

Cited By

  • Partition management method and apparatus for short write pause durations, electronic device, and storage medium

    WO2026052119A1