Database partitioning method and device, equipment and medium

By performing encrypted information security checksum partition processing on the master node in the distributed database system, the security and consistency problems caused by Byzantine node failure are solved, and the security and reliability guarantee of the distributed database system is achieved.

CN119292809APending Publication Date: 2025-01-10BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411223849.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Nodes with Byzantine failures in distributed database systems may occur, resulting in threats to system security and consistency, and it is difficult for existing technologies to effectively deal with this situation.

Method used

By allocating encrypted information between multiple master nodes of a distributed database for security verification, the master node that passed the verification is determined, and partitioned based on the results of two security verifications to ensure that each database partition has not passed the verification. The validated node ratio meets preset conditions to achieve security guarantee.

Benefits of technology

Effectively respond to the failures of Byzantine nodes in distributed database systems, ensure the correctness and consistency of the system, and avoid the negative impact of node failure on system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292809A_ABST
    Figure CN119292809A_ABST
Patent Text Reader

Abstract

The invention provides a database partitioning method and device, equipment and a medium. The method comprises the following steps of: performing security verification on a plurality of main nodes based on first encrypted information distributed to other main nodes by each main node in the plurality of main nodes of a distributed database so as to determine a plurality of first main nodes passing the security verification; therefore, each first main node distributes second encryption information obtained by dividing the first encryption information generated by the first main node to other first main nodes, and security verification is carried out on the plurality of first main nodes again based on the second encryption information distributed by each first main node to other first main nodes. And the plurality of main nodes are partitioned on the basis of the two security check results of the plurality of main nodes, so that the proportion of the main nodes which do not pass the two security check in each database partition meets a first preset condition, and the security of each database partition is guaranteed. And the distributed database can effectively deal with the node fault problem.
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 database partitioning method, apparatus, device, and medium. Background Art

[0002] Distributed database technology can not only effectively process big data and cope with high concurrent access, but also provide high availability and flexible scalability, and can meet the challenging requirements of modern applications for database performance, fault tolerance and data processing capabilities. In a distributed database, large data tables can be horizontally split into multiple partitions distributed on different servers through database partitioning technology to enhance the data management efficiency and data query speed of the distributed database, and can help the distributed database achieve load balancing and improve database throughput.

[0003] However, in some cases, nodes in a distributed database system may fail in any unpredictable way, resulting in Byzantine fault nodes in the distributed database system. Therefore, a database partitioning method is urgently needed to ensure the security of the distributed database system when Byzantine fault nodes appear in the distributed database system. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a database partitioning method, apparatus, device, and 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 database partitioning method is proposed, which is applicable to a distributed database including multiple master nodes. The method includes:

[0007] Based on the first encrypted information allocated by each of the multiple master nodes of the distributed database to other master nodes, security verification is performed on the multiple master nodes to determine multiple first master nodes that pass the security verification from the multiple master nodes, wherein the first encrypted information allocated to the other master nodes is complete;

[0008] Based on the second encrypted information allocated by each first master node to other first master nodes, the security of the multiple first master nodes is again verified, wherein, for any first master node, the second encrypted information allocated by the first master node to other first master nodes is a different part of the first encrypted information generated by the first master node;

[0009] Based on the results of the two security checks of the multiple master nodes, the multiple master nodes are partitioned so that the proportion of the master nodes that fail the two security checks in each database partition meets a first preset condition.

[0010] According to a second aspect of one or more embodiments of this specification, a database partitioning device is provided, the device comprising:

[0011] A first verification module, configured to perform security verification on the plurality of first master nodes again based on the second encryption information allocated by each first master node to other first master nodes, wherein, for any first master node, the second encryption information allocated by the first master node to other first master nodes is a different part of the first encryption information generated by the first master node;

[0012] A second verification module is used to perform security verification on the multiple first master nodes again based on the second encrypted information allocated by each first master node to other first master nodes, wherein the second encrypted information allocated to other master nodes is a part of the second encrypted information, and different first master nodes are allocated to different parts of the second encrypted information;

[0013] The partitioning module is used to partition the multiple master nodes based on the results of the two security checks of the multiple master nodes, so that the proportion of the master nodes that have not passed the two security checks in each database partition meets the first preset condition.

[0014] According to a third aspect of one or more embodiments of this specification, a computing device is provided, including:

[0015] processor;

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

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

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

