WO2022134797A1 - 一种数据分片存储方法、装置、计算机设备和存储介质 - Google Patents
一种数据分片存储方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2022134797A1 WO2022134797A1 PCT/CN2021/124953 CN2021124953W WO2022134797A1 WO 2022134797 A1 WO2022134797 A1 WO 2022134797A1 CN 2021124953 W CN2021124953 W CN 2021124953W WO 2022134797 A1 WO2022134797 A1 WO 2022134797A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- master node
- node cluster
- data storage
- data
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000013467 fragmentation Methods 0.000 title claims abstract description 40
- 238000006062 fragmentation reaction Methods 0.000 title claims abstract description 40
- 238000013500 data storage Methods 0.000 claims abstract description 93
- 238000004590 computer program Methods 0.000 claims description 10
- 239000012634 fragment Substances 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 4
- 238000007726 management method Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- the present application relates to the technical field of block storage, and in particular, to a method, device, computer equipment and storage medium for data fragmentation storage.
- each blockchain node stores complete blockchain data.
- the above distributed data storage method can ensure the security of the data stored in the blockchain. Even if the data in a certain node in the blockchain is lost, since all the other nodes in the blockchain store the complete blockchain data, any other node can completely verify whether the entire blockchain data is Tampering occurs.
- the existing nodes in the blockchain are often single nodes, because the ability of a single node to store data is limited.
- the inventor realized that when there is too much data to be stored, the storage capacity of a single node of the blockchain cannot meet the needs of practical application scenarios.
- the present application provides a data fragmentation storage method, device, computer equipment and storage medium, which solve the problem of limited data storage capacity of a single node in the existing blockchain.
- a first aspect of the present application provides a data fragmentation storage method, the method includes: acquiring a node cluster composed of a plurality of fragmented nodes, the node cluster is used to store the first data in the blockchain.
- One data the total amount of data storage of the first data is the total amount of the first data storage of any node cluster in the blockchain;
- the master node in the node cluster is selected by preset selection conditions, and all The remaining shard nodes in the node cluster except the master node are configured as slave nodes; the account book query result is obtained through the master node, and the account book update result is obtained through the master node.
- a second aspect of the present application provides a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, the processor executing the computer-readable instructions The following steps are implemented during the time: obtaining a node cluster composed of multiple shard nodes, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is the same as that in the blockchain.
- a third aspect of the present application provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer is caused to perform the following steps: obtaining the A node cluster composed of shard nodes, the node cluster is used to store the first data in the blockchain, and the total data storage amount of the first data is the first data storage total of any node cluster in the blockchain. select the master node in the node cluster through preset selection conditions, and configure the remaining shard nodes in the node cluster except the master node as slave nodes; query the ledger through the master node , obtain the ledger query result, and update the ledger through the master node to obtain the ledger update result.
- a fourth aspect of the present application provides a data fragmentation storage device, comprising: an acquisition unit configured to acquire a node cluster composed of a plurality of fragmented nodes, the node cluster being used to store first data in the blockchain, The total amount of data storage of the first data is the total amount of first data storage of any node cluster in the blockchain; the master node selection unit is used to select the node cluster obtained by the acquisition unit through preset selection conditions The master node in the node cluster; the configuration unit is used to configure the remaining shard nodes in the node cluster except the master node elected by the master node selection unit as slave nodes; the data processing unit is used to pass The master node selected by the master node selection unit performs a ledger query to obtain a ledger query result, and the master node selected by the master node selection unit performs a ledger update to obtain a ledger update result.
- a node cluster composed of multiple shard nodes is obtained, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is any node in the blockchain The total amount of the first data storage of the cluster; the master node in the node cluster is selected by the preset selection conditions, and the remaining shard nodes in the node cluster except the master node are configured as slave nodes; the account book query is performed through the master node, Obtain the result of the ledger query, and update the ledger through the master node to obtain the updated result of the ledger.
- Fig. 1 is the implementation environment diagram of a kind of data fragmentation storage method provided in one embodiment
- FIG. 2 is a block diagram of the internal structure of a computer device in one embodiment
- FIG. 3 is a schematic flowchart of a method for storing data fragments provided by an embodiment of the present disclosure
- FIG. 4 is a schematic structural diagram of a data fragmentation storage device provided by an embodiment of the present disclosure.
- the present application provides a data fragmentation storage method, device, computer equipment and storage medium, which solve the problem of limited data storage capacity of a single node in the existing blockchain.
- FIG. 1 is an implementation environment diagram of a method for storing data fragments provided in an embodiment. As shown in FIG. 1 , the implementation environment includes a computer device 110 and a terminal 120 .
- the terminal 120 and the computer device 110 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but are not limited thereto.
- the computer device 110 and the terminal 110 can be connected through Bluetooth, USB (Universal Serial Bus, Universal Serial Bus) or other communication connection methods, which are not limited in this application.
- FIG. 2 is a schematic diagram of the internal structure of a computer device in one embodiment.
- the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus.
- the non-volatile storage medium of the computer device stores an operating system, a database and computer-readable instructions
- the database may store a sequence of control information.
- the processor can realize a A data fragmentation storage method.
- the processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device.
- Computer-readable instructions may be stored in the memory of the computer device, and when executed by the processor, the computer-readable instructions may cause the processor to execute a method for storing data slices.
- the network interface of the computer equipment is used for communication with the terminal connection.
- an embodiment of the present disclosure provides a data fragmentation storage method.
- the data fragmentation storage method is applied to the server side, and specifically includes the following method steps:
- S302 Obtain a node cluster composed of multiple shard nodes, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is the first data storage of any node cluster in the blockchain total.
- the number of sharding nodes in the node cluster may be adjusted according to data storage requirements in different application scenarios, and the number of sharding nodes is not specifically limited here.
- the number of shard nodes in the node cluster will be larger; otherwise, If the total amount of first data storage is smaller and the storage capacity of each shard node in the node cluster is larger, the number of shard nodes in the node cluster is smaller.
- the master node can store data information and metadata information of each fragment; in addition, the master node can also serve as a routing node and an endorsement node.
- the master node can store the data information of each shard node in the node cluster, for example, the number information of each shard node in the node cluster, the unique shard number information of each shard node in the node cluster, and the storage In this way, the master node can achieve unified management of the remaining slave nodes in the node cluster. In order to ensure the data security of the blockchain network, the master node can store data that cannot be tampered with.
- S304 Select the master node in the node cluster according to the preset selection condition, and configure the remaining shard nodes in the node cluster except the master node as slave nodes.
- the preset selection conditions include: the number of votes obtained by the current shard node in the node cluster exceeds half of the total number of votes, and the number of votes obtained by the shard node is the most, then the shard node obtains the most votes. Elected as the master node in the node cluster.
- the master node is a peer node, and the master node provides external services on the chain.
- shard nodes form a node cluster, which is a small cluster.
- a vote is initiated in the node cluster by preset selection conditions, and the master node is elected from all shard nodes.
- the node can provide on-chain services to the outside world, and the master node acts as a peer node.
- the process of selecting the master node in the node cluster through the preset selection conditions is as follows:
- the voting status of each shard node in the node cluster Obtain the voting status of each shard node in the node cluster, and count the voting status to obtain the statistical results. If the statistical results show that in the node cluster, a shard node has obtained more than half of the votes, and the shard node has obtained the most votes, then the shard node will be elected as the master node.
- the number of shard nodes in the node cluster is 10.
- the voting situation is counted to obtain the statistical result. If the statistical results show that the number of votes obtained by a shard node is 6 votes, the shard node has more than half of the total number of shard nodes supported by the shard nodes, and the shard node has the most support, Then, the shard node is elected as the master node, and the remaining shard nodes in the node cluster except the master node are configured as slave nodes.
- S306 Query the ledger through the master node to obtain the result of the ledger query, and update the ledger through the master node to obtain the update result of the ledger.
- the master node provides external services on the chain, and the master node acts as a peer node.
- a blockchain network consists of peer nodes, each of which holds one or more ledgers and one or more smart contracts.
- Network N consists of three peers P1, P2 and P3. Each peer holds a ledger instance L1; each peer accesses its own ledger copy L1 through the chain code (smart contract) S1. Each peer has some system chaincode.
- the ledger can be accessed through peers.
- the interaction between the application and the peer mainly includes ledger query and ledger update.
- Ledger queries require only three simple sessions; ledger updates require two additional sessions.
- Applications always access the ledger and chaincode through peers.
- the SDK provided by Hyperledger allows applications to connect to peers, invoke chaincode to generate transactions, submit transactions to the entire network, and receive events generated during processing.
- the application executes the chaincode to query or update the ledger.
- Query results can be returned quickly; however, updating the ledger requires more complex interactions involving application, peer, and ordering service modules.
- the ordering service module is used to ensure that the ledgers held by all peers are updated synchronously.
- the master node is a peer node
- the account book query is performed through the master node to obtain the account book query result, including the following steps:
- the master node calls the corresponding first chaincode according to the proposal, so that the first chaincode can query the corresponding hyperledger according to the proposal, and obtain the ledger query result returned to the application.
- the account book update is performed by the master node, and the corresponding account book update result is obtained, including the following steps:
- the acquisition application generates a transaction according to the returned ledger query result, and sends the transaction to the ordering service module, so that the ordering service module can send the transaction to the master node in the blockchain;
- the master node invokes the relevant second chain code according to the transaction, so as to update the ledger according to the second chain code, and obtain the corresponding ledger update result.
- a notification event is generated to notify the application that the update is completed.
- the data fragmentation storage method provided by the embodiment of the present disclosure further includes the following steps: expanding the first data storage total amount of the node cluster to obtain the expanded second data storage total amount; thus , the total data storage capacity of any node cluster of the blockchain can be expanded.
- the method further includes the following steps: determining the number of shard nodes to be added in the node cluster; thus, the embodiments of the present application provide
- the new data sharding storage method can introduce newly added sharding nodes into the current node cluster according to the different requirements of blockchain storage capacity, and automatically allocate storage data to the newly added sharding nodes, and finally achieve an effective The purpose of expanding the storage capacity of any node cluster in the blockchain.
- the master node in addition to storing the data information of each shard node in the node cluster, can store the data information of each shard node in the node cluster, for example, the number information of each shard node in the node cluster, and the unique data of each shard node in the node cluster.
- the shard number information and data stored in each shard node can also store the data information of each shard node newly added to the node cluster, for example, the number information of the newly added shard nodes, the newly added shard nodes The unique shard number information of the shard node in the node cluster, and the data stored in each newly added shard node; in this way, the master node can not only achieve unified management of the original slave nodes in the node cluster, but also The unified management of each newly added slave node in the node cluster can be realized, thereby ultimately improving the orderliness and security of data storage.
- determining the number of shard nodes to be added in the node cluster includes the following steps:
- the number of shard nodes to be added in the node cluster is determined according to the third total amount of data storage and the data storage amount threshold of any shard node in the node cluster.
- each sharding node capable of a node cluster can perform automatic sharding, and newly added sharding nodes can be automatically allocated to store data.
- the storage threshold of each shard node in the node cluster is smaller, and the number of shard nodes in the current node cluster is smaller, it is necessary to join the node cluster
- the storage threshold of each shard node in the node cluster is larger, and the number of shard nodes in the current node cluster is larger.
- the sharding in any node cluster in the blockchain can be The number of nodes is dynamically and precisely regulated.
- a node cluster composed of multiple shard nodes is obtained, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is any node cluster in the blockchain The first total amount of data storage; select the master node in the node cluster through the preset selection conditions, and configure the remaining shard nodes in the node cluster except the master node as slave nodes; query the ledger through the master node, get The result of the ledger query, and the ledger update through the master node, the ledger update result is obtained. Therefore, using the embodiments of the present application, since a node cluster composed of multiple shard nodes is introduced, compared with the existing single node, the data storage of any node cluster in the blockchain is greatly improved performance.
- the following is the embodiment of the data fragmentation storage device of the present application, which can be used to execute the embodiment of the data fragmentation storage method of the present application.
- the embodiments of the data fragmentation storage device of the present application please refer to the embodiments of the data fragmentation storage method of the present application.
- FIG. 4 shows a schematic structural diagram of a data fragmentation storage device provided by an exemplary embodiment of the present application.
- the data fragmentation storage device can be implemented as all or a part of the terminal through software, hardware or a combination of the two.
- the data fragmentation storage device includes an acquisition unit 402 , a master node selection unit 404 , a configuration unit 406 and a data processing unit 408 .
- the obtaining unit 402 is configured to obtain a node cluster composed of a plurality of sharded nodes, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is any arbitrary amount in the blockchain.
- the master node selection unit 404 is configured to select the master node in the node cluster obtained by the obtaining unit 402 through preset selection conditions;
- a configuration unit 406 configured to configure the remaining shard nodes in the node cluster except the master node selected by the master node selection unit 404 as slave nodes;
- the data processing unit 408 is configured to query the ledger through the master node selected by the master node selection unit 404 to obtain the result of the ledger query, and update the ledger through the master node selected by the master node selection unit 404 to obtain the updated result of the ledger.
- the master node is a peer node
- the data processing unit 408 is specifically used for:
- the master node calls the corresponding first chaincode according to the proposal, so that the first chaincode can query the corresponding hyperledger according to the proposal, and obtain the ledger query result returned to the application.
- the data processing unit 408 is also specifically used for:
- the acquisition application generates a transaction according to the returned ledger query result, and sends the transaction to the ordering service module, so that the ordering service module can send the transaction to the master node in the blockchain;
- the master node invokes the relevant second chain code according to the transaction, so as to update the ledger according to the second chain code, and obtain the corresponding ledger update result.
- the data fragmentation storage device further includes:
- the capacity expansion unit (not shown in FIG. 4 ) is configured to expand the first data storage total amount of the node cluster obtained by the obtaining unit 402 to obtain the expanded second data storage total amount.
- the data fragmentation storage device further includes:
- the quantity determination unit (not shown in FIG. 4 ) is configured to determine the quantity of the shard nodes to be added in the node cluster after the expansion unit expands the capacity to obtain the expanded second data storage capacity.
- the quantity determination unit is specifically used for:
- the number of shard nodes to be added in the node cluster is determined according to the third total amount of data storage and the data storage amount threshold of any shard node in the node cluster.
- the preset selection conditions include: the number of votes obtained by the current shard node in the node cluster exceeds half of the total number of votes, and the shard node has the most votes obtained, then the shard node is elected as the node cluster. primary node in .
- the data fragmentation storage device provided in the above embodiment executes the data fragmentation storage method
- only the division of the above functional modules is used as an example for illustration.
- the functional modules of the device are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
- the data fragmentation storage device and the data fragmentation storage method provided by the above embodiments belong to the same concept, and the implementation process of the data fragmentation storage method is described in detail in the data fragmentation storage method embodiment, which will not be repeated here.
- the obtaining unit is used to obtain a node cluster composed of a plurality of sharded nodes, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is the amount in the blockchain.
- the total amount of first data storage in any node cluster the master node selection unit selects the master node in the node cluster obtained by the acquisition unit through the preset selection conditions, and the configuration unit is used to select the master node selection unit in the node cluster except the master node selection unit.
- the remaining shard nodes other than the master node are configured as slave nodes; and the data processing unit is used to query the ledger through the master node elected by the master node selection unit to obtain the ledger query result, and the master node selected by the master node selection unit.
- the ledger is updated, and the ledger update result is obtained. Therefore, using the embodiments of the present application, since a node cluster composed of multiple shard nodes is introduced, compared with the existing single node, the data storage of any node cluster in the blockchain is greatly improved performance.
- a computer device in one embodiment, includes a memory, a processor, and a computer program stored in the memory and running on the processor.
- the processor executes the computer program, the processor implements the following steps: acquiring a plurality of A node cluster composed of sharded nodes, the node cluster is used to store the first data in the blockchain, and the total amount of data storage of the first data is the total amount of the first data storage of any node cluster in the blockchain;
- the selection criteria select the master node in the node cluster, and configure the remaining shard nodes in the node cluster except the master node as slave nodes; query the ledger through the master node, get the query result of the ledger, and update the ledger through the master node , to get the ledger update result.
- the present application further provides a computer-readable storage medium
- the computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
- the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on the computer, the computer performs the following steps: obtaining a node cluster composed of multiple shard nodes, and the node cluster is used to store the first node in the blockchain.
- One data, the total amount of data storage of the first data is the total amount of the first data storage of any node cluster in the blockchain;
- the master node in the node cluster is selected according to the preset selection conditions, and all the nodes in the node cluster except the master node are selected.
- the remaining shard nodes other than sharding nodes are configured as slave nodes; the account book query result is obtained through the master node, and the account book update result is obtained through the master node.
- the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods.
- the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- Computational Linguistics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Marketing (AREA)
- Computing Systems (AREA)
- Development Economics (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种数据分片存储方法、装置、计算机设备和存储介质。所述方法包括:获取由多个分片节点组成的节点集群(S302),节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点(S304);通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果(S306)。因此,上述方法由于引入了由多个分片节点组成的节点集群,这样,相比现有的单一节点而言,大大地提高了区块链中的任意一个节点集群的数据存储性能。
Description
本申请要求于2020年12月22日提交中国专利局、申请号为202011529237.0、发明名称为“一种数据分片存储方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
本申请涉及区块存储技术领域,尤其涉及一种数据分片存储方法、装置、计算机设备和存储介质。
目前区块链常用的存储方法为:每个区块链节全部存储有完整的区块链数据。上述分布式数据存储方式,可以确保存储于区块链中的数据的安全性。即使区块链中某一个节点中的数据丢失,由于处于区块链中的其余节点均全部存储有完整的区块链数据,这样,其余任意一个节点均可以完整校验整个区块链数据是否发生篡改。
但是,现有处于区块链中的节点往往为单一节点,由于单一节点存储数据的能力是有限的。发明人意识到,当有过多的数据需要存储时,区块链的单一节点的存储容量就无法满足实际应用场景的需要。
针对现有区块链中的单一节点的数据存储量有限的问题,如何使得区块链中的各个节点能够存储足够多的数据,是待解决的技术问题。
发明内容
本申请提供了一种数据分片存储方法、装置、计算机设备和存储介质,解决了现有区块链中的单一节点的数据存储量有限的问题。
为实现上述目的,本申请第一方面提供了一种数据分片存储方法,所述方法包括:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
本申请第二方面提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
本申请第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
本申请第四方面提供了一种数据分片存储装置,包括:获取单元,用于获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;主节点推选单元,用于通过预设推选条件推选获取单元获取的所述节点集群中的主节点;配置单元,用于将所 述节点集群中的除了所述主节点推选单元推选出的所述主节点之外的其余分片节点配置为从节点;数据处理单元,用于通过所述主节点推选单元推选出的所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点推选单元推选出的所述主节点进行账本更新,得到账本更新结果。
本申请提供的技术方案中,获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点;通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果。因此,采用本申请实施例,由于引入了由多个分片节点组成的节点集群,这样,相比现有的单一节点而言,大大地提高了区块链中的任意一个节点集群的数据存储性能。应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
图1为一个实施例中提供的一种数据分片存储方法的实施环境图;
图2为一个实施例中计算机设备的内部结构框图;
图3是本公开实施例提供的一种数据分片存储方法的流程示意图;
图4是本公开实施例提供的一种数据分片存储装置的结构示意图。
本申请提供了一种数据分片存储方法、装置、计算机设备和存储介质,解决了现有区块链中的单一节点的数据存储量有限的问题。
以下描述和附图充分地示出本申请的具体实施方案,以使本领域的技术人员能够实践它们。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
下面结合附图详细说明本公开的可选实施例。
图1为一个实施例中提供的一种数据分片存储方法的实施环境图,如图1所示,在该实施环境中,包括计算机设备110以及终端120。
需要说明的是,终端120以及计算机设备110可为智能手机、平板电脑、笔记本电脑、台式计算机等,但并不局限于此。计算机设备110以及终端110可以通过蓝牙、USB(Universal Serial Bus,通用串行总线)或者其他通讯连接方式进行连接,本申请在此不做限制。
图2为一个实施例中计算机设备的内部结构示意图。如图2所示,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可读指令,数据库中可存储有控件信息序列,该计算机可读指令被处理器执行时,可使得处理器实现一种数据分片存储方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种数据分片存储方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如图3所示,本公开实施例提供一种数据分片存储方法,该数据分片存储方法应用于服务器端,具体包括以下方法步骤:
S302:获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量。
在本申请实施例中,可以根据不同应用场景下数据存储量的需求,对节点集群中的分片节点的数量进行调整,在此,对分片节点的数量并不做具体限制。
在本申请实施例中,若第一数据存储总量越大、且节点集群中的每一个分片节点的存储能力越小,则该节点集群中的分片节点的数量则越多;反之,若第一数据存储总量越小、且节点集群中的每一个分片节点的存储能力越大,则该节点集群中分片节点的数量则越少。
在本申请实施例中,主节点能够存储各分片数据信息、元数据信息;此外,主节点还可作为路由节点、背书节点。
由于主节点可以存储节点集群中的各个分片节点的数据信息,例如,节点集群中的各个分片节点的数量信息、各个分片节点在该节点集群内的唯一的分片编号信息、以及存储于各个分片节点的数据信息;这样,主节点可以实现对节点集群中的其余从节点的统一管理。为了保证区块链网络的数据安全,主节点内可以存储无法篡改的数据。
S304:通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点。
在某一具体应用场景中,预设推选条件包括:节点集群中的当前分片节点获取到的投票数超过总数的一半、且该分片节点获取到的投票数最多,则将该分片节点推选为节点集群中的主节点。
在本申请实施例中,主节点为peer节点,且主节点对外提供上链服务。
多个分片节点组成节点集群,该节点集群为小集群。在实际应用中,为了更好地对该小集群内的各个分片节点进行管理,通过预设推选条件,在该节点集群中发起投票,从所有的分片节点中推选出主节点,该主节点能够对外提供上链服务,且该主节点作为peer节点。
在某一具体应用场景中,通过预设推选条件推选出节点集群中的主节点的过程具体如下所述:
获取节点集群中的各个分片节点的投票情况,并对投票情况进行统计,得到统计结果。若统计结果显示,在该节点集群中,某一个分片节点获取到的投票数超过一半、且该分片节点获取到的投票数最多,则推选出该分片节点为主节点。
例如,在某一应用场景中,该节点集群中的分片节点的数量为10个,在任意一个分片节点发起投票任务时,则对投票情况进行统计,得到统计结果。若统计结果显示出:某一分片节点获得的票数是6票,该分片节点已经超过总分片节点数量一半以上分片节点的支持,且该分片节点获得的支持数量是最多的,则推选出该分片节点为主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点。
S306:通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果。
在本申请实施例中,主节点对外提供上链服务,且主节点作为peer节点。一个区块链网络由peer节点组成,每一个peer节点持有一个或多个账本,以及一个或多个智能合约。网络N由三个peer组成P1、P2和P3。每一个Peer都持有了一个账本实例L1;每个peer都通过链码(智能合约)S1去访问各自的账本副本L1。每一个peer都有一些系统链码。
在实际应用中,可以通过peer去访问账本。应用程序与peer的交互主要包括账本查询与账本更新。账本查询只需要简单的三次会话;而账本更新需要额外的两次会话。应用程序总是通过peer去访问账本和链码的。超级账本提供的SDK可以允许应用程序连接peer、调用链码产生交易、提交交易到整个网络并接收处理过程中产生的事件。
通过连接到一个peer,应用程序通过执行链码来查询或者更新账本。查询结果可以很 快返回;但是更新账本需要更复杂的交互,这些交互涉及到应用程序、peer和排序服务模块。排序服务模块用来确保所有的Peer持有的账本同步更新。
在本申请实施例中,主节点为peer节点,通过主节点进行账本查询,得到账本查询结果包括以下步骤:
在应用程序连接到主节点之后,获取应用程序生成的提案,并将提案提交至主节点;
主节点根据提案调用相应的第一链码,以便于第一链码根据提案查询对应的超级账本,得到向应用程序返回的账本查询结果。
在本申请实施例中,通过主节点进行账本更新,得到对应的账本更新结果包括以下步骤:
获取应用程序根据返回的账本查询结果生成一个交易,并将交易发送给排序服务模块,以便于排序服务模块将交易发送给区块链中的主节点;
主节点根据交易调用相关的第二链码,以根据第二链码进行账本更新,得到对应的账本更新结果。
在实际应用中,在账本更新完成后,产生通知事件以通知应用程序更新完成。
在一种可能的实现方式中,本公开实施例提供的数据分片存储方法还包括以下步骤:对节点集群的第一数据存储总量进行扩容,得到扩容后的第二数据存储总量;这样,可以对区块链的任意一个节点集群的数据存储总量进行扩容。
在一种可能的实现方式中,在得到扩容后的第二数据存储总量之后,所述方法还包括以下步骤:确定节点集群中待加入的分片节点的数量;这样,本申请实施例提供的数据分片存储方法,能够根据区块链存储容量的不同需求,在当前节点集群中引入新加入的分片节点,并对新加入的分片节点自动分配存储数据,最终达到了能够有效地扩充区块链任意一个节点集群的存储容量的目的。此外,还能够根据第二数据存储总量,动态地调整新加入的分片节点的数量。
在本申请实施例中,主节点除了可以存储节点集群中原有的各个分片节点的数据信息,例如,节点集群中的各个分片节点的数量信息、各个分片节点在该节点集群内的唯一的分片编号信息、存储于各个分片节点的数据;此外,还可以存储新加入该节点集群的各个分片节点的数据信息,例如,新加入的分片节点的数量信息、新加入的各个分片节点在该节点集群内的唯一的分片编号信息、以及存储于新加入的各个分片节点的数据;这样,主节点不仅可以实现对节点集群中原有的各个从节点的统一管理,还可以实现对节点集群中新加入的各个从节点的统一管理,从而,最终提高了数据存储的有序性和安全性。
在本申请实施例中,确定节点集群中待加入的分片节点的数量包括以下步骤:
获取节点集群的第一数据存储总量、节点集群扩容后的第二数据存储总量以及节点集群中的任意一个分片节点的数据存储量阈值;
根据第一数据存储总量和第二数据存储总量,确定出节点集群待扩容的第三数据存储总量;
根据第三数据存储总量和节点集群中的任意一个分片节点的数据存储量阈值,确定节点集群中待加入的分片节点的数量。
在本申请实施例中,节点集群能够的各个分片节点能够进行自动分片,而且新加入的分片节点能够自动地被分配存储数据。
在实际应用中,若第二数据存储总量越大、节点集群中每个分片节点的存储阈值越小、且当前节点集群内的各个分片节点的数量越小,则需要加入该节点集群中的分片节点的数量则越多;反之,若第二数据存储总量越小、节点集群中每个分片节点的存储阈值越大、且当前节点集群内的各个分片节点的数量越多,则需要加入该节点集群中的分片节点的数量则越小,甚至无需在该节点集群中加入新的分片节点;这样,能够对区块链中的任意一 个节点集群中的分片节点的数量实现动态且精准地调控。
在本公开实施例中,获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点;通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果。因此,采用本申请实施例,由于引入了由多个分片节点组成的节点集群,这样,相比现有的单一节点而言,大大地提高了区块链中的任意一个节点集群的数据存储性能。
下述为本申请数据分片存储装置实施例,可以用于执行本申请数据分片存储方法实施例。对于本申请数据分片存储装置实施例中未披露的细节,请参照本申请数据分片存储方法实施例。
请参见图4,其示出了本申请一个示例性实施例提供数据分片存储装置的结构示意图。该数据分片存储装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分。该数据分片存储装置包括获取单元402、主节点推选单元404、配置单元406和数据处理单元408。
具体而言,获取单元402,用于获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;
主节点推选单元404,用于通过预设推选条件推选获取单元402获取的节点集群中的主节点;
配置单元406,用于将节点集群中的除了主节点推选单元404推选出的主节点之外的其余分片节点配置为从节点;
数据处理单元408,用于通过主节点推选单元404推选出的主节点进行账本查询,得到账本查询结果,以及通过主节点推选单元404推选出的主节点进行账本更新,得到账本更新结果。
可选的,主节点为peer节点,数据处理单元408具体用于:
在应用程序连接到主节点之后,获取应用程序生成的提案,并将提案提交至主节点;
主节点根据提案调用相应的第一链码,以便于第一链码根据提案查询对应的超级账本,得到向应用程序返回的账本查询结果。
可选的,数据处理单元408还具体用于:
获取应用程序根据返回的账本查询结果生成一个交易,并将交易发送给排序服务模块,以便于排序服务模块将交易发送给区块链中的主节点;
主节点根据交易调用相关的第二链码,以根据第二链码进行账本更新,得到对应的账本更新结果。
可选的,所述数据分片存储装置还包括:
扩容单元(在图4中未示出),用于对获取单元402获取的节点集群的第一数据存储总量进行扩容,得到扩容后的第二数据存储总量。
可选的,所述数据分片存储装置还包括:
数量确定单元(在图4中未示出),用于在扩容单元扩容得到扩容后的第二数据存储容量之后,确定节点集群中待加入的分片节点的数量。
可选的,数量确定单元具体用于:
获取节点集群的第一数据存储总量、节点集群扩容后的第二数据存储总量以及节点集群中的任意一个分片节点的数据存储量阈值;
根据第一数据存储总量和第二数据存储总量,确定出节点集群待扩容的第三数据存储 总量;
根据第三数据存储总量和节点集群中的任意一个分片节点的数据存储量阈值,确定节点集群中待加入的分片节点的数量。
可选的,预设推选条件包括:节点集群中的当前分片节点获取到的投票数超过总数的一半、且该分片节点获取到的投票数最多,则将该分片节点推选为节点集群中的主节点。
需要说明的是,上述实施例提供的数据分片存储装置在执行数据分片存储方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据分片存储装置与数据分片存储方法实施例属于同一构思,其体现实现过程详见数据分片存储方法实施例,这里不再赘述。
在本公开实施例中,获取单元用于获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;主节点推选单元过于通过预设推选条件推选获取单元获取的节点集群中的主节点,配置单元用于将节点集群中的除了主节点推选单元推选出的主节点之外的其余分片节点配置为从节点;以及数据处理单元用于通过主节点推选单元推选的主节点进行账本查询,得到账本查询结果,以及通过主节点推选单元推选的主节点进行账本更新,得到账本更新结果。因此,采用本申请实施例,由于引入了由多个分片节点组成的节点集群,这样,相比现有的单一节点而言,大大地提高了区块链中的任意一个节点集群的数据存储性能。
在一个实施例中,提出了一种计算机设备,计算机设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点;通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果。
在一个实施例中,本申请还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,也可以为易失性计算机可读存储介质。计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:获取由多个分片节点组成的节点集群,节点集群用于存储区块链中的第一数据,第一数据的数据存储总量为区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选节点集群中的主节点,并将节点集群中的除了主节点之外的其余分片节点配置为从节点;通过主节点进行账本查询,得到账本查询结果,以及通过主节点进行账本更新,得到账本更新结果。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说, 在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (20)
- 一种数据分片存储方法,包括:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
- 根据权利要求1所述的数据分片存储方法,其中,所述主节点为peer节点,所述通过所述主节点进行账本查询,得到账本查询结果包括:在应用程序连接到所述主节点之后,获取所述应用程序生成的提案,并将所述提案提交至所述主节点;所述主节点根据所述提案调用相应的第一链码,以便于所述第一链码根据所述提案查询对应的超级账本,得到向所述应用程序返回的账本查询结果。
- 根据权利要求2所述的数据分片存储方法,其中,所述通过所述主节点进行账本更新,得到对应的账本更新结果包括:获取所述应用程序根据返回的所述账本查询结果生成一个交易,并将所述交易发送给排序服务模块,以便于所述排序服务模块将所述交易发送给所述区块链中的所述主节点;所述主节点根据所述交易调用相关的第二链码,以根据所述第二链码进行账本更新,得到对应的账本更新结果。
- 根据权利要求1所述的数据分片存储方法,其中,所述方法还包括:对所述节点集群的所述第一数据存储总量进行扩容,得到扩容后的第二数据存储总量。
- 根据权利要求4所述的数据分片存储方法,其中,在所述得到扩容后的第二数据存储容量之后,所述方法还包括:确定所述节点集群中待加入的分片节点的数量。
- 根据权利要求5所述的数据分片存储方法,其中,所述确定所述节点集群中待加入的分片节点的数量包括:获取所述节点集群的所述第一数据存储总量、所述节点集群扩容后的所述第二数据存储总量以及所述节点集群中的任意一个分片节点的数据存储量阈值;根据所述第一数据存储总量和所述第二数据存储总量,确定出所述节点集群待扩容的第三数据存储总量;根据所述第三数据存储总量和所述节点集群中的任意一个分片节点的数据存储量阈值,确定所述节点集群中待加入的分片节点的数量。
- 根据权利要求1所述的数据分片存储方法,其中,所述预设推选条件包括:所述节点集群中的当前分片节点获取到的投票数超过总数的一半、且该分片节点获取到的投票数最多,则将该分片节点推选为所述节点集群中的所述主节点。
- 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
- 根据权利要求8所述的计算机设备,所述处理器执行所述计算机程序时还实现以下步骤:在应用程序连接到所述主节点之后,获取所述应用程序生成的提案,并将所述提案提交至所述主节点;所述主节点根据所述提案调用相应的第一链码,以便于所述第一链码根据所述提案查询对应的超级账本,得到向所述应用程序返回的账本查询结果。
- 根据权利要求9所述的计算机设备,所述处理器执行所述计算机程序时还实现以下步骤:获取所述应用程序根据返回的所述账本查询结果生成一个交易,并将所述交易发送给排序服务模块,以便于所述排序服务模块将所述交易发送给所述区块链中的所述主节点;所述主节点根据所述交易调用相关的第二链码,以根据所述第二链码进行账本更新,得到对应的账本更新结果。
- 根据权利要求8所述的计算机设备,所述处理器执行所述计算机程序时还实现以下步骤:对所述节点集群的所述第一数据存储总量进行扩容,得到扩容后的第二数据存储总量。
- 根据权利要求11所述的计算机设备,所述处理器执行所述计算机程序时还实现以下步骤:确定所述节点集群中待加入的分片节点的数量。
- 根据权利要求12所述的计算机设备,所述处理器执行所述计算机程序时还实现以下步骤:获取所述节点集群的所述第一数据存储总量、所述节点集群扩容后的所述第二数据存储总量以及所述节点集群中的任意一个分片节点的数据存储量阈值;根据所述第一数据存储总量和所述第二数据存储总量,确定出所述节点集群待扩容的第三数据存储总量;根据所述第三数据存储总量和所述节点集群中的任意一个分片节点的数据存储量阈值,确定所述节点集群中待加入的分片节点的数量。
- 根据权利要求8所述的计算机设备,当所述处理器执行所述计算机程序时还实现以下步骤时,所述预设推选条件包括:所述节点集群中的当前分片节点获取到的投票数超过总数的一半、且该分片节点获取到的投票数最多,则将该分片节点推选为所述节点集群中的所述主节点。
- 一种计算机可读存储介质,所述计算机可读存储介质中存储计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;通过预设推选条件推选所述节点集群中的主节点,并将所述节点集群中的除了所述主节点之外的其余分片节点配置为从节点;通过所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点进行账本更新,得到账本更新结果。
- 根据权利要求15所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:在应用程序连接到所述主节点之后,获取所述应用程序生成的提案,并将所述提案提交至所述主节点;所述主节点根据所述提案调用相应的第一链码,以便于所述第一链码根据所述提案查询对应的超级账本,得到向所述应用程序返回的账本查询结果。
- 根据权利要求16所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:获取所述应用程序根据返回的所述账本查询结果生成一个交易,并将所述交易发送给排序服务模块,以便于所述排序服务模块将所述交易发送给所述区块链中的所述主节点;所述主节点根据所述交易调用相关的第二链码,以根据所述第二链码进行账本更新,得到对应的账本更新结果。
- 根据权利要求15所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:对所述节点集群的所述第一数据存储总量进行扩容,得到扩容后的第二数据存储总量。
- 根据权利要求18所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:确定所述节点集群中待加入的分片节点的数量。
- 一种数据分片存储装置,所述数据分片存储装置包括:获取单元,用于获取由多个分片节点组成的节点集群,所述节点集群用于存储区块链中的第一数据,所述第一数据的数据存储总量为所述区块链中任意一个节点集群的第一数据存储总量;主节点推选单元,用于通过预设推选条件推选获取单元获取的所述节点集群中的主节点;配置单元,用于将所述节点集群中的除了所述主节点推选单元推选出的所述主节点之外的其余分片节点配置为从节点;数据处理单元,用于通过所述主节点推选单元推选出的所述主节点进行账本查询,得到账本查询结果,以及通过所述主节点推选单元推选出的所述主节点进行账本更新,得到账本更新结果。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011529237.0A CN112650812A (zh) | 2020-12-22 | 2020-12-22 | 一种数据分片存储方法、装置、计算机设备和存储介质 |
CN202011529237.0 | 2020-12-22 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022134797A1 true WO2022134797A1 (zh) | 2022-06-30 |
Family
ID=75359048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/124953 WO2022134797A1 (zh) | 2020-12-22 | 2021-10-20 | 一种数据分片存储方法、装置、计算机设备和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112650812A (zh) |
WO (1) | WO2022134797A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089924A (zh) * | 2021-12-02 | 2022-02-25 | 东软集团股份有限公司 | 区块链账本数据存储系统及方法 |
CN118426970A (zh) * | 2024-06-28 | 2024-08-02 | 天津南大通用数据技术股份有限公司 | 数据分片部署方法、装置、设备及存储介质 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112650812A (zh) * | 2020-12-22 | 2021-04-13 | 深圳壹账通智能科技有限公司 | 一种数据分片存储方法、装置、计算机设备和存储介质 |
CN114363363B (zh) * | 2021-12-31 | 2024-03-22 | 杭州趣链科技有限公司 | 基于多链的数据存储方法、装置、设备及介质 |
US20240036739A1 (en) * | 2022-07-26 | 2024-02-01 | Silicon Motion, Inc. | Method and apparatus for performing data fragmentation reduction control of memory device in predetermined communications architecture with aid of fragmentation information detection, and associated computer-readable medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109345386A (zh) * | 2018-08-31 | 2019-02-15 | 阿里巴巴集团控股有限公司 | 基于区块链的交易共识处理方法及装置、电子设备 |
US20190140935A1 (en) * | 2017-08-03 | 2019-05-09 | Liquineq AG | System and method for performance testing of scalable distributed network transactional databases |
CN109785136A (zh) * | 2019-01-30 | 2019-05-21 | 北京京东尚科信息技术有限公司 | 一种区块链的交易处理方法、客户端及区块链网络 |
US20190205884A1 (en) * | 2017-12-28 | 2019-07-04 | International Business Machines Corporation | Converting processes into multiple blockchain smart contracts |
CN110570202A (zh) * | 2019-09-02 | 2019-12-13 | 杭州趣链科技有限公司 | 一种基于分片技术的混合共识方法 |
CN111092896A (zh) * | 2019-12-23 | 2020-05-01 | 北京工商大学 | 基于优化paxos的食品溯源分布式数据同步方法 |
CN112650812A (zh) * | 2020-12-22 | 2021-04-13 | 深圳壹账通智能科技有限公司 | 一种数据分片存储方法、装置、计算机设备和存储介质 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108134706B (zh) * | 2018-01-02 | 2020-08-18 | 中国工商银行股份有限公司 | 区块链多活高可用系统、计算机设备以及方法 |
CN110084059A (zh) * | 2019-03-21 | 2019-08-02 | 深圳壹账通智能科技有限公司 | 一种银行系统数据配置区块链的方法、装置及计算机设备 |
CN111683118B (zh) * | 2020-05-16 | 2023-07-11 | 中信银行股份有限公司 | 基于区块链的共识方法、装置、主节点设备及从节点设备 |
CN112035215B (zh) * | 2020-08-31 | 2023-12-19 | 腾讯科技(深圳)有限公司 | 节点集群的节点自治方法、系统、装置及电子设备 |
-
2020
- 2020-12-22 CN CN202011529237.0A patent/CN112650812A/zh active Pending
-
2021
- 2021-10-20 WO PCT/CN2021/124953 patent/WO2022134797A1/zh active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190140935A1 (en) * | 2017-08-03 | 2019-05-09 | Liquineq AG | System and method for performance testing of scalable distributed network transactional databases |
US20190205884A1 (en) * | 2017-12-28 | 2019-07-04 | International Business Machines Corporation | Converting processes into multiple blockchain smart contracts |
CN109345386A (zh) * | 2018-08-31 | 2019-02-15 | 阿里巴巴集团控股有限公司 | 基于区块链的交易共识处理方法及装置、电子设备 |
CN109785136A (zh) * | 2019-01-30 | 2019-05-21 | 北京京东尚科信息技术有限公司 | 一种区块链的交易处理方法、客户端及区块链网络 |
CN110570202A (zh) * | 2019-09-02 | 2019-12-13 | 杭州趣链科技有限公司 | 一种基于分片技术的混合共识方法 |
CN111092896A (zh) * | 2019-12-23 | 2020-05-01 | 北京工商大学 | 基于优化paxos的食品溯源分布式数据同步方法 |
CN112650812A (zh) * | 2020-12-22 | 2021-04-13 | 深圳壹账通智能科技有限公司 | 一种数据分片存储方法、装置、计算机设备和存储介质 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089924A (zh) * | 2021-12-02 | 2022-02-25 | 东软集团股份有限公司 | 区块链账本数据存储系统及方法 |
CN114089924B (zh) * | 2021-12-02 | 2024-06-04 | 东软集团股份有限公司 | 区块链账本数据存储系统及方法 |
CN118426970A (zh) * | 2024-06-28 | 2024-08-02 | 天津南大通用数据技术股份有限公司 | 数据分片部署方法、装置、设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN112650812A (zh) | 2021-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022134797A1 (zh) | 一种数据分片存储方法、装置、计算机设备和存储介质 | |
US11726984B2 (en) | Data redistribution method and apparatus, and database cluster | |
US9971823B2 (en) | Dynamic replica failure detection and healing | |
US9015177B2 (en) | Dynamically splitting multi-tenant databases | |
CN106936899B (zh) | 分布式统计分析系统的配置方法及分布式统计分析系统 | |
CN109547512B (zh) | 一种基于NoSQL的分布式Session管理的方法及装置 | |
JP2023546249A (ja) | トランザクション処理方法、装置、コンピュータ機器及びコンピュータプログラム | |
US20160112516A1 (en) | Distributed storage system, cluster node and range management method thereof | |
US20100161551A1 (en) | Selective database replication | |
US11068499B2 (en) | Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching | |
KR20120018178A (ko) | 객체 저장부들의 네트워크상의 스웜-기반의 동기화 | |
US11991094B2 (en) | Metadata driven static determination of controller availability | |
CN106878382B (zh) | 一种分布式仲裁集群中动态改变集群规模的方法及装置 | |
WO2023045617A1 (zh) | 一种交易数据处理方法、装置、设备以及介质 | |
CN106302640A (zh) | 数据请求处理方法及装置 | |
WO2017012383A1 (zh) | 一种服务注册方法、使用方法及相关装置 | |
CN113157450A (zh) | 在区块链系统中执行区块的方法及装置 | |
US20170300553A1 (en) | System and methodology for propagating modifications in key-value pairs across a cluster of computers | |
US20240311391A1 (en) | K-db database multi-node cluster scheduling method and system, device, and medium | |
CN110798358B (zh) | 分布式服务标识方法、装置、计算机可读介质及电子设备 | |
WO2024001304A1 (zh) | 一种数据处理方法及相关设备 | |
CN114205354B (zh) | 事件管理系统、事件管理方法、服务器及存储介质 | |
WO2024001032A1 (zh) | 在区块链系统中执行交易的方法、区块链系统和节点 | |
CN111428114A (zh) | Elasticsearch搜索引擎的索引创建方法及装置 | |
CN112711466B (zh) | 悬挂事务巡检方法和装置、电子设备和存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21908798 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 30.10.2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21908798 Country of ref document: EP Kind code of ref document: A1 |