WO2020238254A1 - 数据存储方法及节点 - Google Patents

数据存储方法及节点 Download PDF

Info

Publication number
WO2020238254A1
WO2020238254A1 PCT/CN2020/072007 CN2020072007W WO2020238254A1 WO 2020238254 A1 WO2020238254 A1 WO 2020238254A1 CN 2020072007 W CN2020072007 W CN 2020072007W WO 2020238254 A1 WO2020238254 A1 WO 2020238254A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
key
node
data
historical
Prior art date
Application number
PCT/CN2020/072007
Other languages
English (en)
French (fr)
Inventor
卓海振
Original Assignee
创新先进技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Priority to US16/776,685 priority Critical patent/US11294875B2/en
Publication of WO2020238254A1 publication Critical patent/WO2020238254A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • One or more embodiments of this specification relate to the field of terminal technology, and in particular to a data storage method and node.
  • Blockchain technology (also known as distributed ledger technology) is a de-neutralized distributed database technology, which has the characteristics of decentralization, openness and transparency, non-tampering, trustworthiness, etc., and is suitable for many In application scenarios with high demand for data reliability.
  • one or more embodiments of this specification provide a data storage method and device.
  • a data storage method including:
  • the blockchain node obtains a first key-value pair corresponding to the data to be stored, where the first key-value pair includes the value of the data to be stored and the first key;
  • the blockchain node determines the corresponding leaf node in the tree-like data organization structure according to the first key, wherein the value of the non-leaf node in the tree-like data organization structure is based on the next-level child node
  • the hash value calculated by taking the value
  • the blockchain node associates the value of the data to be stored with the determined leaf node, so that the value of the determined leaf node is based on the The hash value calculated from the value of the data to be stored;
  • the blockchain node determines that the leaf node has an associated historical value, modify the first key to update the first key-value pair to an updated key-value pair; and, the The blockchain node stores the updated key-value pair in the conflicting data storage structure corresponding to the determined leaf node, so that the determined value of the leaf node is based on the value of the data to be stored and the history. Value calculated hash value.
  • a data storage node including:
  • An obtaining unit for obtaining a first key-value pair corresponding to the data to be stored, the first key-value pair including the value of the data to be stored and the first key;
  • the determining unit determines the corresponding leaf node in the tree data organization structure according to the first key, wherein the value of the non-leaf node in the tree data organization structure is calculated according to the value of the next level child node The hash value obtained;
  • the associating unit associates the value of the data to be stored with the determined leaf node when the determined leaf node does not have an associated historical value, so that the value of the determined leaf node is based on the data to be stored
  • the hash value calculated by the value of;
  • the modification unit when the determined leaf node has an associated historical value, modify the first key to update the first key-value pair to an updated key-value pair;
  • the storage unit stores the updated key-value pair in the determined conflict data storage structure corresponding to the leaf node, and makes the determined leaf node value based on the value of the data to be stored and the historical value The calculated hash value.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor implements the method according to the first aspect by running the executable instruction.
  • a computer-readable storage medium is provided, and computer instructions are stored thereon, which, when executed by a processor, implement the steps of the method described in the first aspect.
  • Fig. 1 is a schematic diagram of an example environment provided by an example embodiment.
  • Fig. 2 is a schematic diagram of a conceptual architecture provided by an exemplary embodiment.
  • Fig. 3 is a flowchart of a data storage method provided by an exemplary embodiment.
  • Fig. 4 is a schematic diagram of a tree data organization structure provided by an exemplary embodiment.
  • Fig. 5 is a schematic diagram of associating values to leaf nodes according to an exemplary embodiment.
  • Figures 6-7 are schematic diagrams of recording key-value pairs in a conflict data storage table corresponding to a leaf node according to an exemplary embodiment.
  • Fig. 8 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 9 is a block diagram of a data storage node provided by an exemplary embodiment.
  • the steps of the corresponding method may not be executed in the order shown and described in this specification.
  • the method includes more or fewer steps than described in this specification.
  • 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 also be combined into a single step in other embodiments. description.
  • Fig. 1 is a schematic diagram of an example environment provided by an example embodiment.
  • the example environment 100 allows entities to participate in the blockchain network 102.
  • the blockchain network 102 may be a public, private, or consortium blockchain network.
  • the example environment 100 may include computing devices 104, 106, 108, 110, 112 and a network 114; in an embodiment, the network 114 may include a local area network (LAN), a wide area network (Wide Area Network, WAN), the Internet, or It is combined and connected to websites, user devices (such as computing devices) and back-end systems.
  • the network 114 may be accessed through wired and/or wireless communication.
  • the computing devices 106, 108 may be nodes of a cloud computing system (not shown), or each computing device 106, 108 may be a separate cloud computing system, including being interconnected by a network and acting as a distributed processing system Multiple computers at work.
  • the computing devices 104-108 may run any appropriate computing system to enable them to serve as nodes in the blockchain network 102; for example, the computing devices 104-108 may include, but are not limited to, servers, desktop computers, and notebooks. Computers, tablet computing devices and smartphones. In an embodiment, the computing devices 104 to 108 may be attributed to related entities and used to implement corresponding services. For example, the service may be used to manage transactions between a certain entity or multiple entities.
  • the computing devices 104-108 respectively store the blockchain ledger corresponding to the blockchain network 102.
  • the computing device 104 may be (or include) a web server for providing browser functions, and the web server may provide visual information related to the blockchain network 102 based on the network 114.
  • the computing device 104 may not participate in block verification, but monitor the blockchain network 102 to determine when other nodes (for example, computing devices 106-108 may include) reached a consensus, and generate corresponding blocks accordingly Chain visual user interface.
  • the computing device 104 may receive a request initiated by a client device (such as the computing device 110 or the computing device 112) for the blockchain visualization user interface.
  • a client device such as the computing device 110 or the computing device 112
  • the nodes of the blockchain network 102 can also serve as client devices.
  • a user of the computing device 108 can use a browser running on the computing device 108 to send the aforementioned request to the computing device 104.
  • the computing device 104 may generate a blockchain visual user interface (such as a web page) based on the stored blockchain ledger, and send the generated blockchain visual user interface to the requesting client device.
  • a blockchain visual user interface such as a web page
  • the request for the blockchain visualization user interface may include user authorization information, before the blockchain visualization user interface is generated and sent to the requesting client device ,
  • the computing device 104 may verify the user authorization information, and return to the corresponding blockchain visual user interface after the verification is passed.
  • the blockchain visual user interface may be displayed on the client device (for example, it may be displayed in the user interface 116 shown in FIG. 1).
  • the display content of the user interface 116 can also be updated accordingly.
  • the user's interaction with the user interface 116 may lead to requests for other user interfaces, such as displaying block lists, block details, transaction lists, transaction details, account lists, account details, contract lists, contract details, or user requests for blocks Search results pages generated by the implementation of the search on the chain network.
  • Fig. 2 is a schematic diagram of a conceptual architecture provided by an exemplary embodiment.
  • the conceptual architecture 200 includes a physical layer 202, a managed service layer 204 and a blockchain network layer 206.
  • the entity layer 202 may include three entities: entity 1, entity 2 and entity 3, and each entity has its own transaction management system 208.
  • the managed service layer 204 may include an interface 210 corresponding to each transaction management system 208.
  • each transaction management system 208 uses a protocol (such as Hypertext Transfer Protocol Security (HTTPS), etc.) to communicate with the respective interface 210 through a network (such as the network 114 in FIG. 1).
  • HTTPS Hypertext Transfer Protocol Security
  • each interface 210 may provide a communication connection between its corresponding transaction management system 208 and the blockchain network layer 206; more specifically, the interface 210 may be connected to the blockchain network of the blockchain network layer 206 212 communications.
  • the communication between the interface 210 and the blockchain network layer 206 can be implemented using remote procedure calls (RPCs).
  • the interface 210 may provide the transaction management system 208 with an API interface for accessing the blockchain network 212.
  • the blockchain network 212 is provided in the form of a peer-to-peer network.
  • the peer-to-peer network includes a plurality of nodes 214, each of which is used to persist the blockchain ledger 216 formed by the blockchain data; Wherein, only one block chain ledger 216 is shown in FIG. 2, but there may be multiple block chain ledger 216 or copies thereof in the block chain network 212.
  • each node 214 can maintain a block chain separately Ledger 216 or a copy thereof.
  • a transaction in a narrow sense refers to a value transfer issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, a transaction can be a transfer initiated by the user in the blockchain.
  • a transaction refers to a piece of business data with business intent released by a user to the blockchain; for example, an operator can build a consortium chain based on actual business needs, and rely on the consortium chain to deploy some other types that are not related to value transfer Online business (for example, renting business, vehicle dispatching business, insurance claims business, credit service, medical service, etc.), and in this kind of alliance chain, the transaction can be a business with business intent issued by the user in the alliance chain Message or business request.
  • value transfer Online business for example, renting business, vehicle dispatching business, insurance claims business, credit service, medical service, etc.
  • Fig. 3 is a flowchart of a data storage method provided by an exemplary embodiment. As shown in Figure 3, the method may include the following steps:
  • Step 302 The blockchain node obtains a first key-value pair corresponding to the data to be stored, where the first key-value pair includes the value of the data to be stored and the first key.
  • the nodes in the blockchain network can organize the stored data in a certain form during the data storage process, such as a tree-like data organization structure.
  • the public chain is represented by Bitcoin and Ethereum.
  • blockchain nodes can implement complex processing logic by running EVM (Ethereum Virtual Machine) and executing smart contract codes in the EVM.
  • EVM Electronicthereum Virtual Machine
  • a number of contract states are defined in the code of the smart contract, and the values of these contract states can change after the code is executed. Therefore, the blockchain nodes in the Ethereum network use an MPT-type tree-like data organization structure to organize and store the values of all contract states, and record the root hash formed at the root node of the MPT in the block header. It is used to verify the state of the contract and its value.
  • the data to be stored in this specification may include the aforementioned contract status.
  • it can also be applied to other types of data, such as receipts generated after the smart contract is executed. This specification does not limit this.
  • a unified key-value pair generation rule is pre-configured on the blockchain node, and a corresponding key can be set for the value of the data to be stored.
  • the blockchain node can directly set the aforementioned first key for the value of the data to be stored according to the key-value pair generation rule.
  • a blockchain node can generate a corresponding initial key-value pair for the data to be stored according to the key-value pair generation rule.
  • the initial key-value pair includes the value of the data to be stored and the initial key; then, the blockchain node can select The characters of a specific position in the initial key form the first key, and the length of the first key is less than the initial key, so as to obtain the above-mentioned first key-value pair.
  • the smart contract model defines that the key length of the contract state is 32 bytes and the value length is 32 bytes, that is, the length of the initial key is 32 bytes, then the first key can be the front of the initial key.
  • 16 bytes that is, the above-mentioned specific bit
  • the length of the first key is 16 bytes; of course, other “specific bits” can be selected in other embodiments, and the length of the first key can also be different. This specification is not correct This is limited. Similarly, for the foregoing embodiment in which the first key is generated directly according to the key-value pair generation rule, the first key with a length of 16 bytes can be directly generated.
  • the initial key-value pair occupies a total of 64 bytes of storage space.
  • the first key-value pair occupies a total of 48 bytes of storage space, and the occupied storage space is reduced by 16 bytes.
  • Step 304 The blockchain node determines the corresponding leaf node in the tree data organization structure according to the first key, wherein the value of the non-leaf node in the tree data organization structure is based on the next level The hash value calculated from the value of the child node.
  • the tree-like data organization structure forms several layers from the root node at the top down, and each layer contains several nodes until the bottom leaf node is formed.
  • the value of each node is a hash value, where: the value of the leaf node is the hash value calculated from the associated data; the value of the non-leaf node is the hash value calculated from the value of the next-level child node , Until the hash value corresponding to the root node is calculated, that is, the root hash. Therefore, according to the value of each node, the tree-like data organization structure has the characteristics of Merkle Tree (Merkle Tree).
  • each node in the tree data organization structure has a corresponding node label; wherein, on the path formed from the root node to the determined leaf node, the node label corresponding to each node is sequentially combined to form a combined value Equal to the aforementioned first key. Therefore, the blockchain node can determine the node corresponding to each level from the root node of the tree-like data organization structure according to the first key corresponding to the data to be stored, until the corresponding leaf node is determined. Therefore, according to the corresponding relationship between the path and the key, the tree-like data organization structure has the characteristics of a dictionary tree, for example, a prefix tree (Trie), a compressed prefix tree (Patricia trie), or a similar structure form can be specifically adopted.
  • Trie prefix tree
  • Patricia trie a compressed prefix tree
  • the tree-like data organization structure can integrate the aforementioned characteristics of the Merkel tree and the dictionary tree. For example, based on the structure of the dictionary tree, the value of each node is made to conform to the characteristics of the Merkel tree. In this way, the node path can be matched with the key, and the hash value corresponding to each node can be determined step by step from the leaf nodes.
  • the tree-like data organization structure may be a Merkle-Patricia Tree (MPT); or, the tree-like data organization structure may be other similar structures.
  • Step 306a When the determined leaf node does not have an associated historical value, the blockchain node associates the value of the data to be stored with the determined leaf node, so that the value of the determined leaf node is A hash value calculated according to the value of the data to be stored.
  • the value of the data to be stored can be associated with the leaf node, so that the value of the leaf node temporarily corresponds to the value of the data to be stored
  • the value of the data to be stored is the historical value of the leaf node relative to the subsequent other data. Go to step 306b for processing.
  • Step 306b when the blockchain node determines that the leaf node has an associated historical value, it modifies the first key to update the first key-value pair to an updated key-value pair.
  • the blockchain node since the blockchain node determines the leaf node according to the first key corresponding to the data to be stored, when the leaf node has an associated historical value, it indicates that the key corresponding to the historical value is the same as the first key the same. Therefore, by modifying the first key, the key in the updated key-value pair is distinguished from the key corresponding to the historical value, so as to distinguish between the data to be stored and the historical value to avoid confusion.
  • the first key is composed of specific bits contained in the aforementioned initial key
  • the first key can be restored to the initial key, that is, the updated key-value pair is the aforementioned The initial key-value pair.
  • the first key can also be modified to other values, and the aforementioned initial key is not necessarily used, as long as it can be distinguished from the key corresponding to the historical value, and this specification does not limit this.
  • Step 308 The blockchain node stores the updated key-value pair in the determined conflict data storage structure corresponding to the leaf node, and sets the value of the determined leaf node to a value based on the data to be stored And the hash value calculated from the historical value.
  • the leaf node determined by the data to be stored already has an associated historical value, it indicates that a data conflict has occurred between the data to be stored and the historical value.
  • each leaf node can only be associated with one value, so by setting a corresponding conflict data storage structure for each leaf node, so that in the event of a data conflict, data can be stored in the conflict data storage structure
  • the conflict data storage structure there is no limit on the number of data in the conflict data storage structure, and the data stored in the conflict data storage structure is determined to be associated with the corresponding leaf node, thereby realizing the data that can be associated with the leaf node Number expansion. Therefore, when a key-value pair is stored in the conflict data storage structure, it is equivalent to the value in the key-value pair is indirectly associated with the corresponding leaf node.
  • the corresponding historical value may include the historical value directly associated with the leaf node at the historical moment, or may include the historical value recorded in the conflict data storage structure at the historical moment.
  • Historical key-value pairs are examples of historical key contained in the historical key-value pair. Among them, the historical key contained in the historical key-value pair should be different from the key contained in the above-mentioned updated key-value pair.
  • the historical value when there is only one historical value, the historical value is usually directly related to the historical value of the leaf node; of course, this specification does not exclude that the historical value may be a historical key-value pair in the conflicting data storage structure .
  • the multiple historical values can all be historical key-value pairs located in the conflicting data storage structure; or, the earliest historical value is the historical value directly related to the leaf node, and the other historical values The values are all historical key-value pairs located in the conflicting data storage structure.
  • the hash value corresponding to the leaf node when there are both historical values directly related to the leaf nodes and key-value pairs stored in the data storage structure (historical key-value pairs and/or the aforementioned updated key-value pairs), unless pre-defined The order between these data is changed. Otherwise, when the hash value corresponding to the leaf node is generated based on the data, the different order may lead to different hash values, that is, the hash value is not stable.
  • the blockchain node can delete the determined historical value associated with the leaf node, and record the second key-value pair corresponding to the historical value in the conflict data storage structure; where the second key-value pair contains the historical value and The second key is different from the keys contained in other key-value pairs in the conflicting data storage structure. Then, since all key-value pairs in the conflicting data storage structure are arranged in a preset order, such as the order of value generation, the order of the value of the key, etc., it can be ensured that the order is arranged in this order and the hash of the corresponding leaf node is generated. Value, so you can get a steady-state hash value.
  • the conflicting data storage structure may be a tree-like data organization structure, such as a Merkel tree.
  • the conflict data storage structure may be a table structure.
  • other forms of conflicting data storage structures can be used, and this specification does not limit this.
  • Fig. 4 is a schematic diagram of a tree data organization structure provided by an exemplary embodiment.
  • the top of the tree-like data organization structure is the root node 41, and other levels contain several nodes.
  • the child nodes of the root node 41 include node 421 and node 422.
  • the child nodes of node 421 include node 431, node 432, etc.
  • the bottom layer is a number of leaf nodes, such as node 441, node 442, and node 443.
  • each other node has one or more sub-nodes, and the number of sub-nodes depends on the actual situation, which is not limited in this specification.
  • the tree-like data organization structure inherits the characteristics of the dictionary tree, and the keys of the corresponding key-value pairs can be characterized by paths.
  • the node corresponding to root node 41 is labeled a
  • the node corresponding to node 421 is labeled 5
  • the node corresponding to node 422 is labeled 7
  • the node corresponding to node 431 is labeled 1
  • the node corresponding to node 432 is labeled 2
  • node 441 The corresponding node is labeled 1
  • the node corresponding to node 442 is labeled 5
  • the node corresponding to node 443 is labeled f, and so on.
  • the path a-5-1-...-1 can be formed from the root node 41 to the node 441.
  • a path a-5-2-...-5 can be formed from the root node to the node 442.
  • a path a-5-2-...-f can be formed from the root node to the node 443.
  • the tree-like data organization structure inherits the characteristics of the Merkel tree, and the value of each node is a hash value.
  • the hash value is calculated from the numerical value associated with the leaf node.
  • the value of the node 441 is the hash value Hn-1
  • the hash value Hn-1 is: the hash value calculated from the value associated with the node 441
  • the value of the node 442 is the hash value Hn-2
  • the hash value Hn-2 is: the hash value calculated by the value associated with the node 442
  • the value of the node 443 is the hash value Hn-3
  • the hash value Hn-3 is: associated with the node 443 is the calculated hash value.
  • the hash value is calculated from the value of the child node at the next level of the node.
  • the value of the root node 41 is the hash value Hr
  • the nodes at the next level of the root node 41 are the node 421 and the node 422
  • the hash value Hr is: according to the value of the node 421 and the value of the node 422
  • the calculated hash value for example, the hash value H1-1 corresponding to node 421 and the hash value H1-2 corresponding to node 422 are spliced into a string, and the hash value calculated from the string is used as the above Hash value Hr.
  • the hash value H1-1 is: according to the value of node 431 and node 432
  • the hash value calculated by the value of, for example, the hash value H2-1 corresponding to node 431 and the hash value H2-2 corresponding to node 432 are spliced into a string, and the hash value calculated by the string As the above hash value H1-1.
  • the blockchain node After the blockchain node executes a smart contract called by a transaction, assuming that the value of the contract state Z1 defined in the smart contract has changed, the blockchain node needs to store the value of the contract state Z1 as shown in Figure 4. The tree data organization structure shown. The blockchain node first generates the corresponding key-value pair for the contract state Z1.
  • the key in the key-value pair generated by the blockchain node is 32 bytes and the value is 32 bytes.
  • the blockchain node can first generate the initial key-value pair in a similar way, including the initial key K1', the value value is V1, that is, the key-value pair is K1'-V1, where the length of K1' is 32 The length of byte and V1 is 32 bytes. Then, the blockchain node can transform the initial key K1', such as intercepting the first 16 bytes to form a new key K1, forming a new key-value pair K1-V1. Then, when the blockchain node stores the contract state Z1, the key-value pair K1-V1 only needs to occupy 48 bytes of storage space, instead of the 64 bytes that the key-value pair K1'-V1 needs.
  • the blockchain node determines the corresponding leaf node in the tree data organization structure shown in Figure 4 according to K1. For example, when the value of K1 is a52...f, assuming that the value of K1 matches the path from the root node 41 to the leaf node 443, it can be determined that K1 corresponds to the leaf node 443.
  • the blockchain node can directly associate the value V1 of the contract state Z1 to the leaf node 443, as shown in FIG. 5.
  • the hash value Hn-i corresponding to the node 443 is obtained by hashing the value V1.
  • the storage process for contract state Z2 is similar to the storage process for contract state Z1 described above.
  • the blockchain node generates the initial key-value pair K2'-V2 for the contract state Z2, and then intercepts the first 16 bytes of the initial key K2' as a new key K2, and forms the key-value pair K2-V2 of the contract state Z2. Then, the blockchain node determines the corresponding leaf node from the tree data organization structure shown in FIG. 5 according to the key K2.
  • the blockchain node can determine the corresponding leaf node as node 443 accordingly. Then, for the contract state Z2, the node 443 already has an associated historical value, that is, the historical value V1 associated with the node 443 above. Therefore, the storage process for contract state Z2 is different from the previous storage process for contract state Z1.
  • the blockchain node may create a corresponding conflict data storage table for node 443, for example, the conflict data storage table may be as shown in FIG. 6.
  • the blockchain node can create a conflict data storage table when node 443 is created; or, the blockchain node can temporarily store the contract state Z2 in the case of data conflict. Create a conflict data storage table.
  • the processing process of the blockchain node includes two aspects: First, the blockchain node deletes the historical value V1 associated with the node 443. In the second aspect, the blockchain node restores the key-value pair corresponding to the contract state Z1 to the initial key-value pair K1-V1, restores the key-value pair corresponding to the contract state Z2 to the initial key-value pair K2-V2, and sets the initial key
  • the value pairs K1-V1 and K2-V2 are respectively stored in the conflict data storage table corresponding to the node 443.
  • the primary key of the conflict data storage table can include "key” and "value”
  • the blockchain node can write K1-V1 and K2-V2 accordingly.
  • the primary key of the conflict data storage table can also include the "number of conflicts", and the blockchain node can record the total number of conflicting key-value pairs, such as 2 here.
  • each key-value pair is arranged in sequence according to a preset order.
  • the order may include the generation order of key-value pairs. Therefore, when all the blockchain nodes insert the key-value pairs K1-V1, K2-V2, K3-V3 into the conflict data storage table, it can be ensured that each blockchain node arranges the key-value pair K1-V1 in First, the key-value pair K2-V2 is arranged after, and the key-value pair K3-V3 is arranged last, and the hash value Hn-i corresponding to node 443 is obtained by taking the values V1, V2, and V3 according to V1 ⁇ V2 ⁇ V3 The hash calculation is performed after splicing in the order of, instead of splicing in the order of V2 ⁇ V1 ⁇ V3 or other order, to ensure that the hash value Hn-i calculated by all blockchain nodes is the same.
  • the technical solution of this specification can support keys of shorter length, and in the case of data conflict, by configuring the corresponding conflict data storage structure for the leaf node, you can record all the matching leaf nodes Key-value pairs, and effectively distinguish each key-value pair.
  • the 16-byte length key described above is used, the probability of generating the same key between different contract states is extremely low. Therefore, for most key-value pairs, the shorter length is used. The key saves a lot of storage space for the node.
  • Fig. 8 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 8.
  • the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810.
  • the processor 802 reads the corresponding computer program from the non-volatile memory 810 to the memory 808 and then runs it to form a data storage node on a logical level.
  • 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 to say, the execution body of the following processing flow is not limited to each
  • the logic unit can also be a hardware or logic device.
  • the data storage node may include:
  • the obtaining unit 91 obtains a first key-value pair corresponding to the data to be stored, where the first key-value pair includes the value of the data to be stored and the first key;
  • the determining unit 92 determines the corresponding leaf node in the tree data organization structure according to the first key, wherein the value of the non-leaf node in the tree data organization structure is based on the value of the next-level child node The calculated hash value;
  • the associating unit 93 when the determined leaf node does not have an associated historical value, associates the value of the data to be stored with the determined leaf node, so that the value of the determined leaf node is based on the value to be stored
  • the modification unit 94 when the determined leaf node has an associated historical value, modify the first key to update the first key-value pair to an updated key-value pair;
  • the storage unit 95 stores the updated key-value pair in the conflict data storage structure corresponding to the determined leaf node, so that the determined value of the leaf node is based on the value of the data to be stored and the history. Value calculated hash value.
  • the obtaining unit 91 is specifically configured to:
  • the first key is formed by selecting characters with a specific position in the initial key, and the length of the first key is smaller than the initial key, so as to obtain the first key-value pair.
  • the updated key-value pair is the initial key-value pair.
  • each node in the tree data organization structure has a corresponding node label; wherein, on the path formed from the root node to the determined leaf node, the node label corresponding to each node is sequentially combined to form a combined value Equal to the first key.
  • the historical value includes: historical key-value pairs recorded in the conflict data storage structure at historical moments; wherein the historical key contained in the historical key-value pair is different from the updated key value The keys contained.
  • the historical value includes: a historical value associated with the determined leaf node at a historical moment.
  • Optional also includes:
  • the deleting unit 96 deletes the associated historical value of the determined leaf node
  • the recording unit 97 records a second key-value pair corresponding to the historical value in the conflict data storage structure, the second key-value pair includes the historical value and a second key, and the second key is different The keys contained in other key-value pairs in the conflicting data storage structure.
  • all the key-value pairs in the conflicting data storage structure are sequentially arranged in a preset order.
  • the conflict data storage structure is a tree data organization structure or a table structure.
  • a typical implementation device is a computer.
  • the specific form of the computer can be 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 receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used in one or more embodiments of this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