[0019] This specification performs security verification on multiple master nodes based on the first encryption information assigned by each master node of multiple master nodes of a distributed database to other master nodes, so as to determine multiple first master nodes that pass the security verification, so that each first master node assigns a part of the first encryption information generated by itself to other first master nodes, so that each other master node can receive the second encryption information as a part of the first encryption information, and based on the second encryption information assigned by each first master node to other first master nodes, the security of the multiple first master nodes is verified again to achieve node security verification based on distributed encryption information, and then based on the two security verification results of the multiple master nodes, the multiple master nodes are partitioned, so that the proportion of master nodes that have not passed the two security verifications in each database partition meets the first preset condition, so as to achieve security protection for each database partition, so that the distributed database can effectively deal with node failure problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a system architecture diagram of a distributed database system provided by an exemplary embodiment.

[0021] Figure 2 The invention is a flowchart of a database partitioning method provided by an exemplary embodiment.

[0022] Figure 3 It is a schematic diagram of a distributed key generation process shown by an exemplary embodiment.

[0023] Figure 4 It is a schematic diagram of a database partition result provided by an exemplary embodiment.

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

[0025] Figure 6 It is a schematic block diagram of a database partitioning device provided by an exemplary embodiment. DETAILED DESCRIPTION

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

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

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

[0029] In the related art, in a distributed system, participating nodes may fail or exhibit unpredictable behavior (such as transmitting wrong information, etc.), and such nodes can be called Byzantine nodes. It should be noted that a Byzantine node may be a defective node, such as a node that makes wrong decisions or sends wrong information due to software errors or hardware errors; it may also be a malicious node, such as a node controlled by an attacker, deliberately destroying the protocol or spreading wrong information; it may also be an unresponsive node, such as a node that fails to send or receive information in time due to network problems or other reasons.

[0030] In some cases, Byzantine nodes may appear in the distributed database system, that is, the nodes may fail in any unpredictable way, including but not limited to returning wrong information, deliberately causing confusion or keeping silent, etc. The existence of these Byzantine nodes will bring a series of adverse effects to the distributed database system. In view of this, this specification hopes to provide a database partitioning method to ensure the correctness and consistency of the distributed database system when a certain number of nodes exhibit Byzantine behavior.

[0031] See also Figure 1 , Figure 1 is a system architecture diagram of a distributed database system provided by an exemplary embodiment. Figure 1In the distributed database system shown, two servers (Server) can be deployed in zone 1 (i.e. Zone1), zone 2 (i.e. Zone2), zone 3 (i.e. Zone3) and zone 4 (i.e. Zone4) respectively, where Server10 and Server11 can be deployed in Zone1, Server20 and Server21 can be deployed in Zone2, Server30 and Server31 can be deployed in Zone3, and Server40 and Server41 can be deployed in Zone4.

[0032] In some embodiments, replica P00 can be deployed on Server10, Server20, Server30 and Server40, and replica P00 can be used as the primary replica in Server10; replica P01 can be deployed on Server10, Server20, Server30 and Server40, and replica P10 can be used as the primary replica in Server20; replica P02 can be deployed on Server10, Server20, Server30 and Server40, and replica P02 can be used as the primary replica in Server30; replica P03 can be deployed on Server10, Server20, Server30 and Server40, and replica P03 can be used as the primary replica in Server40. Master replica; replica P04 can be deployed on Server11, Server21, Server31 and Server41, and in Server11, replica P04 can serve as the master replica; replica P05 can be deployed on Server11, Server21, Server31 and Server41, and in Server21, replica P05 can serve as the master replica; replica P06 can be deployed on Server11, Server21, Server31 and Server41, and in Server31, replica P06 can serve as the master replica; replica P07 can be deployed on Server11, Server21, Server31 and Server41, and in Server41, replica P07 can serve as the master replica.

[0033] That is, replicas P00, P01, P02, and P03 can be deployed in Server10, where replica P00 is the master replica and replicas P01, P02, and P03 are slave replicas; replicas P04, P05, P06, and P07 can be deployed in Server11, where replica P04 is the master replica and replicas P05, P06, and P07 are slave replicas; replicas P00, P01, P02, and P03 can be deployed in Server20, where replica P01 is the master replica and replicas P02, P02, and P03 are slave replicas; replicas P04, P05, P06, and P07 can be deployed in Server21, where replica P05 is the master replica and replicas P04, P06, and P07 are slave replicas. Replicas P00, P01, P02 and P03 can be deployed in Server30, among which replica P02 is the master replica and replicas P00, P01 and P03 are slave replicas; replicas P04, P05, P06 and P07 can be deployed in Server31, among which replica P06 is the master replica and replicas P04, P05 and P07 are slave replicas; replicas P00, P01, P02 and P03 can be deployed in Server40, among which replica P03 is the master replica and replicas P00, P01 and P02 are slave replicas; replicas P04, P05, P06 and P07 can be deployed in Server41, among which replica P07 is the master replica and replicas P04, P05 and P06 are slave replicas.

