WO2020259352A1 - 一种数据处理方法、节点及区块链系统 - Google Patents

一种数据处理方法、节点及区块链系统 Download PDF

Info

Publication number
WO2020259352A1
WO2020259352A1 PCT/CN2020/096315 CN2020096315W WO2020259352A1 WO 2020259352 A1 WO2020259352 A1 WO 2020259352A1 CN 2020096315 W CN2020096315 W CN 2020096315W WO 2020259352 A1 WO2020259352 A1 WO 2020259352A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
block
hash value
data
identifier
Prior art date
Application number
PCT/CN2020/096315
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 华为技术有限公司
Publication of WO2020259352A1 publication Critical patent/WO2020259352A1/zh

Links

Images

Classifications

    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • H04L67/1065Discovery involving distributed pre-established resource-based relationships among peers, e.g. based on distributed hash tables [DHT] 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • This application relates to the field of network technology, in particular to a data processing method, node, and blockchain system.
  • Blockchain is a chain structure for maintaining blocks, which can maintain a continuously growing, shareable, and non-tamperable data record. Because the blockchain technology has the characteristics of decentralization, openness and transparency, and rapid data synchronization, the blockchain technology has been widely used in many fields.
  • All blockchain nodes in the same blockchain system store the same blockchain. Each blockchain often includes multiple blocks. During the operation of the blockchain system, new blocks will be continuously generated. In this way, the number of blocks stored by each blockchain node will increase, resulting in increasing storage pressure on blockchain nodes Bigger.
  • This application provides a data processing method, node, and blockchain system, which are used to improve the storage resource utilization of blockchain nodes.
  • a data processing method is provided, which is applied to a blockchain system including a first node in which multiple blocks are stored.
  • the method includes: after the cleaning request sent by the client obtains the consensus of multiple nodes in the blockchain system, the first node obtains the identifier of the first block, and deletes the first node in the first node according to the identifier of the first block.
  • the first data in a block.
  • the cleanup request is used to request to clean up the data of the first block, and the cleanup request includes the identifier of the first block.
  • the first data is used to indicate the verification of the transaction data in the first block by multiple nodes in the blockchain system, for example, the signature of the node on the transaction data or the certificate of the node that has verified the transaction data.
  • the node in this application can be understood as a processing unit.
  • the node may be a physical device, such as a server or a terminal device.
  • the node may be a virtual computer; the virtual computer is a general term for the operating environment virtualized by software in all types of virtualization devices, and the concept includes virtual machines and containers.
  • the node can be a process or a thread; a thread is the smallest unit that the operating system can perform operation scheduling. The thread is included in the process and is the actual operating unit in the process; the process is a computer
  • the program in a certain data set is the basic unit of resource allocation and scheduling.
  • the accounting node can also be called a committing peer, which is used to finally confirm the block and change its own world state. Taking the blockchain system in the financial transaction scenario as an example, changing one's own world state can be understood as updating the account balance.
  • the ordering node which can also be called a consensus node (orderer), is used to make a consensus on the received transactions and package multiple transactions to generate a block.
  • the process of ordering nodes' consensus on transactions can be: any ordering node broadcasts the block generated by the ordering node to other ordering nodes, and other ordering nodes respond to the received blocks For verification, other ordering nodes can verify the order of multiple transactions contained in the received block.
  • the endorsement node and the accounting node can be the same node or different nodes.
  • the blockchain deployed in the blockchain system is a private chain or a public chain
  • the first node is any node in the blockchain system.
  • the above "the cleanup request sent by the client obtains the consensus of multiple nodes in the blockchain system” includes the verification of the cleanup request by each node in the blockchain system and each node agrees on the order of the cleanup request in the block .
  • the first node may delete the first data in the first block in the first node in many ways.
  • the first node deletes the first data in the first block stored in the non-volatile storage medium of the first node; in another implementation manner, the first node deletes the first block Read from a non-volatile storage medium to a volatile storage medium (such as memory), delete the first data in the first block in the volatile storage medium, and delete the data in the non-volatile storage medium All the data of the first block, and subsequently, the first node stores the first block after deleting the first data from the volatile storage medium in the non-volatile storage medium.
  • a volatile storage medium such as memory
  • the block body of a block there are multiple transaction data stored in the block body of a block, and for each transaction data, the block body also includes verification information of the transaction data by multiple nodes in the blockchain system (such as the node’s signature).
  • This application refers to the data used to verify the transaction data in the first block as the first data.
  • the first data usually occupies a large storage space in the block body of the block, and the first node deletes the first area After the first data in the block, the storage space occupied by the block is effectively reduced, the storage pressure of the first node is reduced, and the utilization of storage resources is improved.
  • the first node only deletes the first data in the first block. After deleting the first data, the first node still stores the first block after deleting the first data. In this way, when the first block is subsequently read, the block can be read quickly and conveniently, and the transaction data of the block body in the block can be directly read, without decompression and other operations, and the access speed is faster. fast.
  • the first node also obtains and stores a mapping relationship, the mapping relationship includes the correspondence between the identifier of the first block, the first hash value and the second hash value
  • the first hash value is the hash value of the block body in the first block
  • the second hash value is the hash value of data in the block body of the first block except the first data.
  • the first node is an accounting node
  • the blockchain system further includes an ordering node and an endorsing node.
  • the above-mentioned method of "the first node obtains the identifier of the first block” includes: the accounting node (the first node) obtains the identifier of the first block from the ordering node, wherein the identifier of the first block includes the identifier sent by the client to Among the endorsement results of the ordering node, the endorsement result is the verification result of the endorsement node on the above-mentioned cleanup request.
  • the above-mentioned method of "the first node obtaining the mapping relationship” is: the accounting node (the first node) obtains the mapping relationship from the ordering node, and the endorsement result also includes the mapping relationship.
  • the accounting node may adopt the following implementation manner 1, implementation manner 2, or implementation manner 3 to obtain the identification and mapping relationship of the first block from the ordering node.
  • Implementation method 1 The accounting node reads the block including the identifier of the first block and the mapping relationship from the ordering node, thereby obtaining the identifier and mapping relationship of the first block.
  • Implementation manner 2 The accounting node receives a message (or block) sent by the ordering node, and the message (or block) includes at least one of the identifier of the first block and the mapping relationship.
  • Implementation manner 3 The accounting node obtains the identifier of the first block in the manner described in the implementation manner 1 or the implementation manner 2, and then, the accounting node obtains the mapping relationship by calculating the first hash value and the second hash value.
  • the first node is an endorsing node.
  • the above-mentioned method of "the first node obtaining the identifier of the first block” includes: the endorsing node (the first node) receives the cleaning request sent by the client, and obtaining the identification of the first block from the cleaning request.
  • the above-mentioned method of "the first node obtains the mapping relationship” includes: the endorsing node (the first node) obtains the first hash value from the block header of the first block, and calculates the second hash value.
  • the node can generate the mapping relationship according to the identifier of the first block, the first hash value, and the second hash value. That is, the endorsing node can obtain the mapping relationship by calculating the first hash value and the second hash value.
  • the first node is an ordering node
  • the blockchain system also includes an endorsement node.
  • the above-mentioned method of "the first node obtaining the identifier of the first block” includes: the ordering node (the first node) receives the endorsement result sent by the client, and obtains the identifier of the first block from the endorsement result.
  • the endorsement result is the verification result of the cleanup request sent by the endorsing node to the client, and the endorsement result includes the identification and mapping relationship of the first block.
  • the above-mentioned method of "the first node obtains the mapping relationship” includes: the first node obtains the mapping relationship from the endorsement result.
  • the first node is any node in the blockchain system.
  • the deployment method of the blockchain system can be a public chain or a private chain.
  • the above-mentioned method of "the first node obtaining the identifier of the first block” includes: the first node receives the cleaning request sent by the client, and obtaining the identifier of the first block from the cleaning request.
  • the above-mentioned method of "the first node obtaining the mapping relationship” includes: the first node obtains the first hash value from the block header of the first block, and calculates the second hash value, so that the first node can The mapping relationship is generated according to the identifier of the first block, the first hash value, and the second hash value.
  • the method for the first node to calculate and generate the mapping relationship may include: the first node obtains the first hash value (that is, the hash value of the block body in the first block) from the block header of the first block according to the identifier of the first block. Hope value), and calculate the second hash value (that is, calculate the hash value of the data in the block body of the first block except the first data); then, the first node generates a mapping relationship, the mapping relationship It includes the identifier of the first block, and the first hash value and the second hash value corresponding to the identifier of the first block.
  • the block includes a block header and a block body.
  • the block header of the block stores the hash value of the block body of the block.
  • the first node deletes the first data in the first block. For the first block after the data is deleted, "the hash of the block body stored in the block header "Value" is not the same as "Hash value of the block body of the first block after deleting data".
  • the first node In order to subsequently determine whether an error occurs in the transaction data in the first block, the first node also needs to store the mapping relationship.
  • the first node in this application may obtain the mapping relationship from other nodes, or may generate the mapping relationship by itself, which is not limited in this application.
  • the first node will also receive a transaction query request including the identifier of the first block sent by the client, for requesting to query the first block
  • the first node reads the first block according to the identifier of the first block, so that the first node can obtain the first hash value (that is, the area stored in the block header of the first block Block hash value), and calculate the second hash value (that is, the hash value of the block body in the first block); if the first hash value is different from the second hash value, the first node determines whether A mapping relationship is stored, and the mapping relationship includes the corresponding relationship between the identifier of the first block, the first hash value and the second hash value; when the first node determines that the mapping relationship is stored, the first node Read the transaction data in the first block.
  • the first node determines that the mapping relationship is not stored, the first node determines that an error has occurred in the transaction data in the first block.
  • the first node reads the transaction data in the block.
  • the first node needs to determine the "hash value of the block body stored in the block header of the first block" and "the actual value of the first block". Whether the hash value of the block body is the same, that is, it is judged whether the first hash value is the same as the second hash value. If the first hash value is the same as the second hash value, it means that the first block is not a block after data cleaning, and its transaction data can be directly read.
  • the first node needs to further determine whether a mapping relationship is stored. If the first node stores the mapping relationship, it means that no error has occurred in the transaction data in the first block. If the first node does not store the mapping relationship, it means that the transaction data in the first block has an error.
  • a node in a second aspect, can implement the functions in the first aspect and any one of its possible implementation manners. These functions can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • the node may include an acquiring unit and a deleting unit, and the acquiring unit and the deleting unit may perform the corresponding functions in the data processing method of the first aspect and any one of its possible implementations.
  • the obtaining unit is used to obtain the identifier of the first block after the clearing request sent by the client obtains the consensus of multiple nodes in the blockchain system, and the clearing request is used to request to clear the data of the first block.
  • the cleanup request includes the identifier of the first block.
  • the deleting unit is used to delete the first data in the first block in the node according to the identifier of the first block acquired by the acquiring unit, and the first data is used to indicate that multiple nodes in the blockchain system pair the first zone Verification of transaction data in the block.
  • the above-mentioned obtaining unit is also used to obtain a mapping relationship, and the mapping relationship includes the correspondence between the identifier of the first block, the first hash value and the second hash value. Relationship, where the first hash value is the hash value of the block body in the first block, and the second hash value is the hash value of the data in the block body of the first block except the first data .
  • the node provided in this application also includes a storage unit for storing the mapping relationship obtained by the obtaining unit.
  • the nodes provided in this application are accounting nodes, and the blockchain system also includes ordering nodes and endorsement nodes.
  • the above-mentioned obtaining unit is specifically configured to obtain the identifier of the first block from the ordering node.
  • the identifier of the first block is included in the endorsement result sent by the client to the ordering node, and the endorsement result is the verification result of the endorsing node on the cleaning request.
  • the aforementioned acquiring unit is specifically configured to acquire the mapping relationship from the ordering node, and the endorsement result also includes the mapping relationship.
  • the nodes provided in this application are endorsing nodes.
  • the node also includes a receiving unit; the receiving unit is used to receive a cleanup request sent by the client.
  • the above-mentioned acquiring unit is specifically configured to acquire the identifier of the first block from the cleaning request received by the receiving unit.
  • the above-mentioned obtaining unit is also specifically configured to obtain the first hash value from the block header of the first block.
  • the node provided in this application also includes a calculation unit and a generating unit; the calculation unit is used to calculate the second hash value; the generation unit is used to generate a mapping relationship.
  • the nodes provided in this application are sorting nodes, and the blockchain system also includes endorsement nodes.
  • the node also includes a receiving unit configured to receive an endorsement result sent by the client.
  • the endorsement result is a verification result of a cleanup request sent by the endorsing node to the client.
  • the endorsement result includes the identification and mapping relationship of the first block.
  • the aforementioned acquiring unit is specifically configured to acquire the identifier of the first block from the endorsement result received by the receiving unit.
  • the acquiring unit is further specifically configured to acquire the mapping relationship from the endorsement result received by the receiving unit.
  • the node provided by this application is any node in the blockchain system.
  • the node also includes a receiving unit for receiving a cleanup request sent by the client.
  • the above-mentioned acquiring unit is specifically configured to acquire the identifier of the first block from the cleaning request received by the receiving unit.
  • the aforementioned obtaining unit is specifically configured to obtain the first hash value from the block header of the first block.
  • the node provided in this application also includes a calculation unit and a generating unit, where the calculation unit is used to calculate the second hash value; the generating unit is used to generate a mapping relationship.
  • the node provided in this application further includes a receiving unit, a reading unit, a calculation unit, and a determination unit.
  • the receiving unit is used to receive a transaction query request sent by the client, the transaction query request includes the identifier of the first block, and the transaction query request is used to request to query transaction data in the first block;
  • the identifier of the first block in the received transaction request read the first block;
  • the above-mentioned obtaining unit is also used to obtain the first hash value;
  • the calculation unit is used to calculate the second hash value; the determining unit, If the first hash value is different from the second hash value, determine that a mapping relationship is stored; the reading unit is also used to read transaction data in the first block.
  • a computer device in a third aspect, has one or more processors and one or more memories; the one or more memories are coupled with the one or more processors, and the one or more Each memory stores computer instructions.
  • the one or more processors execute the computer instructions, the computer device is enabled to implement the data processing method described in the first aspect and any one of its possible implementation manners.
  • the node may further include a communication interface configured to execute the steps of sending and receiving data, signaling, or information in the data processing method described in the first aspect and any one of its possible implementation manners.
  • the computer device may be the first node in this application, or a part of the devices in the first node in this application, such as a chip system in the first node.
  • the chip system is used to support the first node to implement the functions involved in the first aspect and any one of its possible implementations, for example, to obtain or delete the data and/or information involved in the aforementioned data processing method.
  • the chip system includes a chip, and may also include other discrete devices or circuit structures.
  • a computer-readable storage medium stores instructions; when the instructions are run on a computer, the computer executes the above-mentioned first aspect and its various possible implementations. The data processing method described.
  • a computer program product includes computer instructions.
  • the computer instructions run on the computer, the computer executes the data processing described in the first aspect and various possible implementations thereof. method.
  • first computer storage medium may be packaged with the processor of the computer device, or may be packaged separately with the processor of the computer device , This application does not limit this.
  • a blockchain system in a sixth aspect, includes the nodes provided in any of the second aspect and its various implementation methods.
  • FIG. 1A is a schematic diagram of a protocol architecture applicable to the blockchain system provided by an embodiment of the present application
  • FIG. 1B is a schematic diagram of the structure of the blockchain system applicable to the embodiment of the present application.
  • 2A is a schematic diagram 1 of the functions of nodes in the blockchain system in an embodiment of the application;
  • FIG. 3 is a schematic diagram of interaction of a data processing method provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of interaction of another data processing method provided by an embodiment of the application.
  • FIG. 5 is a first structural diagram of a block where the first data is deleted in an embodiment of the application
  • FIG. 7 is a schematic diagram of interaction of another data processing method provided by an embodiment of the application.
  • FIG. 8 is an interactive schematic diagram of another data processing method provided by an embodiment of this application.
  • FIG. 9 is an interactive schematic diagram of another data processing method provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of interaction of another data processing method provided by an embodiment of the application.
  • FIG. 11 is a schematic diagram of interaction of another data processing method provided by an embodiment of the application.
  • FIG. 12 is an interactive schematic diagram of another data processing method provided by an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of a node provided by an embodiment of the application.
  • FIG. 14 is a schematic diagram of the hardware structure of a computer device provided by an embodiment of the application.
  • words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as “exemplary” or “for example” are used to present related concepts in a specific manner.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices participate in “bookkeeping" (that is, record transaction data) and jointly maintain a complete distributed database. Because the blockchain technology has the characteristics of decentralization (that is, no central node), openness and transparency, each computing device can participate in database records, and the data synchronization between computing devices can be fast, so that the blockchain technology has been Widely used in many fields.
  • the blockchain system may include multiple blockchain nodes.
  • Blockchain nodes are devices that have communication and storage functions, such as devices that store blockchains.
  • this application uses nodes to represent blockchain nodes. In other words, all the nodes involved in this application can be used to represent blockchain nodes.
  • Each node can receive and generate information. Different nodes maintain a common blockchain to maintain communication. Specifically, in the blockchain system, any node can generate a new block according to transaction-related data sent by the client, and notify other nodes in the form of broadcast, and other nodes can verify this block. When all nodes in the blockchain system reach a consensus, new blocks can be added to the blockchain.
  • the node in this application can be understood as a processing unit.
  • the node may be a physical device, such as a server or a terminal device.
  • the node may be a virtual computer; the virtual computer is a general term for the operating environment virtualized by software in all types of virtualization devices, and the concept includes virtual machines and containers.
  • the node can be a process or a thread; a thread is the smallest unit that the operating system can perform operation scheduling. The thread is included in the process and is the actual operating unit in the process; the process is a computer
  • the program in a certain data set is the basic unit of resource allocation and scheduling.
  • transaction data is permanently stored in the form of electronic records, and the files that store these electronic records are called "blocks”.
  • Blocks are generated one after another in chronological order. Each block records all the transactions that occurred during its creation. All blocks are aggregated to form a chained record collection. Since the throughput rates of nodes are different in different blockchain systems, the size of the blocks may be different in different blockchain systems.
  • each block chain may not be exactly the same, but a block usually includes two parts: a header and a body.
  • the block header is mainly used to record the characteristic value of the current block, which can include the identifier of the current block (such as the number of the block), the hash value of the block body in the current block, and the timestamp (used to indicate the area At least one of information such as block generation time), transaction count (transaction count), and random number (nonce).
  • the block header may also include the hash value of the previous block (specifically, the previous block The hash value of the block header).
  • the block header includes multiple characteristic values.
  • the characteristic values in the block header need to be connected together in order to form a string, and then the hash of the string is calculated value. Since the value of the feature value included in the block header of different blocks is usually different, each block uniquely corresponds to a hash value.
  • each block uniquely corresponds to a hash value, and the block header of each block includes the hash value of the previous block, multiple blocks can form a blockchain.
  • the block body can include multiple transaction data.
  • the block body also includes information such as the client's certificate (used to indicate the originator of the transaction), the certificate of the endorsing node, and the signature of the endorsing node for the transaction.
  • the block body may also include the signature of the ordering node (or called the consensus node) for the transaction.
  • the signature here is used to represent the authentication of the transaction by the device corresponding to the signature, and the certificate is used to represent the identity.
  • the above-mentioned data such as signatures and certificates are used to verify transaction data, and these data usually occupy 70% of the storage space in the block body.
  • Table 1 shows a structure of the block.
  • the structure of the block is not limited to those shown in Table 1, and the value of each structure is not limited to those shown in Table 1.
  • blockchains can be divided into public chains, private chains, and alliance chains according to deployment methods.
  • Public chain refers to a blockchain that can be read by any device in the world, or a blockchain in which any device can participate in the consensus verification process of transactions.
  • Private chain refers to a blockchain with stricter access control.
  • Consortium chains also called consortium blockchains, refer to blockchains whose consensus process is controlled by preselected nodes.
  • all or part of the functions are only open to the nodes storing the consortium chain, and each node in the consortium chain can customize read and write permissions, query permissions, etc. based on needs.
  • nodes can be divided into three types: endorsement nodes, sorting nodes, and accounting nodes.
  • Endorsement can be understood as a digital signature.
  • this application refers to nodes that can complete the “endorsement” as “endorsement nodes”.
  • An endorsement node is a node in a blockchain system (such as the blockchain system of an enterprise organization) that verifies whether the transaction request is legal, and the block data stored by other nodes is consistent with the block data stored by the endorsement node . In other words, the endorsement node has the endorsement function.
  • the endorsing node determines whether the transaction request is legal; when it is determined that the transaction request is legal, the endorsing node signs the transaction request, that is, adds the endorsement to the transaction request.
  • the signature (or certificate) of the node and a transaction request with the signature (or certificate) of the endorsing node is sent to the client.
  • the message containing the signature (or certificate) of the endorsing node is used to indicate that the endorsing node has determined that it is legal.
  • the information sent by the endorsing node to the client can also be called the endorsement result.
  • the endorsement node may be a certain/certain node set in advance, or may be a node elected by all nodes in the blockchain system during operation.
  • the ordering node also known as the consensus node, refers to a node that agrees on the data sent by the client (such as the endorsement result), and packages the data sent by the client to generate a block after the consensus.
  • This application refers to this function as a sorting function.
  • the consensus here refers to a process in which multiple participants (such as ordering nodes) agree on whether a transaction is submitted to the ledger and the order of submission.
  • the ordering node after receiving multiple endorsement results sent by the client, performs a consensus process on the ordering of multiple transactions corresponding to the received multiple endorsement results, which can be based on the time when the endorsement results are received.
  • the order is arranged in sequence, or it can be arranged in the order of processing priority from high to low; after multiple sorting nodes reach a consensus on the sorting of multiple transactions, each sorting node can write the sorted multiple endorsement results to the new generation In the block.
  • the accounting node can obtain blocks from the ordering node, ensuring the consistency of the blocks stored by all accounting nodes.
  • nodes with endorsement function will also have accounting function.
  • nodes with accounting functions may not have endorsement functions.
  • the transaction request sent by the client needs to be agreed by all nodes in the blockchain system before it can be written to the blockchain stored by the node.
  • the consensus mentioned here includes all nodes verifying the same transaction request and agreeing on the order of a transaction request in the block. For example, for any node A in the blockchain system, after node A receives the transaction request sent by the client, node A verifies whether the transaction request is legal. If the verification passes, node A can broadcast a message to the rest of the nodes in the system. The message may indicate that the transaction request is verified by node A, and specifically may include the signature of node A. Thus, each node in the system can receive the verification result of the other nodes for the same transaction request. After node A packs multiple transactions into blocks, it broadcasts the generated blocks to other nodes in the blockchain system. Other nodes verify the sequence of multiple transactions contained in the received block, and finally achieve the same transaction sequence in the block for multiple nodes in the blockchain system.
  • the transaction data involved in this application refers to a piece of data that is created by a user through any node and needs to be finally published to the distributed database of the blockchain.
  • the transaction data is divided into narrow transaction data and broad transaction data.
  • Transaction data in a narrow sense refers to a transfer of value issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, transaction data can be the data of a transfer initiated by the user in the blockchain.
  • any data released by users to the distributed database of the blockchain can belong to the "transaction data" described in this application.
  • the client can be deployed on any electronic device and implemented through the corresponding software development kit (SDK) of the blockchain system.
  • SDK software development kit
  • the electronic device communicates with nodes in the blockchain network to realize the corresponding functions of the client.
  • this application provides a data processing method, node, and blockchain system. Specifically, in a scenario where the cleanup request (used to request cleanup of the data of the first block) sent by the client obtains the consensus of multiple nodes in the blockchain system, the first node in the blockchain system cleans the node The data of the first block effectively reduces the storage space occupied by the block and reduces the storage pressure.
  • cleaning up the data of the first block refers to deleting the first data in the first block, and the first data is used to indicate that multiple nodes in the blockchain system Verification of transaction data in the block, so that when the transaction data of the first block after being cleaned is subsequently read, the block can be quickly and conveniently read, and the transactions in the block can be directly read Data, no need to decompress and other operations, faster access speed.
  • the first block mentioned in each embodiment of this application is a block that has been recorded in the blockchain; optionally, a block whose generation time is greater than the first threshold in the blockchain is regarded as the first block; optional Yes, the block whose frequency or number of queries in the blockchain is lower than the second threshold is regarded as the first block.
  • the protocol layer provides the underlying capabilities of the blockchain system, maintains the nodes, and generally provides an application programming interface (API) for calling.
  • the protocol layer builds the network environment of the blockchain system, builds transaction channels, and develops a consensus mechanism for nodes.
  • the protocol layer mainly includes network programming, distributed algorithms, cryptographic signatures, and data storage.
  • protocol layer can be divided into a network layer and a storage layer in terms of function and technology.
  • the network layer is used to realize the information exchange between nodes in the blockchain network.
  • the blockchain system is essentially a peer-to-peer (P2P) network system. Each node not only receives information, but also generates information.
  • the nodes maintain communication by maintaining a common blockchain.
  • a node can create a new block. After the new block is created, it will notify other nodes in the form of broadcast. Other nodes will verify the block. When all nodes in the blockchain system reach a consensus Later, the new block can be added to the blockchain.
  • the extension layer which provides the functional realization of the blockchain system based on the protocol layer.
  • the extension layer can implement various script codes, algorithm mechanisms, and application mechanisms.
  • a smart contract is a typical application of the extension layer.
  • the node can automatically execute the contract after reaching a certain condition through the deployed smart contract.
  • the virtual currency trading market specifies the virtual currency trading method and the implementation details in the process through script packaging, which is also implemented in the expansion layer.
  • the extension layer is the application layer, which encapsulates various application scenarios and cases of the blockchain.
  • the application layer realizes the blockchain function that directly interacts with users, mostly in the form of a client.
  • Figure 1A is a schematic diagram of a protocol architecture of the blockchain system, not the protocol architecture of the blockchain system limited.
  • the blockchain system provided by the embodiment of the present application includes a client and at least two nodes.
  • Figure 1B shows a schematic structural diagram of the blockchain system in an embodiment of the present application.
  • the blockchain system shown in FIG. 1B has the protocol architecture shown in FIG. 1A.
  • the blockchain system includes a client 10 and multiple nodes 11, and one or more nodes 11 of the multiple nodes 11 are connected to the client 10.
  • the blockchain system shown in Figure 1B can provide data storage services and data query services for multiple enterprises. It is understandable that the blockchain system shown in FIG. 1B is only an example, and is not a limitation to the blockchain system provided in the embodiment of the present application.
  • the client 10 when the client 10 needs to query the flow data of the enterprise corresponding to the client, the client can initiate a query request to a certain node 11 connected to it; in the case of a consensus query request for all nodes in the blockchain system , The node 11 provides the client with the running data of the enterprise corresponding to the client.
  • the node 11 may be a device that provides input/output (IO) processing capabilities in the blockchain system.
  • IO input/output
  • Each node 11 stores a block chain, and all nodes 11 in the block chain system can store the same block chain (as shown in FIG. 1B, the block chain includes multiple blocks),
  • the blockchain can be a consortium chain/public chain/private chain.
  • the node 11 performs operations on the blockchain (such as adding blocks, deleting blocks, etc.).
  • the node 11 may have one or more functions, such as at least one of an endorsement function, a sorting function, or an accounting function. In the blockchain system shown in FIG. 1B, different nodes 11 may have different functions.
  • the node 21 in the blockchain system has an endorsement function, a sorting function, and an accounting function
  • the node 22 has a sorting function and an accounting function
  • the node 23 has an accounting function.
  • Fig. 2A and Fig. 2B are both schematic diagrams of the function of the node, and are not a limitation on the function of the node.
  • the node 11 can be used to: obtain the consensus of multiple nodes in the blockchain system by the cleanup request sent by the client 10 (used to request to clean up the data of the first block) After that, obtain the identifier of the first block from the node with the sorting function in the blockchain system (referred to as the sorting node for short), and delete the first data in the first block in the node 11 according to the identifier of the first block (Used to indicate the verification of transaction data in the first block by multiple nodes in the blockchain system).
  • the node 11 is also used to obtain the mapping relationship and store the mapping relationship.
  • the mapping relationship includes the corresponding relationship between the identifier of the first block, the first hash value and the second hash value.
  • the first hash value is the hash value of the block body in the first block
  • the second hash value is the hash value of data other than the first data in the block body of the first block.
  • the node 11 is also used to: receive a transaction query request including the identifier of the first block sent by the client 10, and read the first block according to the identifier of the first block; and obtain the first hash Value (the hash value of the block body stored in the first block header), and calculate the second hash value (the hash value of the block body in the first block), and then determine the first hash value and the first hash value Whether the second hash value is the same; if the first hash value is different from the second hash value, judge whether there is a mapping relationship (including the identification of the first block, the first hash value and the second hash value) Correspondence between ); After confirming that the mapping relationship is stored, the transaction data in the first block is read.
  • a mapping relationship including the identification of the first block, the first hash value and the second hash value
  • the node 11 can be used to: receive the endorsement result sent by the client 10, obtain the identifier of the first block from the endorsement result, and delete according to the identifier of the first block The first data in the first block in the node 11.
  • the endorsement result is the verification result of the cleanup request sent by the client by the node with the endorsement function in the blockchain system (referred to as the endorsement node for short), and the cleanup request is used to request to clean up the data of the first block.
  • the endorsement result includes the identifier of the first block and the mapping relationship.
  • the mapping relationship includes the identifier of the first block, the first hash value (refer to the above description of the first hash value) and the second hash value (refer to the above pair The description of the second hash value) the correspondence between the three.
  • the node 11 is also used to send the identification and mapping relationship of the first block to a node having a billing function in the blockchain system (referred to as a billing node for short).
  • the node 11 can be used to: receive the cleanup request including the first block sent by the client; determine that the cleanup request is legal, and generate a mapping relationship (refer to the above description), and send The client sends the mapping relationship.
  • the embodiment of the application uses the communication process of the accounting node, the ordering node, and the endorsing node to describe the data processing method provided in the embodiment of the application.
  • accounting node, the ordering node, and the endorsing node can be different devices, or the same device, or partially integrated in the same device (for example, the accounting node and the endorsing node are the same device).
  • FIG. 3 is a schematic diagram of interaction of a data processing method provided by an embodiment of this application.
  • the blockchain system includes a bookkeeping node, a sorting node, and an endorsement node.
  • the data processing method provided by the embodiment of the present application includes:
  • the client sends a cleanup request to the endorsing node, requesting to clean up the data of the first block.
  • the endorsement node may be pre-set, or may be a node elected by all nodes in the blockchain system during operation.
  • the number of blocks continues to grow.
  • the administrator can request to clear the data of certain blocks (that is, the first block, such as the block that has not been accessed for a long time or the block with a long generation time) through the client according to actual needs.
  • the client sends a cleanup request to the endorsement node, where the cleanup request includes the identifier (such as a serial number) of the first block, and is used to request to clean up the data of the first block.
  • the first block here is an existing block in the blockchain, so that the data in the first block can be cleaned up in the subsequent process.
  • the endorsing node determines whether the cleanup request is legal.
  • the endorsing node checks whether the first block is included in the blocks already stored by the endorsing node according to the identifier of the first block. If it exists, it means that the cleanup request is legal; if it does not exist, it means that the cleanup request is illegal.
  • the endorsing node sends a response message to the client.
  • the response message may also be called an endorsement result, which represents the verification result of the endorsing node on the cleanup request.
  • the endorsing node generates and stores the mapping relationship, and the response message includes the mapping relationship.
  • mapping relationship includes the corresponding relationship between the identifier of the first block, the first hash value and the second hash value.
  • the first data may include the signature of the endorsing node, the certificate of the endorsing node, the certificate of the client, and so on.
  • the method for the endorsing node to generate and store the mapping relationship is as follows: first, the endorsing node reads the first block from the non-volatile storage medium of the endorsing node to the endorsement according to the identifier of the first block The node's volatile storage medium (such as memory); the endorsing node retains the block header of the first block (the block header includes the hash value of the block body in the first block, that is, the first hash value), And delete the first data in the block body of the first block in the volatile storage medium. Then, the endorsing node calculates the second hash value. Finally, the endorsing node generates a mapping relationship and stores the mapping relationship in the non- Volatile storage media.
  • the method for the endorsing node to generate and store the mapping relationship is: the endorsing node reads the first block from the non-volatile storage medium of the endorsing node to the endorsing node according to the identifier of the first block Volatile storage medium (such as memory); the endorsing node reads the first hash value from the block header of the first block, and reads all transaction data from the block body of the first block, and calculates The hash value (ie, the second hash value) of all the transaction data read, finally, the endorsing node generates a mapping relationship, and stores the mapping relationship in a non-volatile storage medium.
  • the endorsing node reads the first block from the non-volatile storage medium of the endorsing node to the endorsing node according to the identifier of the first block Volatile storage medium (such as memory); the endorsing node reads the first hash value from the block header of the first block, and read
  • the endorsing node After the mapping relationship is generated, the endorsing node sends a response message including the mapping relationship to the client to indicate that the endorsing node determines that the cleanup request is legal.
  • the signature of the endorsing node is encrypted by the endorsing node with a private key, the signature cannot be tampered with, and the accuracy and reliability are guaranteed.
  • the signature of the endorsing node is used to indicate that the cleanup request is verified by the endorsing node.
  • the endorsing node may also directly send a response message including the signature of the endorsing node to the client when it determines that the cleanup request is legal.
  • the client sends a first message to the ordering node, which is used to indicate that the cleanup request sent by the client is legal.
  • the client After receiving the response message sent by the endorsing node, the client knows that the accounting node has determined that the cleanup request is legal. After that, the client can communicate with the ordering node. The client sends a first message including the endorsement result to the ordering node, where the first message is used to indicate that the cleanup request is verified by the endorsement node, and the endorsement result may include at least one of the identification and the mapping relationship of the first block.
  • the ordering node When the ordering node receives the first message, that is, it has received the endorsement result of the cleanup request, the ordering node can verify the endorsement result and verify whether the endorsement result is legal.
  • any sorting node can agree on the endorsement result with other sorting nodes in the blockchain system and store the endorsement result. Consensus on the endorsement result can also be regarded as a consensus on the cleanup request.
  • the specific consensus process can include: ordering node A (any ordering node in the blockchain system) broadcasts the endorsement result to the remaining ordering nodes and receiving the remaining orderings The verification result of the endorsement result of the node.
  • the sorting node can use any consensus algorithm in the prior art (such as lottery-based algorithm (Lottery-based Algorithm), voting-based algorithm (Voting-based Algorithm)) and other consensus algorithms in the blockchain system.
  • the node consensus endorsement result is not limited in the embodiment of this application.
  • the ordering node can separately package the endorsement result into a block, so that a block including the endorsement result can be generated.
  • the endorsement result can be placed in the block body of the block or in the block header of the block, which is not limited in the embodiment of the present application.
  • the ordering node also assigns a cleanup identifier to the block including the endorsement result, where the cleanup identifier is used to distinguish from a normal block that includes multiple transaction data, and the cleanup identifier is used to indicate to clean up the first data of the first block.
  • the ordering node also deletes the first data in the first block in the ordering node.
  • the ordering node can delete the first data in the first block in the following implementation manner.
  • the ordering node deletes the first data in the first block stored in the non-volatile storage medium of the ordering node.
  • the ordering node reads the first block from the non-volatile storage medium to the volatile storage medium (such as memory), and deletes the first block in the volatile storage medium And delete all the data in the first block in the non-volatile storage medium. After that, the ordering node stores the first block in the volatile storage medium after deleting the first data in the non-volatile storage medium. Storage medium.
  • ordering node may also use other methods to delete the first data in the first block, which will not be repeated here.
  • the ordering node stores the first area in the non-volatile storage medium Replace the block with the first block after deleting the first data, or delete the first block in the non-volatile storage medium, and re-divide the storage space in the non-volatile storage medium, and in the newly divided storage space Store the first block after deleting the first data.
  • the generated first block after deleting the first data is shown in Table 2.
  • the accounting node obtains the identifier of the first block from the sorting node.
  • the accounting node sends an acquisition request to the ordering node, requesting to obtain the information stored by the ordering node within a preset time period; accordingly, the ordering node sends the endorsement result to the accounting node, so that the accounting node is The identification of the first block can be obtained from the endorsement result.
  • the ordering node sends the endorsement result to the billing node after the consensus cleanup request or after storing the endorsement result, so that the billing node can obtain the identifier of the first block from the endorsement result.
  • S305 can be replaced with S305' (not shown in FIG. 3).
  • the ordering node sends the endorsement result to the accounting node.
  • the accounting node deletes the first data in the first block in the accounting node according to the identifier of the first block.
  • the accounting node can delete the first data in the first block in the following implementation manner.
  • the accounting node deletes the first data in the first block stored in the non-volatile storage medium of the ordering node.
  • the accounting node reads the first block from the non-volatile storage medium to a volatile storage medium (such as memory), and deletes the first block in the volatile storage medium And delete all data in the first block in the non-volatile storage medium. After that, the accounting node stores the first block in the volatile storage medium after the first data is deleted in the non-volatile storage medium. Lost storage media.
  • a volatile storage medium such as memory
  • the accounting node replaces the first block in the non-volatile storage medium with the first block after deleting the first data, or deletes the first block in the non-volatile storage medium, and
  • the storage space is re-divided in the non-volatile storage medium, and the first block after deleting the first data is stored in the newly divided storage space.
  • the endorsing node will also delete the first data in the first block in the endorsing node.
  • the process of deleting the first data in the first block by the endorsing node refer to the description of S304 or S306, which will not be described in detail here.
  • the nodes in the blockchain system can delete the first data in the first block. Since the first data is used to verify transaction data, it usually takes up 70% of the storage space in the block body. Therefore, the node Deleting the first data can effectively reduce the storage space occupied by the block and reduce the storage pressure.
  • the block header includes the hash value of the block body of the first block, and the data in the block body corresponding to the block header has been It is not the original data in the block body of the first block, so the hash value is different from the hash value of the block body of the first block after the first data is deleted.
  • the accounting node in order to facilitate subsequent data query and to determine that the transaction data in the first block after the first data is deleted has no error, the accounting node also needs to store the mapping relationship.
  • the data processing method provided by the embodiment of the present application further includes S400.
  • the accounting node stores the mapping relationship.
  • the accounting node can store the mapping relationship after obtaining the endorsement result. If the endorsement result does not include the mapping relationship, the accounting node generates and stores the mapping relationship.
  • the method for the accounting node to generate the mapping relationship is: the accounting node obtains the first hash value from the block header of the first block, and calculates the second hash value, so that the accounting node can be based on the first hash value.
  • the hope value, the second hash value, and the identifier of the first block generate a mapping relationship.
  • the accounting node reallocates storage space in the non-volatile storage medium, and stores the block including the mapping relationship in the storage space.
  • block N-1, block N, and block N+1 are already stored in the accounting node. If the first block is block N, and the block header of block N The hash value in block N is y, and the accounting node deletes the first data in block N to generate block N'. The hash value of the block body in block N'is K. After that, the accounting node will Block N is replaced with block N'(or the accounting node deletes block N and stores block N'). In addition, the accounting node re-divides the storage space and stores the block N+2 including the mapping relationship, which is the correspondence relationship between the identifier of the block N, the hash value y, and the hash value K.
  • the accounting node reallocates storage space in the non-volatile storage medium, and stores the block including the mapping relationship in the storage space (as shown in Figure 5); the mapping relationship can also be changed Stored in the first block after deleting the first data.
  • block N-1, block N, and block N+1 are already stored in the accounting node. If the first block is block N, and the block header of block N The hash value in block N is y, and the accounting node deletes the first data in block N to generate block N'. The hash value of the block body in block N'is K. After that, the accounting node will Block N is replaced with block N'(or the accounting node deletes block N and stores block N'). In addition, the accounting node stores the mapping relationship in block N'. The mapping relationship is the corresponding relationship between the identifier of the block N, the hash value y, and the hash value K.
  • the endorsing node may also directly send a response message including the signature of the endorsing node to the client in the case of determining that the cleanup request is legal.
  • the endorsement result obtained by the ordering node is the identifier of the first block.
  • the accounting node also needs to generate and store the mapping relationship. This process is explained below.
  • FIG. 7 shows another schematic diagram of interaction of a data processing method provided by an embodiment of the present application.
  • the data processing method provided by the embodiment of the present application includes:
  • the client sends a cleanup request to the endorsing node, requesting to clean up the data of the first block.
  • the endorsing node determines whether the cleanup request is legal.
  • the method for the endorsement node to determine whether the cleanup request is legal can refer to the description of S301 above, which will not be repeated here.
  • S702 continues to be executed after S701. If the cleanup request is illegal, the endorsing node sends a message indicating that the cleanup request is illegal to the client.
  • the endorsing node sends a response message including the signature of the endorsing node to the client.
  • the signature of the endorsing node is encrypted by the endorsing node with a private key, the signature cannot be tampered with, and the accuracy and reliability are guaranteed.
  • the signature of the endorsing node is used to indicate that the cleanup request is verified by the endorsing node.
  • the endorsing node may also directly send a response message including the signature of the endorsing node to the client in the case of determining that the cleanup request is legal.
  • S703 The client sends a first message to the ordering node, which is used to indicate that the cleanup request sent by the client is legal.
  • the first message includes the identifier of the first block and does not include the mapping relationship.
  • the ordering node deletes the first data in the first block according to the first message, and stores the identifier of the first block.
  • the ordering node For S704, reference may be made to the description of S304 above. The difference is that in S704, the first message received by the ordering node includes the identifier of the first block, and does not include the mapping relationship. Therefore, the ordering node here stores the identifier of the first block.
  • the accounting node obtains the identifier of the first block from the sorting node.
  • the accounting node sends an acquisition request to the ordering node, requesting to obtain the information stored by the ordering node within a preset period of time; correspondingly, the ordering node sends the identification of the first block to the accounting node, so that, The accounting node can obtain the identification of the first block.
  • the ordering node sends the identification of the first block to the accounting node after the consensus cleanup request or after storing the endorsement result, so that the accounting node can obtain the identification of the first block.
  • S705 can be replaced with S305' (not shown in FIG. 3).
  • the ordering node sends the identifier of the first block to the accounting node.
  • the accounting node deletes the first data in the first block in the accounting node according to the identifier of the first block.
  • the endorsing node will also delete the first data in the first block in the endorsing node.
  • all nodes in the blockchain system can delete the first data in the first block. Since the first data is used to verify transaction data, it usually occupies 70% of the block body. % Of storage space. Therefore, the node deletes the first data, which can effectively reduce the storage space occupied by the block and reduce the storage pressure.
  • accounting node also needs to store the mapping relationship.
  • the data processing method provided in the embodiment of the present application further includes S707 to S709.
  • the accounting node obtains the first hash value from the block header of the first block.
  • the first hash value is the hash value of the block body in the first block.
  • the accounting node calculates a second hash value.
  • the second hash value is the hash value of other data in the block body of the first block except the first data.
  • the accounting node generates and stores a mapping relationship.
  • the mapping relationship includes the identifier of the first block, and the first hash value and the second hash value both corresponding to the identifier of the first block.
  • the accounting node reallocates storage space in the nonvolatile storage medium, and stores the block including the mapping relationship in the storage space (as shown in Figure 5); the mapping relationship can also be stored in the first deletion In the first block after the data (as shown in Figure 6).
  • the accounting node, ordering node and endorsing node are different devices.
  • the accounting node, ordering node, and endorsing node in the embodiment of the present application may also be the same device.
  • the accounting node, ordering node, and endorsing node are the same device, and the device is node A as an example.
  • FIG. 9 is a schematic diagram of another interaction of a data processing method provided by an embodiment of the application.
  • the data processing method provided by the embodiment of the present application includes:
  • the client sends a cleanup request to node A, requesting to clean up the data of the first block.
  • the node A may be preset, or it may be a node elected by all nodes in the blockchain system during the operation.
  • the number of blocks continues to grow.
  • the administrator can request to clear the data of certain blocks (that is, the first block, such as the block that has not been accessed for a long time or the block with a long generation time) through the client according to actual needs.
  • the client sends a cleanup request to node A, where the cleanup request includes an identifier (such as a serial number) of the first block for requesting to clean up the data of the first block.
  • the first block here is an existing block in the blockchain, so that the data in the first block can be cleaned up in the subsequent process.
  • node A determines whether the cleanup request is legal.
  • the node A checks whether the first block is included in the stored block according to the identifier of the first block. If it exists, it means that the cleanup request is legal; if it does not exist, it means that the cleanup request is illegal.
  • cleanup request In the case that the cleanup request is legal, continue to execute S902 after S901. If the cleanup request is illegal, node A sends a message indicating that the cleanup request is illegal to the client.
  • S902 The node A deletes the first data in the first block in the node A.
  • node A determines that the cleanup request is legal
  • other nodes in the blockchain system agree on the cleanup request.
  • node A can use any consensus algorithm in the existing technology (such as lottery-based algorithm (Lottery-based Algorithm), voting-based algorithm (Voting-based Algorithm)) and other blockchain systems.
  • the node consensus cleanup request is not limited in the embodiment of this application.
  • node A deletes the first data in the first block in node A.
  • the node A can delete the first data in the first block in the following implementation manner.
  • the node A deletes the first data in the first block stored in the non-volatile storage medium of the node A.
  • node A reads the first block from the non-volatile storage medium into a volatile storage medium (such as memory), and deletes the first block in the volatile storage medium And delete all the data of the first block in the non-volatile storage medium. After that, node A stores the first block in the volatile storage medium after the first data is deleted in the non-volatile storage medium. Storage medium.
  • node A may also delete the first data in the first block in other ways, which will not be repeated here.
  • the method for node A to store the first block in the volatile storage medium after the first data is deleted in the non-volatile storage medium is: node A stores the first area in the non-volatile storage medium Replace the block with the first block after deleting the first data, or delete the first block in the non-volatile storage medium, and re-divide the storage space in the non-volatile storage medium, and in the newly divided storage space Store the first block after deleting the first data.
  • Node A deletes the first data, which can effectively reduce the storage space occupied by the block and reduce the storage pressure.
  • node A determines that the cleanup request is legal, it also generates and stores the mapping relationship.
  • the data processing method provided by the embodiment of the present application further includes S1000.
  • Node A generates and stores the mapping relationship.
  • the mapping relationship includes the identifier of the first block, and the first hash value and the second hash value both corresponding to the identifier of the first block, and the first hash value is the block body in the first block
  • the second hash value is the hash value of other data except the first data in the block body of the first block, and the first data is used to indicate the verification of the transaction data in the first block .
  • the first data may include the signature of the endorsing node, the certificate of the endorsing node, the certificate of the client, and so on.
  • the method for node A to generate and store the mapping relationship is as follows: first, node A reads the first block from the non-volatile storage medium of node A to the node according to the identifier of the first block A's volatile storage medium (such as memory); node A retains the block header of the first block (the block header includes the hash value of the block body in the first block, that is, the first hash value), And delete the first data in the block body of the first block in the volatile storage medium. Then, node A calculates the second hash value. Finally, node A generates a mapping relationship and stores the mapping relationship in a non-volatile storage medium. Volatile storage media.
  • the method for node A to generate the mapping relationship is: node A reads the first block from the non-volatile storage medium of node A to the easy-to-use link of node A according to the identifier of the first block. Lost storage medium (such as memory); node A reads the first hash value from the block header of the first block, and reads all transaction data from the block body of the first block, and calculates and reads The hash value (ie, the second hash value) of all transaction data obtained, finally, node A generates a mapping relationship, and stores the mapping relationship in a non-volatile storage medium.
  • node A reallocates the storage space in the non-volatile storage medium, and stores the block including the mapping relationship in the storage space (as shown in FIG. 5); the mapping relationship may also be stored in the delete first data After the first block (as shown in Figure 6).
  • node A may execute S1000 before S902, may execute S1000 after S902, or may execute S902 and S1000 simultaneously, which is not limited in the embodiment of the present application.
  • blockchain systems often include multiple subsystems, and each subsystem includes nodes with endorsement functions.
  • node A determines that the cleanup request is legal, it also sends a response message indicating that the cleanup request is legal to the client.
  • the client sends a first message to node A, so that node A can delete the first data in the first block according to the first message.
  • the nodes in the blockchain system store the blockchain.
  • the blockchain includes multiple blocks, and each block stores multiple transaction data. In this way, users can read certain/certain data through the client according to actual needs. Transaction data in the block.
  • the accounting node is used to store the ledger, regardless of whether the accounting node, sorting node, and endorsing node are the same device, the client directly communicates with the accounting function when reading the transaction data of the block. Nodes communicate to obtain transaction data.
  • the node with the accounting function is node B, and the node B requests to read the transaction data in block 1 as an example.
  • FIG. 11 is another schematic diagram of interaction of a data processing method provided by an embodiment of this application. As shown in FIG. 11, the data processing method provided by the embodiment of the present application includes:
  • S1100 The client sends a transaction query request to node B.
  • the transaction query request includes the identifier of block 1, and the transaction data in block 1 is requested.
  • the block 1 can be any block in the blockchain, such as the first block mentioned above.
  • Node B reads block 1 according to the identifier of block 1.
  • Node B obtains hash value 1, and calculates hash value 2.
  • Hash value 1 (corresponding to the first hash value in the embodiment of this application) is the hash value of the block body stored in the block header of block 1, and hash value 2 (corresponding to the first hash value in the embodiment of this application) The second hash value) is the hash value of the block body in block 1.
  • the hash value 1 is the same as the hash value 2, it means that block 1 is not the block after deleting the first data. In this way, node B can directly download the block body of block 1 To obtain transaction data. If the hash value 1 is different from the hash value 2, it means that the block 1 may be the block after the first data is deleted.
  • node B In order to further determine whether block 1 is a block after deleting the first data, node B needs to determine whether there is a correspondence between hash value 1, hash value 2 and the identifier of block 1.
  • the mapping relationship includes the corresponding relationship between the identifier of the block 1, the hash value 1 and the hash value 2.
  • the data processing method provided by the embodiment of the present application also includes the case where the hash value 1 is the same as the hash value 2, and the case where the node B does not store the above-mentioned mapping relationship.
  • the data processing method provided by the embodiment of the present application further includes:
  • the node B reads the transaction data in block 1, and sends the read transaction data to the client.
  • the node B further sends a message indicating that the data has an error to the client, that is, S1202 is further included after S1200.
  • the node B sends a message indicating that an error occurs in the data to the client.
  • the node in the embodiment of the present application stores the block after deleting the first data in a non-volatile storage medium, in this way, when the block after deleting the first data is subsequently read, it can be quickly and conveniently read This block, and the transaction data in the block can be directly read, without decompression and other operations, and the access speed is faster.
  • the embodiments of the present application may divide the nodes into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and another division method may be used in actual implementation.
  • FIG. 13 shows a schematic diagram of the composition of a node 130.
  • the node 130 may be the above-mentioned endorsing node, ordering node, or accounting node, or the above-mentioned node A or node B, which can be used to execute the nodes involved in the above-mentioned embodiment Function.
  • the node 130 shown in FIG. 13 includes: an acquiring unit 131 and a deleting unit 132.
  • the obtaining unit 131 is used to support the node 130 to perform operations such as obtaining shown in any of the above-mentioned figures 3, 4, and 7-12, for example: S305, S705, S707, and/or used as described herein Other processes of the technology.
  • the deletion unit 132 is used to support the node 130 to perform operations such as deletion shown in any of the above-mentioned figures 3, 4, and 7-12, for example: S306, S706, S902, S304, S704, and/or use Other processes in the technology described in this article.
  • the node 130 provided in the embodiment of the present application includes but is not limited to the above-mentioned modules.
  • the node 130 may also include a storage unit 133, a receiving unit 134, a reading unit 135, a calculation unit 136, a determination unit 137, and a generation unit 138.
  • the storage unit 133 may be used to store the program code of the node 130, and may also be used to store data generated during the operation of the node 130, such as a mapping relationship.
  • the receiving unit 134 is used to support the node 130 to perform the receiving operations shown in any of the above figures 3, 4, and 7-12, such as receiving endorsement results, cleaning requests, etc., S300, S700, S303, S703, and / Or other processes used in the techniques described herein.
  • the reading unit 135 is configured to support the node 130 to perform the reading operation shown in any one of the above-mentioned FIG. 3, FIG. 4, and FIG. 7-12, such as reading the first block.
  • the determining unit 137 is used to support the node 130 to perform operations such as determination and judgment shown in any of the above-mentioned figures 3, 4, and 7-12, for example: S301, S701, S1103, and/or used in this article Other processes of the described technology.
  • nodes provided in the embodiments of the present application are used to perform the functions of the endorsement node, ordering node, accounting node, node A, or node B in the foregoing data processing method, and therefore can achieve the same effect as the foregoing data processing method.
  • FIG. 14 is a schematic diagram of the hardware structure of a computer device provided by an embodiment of this application.
  • the computer device can be used to implement the data processing method provided by the embodiment of this application.
  • the computer equipment can be the first node in this application (the endorsement node, ordering node, accounting node, node A or node B mentioned above), or it can be a part of the device in the first node in this application, for example, in the first node Chip system.
  • the chip system is used to support the first node to implement the data processing method provided in the embodiment of the present application.
  • the chip system includes a chip, and may also include other discrete devices or circuit structures.
  • the computer device may include a processor 141, a memory 142, a communication interface 143, and a communication bus 144.
  • the processor 141, the memory 142, and the communication interface 143 may be connected by a communication bus 144.
  • the processor 141 is the control center of the data processing device, and may be a processor or a collective term for multiple processing elements.
  • the processor 141 is a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or is configured to implement one or more integrated circuits of the embodiments of the present application.
  • Circuits for example: one or more digital signal processors (DSP), or one or more field-programmable gate arrays (FPGA).
  • the processor 141 can execute various functions of the data processing device by running or executing a software program stored in the memory 142 and calling data stored in the memory 142.
  • the processor 141 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 14.
  • the data processing apparatus may further include other processors, for example, the processor 145 shown in FIG. 14, and the processor 145 includes an ASIC 0.
  • processors for example, the processor 145 shown in FIG. 14, and the processor 145 includes an ASIC 0.
  • Each of the multiple processors in the data processing device may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the memory 142 may exist independently of the processor 141, that is, the memory 142 may be a memory external to the processor 141. In this case, the memory 142 may be connected to the processor 141 through the communication bus 144 for storage. Instructions or program codes. When the processor 141 calls and executes instructions or program codes stored in the memory 142, it can implement the data processing method provided in the following embodiments of the present application.
  • the memory 142 can also be integrated with the processor 141, that is, the memory 142 can be an internal memory of the processor 141.
  • the memory 142 is a high-speed cache that can be used to temporarily store some data and / Or instruction information, etc.
  • the communication interface 143 is used to communicate with other devices or communication networks using any device such as a transceiver, such as Ethernet, radio access network (RAN), and wireless local area network (RAN). local area networks, WLAN), etc.
  • the communication interface 143 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
  • the communication bus 144 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 14, but it does not mean that there is only one bus or one type of bus.
  • the above-mentioned acquiring unit 131 and receiving unit 134 may be the communication interface 143 in FIG. 14, and the deleting unit 132, the reading unit 135, the calculating unit 136, the determining unit 137, and the generating unit 138 may be the processor 141 in FIG. 14, the storage unit 133 may be the memory 142 in FIG. 14.
  • a computer program product is further provided.
  • the computer program product includes computer instructions.
  • the at least one processor executes the computer instructions, the at least one processor executes the instructions shown in the method embodiments. Each step performed by the endorsement node, ordering node, accounting node, node A or node B in the method flow.
  • the above embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • a software program it may appear in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • the computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions can be passed from a website, computer, blockchain node, or data center.
  • Wire for example, coaxial cable, optical fiber, Digital Subscriber Line (DSL)
  • wireless for example, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data terminal such as a blockchain node or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a Digital Versatile Disc DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • a magnetic medium for example, a floppy disk, a hard disk, and a magnetic tape
  • an optical medium for example, a Digital Versatile Disc DVD
  • a semiconductor medium for example, a solid state disk (SSD)
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate.
  • the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, which are stored in a storage medium.
  • a device which may be a single-chip microcomputer, a chip, etc.
  • a processor processor
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