一种数据存储方法及节点,该方法可以包括:区块链节点(214)获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;所述区块链节点(214)根据所述第一键在树状数据组织结构中确定出对应的叶子节点(443);所述区块链节点(214)在确定出的叶子节点(443)不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点(443);所述区块链节点(214)在确定出的叶子节点(443)存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对,并将所述更新后键值对存储于确定出的叶子节点(443)对应的冲突数据存储结构中,使确定出的叶子节点(443)的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。

Description

数据存储方法及节点 技术领域
本说明书一个或多个实施例涉及终端技术领域,尤其涉及一种数据存储方法及节点。
背景技术
区块链技术(也被称之为,分布式账本技术)是一种去中性化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。
发明内容
有鉴于此,本说明书一个或多个实施例提供一种数据存储方法及装置。
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:
根据本说明书一个或多个实施例的第一方面,提出了一种数据存储方法,包括:
区块链节点获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;
所述区块链节点根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值;
所述区块链节点在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值;
所述区块链节点在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对;以及,所述区块链节点将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。
根据本说明书一个或多个实施例的第二方面,提出了一种数据存储节点,包括:
获取单元,获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;
确定单元,根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值;
关联单元,在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值;
修改单元,在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对;
存储单元,将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
附图说明
图1是一示例性实施例提供的一种示例环境的示意图。
图2是一示例性实施例提供的一种概念架构的示意图。
图3是一示例性实施例提供的一种数据存储方法的流程图。
图4是一示例性实施例提供的一种树状数据组织结构的示意图。
图5是一示例性实施例提供的一种将值关联至叶子节点的示意图。
图6-7是一示例性实施例提供的一种将键值对记录于叶子节点对应的冲突数据存 储表的示意图。
图8是一示例性实施例提供的一种设备的结构示意图。
图9是一示例性实施例提供的一种数据存储节点的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
图1是一示例性实施例提供的一种示例环境的示意图。如图1所示,示例环境100允许实体参与区块链网络102。区块链网络102可以为公有类型、私有类型或联盟类型的区块链网络。示例环境100可以包括计算设备104、106、108、110、112和网络114;在一实施例中,网络114可以包括局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)、因特网或其组合,并连接至网站、用户设备(例如计算设备)和后端系统。在一实施例中,可以通过有线和/或无线通信方式访问网络114。
在某些情况下,计算设备106、108可以是云计算系统的节点(未显示),或者每个计算设备106、108可以是单独的云计算系统,包括由网络互连并作为分布式处理系统工作的多台计算机。
在一实施例中,计算设备104~108可以运行任何适当的计算系统,使其能够作为区块链网络102中的节点;例如,计算设备104~108可以包括但不限于服务器、台式计算机、笔记本电脑、平板电脑计算设备和智能手机。在一实施例中,计算设备104~108可以归属于相关实体并用于实现相应的服务,例如该服务可以用于对某一实体或多个实体之间的交易进行管理。
在一实施例中,计算设备104~108分别存储有区块链网络102对应的区块链账本。计算设备104可以是(或包含)用于提供浏览器功能的网络服务器,该网络服务器可基于网络114提供与区块链网络102相关的可视化信息。在一些情况下,计算设备104可以不参与区块验证,而是监控区块链网络102以确定其他节点(譬如可以包括计算设备106-108)何时达成共识,并据此生成相应的区块链可视化用户界面。
在一实施例中,计算设备104可接收客户端设备(例如计算设备110或计算设备112)针对区块链可视化用户界面发起的请求。在一些情况下,区块链网络102的节点也可以作为客户端设备,比如计算设备108的用户可以使用运行在计算设备108上的浏览器向计算设备104发送上述请求。
响应于上述请求,计算设备104可以基于存储的区块链账本生成区块链可视化用户界面(如网页),并将生成的区块链可视化用户界面发送给请求的客户端设备。如果区块链网络102是私有类型或联盟类型的区块链网络,对区块链可视化用户界面的请求可以包括用户授权信息,在生成区块链可视化用户界面并发送给请求的客户端设备之前,可以由计算设备104对该用户授权信息进行验证,并在验证通过后返回相应的区块链可视化用户界面。
区块链可视化用户界面可以显示在客户端设备上(例如可显示在图1所示的用户界面116中)。当区块链账本发生更新时,用户界面116的显示内容也可以随之发生更新。此外,用户与用户界面116的交互可能导致对其他用户界面的请求,例如显示区块列表、区块详情、交易列表、交易详情、账户列表、账户详情、合约列表、合约详情或者用户对区块链网络实施搜索而产生的搜索结果页面等。
图2是一示例性实施例提供的一种概念架构的示意图。如图2所示,该概念架构200包括实体层202、托管服务层204和区块链网络层206。例如,实体层202可以包括三个实体:实体1、实体2和实体3,每个实体都有各自的交易管理系统208。
在一实施例中,托管服务层204可以包括每个事务管理系统208对应的接口210。例如,各个事务管理系统208使用协议(例如超文本传输协议安全(HTTPS)等)通过网络(例如图1中的网络114)与各自的接口210通信。在一些例子中,每个接口210可以提供各自对应的交易管理系统208与区块链网络层206之间的通信连接;更具体地,接口210可与区块链网络层206的区块链网络212通信。在一些例子中,接口210和区块链网络层206之间的通信可以使用远程过程调用(Remote Procedure Calls,RPCs)而实现。在一些例子中,接口210可以向交易管理系统208提供用于访问区块链网络212 的API接口。
如本文所述,区块链网络212以对等网络的形式提供,该对等网络包括多个节点214,这些节点214分别用于对块链数据所形成的区块链账本216进行持久化;其中,图2中仅示出了一份区块链账本216,但区块链网络212中可以存在多份区块链账本216或其副本,比如每一节点214可以分别维护一份区块链账本216或其副本。
需要指出的是:在本说明书中所描述的交易(transaction),是指用户通过区块链的客户端创建,并需要最终发布至区块链的分布式数据库中的一笔数据。其中,区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。
图3是一示例性实施例提供的一种数据存储方法的流程图。如图3所示,该方法可以包括以下步骤:
步骤302,区块链节点获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键。
在一实施例中,不论是公有链(Public Blockchain),私有链(Private Blockchain)、联盟链(Consortium Blockchain),还是多种类型的结合(比如私有链+联盟链、联盟链+公有链等不同组合形式),区块链网络中的节点(即区块链节点)在数据存储的过程中,可以对存储的数据按照一定形式进行组织,比如组织为树状数据组织结构等。
以公有链为例,公有链以比特币、以太坊为代表。例如,在以太坊网络中,区块链节点通过运行EVM(以太坊虚拟机),并在EVM内执行智能合约的代码,可以实现复杂的处理逻辑。智能合约的代码中定义有若干合约状态,这些合约状态的取值可以在代码被执行后发生变化。因此,以太坊网络中的区块链节点采用MPT类型的树状数据组织结构对所有合约状态的取值进行组织和存储,并将MPT的根节点处形成的根哈希记录至区块头中,以用于对合约状态及其取值进行验证。
在一实施例中,本说明书中的待存储数据可以包括上述的合约状态。当然,在其 他实施例中还可以适用于其他类型的数据,比如智能合约被执行后产生的收据(receipt)等,本说明书并不对此进行限制。
在一实施例中,区块链节点上预配置有统一的键值对生成规则,可以为待存储数据的值设定相应的键。例如,区块链节点可以直接根据该键值对生成规则,为待存储数据的值设定上述的第一键。
再例如,区块链节点可以根据该键值对生成规则为待存储数据生成对应的初始键值对,该初始键值对包括待存储数据的值和初始键;然后,区块链节点可以选取初始键中特定位的字符组成第一键,且第一键的长度小于初始键,以得到上述的第一键值对。比如在以太坊中,智能合约的模型中定义了合约状态的key长度为32字节、value长度为32字节,即初始键的长度为32字节,那么第一键可以为初始键的前16字节(即上述的特定位),即第一键的长度为16字节;当然,其他实施例中可以选取其他的“特定位”,第一键的长度也可以不同,本说明书并不对此进行限制。类似地,对于前述直接根据键值对生成规则而生成第一键的实施例中,可以直接生成16字节长度的第一键。
假定在待存储数据对应的初始键值对中,待存储数据的值为32字节、初始键的长度为32字节,那么该初始键值对总共占用64字节的存储空间。而通过将初始键处理为上述的第一键,且第一键的长度为16字节,使得第一键值对总共占用48字节的存储空间,所占用的存储空间减少了16字节。在区块链节点针对更多数据进行组织和存储时,如果均采用长度相对更短的第一键,相比于采用长度相对更长的初始键或其他键,显然能够极大地减少对节点上存储空间的占用,并且有助于提升检索性能。
步骤304,所述区块链节点根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值。
在一实施例中,树状数据组织结构从顶部的根节点向下形成若干层,每层包含若干节点,直至形成最底部的叶子节点。每一节点的取值均为哈希值,其中:叶子节点的取值为关联数据计算得到的哈希值;非叶子节点的取值为下一级子节点的取值计算得到的哈希值,直至计算得到根节点对应的哈希值,即根哈希。因此,根据各节点的取值情况,该树状数据组织结构具有Merkle Tree(默克尔树)的特性。
在一实施例中,树状数据组织结构中的每一节点存在对应的节点标记;其中,在根节点至确定出的叶子节点构成的路径上,各个节点对应的节点标记依次组合形成的组 合值等于前述的第一键。因此,区块链节点可以根据待存储数据对应的第一键,从树状数据组织结构的根节点依次向下、分别确定出每一级对应的节点,直至确定出对应的叶子节点。因此,根据路径与键之间的对应关系,该树状数据组织结构具有字典树的特性,比如具体可以采用前缀树(Trie)、压缩前缀树(Patricia trie)或类似的结构形式。
在一实施例中,树状数据组织结构可以综合前述的默克尔树与字典树的特性,譬如在基于字典树的结构的基础上,使得各节点的取值符合默克尔树的特性,从而既可以使节点路径与键相匹配,又可以从叶子节点逐步向上确定出各个节点对应的哈希值。例如,该树状数据组织结构可以为默克尔-帕特里夏树(Merkle Patricia Tree,简称MPT);或者,该树状数据组织结构可以为类似的其他结构。
步骤306a,所述区块链节点在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值。
在一实施例中,如果确定出的叶子节点尚未存在关联的历史取值,那么可以将待存储数据的值关联至该叶子节点,使得该叶子节点的取值暂时为该待存储数据的值对应的哈希值,且对于后续通过上述步骤302-304定位到该叶子节点的其他数据,该待存储数据的值相对于后续的其他数据而言是已关联至该叶子节点的历史取值,需要转至步骤306b进行处理。
步骤306b,所述区块链节点在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对。
在一实施例中,由于区块链节点根据待存储数据对应的第一键确定出叶子节点,那么当该叶子节点存在关联的历史取值时,表明该历史取值对应的键与第一键相同。因此,通过对第一键进行修改,使得更新后键值对中的键区别于历史取值对应的键,以便对待存储数据与历史取值之间进行区分、避免混淆。
在一实施例中,如果第一键是由前述的初始键所含的特定位组成,那么对第一键进行修改时,可以将第一键恢复为初始键,即更新后键值对为前述的初始键值对。当然,第一键还可以被修改为其他取值,而并不一定采用上述的初始键,只要能够区别于历史取值对应的键即可,本说明书并不对此进行限制。
步骤308,所述区块链节点将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史 取值计算得到的哈希值。
在一实施例中,如果待存储数据确定出的叶子节点已经存在关联的历史取值,表明该待存储数据与历史取值之间发生了数据冲突。但是,每个叶子节点只能够与一个取值建立关联,因而通过为每一叶子节点分别设定对应的冲突数据存储结构,使得发生数据冲突的情况下,可以将数据存储于该冲突数据存储结构中,该冲突数据存储结构中的数据不存在数量限制,并且存储于该冲突数据存储结构中的数据均被确定为与相应的叶子节点之间建立关联,从而对叶子节点可关联的数据实现了数量扩展。因此,当某一键值对被存储于冲突数据存储结构时,相当于该键值对中的值被间接关联至相应的叶子节点。
在一实施例中,根据待存储数据确定出的叶子节点,对应的历史取值可以包括在历史时刻直接关联至该叶子节点的历史值,也可以包括在历史时刻记录于冲突数据存储结构中的历史键值对。其中,历史键值对所含的历史键应当区别于上述更新后键值对所含的键。
其中,当仅存在一个历史取值时,该历史取值通常是直接关联至叶子节点的历史值;当然,本说明书并不排除该历史取值可能是位于冲突数据存储结构中的历史键值对。当存在多个历史取值时,多个历史取值可以均为位于冲突数据存储结构中的历史键值对;或者,最早的一条历史取值为直接关联至叶子节点的历史值,而其他历史取值均为位于冲突数据存储结构中的历史键值对。
在一实施例中,当同时存在直接关联至叶子节点的历史取值和存储于数据存储结构中的键值对(历史键值对和/或上述的更新后键值对)时,除非预先定义了这些数据之间的顺序,否则在基于这些数据生成叶子节点对应的哈希值时,不同顺序可能导致不同的哈希值,即哈希值不是稳态的。
因此,区块链节点可以删除确定出的叶子节点被关联的历史值,并将该历史值对应的第二键值对记录于冲突数据存储结构中;其中,第二键值对包含历史值和第二键,且第二键区别于冲突数据存储结构中的其他键值对所含的键。那么,由于冲突数据存储结构中的所有键值对之间按照预设顺序进行依次排列,比如按照数值生成顺序、键的数值大小顺序等,可以确保按照该顺序排列并生成相应叶子节点的哈希值,因而可以得到稳态哈希值。
在一实施例中,冲突数据存储结构可以为树状数据组织结构,比如默克尔树等。 或者,冲突数据存储结构可以为表格结构。或者,可以采用其他形式的冲突数据存储结构,本说明书并不对此进行限制。
图4是一示例性实施例提供的一种树状数据组织结构的示意图。假定区块链节点采用如图4所示的树状数据组织结构,该树状数据组织结构的顶部为根节点41、其他层级包含若干节点,比如根节点41的子节点包括节点421、节点422等,节点421的子节点包括节点431、节点432等,底层为若干叶子节点,如节点441、节点442和节点443等。除了叶子节点之外,其他的每一节点分别存在一个或多个子节点,子节点的数量根据实际情况而定,本说明书并不对此进行限制。
如前所述,树状数据组织结构继承了字典树的特性,可以通过路径表征相应键值对的键。例如,根节点41对应的节点标记为a、节点421对应的节点标记为5、节点422对应的节点标记为7、节点431对应的节点标记为1、节点432对应的节点标记为2、节点441对应的节点标记为1、节点442对应的节点标记为5、节点443对应的节点标记为f等。假定叶子节点441对应于节点431,那么从根节点41至节点441可以形成路径a-5-1-……-1。假定叶子节点442对应于节点432,那么从根节点至节点442可以形成路径a-5-2-……-5。假定叶子节点443对应于节点432,那么从根节点至节点443可以形成路径a-5-2-……-f。
如前所述,树状数据组织结构继承了默克尔树的特性,每个节点的取值为哈希值。对于叶子节点而言,哈希值由叶子节点所关联的数值计算得到。例如,节点441的取值为哈希值Hn-1,该哈希值Hn-1为:关联至该节点441的数值计算出的哈希值;节点442的取值为哈希值Hn-2,该哈希值Hn-2为:关联至该节点442的数值计算出的哈希值;节点443的取值为哈希值Hn-3,该哈希值Hn-3为:关联至该节点443的数值计算出的哈希值。而对于非叶子节点而言,哈希值由节点下一级的子节点的取值计算得到。例如,根节点41的取值为哈希值Hr,且根节点41下一级的节点为节点421和节点422,那么该哈希值Hr为:根据节点421的取值与节点422的取值计算得到的哈希值,比如将节点421对应的哈希值H1-1与节点422对应的哈希值H1-2拼接为一字符串,并将该字符串计算出的哈希值作为上述的哈希值Hr。再例如,节点421的取值为哈希值H1-1,且节点421下一级的节点为节点431和节点432,那么该哈希值H1-1为:根据节点431的取值与节点432的取值计算得到的哈希值,比如将节点431对应的哈希值H2-1与节点432对应的哈希值H2-2拼接为一字符串,并将该字符串计算出的哈希值作为上述的哈希值H1-1。
区块链节点通过执行某一交易调用的智能合约后,假定该智能合约中定义的合约状态Z1发生了取值变化,区块链节点需要将该合约状态Z1的取值存储至如图4所示的树状数据组织结构中。区块链节点首先为该合约状态Z1生成对应的键值对。
对于以太坊网络而言,如前所述,区块链节点生成的键值对中的key为32字节、value为32字节。而在本说明书中,区块链节点可以首先采用类似的方式生成初始键值对,包括初始键K1’、值value为V1,即键值对为K1’-V1,其中K1’的长度为32字节、V1的长度为32字节。然后,区块链节点可以对初始键K1’进行转换,比如截取前16字节,形成新的键K1,构成新的键值对K1-V1。那么,区块链节点在存储该合约状态Z1时,键值对K1-V1仅需占用48字节的存储空间,而非键值对K1’-V1所需占用的64字节。
针对合约状态Z1的键值对K1-V1,区块链节点根据K1在如图4所示的树状数据组织结构中确定相应的叶子节点。例如,当K1的取值为a52……f时,假定该K1的取值匹配于根节点41至叶子节点443的路径,那么可以确定K1对应于叶子节点443。
假定此前并不存在已关联至叶子节点443的历史取值,区块链节点可以将合约状态Z1的取值V1直接关联至叶子节点443,如图5所示。此时,节点443对应的哈希值Hn-i是通过对取值V1进行哈希计算得到。
在针对合约状态Z1进行存储之后,假定区块链节点通过执行某一交易调用的智能合约后,该智能合约中定义的合约状态Z2发生了取值变化,区块链节点需要将该合约状态Z2的取值存储至如图5所示的树状数据组织结构中。
对合约状态Z2的存储过程,与上述合约状态Z1的存储过程类似。区块链节点为合约状态Z2生成初始键值对K2’-V2,然后将初始键K2’的前16字节截取为新的键K2,并组成合约状态Z2的键值对K2-V2。然后,区块链节点根据键K2从如图5所示的树状数据组织结构中确定对应的叶子节点。
假定K2的取值为a52……f,与上述的K1恰好相同,区块链节点可以据此确定出相应的叶子节点为节点443。那么,对于合约状态Z2而言,节点443已经存在相关联的历史取值,即上文被关联至节点443的历史值V1。因此,对合约状态Z2的存储过程,区别于前文对合约状态Z1的存储过程。
区块链节点可以为节点443创建对应的冲突数据存储表,例如该冲突数据存储表可以如图6所示。区块链节点可以在节点443被创建时,就随之创建了冲突数据存储表; 或者,区块链节点可以在发生数据冲突的情况下,比如上文中在存储合约状态Z2的过程中,临时创建冲突数据存储表。
区块链节点的处理过程包括两个方面:第一方面,区块链节点将关联至节点443的历史取值V1删除。第二方面,区块链节点将合约状态Z1对应的键值对恢复为初始键值对K1-V1、将合约状态Z2对应的键值对恢复为初始键值对K2-V2,并将初始键值对K1-V1、K2-V2分别存储至节点443对应的冲突数据存储表中。例如图6所示,冲突数据存储表的主键可以包括“键”和“值”,区块链节点可以相应地写入K1-V1、K2-V2。冲突数据存储表的主键还可以包括“冲突数量”,区块链节点可以记入发生冲突的键值对的总量,比如此处为2。
类似地,当区块链节点后续再次生成匹配于叶子节点443的合约状态Z3时,由于键值对K1-V1、K2-V2已经存储于节点443对应的冲突数据存储表中,因而如图7所示,只需要确定出合约状态Z3对应的初始键值对K3-V3,并将该键值对K3-V3记入节点443对应的冲突数据存储表即可。区块链节点还将“冲突数量”的取值更新为3。
在冲突数据存储表中,各条键值对之间按照预设顺序进行依次排列。比如该顺序可以包括键值对的生成顺序。因此,在所有区块链节点分别将键值对K1-V1、K2-V2、K3-V3插入冲突数据存储表时,可以确保每个区块链节点都是将键值对K1-V1排列在先、键值对K2-V2排列在后、键值对K3-V3排列在最后,而节点443对应的哈希值Hn-i均是通过将取值V1、V2、V3按照V1→V2→V3的顺序拼接后进行哈希计算得到,而不会按照V2→V1→V3或其他顺序进行拼接,确保所有区块链节点计算出的哈希值Hn-i取值均相同。
综上所述,本说明书的技术方案可以支持较短长度的key,并且在发生数据冲突的情况下,通过为叶子节点配置相应的冲突数据存储结构,即可记下匹配于该叶子节点的所有键值对,并对各个键值对进行有效区分。实际上,即便是采用上文所述的16字节长度的key,不同合约状态之间产生相同key的概率也极低,因而对于绝大部分的键值对而言,均因采用较短长度的key而为节点节省了大量的存储空间。
图8是一示例性实施例提供的一种设备的示意结构图。请参考图8,在硬件层面,该设备包括处理器802、内部总线804、网络接口806、内存808以及非易失性存储器810,当然还可能包括其他业务所需要的硬件。处理器802从非易失性存储器810中读取对应的计算机程序到内存808中然后运行,在逻辑层面上形成数据存储节点。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑 器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图9,在软件实施方式中,该数据存储节点可以包括:
获取单元91,获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;
确定单元92,根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值;
关联单元93,在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值;
修改单元94,在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对;
存储单元95,将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。
可选的,获取单元91具体用于:
获取所述待存储数据对应的初始键值对,所述初始键值对包括所述待存储数据的值和初始键;
选取所述初始键中特定位的字符组成所述第一键,且所述第一键的长度小于所述初始键,以得到所述第一键值对。
可选的,所述更新后键值对为所述初始键值对。
可选的,所述树状数据组织结构中的每一节点存在对应的节点标记;其中,在根节点至确定出的叶子节点构成的路径上,各个节点对应的节点标记依次组合形成的组合值等于所述第一键。
可选的,所述历史取值包括:在历史时刻记录于所述冲突数据存储结构中的历史键值对;其中,所述历史键值对所含的历史键区别于所述更新后键值对所含的键。
可选的,所述历史取值包括:在历史时刻被关联至确定出的叶子节点的历史值。
可选的,还包括:
删除单元96,删除确定出的叶子节点被关联的历史值;
记录单元97,将所述历史值对应的第二键值对记录于所述冲突数据存储结构中,所述第二键值对包含所述历史值和第二键,且所述第二键区别于所述冲突数据存储结构中的其他键值对所含的键。
可选的,所述冲突数据存储结构中的所有键值对之间按照预设顺序进行依次排列。
可选的,所述冲突数据存储结构为树状数据组织结构或表格结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素, 而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。