[0034] The database partitioning method provided in this manual can be used to Figure 1 The partition operation of the distributed database system shown in Figure 1 The master replica (or master node) on each server in the distributed database system shown is divided into multiple database partitions.

[0035] It should be noted that Figure 1 This is only an illustrative description of the application scenarios of the database partitioning method provided in this specification, and does not constitute a limitation on the application scenarios of the database partitioning method provided in this specification. In more possible implementations, the database partitioning method provided in this specification can also implement database partitioning processing for other distributed systems. In addition, the database partitioning method provided in this specification can also implement database partitioning processing for non-distributed (such as centralized) systems, and this specification does not limit this.

[0036] Optionally, the database partitioning method provided in this specification may be executed by a computing device, and the computing device may be a server, such as one server, multiple servers, a server cluster, a cloud computing platform, etc., but is not limited thereto.

[0037] After introducing the application scenarios of the database partitioning method provided in this specification, the implementation method of the database partitioning method provided in this specification is introduced below.

[0038] See also Figure 2 , Figure 2 is a flowchart of a database partitioning method provided by an exemplary embodiment. Figure 2 As shown, the method can be applied to a distributed database including multiple master nodes, and the method includes:

[0039] Step 201: Based on the first encryption information allocated by each of the multiple master nodes of the distributed database to other master nodes, security verification is performed on the multiple master nodes to determine multiple first master nodes that pass the security verification from the multiple master nodes, wherein the first encryption information allocated to the other master nodes is complete.

[0040] Optionally, each master node in the distributed database system may be equipped with a pair of public and private keys (E i ,D i ), where E i is the public key, D i It is a private key, known only to the master node itself.

[0041] In some embodiments, each master node may encrypt using a private key to obtain first encrypted information, thereby distributing the first encrypted information to other master nodes in the distributed database. The master node that receives the first encrypted information may use a public verification algorithm to verify the validity of the received first encrypted information, so as to implement security verification of each master node that receives the first encrypted information.

[0042] Among them, for the master node whose received first encrypted information verification is valid, it can be considered that it has passed the security check, and for the master node whose received first encrypted information verification is invalid, it can be considered that it has failed the security check.

[0043] Step 202: Based on the second encryption information assigned by each first master node to other first master nodes, security verification is performed again on multiple first master nodes, wherein, for any first master node, the second encryption information assigned by the first master node to other first master nodes is a different part of the first encryption information generated by the first master node.

[0044] Optionally, each first master node can decapsulate the first encrypted information generated by itself into multiple fragments (or multiple shares) to obtain multiple second encrypted information, so that the multiple second encrypted information can be respectively distributed to different first master nodes to realize the validity verification of each first master node based on the distributed second encrypted information.

[0045] In some embodiments, each first master node that receives the second encrypted information may verify the validity of the received second encrypted information. Optionally, for a master node that verifies the received second encrypted information as valid, it may be considered that it has passed the security check, and for a master node that verifies the received second encrypted information as invalid, it may be considered that it has failed the security check.

[0046] Step 203: partition the multiple master nodes based on the results of the two security checks of the multiple master nodes, so that the proportion of the master nodes that have not passed the two security checks in each database partition meets the first preset condition.

[0047] The above-mentioned embodiment performs security verification on multiple master nodes based on the first encryption information assigned by each master node of the multiple master nodes of the distributed database to other master nodes, so as to determine multiple first master nodes that pass the security verification, so that each first master node assigns a part of the first encryption information generated by itself to other first master nodes, so that each other master node can receive the second encryption information as a part of the first encryption information, and based on the second encryption information assigned by each first master node to other first master nodes, the security of the multiple first master nodes is verified again to achieve node security verification based on distributed encryption information, and then based on the two security verification results of the multiple master nodes, the multiple master nodes are partitioned, so that the proportion of master nodes that have not passed the two security verifications in each database partition meets the first preset condition, so as to achieve security protection for each database partition, so that the distributed database can effectively deal with node failure problems.

[0048] In some embodiments, the database partitioning method provided in this specification can be used to partition the master node in the database when the database is first created, and can also be used to partition the newly added nodes each time a new node is added subsequently, but is not limited to this.