本申请实施例公开一种数据处理方法、节点及区块链系统,该方法包括:在客户端发送的清理请求获得区块链系统中多个节点的共识之后,区块链系统中的节点对该节点中的区块进行数据清洗,清洗区块中冗余的数据,即清洗用于表示区块链系统中多个节点对区块中交易数据的验证的数据,有效地减少了区块占用的存储空间,降低了存储压力。

Description

一种数据处理方法、节点及区块链系统
本申请要求于2019年06月26日提交国家知识产权局、申请号为201910563257.0、申请名称为“一种数据处理方法、节点及区块链系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,尤其涉及一种数据处理方法、节点及区块链系统。
背景技术
区块链是一种维护区块的链式结构,可以维持持续增长的、可共享的、不可篡改的数据记录。由于区块链技术具有去中心化、公开透明、快速实现数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。
同一区块链系统中的所有区块链节点存储有相同的区块链。每一区块链往往包括多个区块。在区块链系统的运行期间,会持续不断的生成新的区块,这样,每个区块链节点存储的区块的数量会越来越多,导致区块链节点的存储压力会越来越大。
发明内容
本申请提供一种数据处理方法、节点及区块链系统,用于提高区块链节点的存储资源利用率。
为达到上述目的,本申请实施例采用如下技术方案:
第一方面,提供一种数据处理方法,该数据处理方法应用于包括第一节点的区块链系统,该第一节点中存储有多个区块。该方法包括:在客户端发送的清理请求获得区块链系统中多个节点的共识之后,第一节点获取第一区块的标识,并根据第一区块的标识,删除第一节点中第一区块中的第一数据。其中,清理请求用于请求清理第一区块的数据,该清理请求包括第一区块的标识。第一数据用于表示区块链系统中的多个节点对第一区块中交易数据的验证,例如:节点对交易数据的签名或已对交易数据进行验证的节点的证书。
本申请中的节点可以理解为处理单元。在一种实现方式中,节点可以为物理设备,例如服务器或终端设备。在另一种实现方式中,节点可以为虚拟计算机;虚拟计算机为所有类型的虚拟化设备中软件虚拟出来的运行环境的统称,该概念包括虚拟机、容器。在其他实现方式中,节点可以为进程(process)或者线程(thread);线程是操作系统能够进行运算调度的最小单位,线程被包含在进程之中,是进程中的实际运作单位;进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位。
在一种实现方式中,区块链系统(例如联盟链)包括背书节点、排序节点和记账节点。上述“客户端发送的清理请求获得区块链系统中多个节点的共识”包括多个排序节点对清理请求在区块中顺序的共识。简单的,可将清理请求当做一笔待处理的交易, 多个排序节点对清理请求这笔交易在区块中的顺序进行共识。在多笔交易被打包生成区块后,某一笔交易在该区块中的顺序表示该笔交易在多笔交易中被处理的顺序。对于多个排序节点中的每个排序节点,共识后的清理请求在区块中的顺序是一致的。记账节点,还可以称为提交节点(committing peer),用于最终确认区块并改变自身世界状态。以金融交易场景下的区块链系统为例,改变自身世界状态可以理解为更新账户余额。排序节点,还可以称为共识节点(orderer),用于对接收到的交易进行共识,并将多笔交易打包生成区块。当区块链系统中存在多个排序节点时,排序节点对交易进行共识的流程可为:任意一个排序节点向其他排序节点广播该排序节点生成的区块,其他排序节点对收到的区块进行验证,其他排序节点可验证收到的区块中所包含的多笔交易的顺序。背书节点与记账节点可以是同一个节点,也可以是不同的节点。
在另一种实现方式中,区块链系统中部署的区块链为私有链或者共有链,此时第一节点为区块链系统中任一个节点。上述“客户端发送的清理请求获得区块链系统中多个节点的共识”包括区块链系统中的每个节点对清理请求的验证以及每个节点对清理请求在区块中的顺序达成一致。
本申请中第一节点删除第一节点中第一区块中的第一数据的方式可存在多种。在一种实现方式中,第一节点删除第一节点的非易失性存储介质中存储的第一区块中的第一数据;在另一种实现方式中,第一节点将第一区块从非易失性存储介质中读取至易失性存储介质(例如内存)中,并删除易失性存储介质中第一区块中的第一数据,以及删除非易失性存储介质中的第一区块的所有数据,后续,第一节点将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中。
一般的,区块的区块体中存储有多个交易数据,以及对于每一交易数据而言,区块体还包括区块链系统中多个节点对该交易数据的验证信息(如节点的签名)。本申请将用于表示对第一区块中交易数据的验证的数据称为第一数据,第一数据在区块的区块体中通常占用较大的存储空间,第一节点删除第一区块中的第一数据后,有效地减少了区块占用的存储空间,降低了第一节点的存储压力,提高存储资源的利用率。
此外,第一节点只是删除了第一区块中的第一数据,在删除第一数据后,第一节点仍然存储着删除第一数据后的第一区块。这样,在后续读取第一区块时,可快速、方便的读取到该区块,而且能够直接读取到该区块中区块体的交易数据,无需解压缩等操作,访问速度较快。
在本申请的一种可能的实现方式中,第一节点还获取并存储映射关系,该映射关系包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系,第一哈希值为第一区块中区块体的哈希值,第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值。
在本申请的另一种可能的实现方式中,第一节点为记账节点,区块链系统还包括排序节点和背书节点。上述“第一节点获取第一区块的标识”的方法包括:记账节点(第一节点)从排序节点获取第一区块的标识,其中,第一区块的标识包括于客户端发送给排序节点的背书结果中,该背书结果为背书节点对上述清理请求的验证结果。相应的,上述“第一节点获取映射关系”的方法为:记账节点(第一节点)从排序节点获取映射关系,该背书结果还包括映射关系。
其中,记账节点可以采用下述实现方式1、实现方式2或实现方式3从排序节点获取第一区块的标识和映射关系的方式。实现方式1:记账节点从排序节点读取包括有第一区块的标识以及映射关系的区块,从而获得第一区块的标识和映射关系。实现方式2:记账节点接收排序节点发送的消息(或区块),该消息(或区块)包括第一区块的标识和映射关系中的至少一个。实现方式3:记账节点采用实现方式1或实现方式2描述的方式获得第一区块的标识,之后,记账节点通过计算第一哈希值和第二哈希值,得到映射关系。
在本申请的另一种可能的实现方式中,第一节点为背书节点。上述“第一节点获取第一区块的标识”的方法包括:背书节点(第一节点)接收客户端发送的清理请求,并从该清理请求中获取第一区块的标识。相应的,上述“第一节点获取映射关系”的方法包括:背书节点(第一节点)从第一区块的区块头中获取第一哈希值,并计算第二哈希值,这样,背书节点即可根据第一区块的标识、第一哈希值以及第二哈希值生成映射关系。即背书节点可通过计算第一哈希值和第二哈希值,获得映射关系。
在本申请的另一种可能的实现方式中,第一节点为排序节点,区块链系统还包括背书节点。上述“第一节点获取第一区块的标识”的方法包括:排序节点(第一节点)接收客户端发送的背书结果,并从该背书结果中获取第一区块的标识。该背书结果为背书节点对客户端发送的清理请求的验证结果,该背书结果包括第一区块的标识和映射关系。相应的,上述“第一节点获取映射关系”的方法包括:第一节点从背书结果中获取映射关系。
在本申请的另一种可能的实现方式中,第一节点为区块链系统中任一节点。该区块链系统部署方式可以为公有链或私有链。上述“第一节点获取第一区块的标识”的方法包括:第一节点接收客户端发送的清理请求,并从该清理请求中获取第一区块的标识。相应的,上述“第一节点获取映射关系”的方法包括:第一节点从第一区块的区块头中获取第一哈希值,并计算第二哈希值,这样,第一节点即可根据第一区块的标识、第一哈希值以及第二哈希值生成映射关系。
例如:对于公有链和私有链,区块链系统中的任一节点接收并验证客户端发送的清理请求,并计算生成映射关系。
第一节点计算生成映射关系的方法可包括:第一节点根据第一区块的标识,从第一区块的区块头中获取第一哈希值(即第一区块中区块体的哈希值),并计算第二哈希值(即计算第一区块的区块体中除第一数据之外其他数据的哈希值);之后,该第一节点生成映射关系,该映射关系包括第一区块的标识,以及与第一区块的标识对应的第一哈希值和第二哈希值。
区块包括区块头和区块体。当生成某一区块时,该区块的区块头中存储有该区块的区块体的哈希值。在本申请的实施例中第一节点删除了第一区块中的第一数据,对于删除数据后的第一区块而言,“该区块的区块头中存储的区块体的哈希值”与“删除数据后的第一区块的区块体的哈希值”不相同。为了后续确定第一区块中的交易数据是否发生错误,第一节点还需要存储映射关系。本申请中的第一节点可以从其他节点获取映射关系,也可以自身生成映射关系,本申请对此不作限定。
本申请中的背书节点具备背书的功能,排序节点具备排序(或共识)的功能,记 账节点具备记账的功能。对于不同功能的第一节点而言,获取第一区块的标识和映射关系的方法不同。区块链系统中的某一节点可以同时具备背书功能、排序(或共识)功能和记账功能。本申请中的第一节点可以为背书节点、排序节点或记账节点,也可以为具备背书功能、排序功能和记账功能为一体的节点。
在本申请的另一种可能的实现方式中,除了上述描述外,第一节点还会接收到客户端发送的包括第一区块的标识的交易查询请求,用于请求查询第一区块中的交易数据;之后,第一节点根据第一区块的标识,读取第一区块,这样,第一节点即可获取第一哈希值(即第一区块的区块头中存储的区块体的哈希值),并计算第二哈希值(即第一区块中区块体的哈希值);若第一哈希值与第二哈希值不同,第一节点判断是否存储有映射关系,该映射关系包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系;当第一节点确定存储有该映射关系时,第一节点读取第一区块中的交易数据。
在本申请的另一种可能的实现方式中,若第一节点确定未存储映射关系,则第一节点确定第一区块中的交易数据发生错误。
在本申请的另一种可能的实现方式中,若第一哈希值与第二哈希值相同,则第一节点读取区块中的交易数据。
结合上面描述可知,对于删除数据后的区块而言,“区块头中存储的区块体的哈希值”与“删除数据后的区块的区块体的哈希值”不相同。因此,在接收到包括第一区块的标识的交易查询请求后,第一节点需要判断“第一区块的区块头中存储的区块体的哈希值”与“第一区块的实际的区块体的哈希值”是否相同,即判断第一哈希值与第二哈希值是否相同。若第一哈希值与第二哈希值相同,则说明第一区块并非数据清理后的区块,可直接读取其交易数据。若第一哈希值与第二哈希值不同,则说明第一区块为数据清理后的区块,这种场景中,第一节点需要进一步地确定是否存储有映射关系。若第一节点存储有映射关系,则说明第一区块中的交易数据未发生错误。若第一节点未存储有映射关系,则说明第一区块中的交易数据发生错误。
第二方面,提供一种节点,该节点能够实现第一方面及其任意一种可能的实现方式中的功能。这些功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。
在本申请的一种可能的方式中,该节点可以包括获取单元和删除单元,该获取单元和删除单元可以执行上述第一方面及其任意一种可能的实现方式的数据处理方法中的相应功能。例如:获取单元,用于在客户端发送的清理请求获得区块链系统中多个节点的共识之后,获取第一区块的标识,该清理请求用于请求清理第一区块的数据,该清理请求包括第一区块的标识。删除单元,用于根据获取单元获取到的第一区块的标识,删除节点中第一区块中的第一数据,该第一数据用于表示区块链系统中多个节点对第一区块中交易数据的验证。
在本申请的一种可能的实现方式中,上述获取单元还用于获取映射关系,该映射关系包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系,其中,第一哈希值为第一区块中区块体的哈希值,第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值。此外,本申请提供的节点还包括存储单元,该存储单元用 于存储上述获取单元获取到的映射关系。
在本申请的另一种可能的实现方式中,本申请提供的节点为记账节点,区块链系统还包括排序节点和背书节点。上述获取单元,具体用于从排序节点获取第一区块的标识,第一区块的标识包括于客户端发送给排序节点的背书结果中,该背书结果为背书节点对清理请求的验证结果。相应的,上述获取单元,具体用于从排序节点获取映射关系,背书结果还包括映射关系。
在本申请的另一种可能的实现方式中,本申请提供的节点为背书节点。该节点还包括接收单元;该接收单元用于接收客户端发送的清理请求。上述获取单元,具体用于从接收单元接收到的清理请求中获取第一区块的标识。相应的,上述获取单元还具体用于从第一区块的区块头中获取第一哈希值。此外,本申请提供的节点还包括计算单元和生成单元;计算单元用于计算第二哈希值;生成单元用于生成映射关系。
在本申请的另一种可能的实现方式中,本申请提供的节点为排序节点,区块链系统还包括背书节点。该节点还包括接收单元,该接收单元用于接收客户端发送的背书结果,背书结果为背书节点对客户端发送的清理请求的验证结果,背书结果包括第一区块的标识和映射关系。上述获取单元,具体用于从接收单元接收到的背书结果中获取第一区块的标识。相应的,获取单元还具体用于从接收单元接收到的背书结果中获取映射关系。
在本申请的另一种可能的实现方式中,本申请提供的节点为区块链系统中任一个节点。该节点还包括接收单元,该接收单元用于接收客户端发送的清理请求。上述获取单元,具体用于从接收单元接收到的清理请求中获取第一区块的标识。相应的,上述获取单元,具体用于从第一区块的区块头中获取第一哈希值。本申请提供的节点还包括计算单元和生成单元,计算单元用于计算第二哈希值;生成单元用于生成映射关系。
在本申请的另一种可能的实现方式中,本申请提供的节点还包括接收单元、读取单元、计算单元和确定单元。接收单元,用于接收客户端发送的交易查询请求,交易查询请求包括第一区块的标识,交易查询请求用于请求查询第一区块中的交易数据;读取单元,用于根据接收单元接收到的交易请求中的第一区块的标识,读取第一区块;上述获取单元,还用于获取第一哈希值;计算单元,用于计算第二哈希值;确定单元,用于若第一哈希值与第二哈希值不同,确定存储有映射关系;读取单元,还用于读取第一区块中的交易数据。
第三方面,提供一种计算机设备,该计算机设备一个或多个处理器,以及一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器存储有计算机指令。当所述一个或多个处理器执行所述计算机指令时,使得所述计算机设备实现执行上述第一方面及其任意一种可能的实现方式所述的数据处理方法。
可选的,该节点还可以包括通信接口,该通信接口用于执行上述第一方面及其任意一种可能的实现方式所述的数据处理方法中收发数据、信令或信息的步骤。
该计算机设备可以是本申请中的第一节点,也可以是本申请中第一节点中的一部分装置,例如第一节点中的芯片系统。该芯片系统用于支持第一节点实现第一方面及 其任意一种可能的实现方式中所涉及的功能,例如,获取、删除上述数据处理方法中所涉及的数据和/或信息。该芯片系统包括芯片,也可以包括其他分立器件或电路结构。
第四方面,还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令;当指令在计算机上运行时,使得计算机执行如上述第一方面及其各种可能的实现方式所述的数据处理方法。
第五方面,还提供一种计算机程序产品,该计算机程序产品包括计算机指令,当计算机指令在计算机上运行时,使得计算机执行如上述第一方面及其各种可能的实现方式所述的数据处理方法。
需要说明的是,上述计算机指令可以全部或者部分存储在第一计算机存储介质上,其中,第一计算机存储介质可以与计算机设备的处理器封装在一起的,也可以与计算机设备的处理器单独封装,本申请对此不作限定。
本申请中第二方面、第三方面、第四方面、第五方面及其各种实现方式的描述,可以参考第一方面及其各种实现方式中的详细描述;并且,第二方面、第三方面、第四方面、第五方面及其各种实现方式的有益效果,可以参考第一方面及其各种实现方式中的有益效果分析,此处不再赘述。
第六方面,提供一种区块链系统,该区块链系统包括如第二方面及其各种实现方式任一种方式所提供的节点。
在本申请中,上述节点的名字对设备或功能模块本身不构成限定,在实际实现中,这些设备或功能模块可以以其他名称出现。只要各个设备或功能模块的功能和本申请类似,属于本申请权利要求及其等同技术的范围之内。
本申请的这些方面或其他方面在以下的描述中会更加简明易懂。
附图说明
图1A为可适用于本申请实施例提供的区块链系统的协议架构示意图;
图1B为可适用于本申请实施例提供的区块链系统的结构示意图;
图2A为本申请实施例中区块链系统中节点的功能示意图一;
图2B为本申请实施例中区块链系统中节点的功能示意图二;
图3为本申请实施例提供的一种数据处理方法的交互示意图;
图4为本申请实施例提供的另一种数据处理方法的交互示意图;
图5为本申请实施例中删除第一数据的区块的结构示意图一;
图6为本申请实施例中删除第一数据的区块的结构示意图二;
图7为本申请实施例提供的另一种数据处理方法的交互示意图;
图8为本申请实施例提供的另一种数据处理方法的交互示意图;
图9为本申请实施例提供的另一种数据处理方法的交互示意图;
图10为本申请实施例提供的另一种数据处理方法的交互示意图;
图11为本申请实施例提供的另一种数据处理方法的交互示意图;
图12为本申请实施例提供的另一种数据处理方法的交互示意图;
图13为本申请实施例提供的节点的结构示意图;
图14为本申请实施例提供的计算机设备的硬件结构示意图。
具体实施方式
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
为了便于理解本申请,现对本申请涉及到的相关要素进行描述。
区块链技术
区块链技术,也被称为分布式账本技术,是一种由若干台计算设备共同参与“记账”(即记录交易数据),共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化(即没有中心节点)、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。
区块链系统可包括多个区块链节点。区块链节点为具有通信功能以及存储功能的设备,如存储有区块链的设备。为了便于描述,本申请采用节点表示区块链节点。也就是说,本申请涉及到的节点均可用于表示区块链节点。
每一个节点既可接收信息,也可生成信息。不同的节点之间通过维护一个共同的区块链来保持通信。具体的,在区块链系统中,任一节点可以根据客户端发送的与交易相关的数据生成新的区块,并以广播的形式通知其他节点,其他节点可以对这个区块进行验证。当区块链系统中的所有节点达成共识后,新的区块就可以被添加到区块链中。
本申请中的节点可以理解为处理单元。在一种实现方式中,节点可以为物理设备,例如服务器或终端设备。在另一种实现方式中,节点可以为虚拟计算机;虚拟计算机为所有类型的虚拟化设备中软件虚拟出来的运行环境的统称,该概念包括虚拟机、容器。在其他实现方式中,节点可以为进程(process)或者线程(thread);线程是操作系统能够进行运算调度的最小单位,线程被包含在进程之中,是进程中的实际运作单位;进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位。
区块(block)
在区块链技术中,交易数据以电子记录的形式被永久储存下来,存放这些电子记录的文件我们称之为“区块”。
区块是按时间顺序一个个先后生成的,每一个区块记录有它在被创建期间发生的所有交易,所有区块汇总起来形成一个链式的记录合集。由于不同区块链系统中,节点的吞吐率不同,因此,在不同区块链系统中,区块的大小可能也不同。
可以看出,区块中记录有该区块生成时间段内的交易数据,因此,区块的主体实际上是交易数据的合集。每一种区块链的结构设计可能不完全相同,但区块通常包括区块头(header)和区块体(body)两部分。
其中,区块头主要用于记录当前区块的特征值,可以包括当前区块的标识(如区块的编号)、当前区块中区块体的哈希值、时间戳(用于表示该区块的生成时间)、交易数量(transaction count)和随机数(nonce)等信息中的至少一种信息,此外,区块头还可以包括前一区块的哈希值(具体为前一区块中区块头的哈希值)。
区块头包括有多个特征值,在确定该区块的哈希值时,需要将该区块头中的各个特征值按照顺序连接在一起,以组成一个字符串,再对这个字符串计算哈希值。由于不同区块的区块头所包括的特征值的数值通常不同,因此,每一区块均唯一对应一个哈希值。
基于每一区块均唯一对应一个哈希值,且每个区块的区块头均包括有前一区块的哈希值,这样,多个区块即可形成区块链。
区块体可以包括多个交易数据。对于每一交易数据而言,区块体还包括客户端的证书(用于说明交易的发起端)、背书节点的证书以及背书节点针对该交易的签名等信息。可选的,对于每一笔交易而言,区块体还可以包括排序节点(或称为共识节点)对该笔交易的签名。这里的签名均用于表示与该签名对应的设备对交易的鉴权,证书均用于表示身份。
上述签名和证书等数据均用于对交易数据的验证,这些数据通常占用区块体中70%的存储空间。
示例性的,表1示出了区块的一种结构形式。当然,区块的结构不仅仅局限于表1所示,且各个结构的取值也不仅仅局限于表1所示。
表1
Figure PCTCN2020096315-appb-000001
区块链的划分
目前,区块链按照部署方式可以分为:公有链、私有链、联盟链。
公有链是指全世界任何设备都可读取的区块链,或者是任何设备都能参与交易的共识验证过程的区块链。
私有链是指访问权限控制较为严格的区块链。
联盟链,也称共同体区块链(consortium blockchains),是指其共识过程受到预选节点控制的区块链。在联盟链中,只针对存储有该联盟链的节点开放全部或部分功能,联盟链中的各个节点可以基于需要定制读写权限、查询权限等。
对于联盟链而言,节点可以分为三种类型:背书节点、排序节点、记账节点。
“背书”可以理解为数字签名。相应的,本申请将能够完成“背书”的节点称为“背书节点”。背书节点是一个区块链系统中(如某一企业机构的区块链系统)中验证交易请求是否合法的节点,其他节点所存储的区块数据与该背书节点所存储的区块数据保持一致。也就是说,背书节点具备背书功能。
在一种实现方式中,背书节点在接收到客户端发送的交易请求后,判断该交易请求是否合法;当确定交易请求合法时,背书节点为该交易请求签名,即在交易请求中添加该背书节点的签名(或证书),并向客户端发送添加有该背书节点的签名(或证书)的交易请求。包含背书节点的签名(或证书)的消息用于表示该背书节点已经确定其合法。其中,背书节点向客户端发送的信息也可以称为背书结果。
可选的,在区块链系统中,背书节点可以为预先设定的某一/某些节点,也可以为运行过程中,区块链系统中的所有节点选举出的节点。
排序节点,也称为共识节点,是指对客户端发送的数据(如背书结果)进行共识,并在共识后将客户端发送的数据打包生成区块的节点。本申请将这一功能称为排序功能。
其中,这里的共识是指多个参与方(如排序节点)对一个交易是否提交到账本以及提交的顺序达成一致的过程。
在一种实现方式中,排序节点在接收到客户端发送的多个背书结果后,对接收到的多个背书结果所对应的多笔交易的排序进行共识流程,可以按照背书结果接收的时间先后顺序依次排列,也可以按照处理优先级从高到低的顺序依次排列;多个排序节点对多笔交易的排序达成共识之后,各个排序节点可将排序后的多个背书结果写入到新生成的区块中。在排序节点所处的区块链系统中,记账节点可从排序节点获取区块,保证了所有记账节点存储的区块的一致性。
记账节点是指存储“账本”的节点。
可选的,记账节点周期性地从排序节点中读取新的区块,并将读取到的区块中的数据存储到非易失性存储介质,或者,记账节点接收排序节点发送的区块,存储于非易失性存储介质。本申请将记账节点具备的功能称为记账功能。
一般的,具备背书功能的节点,也会具备记账功能。但具备记账功能的节点不一定具备背书功能。
在公有链和私有链中,客户端发送的交易请求需要被区块链系统中所有节点共识后才能写入到节点存储的区块链中。这里提到的共识包括所有节点对同一个交易请求进行验证以及对一个交易请求在区块中的顺序达成一致。例如,对于区块链系统中的任一个节点A,节点A接收到客户端发送的交易请求后,节点A验证该交易请求是否合法,若验证通过,节点A可向系统中其余节点广播消息,该消息可表示该交易请求得到节点A的验证,具体可包括节点A的签名。由此,系统中的每个节点可收到其余节点对于同一交易请求的验证结果。节点A将多笔交易打包生成区块后,向区块链系统中其他节点广播生成的区块。其他节点验证收到的区块中包含的多笔交易的顺序,最终实现区块链系统中多个节点对于同一笔交易在区块中的顺序的一致。
交易(transaction)数据
本申请涉及到的交易数据,是指用户通过任一节点创建,并需要最终发布至区块 链的分布式数据库中的一笔数据。
该交易数据存在狭义的交易数据以及广义的交易数据之分。
狭义的交易数据是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易数据可以是用户在区块链中发起的一笔转账的数据。
广义的交易数据是指用户向区块链发布的一笔任意的数据:例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些在线业务(比如,租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易数据可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求;又如,该交易数据还可以是用户向区块链发送的、用以更改用户的账户状态的数据(如账户余额等)。
因此,只要是用户向区块链的分布式数据库发布的任意数据,均可属于本申请所述的“交易数据”。
客户端(client)
用户可以通过区块链系统中的客户端实现创建链码,发起交易等功能。客户端可以部署在任意的电子设备上,通过区块链系统相应的软件开发工具包(software development kit,SDK)实现。该电子设备通过与区块链网络中的节点进行通信,从而实现客户端相应的功能。
区块链系统中的每一节点均可存储有区块链的数据。在区块链系统的运行期间,会持续不断的生成新的区块,这样,每个节点存储的区块的数量越来越多,节点的存储压力会越来越大。
为此,本申请提供一种数据处理方法、节点及区块链系统。具体的,在客户端发送的清理请求(用于请求清理第一区块的数据)获得区块链系统中多个节点的共识的场景中,区块链系统中的第一节点清理该节点中第一区块的数据,有效地减少了区块占用的存储空间,降低了存储压力。
其中,本申请提供的方案中的“清理第一区块的数据”是指删除第一区块中的第一数据,该第一数据用于表示区块链系统中多个节点对该第一区块中交易数据的验证,这样,在后续读取清理后的第一区块的交易数据时,可快速、方便的读取到该区块,而且能够直接读取到该区块中的交易数据,无需解压缩等操作,访问速度较快。本申请各个实施例中提到的第一区块为已经记录在区块链中的区块;可选的,区块链中生成时间大于第一阈值的区块作为第一区块;可选的,区块链中被查询频率或查询次数低于第二阈值的区块作为第一区块。
本申请实施例提供的区块链系统的架构可以包括协议层、扩展层和应用层。其中,协议层又可以分为存储层和网络层。图1A示出了本申请实施例提供的区块链系统的三层架构。现在结合图1A对区块链系统的协议架构进行描述。
协议层提供区块链系统的底层能力,维护着节点,一般提供应用程序编程接口(application programming interface,API)供调用。协议层构建了区块链系统的网络环境,并搭建了交易通道,制定了节点共识机制。从技术上讲,协议层主要包括网络编程、分布式算法、加密签名和数据存储等方面。
进一步地,从功能和技术上可以将协议层分为网络层和存储层。
存储层描述了区块链数据的存储形式。具体的,存储层可以包括区块数据的链式存储技术,包括时间戳技术、哈希校验技术等;还可以包含数据库的实现方式,以及节点调用数据库的接口实现。
网络层用于实现区块链网络中节点之间的信息交流。区块链系统本质上是一个点对点(peer to peer,P2P)的网络系统。每一个节点既接收信息,也生成信息。节点之间通过维护一个共同的区块链来保持通信。在区块链系统,节点可以创造新的区块,在新区块被创造后会以广播的形式通知其他节点,其他节点会对这个区块进行验证,当区块链系统中的所有节点达成共识后,新区块就可以被添加到区块链上。
在协议层之上是扩展层,扩展层提供了基于协议层的该区块链系统的功能实现。通过协议层提供的基础能力,扩展层可以实现各类脚本代码、算法机制以及应用机制。例如,智能合约即是扩展层的一种典型应用,节点通过部署的智能合约,实现达到某个条件后自动执行合约。又例如,虚拟货币的交易市场通过脚本封装规定了虚拟货币的交易方式以及过程中的实现细节,这也是在扩展层实现的。
扩展层之上是应用层,应用层封装了区块链的各种应用场景和案例。应用层的实现与用户直接交互的区块链功能,大多采用客户端的形式实现。
在不同的区块链系统中,区块链系统的每层架构的具体实现方式可能存在差异,图1A是区块链系统的一种协议架构示意图,并不是对区块链系统的协议架构的限定。
本申请实施例提供的区块链系统包括客户端和至少两个节点。图1B给出了本申请实施例中区块链系统的一种结构示意图。图1B示出的区块链系统具备有图1A示出的协议架构。
如图1B所示,该区块链系统包括客户端10和多个节点11,多个节点11中的一个或多个节点11与客户端10连接。
图1B示出的区块链系统可以为多个企业机构提供数据存储服务,以及数据查询服务。可以理解的是,图1B所示的区块链系统仅为一个示例,并不是对本申请实施例提供的区块链系统的限定。
客户端10可以通过与其连接的节点11将交易数据上传到区块链中,该交易数据可以为企业中的任一数据,如企业的流水数据,也可以通过与其连接的节点11查询区块链中某一/某些区块的数据。
例如:当客户端10需要查询与该客户端对应的企业的流水数据时,该客户端可以向与其连接的某一节点11发起查询请求;在区块链系统中所有节点共识查询请求的情况下,该节点11为客户端提供与该客户端对应的企业的流水数据。
节点11可以是区块链系统中提供输入输出(input/output,IO)处理能力的设备。
每一节点11存储有区块链,且区块链系统中的所有节点11可存储有相同的区块链(如图1B示出的区块链,该区块链包括多个区块),该区块链可以为联盟链/公有链/私有链。节点11对区块链进行操作(如添加区块、删除区块等)。
节点11可以具备一种或多种功能,如背书功能、排序功能或记账功能中的至少一种。图1B示出的区块链系统中,不同的节点11可以具备不同的功能。
在一个示例中,如图2A所示,区块链系统中的节点21具备背书功能和记账功能,节点22具备排序功能,节点23具备记账功能。
在另一个示例中,如图2B所示,区块链系统中的节点21具备背书功能、排序功能和记账功能,节点22具备排序功能和记账功能,节点23具备记账功能。
图2A和图2B均为节点的功能示意图,并不是对节点的功能的限定。
当然,在实际应用中,还可根据节点的实际功能划分出其他功能模块,本申请实施例对此不作具体限定。
若上述某一节点11具备记账功能,则该节点11可以用于:在客户端10发送的清理请求(用于请求清理第一区块的数据)获得区块链系统中多个节点的共识之后,从区块链系统中具备排序功能的节点(简称为排序节点)获取第一区块的标识,并根据第一区块的标识,删除该节点11中第一区块中的第一数据(用于表示区块链系统中多个节点对第一区块中交易数据的验证)。
进一步地,该节点11还用于:获取映射关系,并存储该映射关系。该映射关系包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系。第一哈希值为第一区块中区块体的哈希值,第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值。
进一步地,该节点11还用于:接收客户端10发送的包括第一区块的标识的交易查询请求,并根据第一区块的标识,读取第一区块;以及获取第一哈希值(第一的区块头中存储的区块体的哈希值),并计算第二哈希值(第一区块中区块体的哈希值),进而判断第一哈希值与第二哈希值是否相同;若第一哈希值与第二哈希值不同,则判断是否存储有映射关系(包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系);在确定存储有映射关系后读取第一区块中的交易数据。
若上述某一节点11具备排序功能,则该节点11可以用于:接收客户端10发送的背书结果,从该背书结果中获取第一区块的标识,以及根据第一区块的标识,删除该节点11中第一区块中的第一数据。
其中,背书结果为区块链系统中具备背书功能的节点(简称为背书节点)对客户端发送的清理请求的验证结果,清理请求用于请求清理第一区块的数据。背书结果包括第一区块的标识和映射关系,映射关系包括第一区块的标识、第一哈希值(参考上述对第一哈希值的描述)和第二哈希值(参考上述对第二哈希值的描述)三者之间的对应关系。
进一步地,该节点11还用于:向区块链系统中具备记账功能的节点(简称为记账节点)发送第一区块的标识和映射关系。
若上述某一节点11具备背书功能,则该节点11可以用于:接收客户端发送的包括第一区块的清理请求;确定清理请求合法,并生成映射关系(可以参考上述描述),以及向客户端发送该映射关系。
以下对本申请实施例提供的数据处理方法进行说明。
为了便于理解,本申请实施例采用记账节点、排序节点、背书节点的通信过程描述本申请实施例提供的数据处理方法。
需要说明的是,记账节点、排序节点和背书节点可以为不同的设备,也可以为同一设备,还可以部分集成于同一设备(如记账节点和背书节点为同一设备)。
这里先以记账节点、排序节点和背书节点为不同的设备为例进行说明。
图3为本申请实施例提供的一种数据处理方法的一种交互示意图。区块链系统中包括记账节点、排序节点和背书节点,如图3所示,本申请实施例提供的数据处理方法包括:
S300、客户端向背书节点发送清理请求,请求清理第一区块的数据。
其中,背书节点可以为预先设定的,也可以为运行过程中,区块链系统中的所有节点选举出的节点。
在区块链系统的运行期间,区块的数量在不断的增长。管理员可根据实际需求,通过客户端请求清理某些区块(即第一区块,如长时间未被访问的区块或生成时间较长的区块)的数据。具体的,客户端向背书节点发送清理请求,该清理请求包括第一区块的标识(如编号),用于请求清理第一区块的数据。
容易理解的是,这里的第一区块为区块链中已经存在的区块,这样,后续过程中才可以清理第一区块的数据。
S301、背书节点确定清理请求是否合法。
在一种实现方式中,背书节点根据第一区块的标识,检查背书节点已经存储的区块中是否包括第一区块。若存在,则说明该清理请求合法;若不存在,则说明该清理请求不合法。
在清理请求合法的情况下,S301后继续执行S302。若清理请求不合法,则背书节点向客户端发送用于表示清理请求非法的消息。
S302、背书节点向客户端发送响应消息。
该响应消息还可以称为背书结果,表示背书节点对清理请求的验证结果。
在一种实现方式中,背书节点生成并存储映射关系,该响应消息中包括映射关系。
其中,映射关系包括第一区块的标识,以及均与第一区块的标识对应的第一哈希值和第二哈希值,该第一哈希值为第一区块中区块体的哈希值,该第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值,第一数据用于表示区块链系统中多个节点对第一区块中交易数据的验证。
也就是说,映射关系包括第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系。
示例性的,结合上述对区块中区块体的描述以及表1可知,第一数据可以包括背书节点的签名、背书节点的证书、客户端的证书等。
在一种实现方式中,背书节点生成并存储映射关系的方法为:首先,背书节点根据第一区块的标识,将第一区块从背书节点的非易失性存储介质中读取到背书节点的易失性存储介质(如内存)中;背书节点保留该第一区块的区块头(该区块头包括第一区块中区块体的哈希值,即第一哈希值),并在易失性存储介质中删除第一区块的区块体中的第一数据,然后,背书节点计算第二哈希值,最后,背书节点生成映射关系,并将该映射关系存储于非易失性存储介质中。
在另一种实现方式中,背书节点生成并存储映射关系的方法为:背书节点根据第一区块的标识,将第一区块从背书节点的非易失性存储介质中读取到背书节点的易失性存储介质(如内存)中;背书节点从第一区块的区块头中读取第一哈希值,并从第一区块的区块体中读取所有交易数据,以及计算读取到的所有交易数据的哈希值(即 第二哈希值),最后,背书节点生成映射关系,并将该映射关系存储于非易失性存储介质中。
在生成映射关系后,背书节点向客户端发送包括映射关系的响应消息,用于表示背书节点确定清理请求合法。
在一种实现方式中,上述响应消息还包括背书节点的签名。
其中,背书节点的签名为背书节点通过私钥进行加密的,该签名无法篡改,准确性和可靠性获得了保证。该背书节点的签名用于表示该清理请求得到背书节点的验证。
在其他实现方式中,背书节点在确定清理请求合法的情况下,也可以直接向客户端发送包括背书节点的签名的响应消息。
S303、客户端向排序节点发送第一消息,用于表示客户端发送的清理请求合法。
客户端在接收到背书节点发送的响应消息后,获知记账节点已经确定该清理请求合法。之后,该客户端即可与排序节点通信。客户端向排序节点发送包括背书结果的第一消息,其中,第一消息用于表示清理请求得到背书节点的验证,背书结果可以包括第一区块的标识和映射关系中的至少一个。
可选的,S304、排序节点根据第一消息,删除排序节点第一区块中的第一数据,并存储背书结果。
排序节点接收到第一消息,即接收到了清理请求的背书结果,排序节点可以对背书结果进行验证,验证背书结果是否合法。
在区块链系统中可能有多个排序节点,任一个排序节点在接收到背书结果后,可以与区块链系统中的其他的排序节点对背书结果进行共识,并存储背书结果。对背书结果进行共识也可以看做是对清理请求进行共识,具体的共识流程可以包括:排序节点A(区块链系统中的任一个排序节点)向其余排序节点广播背书结果,并接收其余排序节点对背书结果的验证结果。其中,排序节点可以采用现有技术中的任意一种共识算法(如基于彩票中奖的算法(Lottery-based Algorithm)、基于投票计数的算法(Voting-based Algorithm))与区块链系统中的其他节点共识背书结果,本申请实施例对此不作限定。
背书结果得到多个排序节点的共识后,排序节点可以将背书结果单独打包为一个区块,这样,即可生成包括背书结果的区块。其中,背书结果可以置于该区块的区块体中,也可以置于该区块的区块头中,本申请实施例对此不作限定。
可选的,排序节点还为包括背书结果的区块分配清理标识,该清理标识用于与包括多笔交易数据的正常区块区分,清理标识用于指示清理第一区块的第一数据。
可选的,在共识清理请求后,排序节点还删除排序节点中第一区块中的第一数据。
排序节点可以采用下述实现方式删除第一区块中的第一数据。
在一种实现方式中,排序节点删除该排序节点的非易失性存储介质中存储的第一区块中的第一数据。
在另一种实现方式中,排序节点将第一区块从非易失性存储介质中读取至易失性存储介质(例如内存)中,并删除易失性存储介质中第一区块中的第一数据,以及删除非易失性存储介质中的第一区块的所有数据,之后,排序节点将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中。
当然,排序节点还可以采用其他方式删除第一区块中的第一数据,这里对此不再一一赘述。
可选的,排序节点将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中的方式为:排序节点将非易失性存储介质中的第一区块替换为删除第一数据后的第一区块,或者删除非易失性存储介质中的第一区块,并在非易失性存储介质中重新划分存储空间,以及在新划分的存储空间存储删除第一数据后的第一区块。
示例性的,若第一区块如上述表1所示,则排序节点删除第一区块中的第一数据后,生成的删除第一数据后的第一区块如表2所示。
表2
Figure PCTCN2020096315-appb-000002
S305、记账节点从排序节点获取第一区块的标识。
在一种实现方式中,记账节点向排序节点发送获取请求,请求获取排序节点在预设时间段内存储的信息;相应的,排序节点向记账节点发送背书结果,这样,记账节点即可从背书结果中获取第一区块的标识。
在另一种实现方式中,排序节点在共识清理请求后或者在存储背书结果后,向记账节点发送背书结果,这样,记账节点即可从背书结果中获取到第一区块的标识。
也就是说,S305可替换为S305'(图3中未示出)。
S305'、排序节点向记账节点发送背书结果。
可选的,S306、记账节点根据第一区块的标识,删除记账节点中第一区块中的第一数据。
记账节点可以采用下述实现方式删除第一区块中的第一数据。
在一种实现方式中,记账节点删除该排序节点的非易失性存储介质中存储的第一区块中的第一数据。
在另一种实现方式中,记账节点将第一区块从非易失性存储介质中读取至易失性存储介质(例如内存)中,并删除易失性存储介质中第一区块中的第一数据,以及删除非易失性存储介质中的第一区块的所有数据,之后,记账节点将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中。
可选的,记账节点将非易失性存储介质中的第一区块替换为删除第一数据后的第一区块,或者删除非易失性存储介质中的第一区块,并在非易失性存储介质中重新划分存储空间,以及在新划分的存储空间存储删除第一数据后的第一区块。
需要说明的是,由于具备背书功能的节点也可具备记账功能,因此,背书节点也会删除该背书节点中第一区块中的第一数据。其中,背书节点删除第一区块中的第一数据的过程可以参考S304或S306的描述,这里不再进行详细赘述。
综上,区块链系统中的节点均可删除第一区块中的第一数据,由于第一数据用于对交易数据的验证,通常占用区块体中70%的存储空间,因此,节点删除第一数据,能够有效地减少区块占用的存储空间,降低了存储压力。
从上述表2可以看出,对于删除第一数据后的第一区块,区块头包括第一区块的区块体的哈希值,而与该区块头对应的区块体中的数据已经不是原来第一区块的区块体中的数据,这样,该哈希值与删除第一数据后的第一区块的区块体的哈希值不相同。
进一步可选的,为了后续便于数据的查询,以及确定该删除第一数据后的第一区块中的交易数据未发生错误,记账节点也需要存储映射关系。
结合上述图3,如图4所示,本申请实施例提供的数据处理方法还包括S400。
S400、记账节点存储映射关系。
若上述第一消息中的背书结果包括映射关系,则记账节点在获取到背书结果后,即可存储该映射关系。若背书结果未包括映射关系,则记账节点生成并存储该映射关系。
其中,记账节点生成映射关系的方法为:记账节点从第一区块的区块头中获取第一哈希值,并计算第二哈希值,这样,记账节点即可根据第一哈希值、第二哈希值以及第一区块的标识,生成映射关系。
具体的,若背书结果包括映射关系,则记账节点在非易失性存储介质中重新分配存储空间,并在该存储空间存储包括映射关系的区块。
示例性的,如图5所示,记账节点中已经存储有区块N-1、区块N以及区块N+1,若第一区块为区块N,且区块N的区块头中的哈希值为y,记账节点删除区块N中的第一数据,以生成区块N',区块N'中区块体的哈希值为K,之后,记账节点将区块N替换为区块N'(或者记账节点删除区块N,并存储区块N')。此外,记账节点重新划分存储空间,存储包括映射关系的区块N+2,该映射关系为区块N的标识、哈希值y以及哈希值K的对应关系。
若背书结果未包括映射关系,则记账节点在非易失性存储介质中重新分配存储空间,并在该存储空间存储包括映射关系的区块(如图5所示);也可以将映射关系存储于删除第一数据后的第一区块中。
示例性的,如图6所示,记账节点中已经存储有区块N-1、区块N以及区块N+1,若第一区块为区块N,且区块N的区块头中的哈希值为y,记账节点删除区块N中的第一数据,以生成区块N',区块N'中区块体的哈希值为K,之后,记账节点将区块N替换为区块N'(或者记账节点删除区块N,并存储区块N')。此外,记账节点将映射关系存储于区块N'中。该映射关系为区块N的标识、哈希值y以及哈希值K的对应关系。
本申请实施例提供的数据处理方法中,背书节点在确定清理请求合法的情况下,也可以直接向客户端发送包括背书节点的签名的响应消息。这种场景中,排序节点获取到的背书结果为第一区块的标识。相应的,记账节点还需生成并存储映射关系。下 面对这一流程进行说明。
图7示出了本申请实施例提供的一种数据处理方法的另一种交互示意图。如图7所示,本申请实施例提供的数据处理方法包括:
S700、客户端向背书节点发送清理请求,请求清理第一区块的数据。
S700可以参考上述S300的描述,这里不再赘述。
S701、背书节点确定清理请求是否合法。
背书节点确定清理请求是否合法的方法可以参考上述S301的描述,这里不再赘述。
在清理请求合法的情况下,S701后继续执行S702。若清理请求不合法,则背书节点向客户端发送用于表示清理请求非法的消息。
S702、背书节点向客户端发送包括该背书节点的签名的响应消息。
其中,背书节点的签名为背书节点通过私钥进行加密的,该签名无法篡改,准确性和可靠性获得了保证。该背书节点的签名用于表示该清理请求得到背书节点的验证。
可选的,背书节点在确定清理请求合法的情况下,也可以直接向客户端发送包括背书节点的签名的响应消息。
S703、客户端向排序节点发送第一消息,用于表示客户端发送的清理请求合法。
该第一消息包括第一区块的标识,并不包括映射关系。
S704、排序节点根据第一消息,删除第一区块中的第一数据,并存储第一区块的标识。
S704可以参考上述S304的描述。不同的是,在S704中,排序节点接收到的第一消息包括的是第一区块的标识,并不包括映射关系,因此这里的排序节点存储第一区块的标识。
S705、记账节点从排序节点获取第一区块的标识。
在一种实现方式中,记账节点向排序节点发送获取请求,请求获取排序节点在预设时间段内存储的信息;相应的,排序节点向记账节点发送第一区块的标识,这样,记账节点即可获取到第一区块的标识。
在另一种实现方式中,排序节点在共识清理请求后或者在存储背书结果后,向记账节点发送第一区块的标识,这样,记账节点即可获取到第一区块的标识。
也就是说,S705可替换为S305'(图3中未示出)。
S705'、排序节点向记账节点发送第一区块的标识。
S706、记账节点根据第一区块的标识,删除记账节点中第一区块中的第一数据。
S706可以参考上述S306的描述,这里不再赘述。
需要说明的是,由于具备背书功能的节点也具备记账功能,因此,背书节点也会删除该背书节点中第一区块中的第一数据。
综上,图7示出的流程中,区块链系统中的节点均可删除第一区块中的第一数据,由于第一数据用于对交易数据的验证,通常占用区块体中70%的存储空间,因此,节点删除第一数据,能够有效地减少区块占用的存储空间,降低了存储压力。
进一步可选的,记账节点还需要存储映射关系。
结合上述图7,如图8所示,本申请实施例提供的数据处理方法还包括S707~S709。
S707、记账节点从第一区块的区块头中获取第一哈希值。
其中,第一哈希值为第一区块中区块体的哈希值。
S708、记账节点计算第二哈希值。
第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值。
S709、记账节点生成并存储映射关系。
映射关系包括第一区块的标识,以及均与第一区块的标识对应的第一哈希值和第二哈希值。
可选的,记账节点在非易失性存储介质中重新分配存储空间,并在该存储空间存储包括映射关系的区块(如图5所示);也可以将映射关系存储于删除第一数据后的第一区块中(如图6所示)。
在上述方法流程中,记账节点、排序节点和背书节点为不同的设备。本申请实施例中的记账节点、排序节点和背书节点也可以为同一设备。
下面以记账节点、排序节点和背书节点为同一设备,该设备为节点A为例进行说明。
图9为本申请实施例提供的一种数据处理方法的另一种交互示意图。如图9所示,本申请实施例提供的数据处理方法包括:
S900、客户端向节点A发送清理请求,请求清理第一区块的数据。
其中,节点A可以为预先设定的,也可以为运行过程中,区块链系统中的所有节点选举出的节点。
在区块链系统的运行期间,区块的数量在不断的增长。管理员可根据实际需求,通过客户端请求清理某些区块(即第一区块,如长时间未被访问的区块或生成时间较长的区块)的数据。具体的,客户端向节点A发送清理请求,该清理请求包括第一区块的标识(如编号),用于请求清理第一区块的数据。
容易理解的是,这里的第一区块为区块链中已经存在的区块,这样,后续过程中才可以清理第一区块的数据。
可选的,S901、节点A确定清理请求是否合法。
具体的,节点A根据第一区块的标识,检查已经存储的区块中是否包括第一区块。若存在,则说明该清理请求合法;若不存在,则说明该清理请求不合法。
在清理请求合法的情况下,S901后继续执行S902。若清理请求不合法,则节点A向客户端发送用于表示清理请求非法的消息。
S902、节点A删除该节点A中第一区块中的第一数据。
可选的,节点A确定清理请求合法后,区块链系统中的其他节点对清理请求进行共识。
其中,节点A可以采用现有技术中的任意一种共识算法(如基于彩票中奖的算法(Lottery-based Algorithm)、基于投票计数的算法(Voting-based Algorithm))与区块链系统中的其他节点共识清理请求,本申请实施例对此不作限定。
在共识清理请求后,节点A删除该节点A中第一区块中的第一数据。
其中,节点A可以采用下述实现方式删除第一区块中的第一数据。
在一种实现方式中,节点A删除该节点A的非易失性存储介质中存储的第一区块中的第一数据。
在另一种实现方式中,节点A将第一区块从非易失性存储介质中读取至易失性存储介质(例如内存)中,并删除易失性存储介质中第一区块中的第一数据,以及删除非易失性存储介质中的第一区块的所有数据,之后,节点A将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中。
当然,节点A还可以采用其他方式删除第一区块中的第一数据,这里对此不再一一赘述。
可选的,节点A将易失性存储介质中删除第一数据后的第一区块存储在非易失性存储介质中的方式为:节点A将非易失性存储介质中的第一区块替换为删除第一数据后的第一区块,或者删除非易失性存储介质中的第一区块,并在非易失性存储介质中重新划分存储空间,以及在新划分的存储空间存储删除第一数据后的第一区块。
节点A删除第一数据,能够有效地减少区块占用的存储空间,降低了存储压力。
进一步可选的,节点A在确定清理请求合法后,还生成并存储映射关系。结合上述图9,如图10所示,本申请实施例提供的数据处理方法还包括S1000。
S1000、节点A生成并存储映射关系。
其中,映射关系包括第一区块的标识,以及均与第一区块的标识对应的第一哈希值和第二哈希值,该第一哈希值为第一区块中区块体的哈希值,该第二哈希值为第一区块的区块体中除第一数据之外其他数据的哈希值,第一数据用于表示对第一区块中交易数据的验证。
示例性的,结合上述对区块中区块体的描述以及表1可知,第一数据可以包括背书节点的签名、背书节点的证书、客户端的证书等。
在一种实现方式中,节点A生成并存储映射关系的方法为:首先,节点A根据第一区块的标识,将第一区块从节点A的非易失性存储介质中读取到节点A的易失性存储介质(如内存)中;节点A保留该第一区块的区块头(该区块头包括第一区块中区块体的哈希值,即第一哈希值),并在易失性存储介质中删除第一区块的区块体中的第一数据,然后,节点A计算第二哈希值,最后,节点A生成映射关系,并将该映射关系存储于非易失性存储介质中。
在另一种实现方式中,节点A生成映射关系的方法为:节点A根据第一区块的标识,将第一区块从节点A的非易失性存储介质中读取到节点A的易失性存储介质(如内存)中;节点A从第一区块的区块头中读取第一哈希值,并从第一区块的区块体中读取所有交易数据,以及计算读取到的所有交易数据的哈希值(即第二哈希值),最后,节点A生成映射关系,并将该映射关系存储于非易失性存储介质中。
可选的,节点A在非易失性存储介质中重新分配存储空间,并在该存储空间存储包括映射关系的区块(如图5所示);也可以将映射关系存储于删除第一数据后的第一区块中(如图6所示)。
其中,节点A可以在S902之前执行S1000,也可以在S902之后执行S1000,还可以同时执行S902和S1000,本申请实施例对此不作限定。
在实际应用中,区块链系统往往包括多个子系统,每个子系统均包括具备背书功能的节点。在这种场景中,节点A在确定清理请求合法后,还向客户端发送用于指示清理请求合法的响应消息。后续,客户端在确定清理请求在各个子系统中均合法后, 向节点A发送第一消息,以便于节点A根据第一消息,删除第一区块中的第一数据。
区块链系统中的节点存储有区块链,区块链包括多个区块,每一区块存储有多个交易数据,这样,用户可以根据实际需要通过客户端读取某个/某些区块中的交易数据。
现在对客户端请求读取区块的交易数据进行说明。
容易理解的是,由于记账节点用于存储账本,因此,不论记账节点、排序节点和背书节点是否为同一设备,客户端在读取区块的交易数据时,直接与具备记账功能的节点通信,以获取交易数据。
为了便于描述,以具备记账功能的节点为节点B,节点B请求读取区块1中的交易数据为例进行说明。
图11为本申请实施例提供的一种数据处理方法的另一交互示意图。如图11所示,本申请实施例提供的数据处理方法包括:
S1100、客户端向节点B发送交易查询请求。
该交易查询请求包括区块1的标识,请求查询区块1中的交易数据。该区块1可以为区块链中的任意一个区块,如上述第一区块。
S1101、节点B根据区块1的标识,读取区块1。
S1102、节点B获取哈希值1,并计算哈希值2。
哈希值1(可对应本申请实施例中的第一哈希值)为区块1的区块头中存储的区块体的哈希值,哈希值2(可对应本申请实施例中的第二哈希值)为区块1中区块体的哈希值。
S1103、节点B判断哈希值1与哈希值2是否相同。
结合上面描述可以理解的是,若哈希值1与哈希值2相同,则说明该区块1不是删除第一数据后的区块,这样,节点B可直接从区块1的区块体中获取交易数据。若哈希值1与哈希值2不同,则说明该区块1可能为删除第一数据后的区块。
为了进一步确定区块1是否为删除第一数据后的区块,节点B需要确定是否存在哈希值1、哈希值2和区块1的标识的对应关系。
S1104、若哈希值1与哈希值2不同,节点B判断是否存储有映射关系。
该映射关系包括区块1的标识、哈希值1和哈希值2三者之间的对应关系。
S1105、若节点B存储有上述映射关系,节点B读取区块1中的交易数据,并向客户端发送读取到的交易数据。
本申请实施例提供的数据处理方法,还包括哈希值1与哈希值2相同的情况,以及节点B未存储上述映射关系的情况。
结合上述图11,如图12所示,本申请实施例提供的数据处理方法还包括:
S1200、若节点B未存储有上述映射关系,节点B确定区块1中的交易数据发生错误。
S1201、若哈希值1与哈希值2相同,节点B读取区块1中的交易数据,并向客户端发送读取到的交易数据。
进一步可选的,节点B在确定区块1中的交易数据发生错误后,还向客户端发送用于表示数据发生错误的消息,即在S1200后还包括S1202。
S1202、节点B向客户端发送用于表示数据发生错误的消息。
由于本申请实施例中的节点将删除第一数据后的区块存储于非易失性存储介质,这样,在后续读取删除第一数据后的区块时,可快速、方便的读取到该区块,而且能够直接读取到该区块中的交易数据,无需解压缩等操作,访问速度较快。
上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对节点进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。可选的,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
图13示出了一种节点130的组成示意图,该节点130可以为上述背书节点、排序节点或记账节点,也可以为上述节点A或节点B,可以用于执行上述实施例中涉及的节点的功能。作为一种可实现方式,图13所示节点130包括:获取单元131和删除单元132。
获取单元131用于支持该节点130执行上述图3、图4、图7~图12中任一附图所示的获取等操作,例如:S305,S705,S707,和/或用于本文所描述的技术的其它过程。
删除单元132用于支持该节点130执行上述图3、图4、图7~图12中任一附图所示的删除等操作,例如:S306,S706,S902,S304,S704,和/或用于本文所描述的技术的其它过程。
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
当然,本申请实施例提供的节点130包括但不限于上述模块,例如节点130还可以包括存储单元133、接收单元134、读取单元135、计算单元136、确定单元137和生成单元138。
存储单元133可以用于存储该节点130的程序代码,还可以用于存储节点130在运行过程中生成的数据,如映射关系等。
接收单元134用于支持节点130执行上述图3、图4、图7~图12中任一附图所示的接收操作,如接收背书结果、清理请求等,S300,S700,S303,S703,和/或用于本文所描述的技术的其它过程。
读取单元135用于支持节点130执行上述图3、图4、图7~图12中任一附图所示的读取操作,如读取第一区块。
计算单元136用于支持节点130执行上述图3、图4、图7~图12中任一附图所示的计算等操作,例如:S708,S1102,和/或用于本文所描述的技术的其它过程。
确定单元137用于支持节点130执行上述图3、图4、图7~图12中任一附图所示 的确定、判断等操作,例如:S301,S701,S1103,和/或用于本文所描述的技术的其它过程。
生成单元138用于支持该数据处理装置130执行上述图3、图4、图7~图12中任一附图所示的生成等操作,例如:S302,S702,和/或用于本文所描述的技术的其它过程。
可选的,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。本申请实施例提供的节点,用于执行上述数据处理方法中背书节点、排序节点、记账节点、节点A或节点B的功能,因此可以达到与上述数据处理方法相同的效果。
上述节点130可以具备图14示出的硬件结构。图14为本申请实施例提供的一种计算机设备的硬件结构示意图,该计算机设备可以用于实现本申请实施例提供的数据处理方法。
该计算机设备可以是本申请中的第一节点(上述背书节点、排序节点、记账节点、节点A或节点B),也可以是本申请中第一节点中的一部分装置,例如第一节点中的芯片系统。该芯片系统用于支持第一节点实现本申请实施例提供的数据处理方法。该芯片系统包括芯片,也可以包括其他分立器件或电路结构。
如图14所示,该计算机设备可以包括处理器141,存储器142、通信接口143、通信总线144。处理器141,存储器142以及通信接口143三者之间可以通过通信总线144连接。下面结合图14对数据处理装置的各个构成部件进行介绍:
在本申请实施例中,处理器141是数据处理装置的控制中心,可以是一个处理器,也可以是多个处理元件的统称。例如,处理器141是一个中央处理器(central processing unit,CPU),也可以是特定集成电路(application-specific integrated circuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路,例如:一个或多个数字信号处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field-programmable gate array,FPGA)。
其中,处理器141可以通过运行或执行存储在存储器142内的软件程序,以及调用存储在存储器142内的数据,执行数据处理装置的各种功能。
作为一种实施例,处理器141可以包括一个或多个CPU,例如图14中所示的CPU 0和CPU 1。
作为一种实施例,数据处理装置还可以包括其他处理器,例如图14中所示的处理器145,处理器145包括ASIC 0。数据处理装置中的多个处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
在本申请实施例中,存储器142可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形 式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
一种可能的实现方式中,存储器142可以独立于处理器141存在,即存储器142可以为处理器141外部的存储器,此时,存储器142可以通过通信总线144与处理器141相连接,用于存储指令或者程序代码。处理器141调用并执行存储器142中存储的指令或程序代码时,能够实现本申请下述实施例提供的数据处理方法。
另一种可能的实现方式中,存储器142也可以和处理器141集成在一起,即存储器142可以为处理器141的内部存储器,例如,该存储器142为高速缓存,可以用于暂存一些数据和/或指令信息等。
在本申请实施例中,通信接口143,用于使用任何收发器一类的装置,与其他设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area networks,WLAN)等。通信接口143可以包括接收单元实现接收功能,以及发送单元实现发送功能。
在本申请实施例中,通信总线144,可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图14中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
需要指出的是,图14中示出的设备结构并不构成对该数据处理装置的限定,除图14所示部件之外,该数据处理装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
上述获取单元131和接收单元134可以是图14中的通信接口143,删除单元132、读取单元135、计算单元136、确定单元137和生成单元138可以是图14中的处理器141,存储单元133可以是图14中的存储器142。
本申请另一实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当指令在上述至少一个处理器上运行时,该至少一个处理器执行上述方法实施例所示的方法流程中背书节点、排序节点、记账节点、节点A或节点B执行的各个步骤。
在本申请的另一实施例中,还提供一种计算机程序产品,该计算机程序产品包括计算机指令,当上述至少一个处理器执行该计算机指令时,至少一个处理器执行上述方法实施例所示的方法流程中背书节点、排序节点、记账节点、节点A或节点B执行的各个步骤。
在上述实施例中,可以全部或部分的通过软件,硬件,固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式出现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。
计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、区块链节点或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber  Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、区块链节点或数据中心传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的区块链节点、数据中心等数据终端。该可用介质可以是磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,数字多功能影音光盘Digital Versatile Disc DVD)或者半导体介质(例如固态硬盘solid state disk(SSD))等。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (17)

  1. 一种数据处理方法,其特征在于,所述数据处理方法应用于区块链系统,所述区块链系统包括第一节点,所述第一节点中存储有多个区块,所述数据处理方法包括:
    在客户端发送的清理请求获得所述区块链系统中多个节点的共识之后,所述第一节点获取第一区块的标识,所述清理请求用于请求清理所述第一区块的数据,所述清理请求包括所述第一区块的标识;
    所述第一节点根据所述第一区块的标识,删除所述第一节点中所述第一区块中的第一数据,所述第一数据用于表示所述多个节点对所述第一区块中交易数据的验证。
  2. 根据权利要求1所述的数据处理方法,其特征在于,所述数据处理方法还包括:
    所述第一节点获取映射关系,所述映射关系包括所述第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系,所述第一哈希值为所述第一区块中区块体的哈希值,所述第二哈希值为所述第一区块的区块体中除第一数据之外其他数据的哈希值;
    所述第一节点存储所述映射关系。
  3. 根据权利要求2所述的数据处理方法,其特征在于,所述第一节点为记账节点,所述区块链系统还包括排序节点和背书节点;
    所述第一节点获取第一区块的标识,包括:
    所述第一节点从所述排序节点获取所述第一区块的标识,所述第一区块的标识包括于所述客户端发送给所述排序节点的背书结果中,所述背书结果为所述背书节点对所述客户端发送的所述清理请求的验证结果;
    相应的,所述第一节点获取映射关系,包括:
    所述第一节点从所述排序节点获取所述映射关系,所述背书结果还包括所述映射关系。
  4. 根据权利要求2所述的数据处理方法,其特征在于,所述第一节点为背书节点;
    所述第一节点获取第一区块的标识,包括:
    所述第一节点接收所述客户端发送的所述清理请求;
    所述第一节点从所述清理请求中获取所述第一区块的标识;
    相应的,所述第一节点获取映射关系,包括:
    所述第一节点从所述第一区块的区块头中获取所述第一哈希值;
    所述第一节点计算所述第二哈希值;
    所述第一节点生成所述映射关系。
  5. 根据权利要求2所述的数据处理方法,其特征在于,所述第一节点为排序节点,所述区块链系统还包括背书节点;
    所述第一节点获取第一区块的标识,包括:
    所述第一节点接收所述客户端发送的背书结果,所述背书结果为所述背书节点对所述客户端发送的所述清理请求的验证结果,所述背书结果包括所述第一区块的标识和所述映射关系;
    所述第一节点从所述背书结果中获取所述第一区块的标识;
    相应的,所述第一节点获取映射关系,包括:
    所述第一节点从所述背书结果中获取所述映射关系。
  6. 根据权利要求2所述的数据处理方法,其特征在于,所述第一节点为所述区块链系统中任一个节点;
    所述第一节点获取第一区块的标识,包括:
    所述第一节点接收所述客户端发送的所述清理请求;
    所述第一节点从所述清理请求中获取所述第一区块的标识;
    相应的,所述第一节点获取映射关系,包括:
    所述第一节点从所述第一区块的区块头中获取所述第一哈希值;
    所述第一节点计算所述第二哈希值;
    所述第一节点生成所述映射关系。
  7. 根据权利要求2-6中任意一项所述的数据处理方法,其特征在于,所述数据处理方法还包括:
    所述第一节点接收所述客户端发送的交易查询请求,所述交易查询请求包括所述第一区块的标识,所述交易查询请求用于请求查询所述第一区块中的交易数据;
    所述第一节点根据所述第一区块的标识,读取所述第一区块;
    所述第一节点获取所述第一哈希值,并计算所述第二哈希值;
    若所述第一哈希值与所述第二哈希值不同,所述第一节点确定所述第一节点已存储有所述映射关系;
    所述第一节点读取所述第一区块中的交易数据。
  8. 一种节点,其特征在于,区块链系统包括所述节点,所述节点中存储有多个区块,所述节点包括:
    获取单元,用于在客户端发送的清理请求获得所述区块链系统中多个节点的共识之后,获取第一区块的标识,所述清理请求用于请求清理所述第一区块的数据,所述清理请求包括所述第一区块的标识;
    删除单元,用于根据所述获取单元获取到的所述第一区块的标识,删除所述节点中所述第一区块中的第一数据,所述第一数据用于表示所述多个节点对所述第一区块中交易数据的验证。
  9. 根据权利要求8所述的节点,其特征在于,
    所述获取单元,还用于获取映射关系,所述映射关系包括所述第一区块的标识、第一哈希值和第二哈希值三者之间的对应关系,所述第一哈希值为所述第一区块中区块体的哈希值,所述第二哈希值为所述第一区块的区块体中除第一数据之外其他数据的哈希值;
    所述节点还包括存储单元;
    所述存储单元,用于存储所述获取单元获取到的所述映射关系。
  10. 根据权利要求9所述的节点,其特征在于,所述节点为记账节点,所述区块链系统还包括排序节点和背书节点;
    所述获取单元,具体用于从所述排序节点获取所述第一区块的标识,所述第一区块的标识包括于所述客户端发送给所述排序节点的背书结果中,所述背书结果为所述背书节点对所述清理请求的验证结果;
    相应的,所述获取单元,具体用于从所述排序节点获取所述映射关系,所述背书 结果还包括所述映射关系。
  11. 根据权利要求9所述的节点,其特征在于,所述节点为背书节点;所述节点还包括接收单元;
    所述接收单元,用于接收所述客户端发送的所述清理请求;
    所述获取单元,具体用于从所述接收单元接收到的所述清理请求中获取所述第一区块的标识;
    相应的,所述获取单元,具体用于从所述第一区块的区块头中获取所述第一哈希值;
    所述节点还包括计算单元和生成单元;
    所述计算单元,用于计算所述第二哈希值;
    所述生成单元,用于生成所述映射关系。
  12. 根据权利要求9所述的节点,其特征在于,所述节点为排序节点,所述区块链系统还包括背书节点;所述节点还包括接收单元;
    所述接收单元,用于接收所述客户端发送的背书结果,所述背书结果为所述背书节点对所述客户端发送的所述清理请求的验证结果,所述背书结果包括所述第一区块的标识和所述映射关系;
    所述获取单元,具体用于从所述接收单元接收到的所述背书结果中获取所述第一区块的标识;
    相应的,所述获取单元具体用于从所述接收单元接收到的所述背书结果中获取所述映射关系。
  13. 根据权利要求9所述的节点,其特征在于,所述节点为所述区块链系统中任一个节点;
    所述节点还包括接收单元;
    所述接收单元,用于接收所述客户端发送的所述清理请求;
    所述获取单元,具体用于从所述接收单元接收到的所述清理请求中获取所述第一区块的标识;
    相应的,所述获取单元,具体用于从所述第一区块的区块头中获取所述第一哈希值;
    所述节点还包括计算单元和生成单元;
    所述计算单元,用于计算所述第二哈希值;
    所述生成单元,用于生成所述映射关系。
  14. 根据权利要求9-13中任意一项所述的节点,其特征在于,所述节点还包括接收单元、读取单元、计算单元和确定单元;
    所述接收单元,用于接收所述客户端发送的交易查询请求,所述交易查询请求包括第一区块的标识,所述交易查询请求用于请求查询所述第一区块中的交易数据;
    所述读取单元,用于根据所述接收单元接收到的所述交易请求中的所述第一区块的标识,读取所述第一区块;
    所述获取单元,还用于获取所述第一哈希值;
    所述计算单元,用于计算所述第二哈希值;
    所述确定单元,用于若所述第一哈希值与所述第二哈希值不同,确定已存储有所述映射关系;
    所述读取单元,还用于读取所述第一区块中的交易数据。
  15. 一种计算机设备,其特征在于,包括:一个或多个处理器,以及一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器存储有计算机指令;
    当所述一个或多个处理器执行所述计算机指令时,使得所述计算机设备实现如上述权利要求1-7中任意一项所述的数据处理方法。
  16. 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算机上运行时,使得所述计算机实现如上述权利要求1-7中任意一项所述的数据处理方法。
  17. 一种区块链系统,其特征在于,所述区块链系统包括如上述权利要求8-14任一项所述的节点。