Claims (12)

  1. 一种数据存储方法,包括:
    区块链节点获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;
    所述区块链节点根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值;
    所述区块链节点在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值;
    所述区块链节点在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对;以及,所述区块链节点将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。
  2. 根据权利要求1所述的方法,所述区块链节点获取待存储数据对应的第一键值对,包括:
    所述区块链节点获取所述待存储数据对应的初始键值对,所述初始键值对包括所述待存储数据的值和初始键;
    所述区块链节点选取所述初始键中特定位的字符组成所述第一键,且所述第一键的长度小于所述初始键,以得到所述第一键值对。
  3. 根据权利要求2所述的方法,所述更新后键值对为所述初始键值对。
  4. 根据权利要求1所述的方法,所述树状数据组织结构中的每一节点存在对应的节点标记;其中,在根节点至确定出的叶子节点构成的路径上,各个节点对应的节点标记依次组合形成的组合值等于所述第一键。
  5. 根据权利要求1所述的方法,所述历史取值包括:在历史时刻记录于所述冲突数据存储结构中的历史键值对;其中,所述历史键值对所含的历史键区别于所述更新后键值对所含的键。
  6. 根据权利要求1所述的方法,所述历史取值包括:在历史时刻被关联至确定出的叶子节点的历史值。
  7. 根据权利要求6所述的方法,还包括:
    所述区块链节点删除确定出的叶子节点被关联的历史值;
    所述区块链节点将所述历史值对应的第二键值对记录于所述冲突数据存储结构中,所述第二键值对包含所述历史值和第二键,且所述第二键区别于所述冲突数据存储结构中的其他键值对所含的键。
  8. 根据权利要求1所述的方法,所述冲突数据存储结构中的所有键值对之间按照预设顺序进行依次排列。
  9. 根据权利要求1所述的方法,所述冲突数据存储结构为树状数据组织结构或表格结构。
  10. 一种数据存储节点,包括:
    获取单元,获取待存储数据对应的第一键值对,所述第一键值对包含所述待存储数据的值和第一键;
    确定单元,根据所述第一键在树状数据组织结构中确定出对应的叶子节点,其中所述树状数据组织结构中的非叶子节点的取值为根据下一级子节点的取值计算得到的哈希值;
    关联单元,在确定出的叶子节点不存在关联的历史取值时,将所述待存储数据的值关联至确定出的叶子节点,使确定出的叶子节点的取值为根据所述待存储数据的值计算得到的哈希值;
    修改单元,在确定出的叶子节点存在关联的历史取值时,对所述第一键进行修改,以将所述第一键值对更新为更新后键值对;
    存储单元,将所述更新后键值对存储于确定出的叶子节点对应的冲突数据存储结构中,使确定出的叶子节点的取值为根据所述待存储数据的值和所述历史取值计算得到的哈希值。
  11. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-9中任一项所述的方法。
  12. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-9中任一项所述方法的步骤。