[0049] Optionally, when partitioning the master node in the database when the database is first created, the database partitioning can be implemented through multiple rounds of database partitioning operations, and each round of database partitioning operations can be used to partition a node in the database. Optionally, when a new node is added later, the partitioning of the newly added node can also be implemented through one round of database partitioning operations.

[0050] For example, for a database including four master nodes, the database can be partitioned through four rounds of database partitioning operations to divide the four master nodes into corresponding database partitions; and when a new node is to be added later, the partition of the newly added node can be implemented through the fifth round of database partitioning operations to divide the newly added node into the corresponding database partition.

[0051] The following introduces the optional implementation of the database partitioning method provided in this specification.

[0052] In some embodiments, for step 201, when security verification is performed on multiple master nodes based on the first encryption information allocated by each master node of the multiple master nodes of the distributed database to other master nodes, it can be implemented by the following steps:

[0053] Step 2011: When performing database partitioning in each round, select a master node from multiple master nodes as an initiating node, so as to generate first encrypted information based on a private key through the master node serving as the initiating node.

[0054] In a possible implementation, when performing database partitioning in each round, a master node may be randomly selected from multiple master nodes as an initiating node (ie, a dealer), so that the master node can generate the first encrypted information based on a private key.

[0055] Optionally, when generating the first encrypted information, the master node as the initiating node may sign using the private key and the random value generated in the previous round to realize the generation of the first encrypted information.

[0056] For example, when performing database partitioning in the Nth round, the master node as the initiating node may sign using the private key and random parameter information to obtain first encrypted information, wherein the random parameter information is used to indicate the random value generated in the N-1th round.

[0057] Optionally, when performing database partitioning in the Nth round, the master node serving as the initiating node may use a private key to sign the information to be encrypted in this round (including but not limited to node information) and the random value generated in the N-1th round to obtain the first encrypted information of the Nth round.

[0058] It should be noted that when performing data partitioning in the first round, the random parameter information used to generate the first encryption information can be a pre-generated random value. For example, a pre-set seed can be used to generate a random value for round 0 as the random parameter information used to generate the first encryption information for the first round of data partitioning.

[0059] Step 2012: The master node serving as the initiating node sends the generated first encrypted information to other master nodes.

[0060] Step 2013: Other master nodes perform validity verification on the first encrypted information assigned to them based on the public verification algorithm and the public key.

[0061] It should be noted that each master node is equipped with a public verification program (i.e., a public verification algorithm), and each master node is equipped with a pair of function combinations (including a public key and a private key), so that each master node can use the public verification algorithm and the public key to verify the validity of the assigned first encrypted information.

[0062] Optionally, the received first encrypted information may be decrypted using a public key and a public verification algorithm. If the decryption is successful, it may be considered that the security check has been passed. If the decryption is unsuccessful, it may be considered that the security check has not been passed.

[0063] It should be noted that, through the security verification method provided in the above embodiment, each master node can realize security verification of each master node without having to exchange information with the master node playing the role of the dealer (i.e., the master node serving as the initiating node) or exchanging information with other master nodes.

[0064] Optionally, if the first encrypted information received by any master node fails the validity verification, it can be considered that the master node has passed this security check. Conversely, if the first encrypted information received by any master node fails the validity verification, it can be considered that the master node has failed this security check.

[0065] It should be noted that, for the first master node that has passed the first security check, a distributed key generation process can be used to create an encrypted information shared by all master nodes, and no single node has a complete understanding of it, so that the second security check can be performed on each master node through the encrypted information shared by all master nodes. Optionally, the second security check can be performed on the first master node that has passed the first security check through step 202.

[0066] In some embodiments, for step 202, when security verification is performed again on multiple first master nodes based on the second encryption information allocated by each first master node to other first master nodes, it can be implemented by the following steps:

[0067] Step 2021: When performing database partitioning in each round, each first master node splits the generated first encrypted information into multiple fragments to obtain multiple second encrypted information.

[0068] Optionally, each first master node may use a private key and random parameter information to sign to obtain first encrypted information. The specific implementation method may refer to step 2011 and will not be repeated here.

[0069] In a possible implementation, each first master node may split the first encrypted information generated by itself into multiple fragments (or multiple shares), and each fragment is a second encrypted information.

[0070] Optionally, for any first master node, the first master node can divide the first encrypted information generated by itself into a corresponding number of fragments according to the number of first master nodes in the distributed database. For example, if there are 6 first master nodes that pass the first security check in the distributed database system, then for any first master node, the first master node can divide the first encrypted information generated by itself into 6 fragments to obtain 6 second encrypted information.