PCT/CN2020/096315 2019-06-26 2020-06-16 一种数据处理方法、节点及区块链系统 WO2020259352A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910563257.0A CN112153085B (zh) 2019-06-26 2019-06-26 一种数据处理方法、节点及区块链系统
CN201910563257.0 2019-06-26

Publications (1)

Publication Number Publication Date
WO2020259352A1 true WO2020259352A1 (zh) 2020-12-30

Family

ID=73870087

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/096315 WO2020259352A1 (zh) 2019-06-26 2020-06-16 一种数据处理方法、节点及区块链系统

Country Status (2)

Country Link
CN (1) CN112153085B (zh)
WO (1) WO2020259352A1 (zh)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667655A (zh) * 2021-01-21 2021-04-16 苏州达家迎信息技术有限公司 多端交互中的数据流转方法、装置、存储介质及电子设备
CN113342850A (zh) * 2021-05-28 2021-09-03 昆明理工大学 一种基于区块图的联盟网络模型及其应用
CN113518129A (zh) * 2021-07-23 2021-10-19 广东电网有限责任公司 一种电力能源互联共享的方法及装置
CN113608703A (zh) * 2021-08-24 2021-11-05 上海点融信息科技有限责任公司 数据处理方法及装置
CN113890753A (zh) * 2021-09-24 2022-01-04 网易(杭州)网络有限公司 数字身份管理方法、装置、系统、计算机设备和存储介质
WO2023142226A1 (en) * 2022-01-28 2023-08-03 Hong Kong Applied Science and Technology Research Institute Company Limited Method and apparatus for exchanging data between blockchain system and non-blockchain system
US11728976B1 (en) * 2022-12-22 2023-08-15 Alchemy Insights, Inc. Systems and methods for efficiently serving blockchain requests using an optimized cache
US11750711B1 (en) 2022-12-22 2023-09-05 Alchemy Insights, Inc. Systems and methods for adaptively rate limiting client service requests at a blockchain service provider platform
US11769143B1 (en) 2022-12-22 2023-09-26 Alchemy Insights, Inc. System and method for high performance providing fresh NFT metadata
US11811955B1 (en) 2022-12-23 2023-11-07 Alchemy Insights, Inc. Systems and methods for improving reliability in blockchain networks using sharding
US11816021B1 (en) 2022-12-22 2023-11-14 Alchemy Insights, Inc. System and method for intelligent testing of blockchain applications using a shadow system
CN117270843A (zh) * 2023-10-19 2023-12-22 江苏苏亿盟智能科技有限公司 一种基于区块链的编程数据推荐管理方法及系统
US11914616B1 (en) 2022-12-16 2024-02-27 Alchemy Insights, Inc. Systems and methods for creating a consistent blockchain including block commitment determinations

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259131B (zh) * 2021-06-23 2021-10-08 北京笔新互联网科技有限公司 区块链节点、系统和区块链构建方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107819749A (zh) * 2017-10-26 2018-03-20 平安科技(深圳)有限公司 基于以太坊的区块链系统和交易数据处理方法
CN108596767A (zh) * 2018-05-09 2018-09-28 中国工商银行股份有限公司 区块链历史数据清理方法及装置
CN108696356A (zh) * 2017-04-05 2018-10-23 中国移动通信有限公司研究院 一种基于区块链的数字证书删除方法、装置及系统
CN109165944A (zh) * 2018-08-21 2019-01-08 北京京东金融科技控股有限公司 基于区块链的多方签名认证方法、装置、设备及存储介质
CN109493044A (zh) * 2018-11-08 2019-03-19 深圳壹账通智能科技有限公司 区块链区块删除方法、装置以及终端设备
US20190147065A1 (en) * 2017-11-16 2019-05-16 International Business Machines Corporation Method and system for verification of deleted data for blockchains

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10114969B1 (en) * 2015-08-04 2018-10-30 Jordan White Chaney Ultra-secure blockchain-based electronic information transfer system
CN106251216B (zh) * 2016-07-18 2020-12-25 恒宝股份有限公司 一种用于缓解节点存储压力的方法和系统
CN108270836B (zh) * 2017-01-03 2020-04-03 华为技术有限公司 基于区块链的数据处理方法、设备和系统
CN109391645B (zh) * 2017-08-03 2020-09-11 中国移动通信有限公司研究院 区块链轻量化处理方法、区块链节点及存储介质
CN107728941B (zh) * 2017-09-28 2019-09-24 中国银行股份有限公司 一种区块链数据压缩方法及系统
CN107734021B (zh) * 2017-09-30 2020-04-07 深圳壹账通智能科技有限公司 区块链数据上传方法、系统、计算机系统及存储介质
CN108416578A (zh) * 2018-03-14 2018-08-17 郑杰骞 一种区块链系统及数据处理方法
CN109324757B (zh) * 2018-08-22 2021-05-21 深圳前海微众银行股份有限公司 区块链数据缩容方法、装置及存储介质
CN109299336B (zh) * 2018-09-30 2022-07-01 腾讯科技(深圳)有限公司 数据备份方法、装置、存储介质及计算设备
CN109739843A (zh) * 2018-12-26 2019-05-10 篱笆墙网络科技有限公司 区块链数据读写方法、系统、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108696356A (zh) * 2017-04-05 2018-10-23 中国移动通信有限公司研究院 一种基于区块链的数字证书删除方法、装置及系统
CN107819749A (zh) * 2017-10-26 2018-03-20 平安科技(深圳)有限公司 基于以太坊的区块链系统和交易数据处理方法
US20190147065A1 (en) * 2017-11-16 2019-05-16 International Business Machines Corporation Method and system for verification of deleted data for blockchains
CN108596767A (zh) * 2018-05-09 2018-09-28 中国工商银行股份有限公司 区块链历史数据清理方法及装置
CN109165944A (zh) * 2018-08-21 2019-01-08 北京京东金融科技控股有限公司 基于区块链的多方签名认证方法、装置、设备及存储介质
CN109493044A (zh) * 2018-11-08 2019-03-19 深圳壹账通智能科技有限公司 区块链区块删除方法、装置以及终端设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YANLI REN, DANTING XU, XINPENG ZHANG, DAWU GU: "Deletable blockchain based on threshold ring signature", JOURNAL ON COMMUNICATIONS, vol. 40, no. 4, 16 April 2019 (2019-04-16), pages 71 - 82, XP055774056, ISSN: 1000-436X, DOI: 10.11959/j.issn.1000−436x.2019084 *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667655B (zh) * 2021-01-21 2022-10-11 苏州达家迎信息技术有限公司 多端交互中的数据流转方法、装置、存储介质及电子设备
CN112667655A (zh) * 2021-01-21 2021-04-16 苏州达家迎信息技术有限公司 多端交互中的数据流转方法、装置、存储介质及电子设备
CN113342850A (zh) * 2021-05-28 2021-09-03 昆明理工大学 一种基于区块图的联盟网络模型及其应用
CN113342850B (zh) * 2021-05-28 2024-03-19 昆明理工大学 一种基于区块图的联盟网络模型及其应用
CN113518129A (zh) * 2021-07-23 2021-10-19 广东电网有限责任公司 一种电力能源互联共享的方法及装置
CN113518129B (zh) * 2021-07-23 2023-09-12 广东电网有限责任公司 一种电力能源互联共享的方法及装置
CN113608703A (zh) * 2021-08-24 2021-11-05 上海点融信息科技有限责任公司 数据处理方法及装置
CN113890753A (zh) * 2021-09-24 2022-01-04 网易(杭州)网络有限公司 数字身份管理方法、装置、系统、计算机设备和存储介质
CN113890753B (zh) * 2021-09-24 2024-04-09 网易(杭州)网络有限公司 数字身份管理方法、装置、系统、计算机设备和存储介质
WO2023142226A1 (en) * 2022-01-28 2023-08-03 Hong Kong Applied Science and Technology Research Institute Company Limited Method and apparatus for exchanging data between blockchain system and non-blockchain system
US11789937B2 (en) 2022-01-28 2023-10-17 Hong Kong Applied Science and Technology Research Institute Company Limited Method and apparatus for exchanging data between blockchain system and non-blockchain system
US11914616B1 (en) 2022-12-16 2024-02-27 Alchemy Insights, Inc. Systems and methods for creating a consistent blockchain including block commitment determinations
US11769143B1 (en) 2022-12-22 2023-09-26 Alchemy Insights, Inc. System and method for high performance providing fresh NFT metadata
US11816021B1 (en) 2022-12-22 2023-11-14 Alchemy Insights, Inc. System and method for intelligent testing of blockchain applications using a shadow system
US11823088B1 (en) 2022-12-22 2023-11-21 Alchemy Insights, Inc. System and method for retrieval and verification of NFT ownership
US11750711B1 (en) 2022-12-22 2023-09-05 Alchemy Insights, Inc. Systems and methods for adaptively rate limiting client service requests at a blockchain service provider platform
US11728976B1 (en) * 2022-12-22 2023-08-15 Alchemy Insights, Inc. Systems and methods for efficiently serving blockchain requests using an optimized cache
US11811955B1 (en) 2022-12-23 2023-11-07 Alchemy Insights, Inc. Systems and methods for improving reliability in blockchain networks using sharding
CN117270843A (zh) * 2023-10-19 2023-12-22 江苏苏亿盟智能科技有限公司 一种基于区块链的编程数据推荐管理方法及系统
CN117270843B (zh) * 2023-10-19 2024-03-12 江苏苏亿盟智能科技有限公司 一种基于区块链的编程数据推荐管理方法及系统