PCT/CN2020/072007 2019-05-31 2020-01-14 数据存储方法及节点 WO2020238254A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/776,685 US11294875B2 (en) 2019-05-31 2020-01-30 Data storage on tree nodes

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910468704.4A CN110275884B (zh) 2019-05-31 2019-05-31 数据存储方法及节点
CN201910468704.4 2019-05-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/776,685 Continuation US11294875B2 (en) 2019-05-31 2020-01-30 Data storage on tree nodes

Publications (1)

Publication Number Publication Date
WO2020238254A1 true WO2020238254A1 (zh) 2020-12-03

Family

ID=67960453

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/072007 WO2020238254A1 (zh) 2019-05-31 2020-01-14 数据存储方法及节点

Country Status (3)

Country Link
CN (1) CN110275884B (zh)
TW (1) TWI728654B (zh)
WO (1) WO2020238254A1 (zh)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11294875B2 (en) 2019-05-31 2022-04-05 Advanced New Technologies Co., Ltd. Data storage on tree nodes
CN110275884B (zh) * 2019-05-31 2020-08-04 阿里巴巴集团控股有限公司 数据存储方法及节点
CN112579343B (zh) * 2019-09-27 2024-05-28 阿里巴巴集团控股有限公司 区块链节点数据的恢复方法及装置
CN111143288A (zh) * 2019-12-22 2020-05-12 北京浪潮数据技术有限公司 一种数据存储方法、系统及相关装置
CN111209341B (zh) * 2020-01-07 2023-03-14 北京众享比特科技有限公司 区块链的数据存储方法、装置、设备及介质
CN111695123B (zh) * 2020-04-27 2021-03-26 华东师范大学 一种面向区块链的降低冲突的乐观并发保序编码方法
CN111651300B (zh) * 2020-06-05 2023-03-21 成都质数斯达克科技有限公司 一种区块链数据恢复方法、装置、设备及介质
CN111782549A (zh) * 2020-07-31 2020-10-16 北京字节跳动网络技术有限公司 测试方法、装置和电子设备
CN112035491B (zh) * 2020-09-30 2021-12-28 中山大学 基于区块链的数据存储方法、电子积分处理方法及系统
CN112434015B (zh) * 2020-12-08 2022-08-19 新华三大数据技术有限公司 数据存储的方法、装置、电子设备及介质
CN112819468A (zh) * 2021-02-24 2021-05-18 浙江蓝景科技有限公司 智能合约的处理方法、装置和电子设备
CN112988910B (zh) * 2021-05-07 2021-09-24 支付宝(杭州)信息技术有限公司 区块链数据存储方法及装置、电子设备
CN114579693B (zh) * 2021-12-02 2024-05-14 广州趣丸网络科技有限公司 一种nlp文本安全审核多级检索系统
CN114510465B (zh) * 2022-02-22 2023-09-26 光大科技有限公司 数据管理方法、装置及计算机可读存储介质
CN116050358B (zh) * 2023-03-21 2023-06-06 北京飞轮数据科技有限公司 应用于动态数据的数据处理方法、装置和电子设备
CN116308367B (zh) * 2023-05-22 2023-07-21 北京智优集品科技有限公司 用于电子商务系统的安全防护方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446376A (zh) * 2018-03-16 2018-08-24 众安信息技术服务有限公司 数据存储方法与装置
CN109165221A (zh) * 2018-08-16 2019-01-08 北京京东尚科信息技术有限公司 区块链的数据存储方法、装置、区块链节点及存储介质
CN109559234A (zh) * 2019-01-31 2019-04-02 杭州复杂美科技有限公司 一种区块链状态数据的存储方法、设备和存储介质
WO2019063995A1 (en) * 2017-09-29 2019-04-04 R3, Ltd. HASH SUBWAYS TO GROUP COMPONENTS BY TYPE OF COMPONENT
CN110275884A (zh) * 2019-05-31 2019-09-24 阿里巴巴集团控股有限公司 数据存储方法及节点