[0071] Optionally, the proportion of each segment to the first encrypted information may be the same or different, and this specification does not limit this. It should be noted that the proportion of each segment to the first encrypted information is, that is, the proportion of the amount of encrypted information included in each segment to the total amount of information in the first encrypted information, for example, the proportion of the length of encrypted information included in each frequency band to the total length of the first encrypted information.

[0072] Step 2022: Each first master node sends a second encrypted message to other first master nodes respectively.

[0073] It should be noted that each first master node sends a second encrypted message to other first master nodes respectively, so that the first master node can share the first encrypted information generated by itself with other first master nodes.

[0074] For example, in a distributed database system, there are 6 first master nodes that pass the first security check. For any first master node, the first master node splits the first encrypted information generated by itself into 6 fragments, that is, 6 second encrypted information are obtained, and then distribution can be made based on 5 of the second encrypted information to allocate one second encrypted information to each of the other 5 first master nodes.

[0075] In one possible implementation, each first master node can also broadcast commitment information to other first master nodes, where the commitment information is used to indicate the number of fragments obtained by splitting the generated first encrypted information and the proportion of information contained in each fragment to the total amount of information in the first encrypted information, so that other first master nodes can understand how many second encrypted information the first master node that allocates the second encrypted information to itself has divided into, and the proportion of each second encrypted information.

[0076] Step 2023: Each first master node verifies the validity of the received second encrypted information.

[0077] Optionally, each first master node may use a public verification vector to verify the validity of the received second encrypted information.

[0078] In one possible implementation, for a first master node for which the received second encrypted information verification is invalid, it can be considered that it has failed the second security check. Conversely, for a first master node for which the received second encrypted information verification is valid, it can be considered that it has passed the security check.

[0079] In one possible implementation, the first master node that verifies the received second encrypted information as invalid can broadcast a complaint message, so that the first master node that generates the first encrypted information corresponding to the second encrypted information can broadcast the correct result of the second encrypted information that has been verified as invalid in response to the complaint message.

[0080] That is, if a first master node finds that the second encrypted information it receives is invalid, the first master node can make a public complaint, and the first master node that allocates the second encrypted information to the first master node can publicly disclose the correct result of the second encrypted information.

[0081] It should be noted that after the first master node that allocates the second encrypted information to the first master node can disclose the correct result of the second encrypted information, each first master node can obtain the correct result of the disclosed second encrypted information to ensure that the complete first encrypted information can be obtained by summing up the shares known by all master nodes.

[0082] Optionally, for the first master node that passes the second security check, any first master node among the multiple first master nodes can generate collective signature information based on all the second encrypted information received, and thus determine the random parameter information corresponding to the current round of database partitioning process based on the collective signature information. The determined random parameter information can be used to ensure the smooth progress of the next round of database partitioning process.

[0083] Optionally, for the first master node that passes the second security check, any first master node among the multiple first master nodes may use the Generate function to restore the collective signature based on all the received second encrypted information to obtain the collective signature information.

[0084] It should be noted that the Generate function can reconstruct the signature of the entire collective from multiple signature shares, and due to the unique nature of the signature, no matter which shares are used as input, the collective signature output by the Generate function will remain consistent.

[0085] Optionally, a hash operation may be performed based on the collective signature information, so that the hash value of the collective signature information is used as random parameter information corresponding to the current round of database partitioning process.

[0086] See also Figure 3 , Figure 3 is a schematic diagram of a distributed key generation process shown in an exemplary embodiment. Figure 3 As shown, through the distributed key generation process as described above, a shared collective private key and a corresponding collective public key pair can be established between n master nodes. Each master node can obtain a copy of the collective public key and a private share of the collective private key to ensure that no single node has all the collective private keys. These private key shares can then be used to perform collective signature calculations to implement the subsequent partitioning process.

[0087] After completing two security checks on each master node through the above embodiment, the multiple master nodes can be partitioned based on the two security check results of the multiple master nodes through step 203.

[0088] In some embodiments, for step 203, multiple master nodes may be partitioned based on the results of two security checks of multiple master nodes, so that the proportion of master nodes that have not passed the two security checks in each database partition meets a first preset condition. The first preset condition may be that the proportion of the number of master nodes that have not passed the two security checks in the total number of database partition nodes meets a first value, and the first value may be 1 / 3.

[0089] That is, through step 203, based on the results of the two security checks of multiple master nodes, the master nodes that passed the two security checks and the master nodes that did not pass the two security checks can be partitioned, so that the proportion of the master nodes that did not pass the two security checks in each database partition does not exceed one third of the total number of nodes in the database partition.