Also Published As

Publication number Publication date
CN112153085B (zh) 2022-05-17
CN112153085A (zh) 2020-12-29

Similar Documents

Publication Publication Date Title
WO2020259352A1 (zh) 一种数据处理方法、节点及区块链系统
JP7292783B2 (ja) 許可型ブロックチェーンにおける優先順位付け
US11709600B2 (en) System and method for performing live partitioning in a data store
JP7304118B2 (ja) 自己監視ブロックチェーンのための安全な合意に基づくエンドースメント
US10776395B2 (en) System and method for implementing a scalable data storage service
WO2020207233A1 (zh) 一种区块链的权限控制方法及装置
US11823178B2 (en) Optimization of high volume transaction performance on a blockchain
US9372911B2 (en) System and method for performing replica copying using a physical copy mechanism
US9507818B1 (en) System and method for conditionally updating an item with attribute granularity
WO2022121538A1 (zh) 基于区块链的数据同步方法、系统及相关设备
CN109067733B (zh) 发送数据的方法和装置,以及接收数据的方法和装置
US10877669B1 (en) System and method for providing a committed throughput level in a data store
TW202027456A (zh) 聯盟鏈的可信度驗證方法、系統、裝置及設備
WO2020052379A1 (zh) 分布式存储系统中处理对象的元数据的方法及装置
WO2022048359A1 (zh) 一种数据归档方法、装置、电子设备和存储介质
WO2024041505A1 (zh) 数据获取方法、装置和设备
CN112148206A (zh) 一种数据读写方法、装置、电子设备及介质
WO2023207529A1 (zh) 数据处理方法、装置及设备、介质、产品
US20220247570A1 (en) Content use system, permission terminal, browsing terminal, distribution terminal, and content use program
CN113886499B (zh) 基于区块链的病理数据分享方法、分享系统及计算设备
CN110597466B (zh) 区块链节点的控制方法、装置、存储介质和计算机设备
WO2023207471A1 (zh) 基于区块链的数据处理方法、相关装置及介质和程序产品
CN113342275B (zh) 区块链节点存取数据的方法、设备和计算机可读存储介质
CN112163034B (zh) 一种模型共享方法、节点及区块链系统
WO2020199982A1 (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: 20831838

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

Country of ref document: EP

Kind code of ref document: A1