Family Cites Families (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100547590C (zh) * 2005-12-05 2009-10-07 北京书生国际信息技术有限公司 文档处理系统
US9449183B2 (en) * 2012-01-28 2016-09-20 Jianqing Wu Secure file drawer and safe
US10193696B2 (en) * 2015-06-02 2019-01-29 ALTR Solutions, Inc. Using a tree structure to segment and distribute records across one or more decentralized, acylic graphs of cryptographic hash pointers
US10075298B2 (en) * 2015-06-02 2018-09-11 ALTR Solutions, Inc. Generation of hash values within a blockchain
US10121019B2 (en) * 2015-06-02 2018-11-06 ALTR Solutions, Inc. Storing differentials of files in a distributed blockchain
CN106815258B (zh) * 2015-11-27 2020-01-17 华为技术有限公司 一种数据存储方法和协调节点
US10013573B2 (en) * 2015-12-16 2018-07-03 International Business Machines Corporation Personal ledger blockchain
CN105719185B (zh) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 区块链的数据对比及共识方法
CN106055597B (zh) * 2016-05-24 2022-05-20 布比(北京)网络技术有限公司 数字交易系统、及用于其的账户信息查询方法
CN106126722B (zh) * 2016-06-30 2019-10-18 中国科学院计算技术研究所 一种基于验证的前缀混合树及设计方法
CN109791594B (zh) * 2016-08-12 2020-10-27 Altr解决方案公司 在关系数据库上执行写入和存储操作的方法及可读介质
CN107015882B (zh) * 2016-12-26 2019-11-22 阿里巴巴集团控股有限公司 一种区块数据校验方法和装置
KR101835519B1 (ko) * 2016-12-29 2018-04-19 주식회사 코인플러그 Utxo 기반 프로토콜에서 머클 트리 구조를 사용하여 통합 포인트 서비스를 제공하는 방법 및 이를 이용한 지원 서버
KR101882805B1 (ko) * 2017-04-17 2018-07-27 주식회사 코인플러그 Utxo 기반 프로토콜에서 머클 트리 구조를 이용하는 블록체인 기반의 문서 관리 방법 및 이를 이용한 문서 관리 서버
CN107332847B (zh) * 2017-07-05 2019-04-26 武汉凤链科技有限公司 一种基于区块链的访问控制方法和系统
CN107862215B (zh) * 2017-09-29 2020-10-16 创新先进技术有限公司 一种数据存储方法、数据查询方法及装置
CN108197226A (zh) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 Mptc账户状态树以及mptc区块链快速检索方法
CN108282474B (zh) * 2018-01-18 2020-04-17 山东大学 基于区块链的数字资产交易一致性的维护方法
US10261711B1 (en) * 2018-01-25 2019-04-16 Merck Sharp & Dohme Corp. Proof of non-tampering for stored data
CN108595538B (zh) * 2018-04-04 2020-05-01 中国地质大学(武汉) 一种基于区块链的键值数据组织方法及系统
CN108615156A (zh) * 2018-05-09 2018-10-02 上海魅联信息技术有限公司 一种基于区块链的数据结构
CN108959563B (zh) * 2018-07-04 2020-05-15 东北大学 一种容量可扩展区块链查询方法及系统
CN109684325A (zh) * 2018-11-07 2019-04-26 天津大学 一种高效的rdf数据存储查询系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019063995A1 (en) * 2017-09-29 2019-04-04 R3, Ltd. HASH SUBWAYS TO GROUP COMPONENTS BY TYPE OF COMPONENT
CN108446376A (zh) * 2018-03-16 2018-08-24 众安信息技术服务有限公司 数据存储方法与装置
CN109165221A (zh) * 2018-08-16 2019-01-08 北京京东尚科信息技术有限公司 区块链的数据存储方法、装置、区块链节点及存储介质
CN109559234A (zh) * 2019-01-31 2019-04-02 杭州复杂美科技有限公司 一种区块链状态数据的存储方法、设备和存储介质
CN110275884A (zh) * 2019-05-31 2019-09-24 阿里巴巴集团控股有限公司 数据存储方法及节点

Also Published As

Publication number Publication date
CN110275884A (zh) 2019-09-24
CN110275884B (zh) 2020-08-04
TWI728654B (zh) 2021-05-21
TW202046299A (zh) 2020-12-16

Similar Documents

Publication Publication Date Title
WO2020238254A1 (zh) 数据存储方法及节点
US11294875B2 (en) Data storage on tree nodes
WO2021017435A1 (zh) 区块链状态数据存储方法及装置、电子设备
WO2021017436A1 (zh) 区块链状态数据同步方法及装置、电子设备
JP6892504B2 (ja) スマートコントラクトを使用したマルチパーティトランザクションの実行
CN107577427B (zh) 用于区块链系统的数据迁移方法、设备和存储介质
CN111213340B (zh) 选择用于密码功能的证明委托并使其安全
US20200167345A1 (en) Method and apparatus for storing blockchain state data and electronic device
WO2020143853A2 (en) Distributed blockchain data storage under account model
EP3837652B1 (en) Distributed blockchain data storage under account model
US10275489B1 (en) Binary encoding-based optimizations at datastore accelerators
TW202107455A (zh) 區塊鏈狀態資料恢復方法及裝置、電子設備
US20170212781A1 (en) Parallel execution of blockchain transactions
TW202030656A (zh) 跨鏈用權系統及方法、裝置、電子設備、儲存媒體
US10958443B2 (en) Confidential blockchain transactions
WO2020211498A1 (zh) 区块链数据的分次获取方法和装置
WO2020125233A1 (zh) 字段更新方法及装置、电子设备
WO2021057482A1 (zh) 一种区块链中布隆过滤器的生成方法及装置
WO2023016091A1 (zh) 数据归档方法、装置、设备、存储介质及计算机程序产品
EP3812917A1 (en) Data structure reading method and apparatus, data structure updating method and apparatus, and electronic device
WO2020098819A2 (en) Performing map iterations in a blockchain-based system
JP7153420B2 (ja) データベース中にグラフ情報を記憶するためのb木使用
US10248668B2 (en) Mapping database structure to software
WO2016188280A1 (zh) 数据库分表的写入方法及装置
US20100191738A1 (en) Apparatus, system, and method for modifying data set names

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: 20814472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20814472

Country of ref document: EP

Kind code of ref document: A1