[0090] In a possible implementation, when partitioning multiple master nodes based on the two security verification results of multiple master nodes, it can be implemented in the following way:

[0091] When performing database partitioning in the Nth round, for any master node, if the master node passes two security checks, the database partition is divided for the master node according to the random parameter information corresponding to this round of database partitioning process.

[0092] Optionally, there will be a target partition for each round of database partitioning. This round of database partitioning operation expects to partition the master node of this round of operation into the target partition. When the database partitioning is performed in the Nth round, for the master node of this round of operation, if it passes two security checks and the size of the target partition is less than the upper limit of the partition size, the master node can be partitioned into the target partition, otherwise, the master node can be partitioned into other partitions.

[0093] It should be noted that the database partitioning method provided in this specification can ensure that in a database partition containing 3f+1 master nodes, the number of Byzantine nodes is at most f, and a contribution of more than 1 / 3 can ensure the completion of a collective operation, thereby ensuring that the existence of Byzantine nodes will not affect the normal operation of the system.

[0094] For ease of understanding, the database partitioning method provided in this specification is further explained below using a specific example.

[0095] Optionally, a node set consisting of multiple master nodes (such as N = {N 1 ,N 2 ,…,N n}) as input, and output the partition set obtained by dividing the multiple master nodes through the database partitioning method provided in this specification (such as P = {P 1 ,P 2 ,…,P m}).

[0096] Optionally, the partition set P can be initialized to an empty set, and for each partition P in the partition set i , can be initialized to an empty set. First, a pre-set seed can be used in the bootstrap node to generate random values ​​for round 0, so that database partitioning can be achieved through the iterative process described below:

[0097] Each master node N i The information of the rth round and the random value obtained in the previous round can be signed with a private key to obtain the signature corresponding to the master node; each master node can broadcast its signature and node information, and the master node that receives the broadcast can use a public verification function to verify the legitimacy of the signature. If the verification is successful, each master node can divide its signature into multiple shares consistent with the number of nodes, and distribute the generated different shares to different master nodes; after receiving at least t valid different signature shares, any master node can execute the Generate function, use these shares to restore the collective signature, and use the hash value of the collective signature to determine the random value of the rth round; if the partition p i If the size of is smaller than the upper limit of the partition size, the master node N can be relocated according to the random value of the rth round.r Assign to partition p i Otherwise, the master node N r Distribute to other partitions, so that one round of database partitioning is completed, and then continue to the next round of data partitioning process until the partition division of all host points is completed.

[0098] See also Figure 4 , Figure 4 is a schematic diagram of a database partition result provided by an exemplary embodiment, such as Figure 4 As shown, for a distributed database system containing 16 master nodes, if it is to be divided into 4 database partitions, a normal node can be divided into partition 1 through the first round of data partitioning operation, a normal node can be divided into partition 2 through the second round of database partitioning operation, a normal node can be divided into partition 2 through the third round of database partitioning operation, a normal node can be divided into partition 2 through the fourth round of database partitioning operation, a normal node can be divided into partition 3 through the fifth round of database partitioning operation, a normal node can be divided into partition 4 through the sixth round of database partitioning operation, a normal node can be divided into partition 1 through the seventh round of database partitioning operation, a normal node can be divided into partition 2 through the eighth round of database partitioning operation, and a normal node can be divided into partition 4 through the ninth round of database partitioning operation. The operation can divide a Byzantine node into partition 2. Through the 10th round of database partitioning operation, a normal node can be divided into partition 1. Through the 11th round of database partitioning operation, a normal node can be divided into partition 3. Through the 12th round of database partitioning operation, a Byzantine node can be divided into partition 4. Through the 13th round of database partitioning operation, a Byzantine node can be divided into partition 1. Through the 14th round of database partitioning operation, a normal node can be divided into partition 3. Through the 15th round of database partitioning operation, a Byzantine node can be divided into partition 3. Through the 16th round of database partitioning operation, a normal node can be divided into partition 4. At this point, the partitioning of these 16 nodes is completed, and it can be ensured that the number of Byzantine nodes in each partition does not exceed 1 / 3 of the total number of nodes in the partition.

[0099] Through the database partitioning method provided in this specification, distributed random numbers can be generated with the help of the collaboration of all master nodes, thereby avoiding the problem of single point failure. In addition, each master node will be selected and assigned to each partition group in a random manner, effectively reducing the risk of Byzantine nodes concentrating on a certain partition group, ensuring the reliability and service availability of the partitioned database system.

[0100] Corresponding to the aforementioned method embodiments, this specification also provides corresponding equipment embodiments and device embodiments.

[0101] Figure 5 is a schematic structural diagram of a computing device provided by an exemplary embodiment. Figure 5 At the hardware level, the computing 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 may also be hardware or logic devices.

[0102] Please refer to Figure 6 , Figure 6 is a schematic block diagram of a database partitioning device provided by an exemplary embodiment. The database partitioning device can be applied to Figure 5 In the computing device shown in the figure, the technical solution of this specification is implemented. Among them, the database partitioning device may include:

[0103] A first verification module 601 is used to perform security verification on multiple master nodes of a distributed database based on first encryption information allocated by each master node to other master nodes, so as to determine multiple first master nodes that pass the security verification from the multiple master nodes, wherein the first encryption information allocated to other master nodes is complete;

[0104] A second verification module 602 is used to perform security verification on the multiple first master nodes again based on the second encryption information allocated by each first master node to other first master nodes, wherein, for any first master node, the second encryption information allocated by the first master node to other first master nodes is a different part of the first encryption information generated by the first master node;

[0105] The partitioning module 603 is used to partition the multiple master nodes based on the two security check results of the multiple master nodes, so that the proportion of the master nodes that have not passed the two security checks in each database partition meets the first preset condition.

[0106] In some embodiments, the first verification module 601, when performing security verification on multiple master nodes of a distributed database based on first encryption information allocated by each master node to other master nodes, is used to:

[0107] When performing database partitioning in each round, selecting a master node from the multiple master nodes as an initiating node, so as to generate the first encrypted information based on a private key through the master node serving as the initiating node;

[0108] The master node serving as the initiating node sends the generated first encrypted information to other master nodes;

[0109] The other master nodes perform validity verification on the first encrypted information assigned to them based on the public verification algorithm and the public key.

[0110] In some embodiments, the first verification module 601, when used to generate the first encrypted information based on a private key by a master node as an initiating node, is used to:

[0111] When performing database partitioning in the Nth round, the master node as the initiating node signs using the private key and random parameter information to obtain the first encrypted information, wherein the random parameter information is used to indicate the random value generated in the N-1th round.

[0112] In some embodiments, the second verification module 602, when used to perform security verification on the plurality of first master nodes again based on the second encryption information allocated by each first master node to other first master nodes, is used to:

[0113] When performing database partitioning in each round, each first master node splits the generated first encrypted information into multiple fragments to obtain multiple second encrypted information;

[0114] Each first master node sends a second encrypted message to other first master nodes respectively;

[0115] Each first master node verifies the validity of the received second encrypted information.

[0116] In some embodiments, the apparatus further comprises:

[0117] The first broadcast module is used for each first master node to broadcast commitment information to other first master nodes, where the commitment information is used to indicate the number of fragments obtained by splitting the generated first encrypted information and the proportion of the information contained in each fragment in the total information of the first encrypted information.

[0118] In some embodiments, the apparatus further comprises:

[0119] A second broadcast module is used for broadcasting complaint information to the first master node for which the received second encrypted information verification is invalid;

[0120] The second broadcast module is also used to respond to the complaint information, and broadcast the correct result of verifying the invalid second encrypted information by the first master node that generates the first encrypted information corresponding to the second encrypted information.

[0121] In some embodiments, the apparatus further comprises:

[0122] A generating module, configured to generate collective signature information by any first master node among the plurality of first master nodes based on all received second encrypted information;

[0123] A determination module is used to determine the random parameter information corresponding to the current round of database partitioning process based on the collective signature information.

[0124] In some embodiments, the partitioning module 603, when used to partition the multiple master nodes based on the two security check results of the multiple master nodes so that the proportion of the master nodes that have not passed the two security checks in each database partition meets the first preset condition, is used to:

[0125] Based on the results of the two security checks of the multiple master nodes, the master nodes that passed the two security checks and the master nodes that failed the two security checks are partitioned so that the proportion of the number of master nodes that failed the two security checks in each database partition to the total number of database partition nodes meets the first value.

[0126] In some embodiments, the partitioning module 603, when used to partition the multiple master nodes based on the two security verification results of the multiple master nodes, is used to:

[0127] When performing database partitioning in the Nth round, for any master node, if the master node passes two security checks, the master node is divided into database partitions according to the random parameter information corresponding to this round of database partitioning process.

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

[0129] In a typical configuration, a computer includes one or more processors (Central Processing Unit, CPU), input / output interface, network interface and memory.

[0130] 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. Memory is an example of a computer-readable medium.

[0131] 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, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change random access 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. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

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

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

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

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

[0136] 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 database partitioning method, applicable to a distributed database including multiple master nodes, the method comprising: Based on the first encrypted information allocated by each of the multiple master nodes of the distributed database to other master nodes, security verification is performed on the multiple master nodes to determine multiple first master nodes that pass the security verification from the multiple master nodes, wherein the first encrypted information allocated to the other master nodes is complete; Based on the second encrypted information allocated by each first master node to other first master nodes, the security of the multiple first master nodes is again verified, wherein, for any first master node, the second encrypted information allocated by the first master node to other first master nodes is a different part of the first encrypted information generated by the first master node; Based on the results of the two security checks of the multiple master nodes, the multiple master nodes are partitioned so that the proportion of the master nodes that fail the two security checks in each database partition meets a first preset condition.

2. The method according to claim 1, wherein each of the plurality of master nodes in the distributed database allocates first encryption information to other master nodes, and performs security verification on the plurality of master nodes, comprising: When performing database partitioning in each round, selecting a master node from the multiple master nodes as an initiating node, so as to generate the first encrypted information based on a private key through the master node serving as the initiating node; The master node serving as the initiating node sends the generated first encrypted information to other master nodes; The other master nodes perform validity verification on the first encrypted information assigned to them based on the public verification algorithm and the public key.

3. The method according to claim 2, wherein the generating the first encrypted information based on a private key by a master node as an initiating node comprises: When performing database partitioning in the Nth round, the master node as the initiating node signs using the private key and random parameter information to obtain the first encrypted information, wherein the random parameter information is used to indicate the random value generated in the N-1th round.

4. The method according to claim 1, wherein the security verification of the plurality of first master nodes is performed again based on the second encryption information allocated by each first master node to other first master nodes, comprises: When performing database partitioning in each round, each first master node splits the generated first encrypted information into multiple fragments to obtain multiple second encrypted information; Each first master node sends a second encrypted message to other first master nodes respectively; Each first master node verifies the validity of the received second encrypted information.

5. The method according to claim 4, wherein each first master node divides the generated first encrypted information into a plurality of shares to obtain a plurality of second encrypted information, the method further comprises: Each first master node broadcasts commitment information to other first master nodes, where the commitment information is used to indicate the number of fragments obtained by splitting the generated first encrypted information and the proportion of the amount of information contained in each fragment to the total amount of information in the first encrypted information.

6. The method according to claim 4, after each first master node verifies the validity of the received second encrypted information, the method further comprises: For the first master node for which the received second encrypted information verification is invalid, the first master node for which the received second encrypted information verification is invalid broadcasts complaint information; In response to the complaint information, the first master node that generates the first encrypted information corresponding to the second encrypted information broadcasts the correct result of verifying the invalid second encrypted information.

7. The method according to claim 4, after each first master node verifies the validity of the received second encrypted information, the method further comprises: Any first master node among the plurality of first master nodes generates collective signature information based on all received second encrypted information; Based on the collective signature information, the random parameter information corresponding to the current round of database partitioning process is determined.

8. The method according to claim 7, wherein partitioning the plurality of master nodes based on the two security check results of the plurality of master nodes so that the proportion of the master nodes that fail the two security checks in each database partition meets a first preset condition comprises: Based on the results of the two security checks of the multiple master nodes, the master nodes that passed the two security checks and the master nodes that failed the two security checks are partitioned so that the proportion of the number of master nodes that failed the two security checks in each database partition to the total number of database partition nodes meets the first value.

9. The method according to claim 8, partitioning the multiple master nodes based on the two security verification results of the multiple master nodes, comprises: When performing database partitioning in the Nth round, for any master node, if the master node passes two security checks, the master node is divided into database partitions according to the random parameter information corresponding to this round of database partitioning process.

10. A database partitioning device, comprising: A first verification module is used to perform security verification on the multiple master nodes based on the first encryption information allocated by each master node of the distributed database to other master nodes, so as to determine multiple first master nodes that pass the security verification from the multiple master nodes, wherein the first encryption information allocated to the other master nodes is complete; A second verification module is used to perform security verification on the multiple first master nodes again based on the second encryption information allocated by each first master node to other first master nodes, wherein, for any first master node, the second encryption information allocated by the first master node to other first master nodes is a different part of the first encryption information generated by the first master node; The partitioning module is used to partition the multiple master nodes based on the results of the two security checks of the multiple master nodes, so that the proportion of the master nodes that have not passed the two security checks in each database partition meets the first preset condition.

11. A computing device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.

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