WO2020093565A1 - 区块链区块删除方法、装置以及终端设备 - Google Patents

区块链区块删除方法、装置以及终端设备 Download PDF

Info

Publication number
WO2020093565A1
WO2020093565A1 PCT/CN2018/124670 CN2018124670W WO2020093565A1 WO 2020093565 A1 WO2020093565 A1 WO 2020093565A1 CN 2018124670 W CN2018124670 W CN 2018124670W WO 2020093565 A1 WO2020093565 A1 WO 2020093565A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
user
current block
verification
deletion
Prior art date
Application number
PCT/CN2018/124670
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 WO2020093565A1 publication Critical patent/WO2020093565A1/zh

Links

Images

Classifications

    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Definitions

  • This application relates to the field of blockchain technology, and in particular, to a blockchain block deletion method, device, terminal device, and computer-readable storage medium.
  • the blockchain is a decentralized distributed database system that is jointly maintained by all nodes in the blockchain network. It is composed of a series of data blocks generated based on cryptographic methods. Each data block is a block chain. A block. According to the order of generation time, the blocks are linked together in an orderly manner to form a data chain, which is visually called a blockchain.
  • Blockchain has its own unique block generation, transaction generation and verification protocols, with security features such as unchangeable, unforgeable and fully traceable.
  • the present application proposes a user blockchain block deletion method, device, terminal device, and computer-readable storage medium, which can confirm the user's super user authority after receiving the user's block data deletion request,
  • the user is a super user, change the verification method of the block to the super user signature + hash value verification method, and then delete the corresponding transaction information in the block body of the block, and store the deletion operation information to The block header of the current block can therefore delete block data in the block.
  • this application provides a blockchain block deletion method, which is applied to terminal equipment.
  • the method includes:
  • a blockchain block deletion device which includes:
  • the receiving module is used to receive the current block data deletion request input by the user; the judgment module is used to confirm whether the user is a super user; the setting module is used to transfer the current block when the user is a super user
  • the hash value verification method in the first verification field preset in the block header of the block is changed to the super user signature + hash value verification method; a deletion module is used to delete the current block according to the data deletion request
  • the corresponding transaction information in the block body, and the deletion operation information is stored in the block header of the current block, wherein the deletion operation information includes the hash value of the current block and the super user signature before the deletion operation.
  • the present application also provides a terminal device, the terminal device includes a memory and a processor, and the memory stores a computer program that can run on the processor, and the computer program is executed by the processor The following steps are implemented:
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor, so that the at least one The processor performs the following steps:
  • the blockchain block deletion method, device, terminal equipment and computer-readable storage medium proposed in this application can confirm the user's super user after receiving the user's block data deletion request Authority, when the user is a super user, change the verification method of the block to the super user signature + hash value verification method, and then delete the corresponding transaction information in the block body of the block, and delete the operation information It is stored to the block header of the current block, so the block data in the block can be deleted.
  • 1 is a schematic diagram of an optional hardware architecture of the terminal device of this application.
  • FIG. 2 is a schematic diagram of a program module of an embodiment of a blockchain block deletion device of the present application
  • FIG. 3 is a schematic flowchart of an embodiment of a blockchain block deletion method of the present application.
  • FIG. 1 it is a schematic diagram of an optional hardware architecture of the terminal device 1 of the present application.
  • the terminal device 1 may include, for example, a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a personal digital assistant (Personal Digital Assistant (PDA), a portable media player (Portable Media Player, PMP), a navigation device, a wearable device, Mobile terminals such as smart bracelets and pedometers, as well as fixed terminals such as digital TVs, desktop computers, user equipment (UE) and vehicles.
  • PDA Personal Digital Assistant
  • PMP portable media player
  • PMP Portable Media Player
  • PMP Portable Media Player
  • Navigation device a wearable device
  • Mobile terminals such as smart bracelets and pedometers
  • Fixed terminals such as digital TVs, desktop computers, user equipment (UE) and vehicles.
  • the terminal device 1 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 may be connected to each other through a system bus.
  • the terminal device 1 is connected to a network through a network interface 13 (not shown in FIG. 1), and is connected to other terminals such as a PC terminal, a mobile terminal, etc. through the network.
  • the network may be Intranet, Internet, Global System of Mobile (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G Network, Bluetooth (Bluetooth), Wi-Fi, call network and other wireless or wired networks.
  • FIG. 1 only shows the terminal device 1 having the components 11-13, but it should be understood that it is not required to implement all the components shown, and that more or fewer components may be implemented instead.
  • the memory 11 includes at least one type of readable storage medium
  • the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a random access memory (RAM) , Static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the terminal device 1, such as a hard disk or a memory of the terminal device 1.
  • the memory 11 may also be an external storage device of the terminal device 1, such as a plug-in hard disk equipped with the terminal device 1, a smart memory card (Smart Media Card, SMC), and a secure digital ( Secure (Digital, SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both the internal storage unit of the terminal device 1 and its external storage device.
  • the memory 11 is generally used to store an operating system installed in the terminal device 1 and various application software, including program codes of the blockchain block deletion device 200.
  • the memory 11 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 12 is generally used to control the overall operation of the terminal device 1, for example, to perform control and processing related to data interaction or communication.
  • the processor 12 is used to run the program code or process data stored in the memory 11, for example, to run the program of the blockchain block deletion device 200.
  • the network interface 13 may include a wireless network interface or a wired network interface.
  • the network interface 13 is generally used to establish a communication connection between the terminal device 1 and other terminal devices.
  • the terminal device 1 and other terminal devices together form one Blockchain system.
  • the blockchain block deletion device 200 when the blockchain block deletion device 200 is installed in the terminal device 1, it can confirm the user's super user authority after receiving the user's block data deletion request.
  • the user When it is a super user, change the verification method of the block to the super user signature + hash value verification method, then delete the corresponding transaction information in the block body of the block, and store the deletion operation information in the current area The block header of the block, so that the block data in the block can be deleted.
  • this application proposes a blockchain block deletion device.
  • FIG. 2 it is a program block diagram of an embodiment of a blockchain block deletion device 200 of the present application.
  • the blockchain block deletion device 200 includes a series of computer program instructions stored on the memory 11, and when the computer program instructions are executed by the processor 12, the area of each embodiment of the present application can be realized Block chain block deletion operation.
  • the blockchain block deletion device 200 may be divided into one or more modules.
  • the blockchain block deletion program 200 may be divided into a receiving module 201, a judging module 202, a setting module 203, and a deleting module 204. among them:
  • the receiving module 201 is configured to receive a current block data deletion request input by a user.
  • the blockchain is composed of connected blocks. Blocks are used to record data. Writing data to the blockchain is actually creating a new block, and then writing the data to the newly created block. The newly created block is linked to the end of the blockchain to become a zone Part of the blockchain.
  • the blockchain system includes multiple block nodes, and each block node may be the same terminal device as the terminal device 1 described above. Users perform data access to the blockchain through block nodes, as well as new block creation and block data writing. In this embodiment, the user receives the current block data deletion request input by the user through the terminal device 1.
  • the receiving module 201 receives the current block data deletion request input by the user, the receiving module 201 is also used to receive the user's registration information, and then store the digital signature including the user's public key information in the creation area Block and sync to all other blocks.
  • the creation block is the first block of the blockchain.
  • the judgment module 202 is used to confirm whether the user is a super user.
  • the blockchain is a decentralized management control
  • the blockchain continues to increase blocks, it is inevitable that the data of the first created block has expired or expired, and the invalid or expired data However, it always occupies the storage space of the block and the transmission bandwidth. Therefore, in this embodiment, the user accesses the data on the blockchain through the block node of the blockchain system, that is, through the terminal device 1, or creates a new block and writes the data.
  • the blockchain system may preset at least one super user, and the authority of the super user is set to be able to delete data on any block on the blockchain, or write new content after deletion.
  • the judgment module 202 when a user sends a request to access the blockchain through the terminal device 1, the judgment module 202 requires the user to perform identity verification based on the digital certificate containing the user's public key submitted in advance by each user during registration To confirm whether the user is a super user.
  • the judgment process of the judgment module 202 includes: obtaining the private key information input by the user, and finding a digital signature including the public key information matching the private key information according to the private key information, when the digital If the signature exists in the preset super user signature list, the user is judged to be a super user.
  • the judgment module 202 matches the private key entered by the user with the stored public key carried by all the digital certificates, thereby confirming the identity and authority of the user.
  • the judging module 202 confirms that the user is a super user, the super user authority is developed for the user, and then the content of any block on the blockchain can be deleted or changed.
  • the setting module 203 is configured to, when the user is a super user, change the hash value verification method in the first verification field preset in the block header of the current block to super user signature + hash Value verification method.
  • each block in the blockchain includes two parts: a block header and a block body.
  • the block header includes the version number, timestamp, hash value of the previous block, hash value of the block body of the block, and operation information of the block being executed, etc .; block body (Body ) Is used to record actual data.
  • the hash value is a feature value of the same length that the computer can calculate for any content. For different data, the corresponding hash value is different. Therefore, any change in the content of the block body or block header of any block will inevitably lead to a change in the hash value, and a change in the content of the block header or block body of the previous block of the block will also cause this The hash value of the block changes.
  • each block can accurately point to the previous block based on the hash value of the previous block stored in the block header. Therefore, in this one-way verification link process, hash value verification is an indispensable step.
  • the setting module 203 can reset the rules for linking each block to the previous block in advance, for example, including two methods: 1 hash value verification; 2 superuser signature + hash value verification.
  • the setting module 203 presets a first verification field in the block header of the current block, and the first verification field is used to link the current area in a subsequent block of the current block Before the block, define a hash value verification path for the current block by the latter block, the hash verification path includes: a hash value verification method, including: The hope value is consistent with the hash value of the current block stored in the latter block; the super user signature + hash value verification method includes: the latter block will delete the operation information recorded in the current block The hash value of the current block before the deletion operation is checked for consistency with the hash value of the current block stored in the latter block, and whether the super user signature in the deletion operation information recorded in the current block is legal.
  • the setting module 203 presets the blockchain to perform data synchronization
  • the latter block obtains the hash verification path according to the first verification field of the block header of the current block, and then according to the description It is hoped that the verification method will be verified by the verification method and linked to the current block after the verification is passed.
  • the setting module 203 sets the hash verification path to an identification code, which has two states, for example, state M means to select the hash value verification method, and state N means to select the super user signature + hash Value verification method.
  • the latter block calculates the hash value of the current block and compares it with the "previous block hash value" stored in its own block header "Compare and link to the current block when they match.
  • the verification selection code is N
  • the latter block obtains the deletion operation information in the current block, and the deletion operation information includes the current block hash value and the super user signature before the deletion operation . Only when the user signature information in the deletion operation information is the super user's signature information and the hash value of the current block before the deletion operation is consistent with the "previous block hash value" stored in its own block header, can it be linked To the current block. Therefore, when a block data of the block chain is modified or deleted, the setting module 203 will correspondingly set the hash value in the first verification field preset in the block header of the block The verification method is changed to the verification method of super user signature + hash value.
  • the deletion module 204 is configured to delete the corresponding transaction information in the block body of the current block according to the data deletion request, and store the deletion operation information in the block header of the current block, wherein The deletion operation information includes the hash value of the current block and the super user signature before the deletion operation.
  • the deletion module 204 performs data deletion on the current block on the blockchain according to the current block data deletion request .
  • the judgment module 203 has authenticated the user when the user logs in to the terminal device 1
  • the deletion module 204 still requests the user when performing block data deletion
  • the user authenticates, and then obtains the user's signature information, and compares the signature according to the digital certificate with the super user's public key stored in the block.
  • the deletion module 204 will also store the deletion operation information in the block header of the current block.
  • the deletion operation information includes the current block hash value and the super user signature before the deletion operation.
  • the setting module 203 will also delete the transaction information of the current block, the version number corresponding to the deleted transaction information, and the super user signature Version verification information recorded in the block header of the current block.
  • the version verification information is used to skip verification when it is verified by other transaction information on the version number of the deleted transaction information and determine that verification is passed.
  • the stored data information in the blocks in the blockchain that is, the transaction image
  • the transaction information of the latter block is based on the transaction information of the previous block. Based on. Therefore, in the definition of the blockchain, the transaction information in the block includes a version number, and the version number serves as the unique identifier of the transaction information.
  • the setting module 203 records the transaction information deleted in the current block, the version number corresponding to the deleted transaction information, and the version verification information in the block header of the current block by the super user signature.
  • the B transaction information of the block occurs based on the A transaction information deleted by the current block, then when the B transaction information of the subsequent block is verified, the version verification stored in the block header of the current block can be found Delete the version number in the transaction information in the information, and then judge whether the super user signature in the version verification information is legal, that is, sign the preset super user, and when the super user signature is legal, the version number is verified Skip the verification directly and judge that the verification is passed.
  • the deletion module 204 will also synchronize the deleted block information to other block nodes in the form of broadcast.
  • the terminal device 1 can confirm the super user authority of the user after receiving the user's block data deletion request, and when the user is a super user, change the verification path of the block to the super user signature + Hash value verification method, then delete the corresponding transaction information in the block body of the block, and store the deletion operation information in the block header of the current block, so the block data in the block can be realized delete.
  • the present application also proposes a blockchain block deletion method, which is applied to the terminal device 1.
  • FIG. 3 is a schematic flowchart of an embodiment of a blockchain block deletion method of the present application.
  • the execution order of the steps in the flowchart shown in FIG. 3 may be changed, and some steps may be omitted.
  • Step S500 Receive a current block data deletion request input by the user, and confirm whether the user is a super user.
  • the blockchain consists of connected blocks. Blocks are used to record data. Writing data to the blockchain is actually creating a new block, and then writing the data to the newly created block. The newly created block is linked to the end of the blockchain to become a zone Part of the blockchain.
  • the blockchain system includes multiple block nodes, and each block node may be the same terminal device as the terminal device 1 described above. Users perform data access to the blockchain through block nodes, as well as new block creation and block data writing. In this embodiment, the user receives the current block data deletion request input by the user through the terminal device 1.
  • the terminal device 1 before receiving the current block data deletion request input by the user, the terminal device 1 also receives the user's registration information, and then stores the digital signature including the user's public key information in the genesis block, and synchronizes it to all other Block.
  • the creation block is the first block of the blockchain.
  • the blockchain is decentralized management and control, as the blockchain continues to increase the number of blocks, it is inevitable that the data of the first block created will expire or become invalid.
  • the expired data always occupies the storage space of the block and the transmission bandwidth. Therefore, in this embodiment, the user accesses the data on the blockchain through the block node of the blockchain system, that is, through the terminal device 1, or creates a new block and writes the data.
  • the blockchain system may preset at least one super user, and the authority of the super user is set to be able to delete data on any block on the blockchain, or write new content after deletion.
  • the terminal device 1 issues a digital certificate containing the user's public key that is submitted in advance by each user during registration to require the user to perform identity verification, thereby confirm Whether the user is a super user.
  • the judgment process includes: obtaining the private key information input by the user, finding a digital signature including the public key information matching the private key information according to the private key information, when the digital signature has a preset super In the user signature list, it is determined that the user is a super user.
  • the terminal device 1 matches the private key entered by the user with the stored public key carried by all the digital certificates, thereby confirming the identity and authority of the user.
  • the super user authority is developed for the user, and the content of any block on the blockchain can be deleted or changed.
  • Step S502 When the user is a super user, change the hash value verification method in the first verification field preset in the block header of the current block to the super user signature + hash value verification method.
  • each block in the blockchain includes two parts: block header and block body.
  • the block header includes the version number, time stamp, hash value of the previous block, hash value of the block body of the block, and operation information of the block being executed, etc.
  • the block body is used for Record actual data.
  • the hash value is a feature value of the same length that the computer can calculate for any content. For different data, the corresponding hash value is different. Therefore, any change in the content of the block body or block header of any block will inevitably lead to a change in the hash value, and changes in the content of the block header or block body of the previous block of the block will also cause The hash value of the block changes.
  • each block can accurately point to the previous block based on the hash value of the previous block stored in the block header. Therefore, in this one-way verification link process, hash value verification is an indispensable step.
  • the terminal device 1 may reset the rules for linking each block to the previous block in advance, for example, including two methods: 1 hash value verification; 2 superuser signature + hash value verification.
  • the terminal device 1 presets a first verification field in the block header of the current block, and the first verification field is used to link the current area in a subsequent block of the current block Before the block, define a hash value verification path for the current block by the latter block, the hash verification path includes: a hash value verification method, including: The hope value is consistent with the hash value of the current block stored in the latter block; the super user signature + hash value verification method includes: the latter block will delete the operation information recorded in the current block The hash value of the current block before the deletion operation is checked for consistency with the hash value of the current block stored in the latter block, and whether the super user signature in the deletion operation information recorded in the current block is legal.
  • a hash value verification method including: The hope value is consistent with the hash value of the current block stored in the latter block
  • the super user signature + hash value verification method includes: the latter block will delete the operation information recorded in the current block
  • the hash value of the current block before the deletion operation is checked for consistency with the hash
  • the terminal device 1 presets the blockchain to perform data synchronization
  • the latter block obtains the hash verification path according to the first verification field of the block header of the current block, and then according to the description It is hoped that the verification method will be verified by the verification method and linked to the current block after the verification is passed.
  • the terminal device 1 sets the hash verification path to an identification code, and has two states, for example, state M indicates that a hash value verification method is selected, and state N indicates that a super user signature + hash is selected. Value verification method.
  • the latter block calculates the hash value of the current block and compares it with the "previous block hash value" stored in its own block header "Compare and link to the current block when they match.
  • the verification selection code is N
  • the latter block obtains the deletion operation information in the current block, and the deletion operation information includes the current block hash value and the super user signature before the deletion operation . Only when the user signature information in the deletion operation information is the super user's signature information and the hash value of the current block before the deletion operation is consistent with the "previous block hash value" stored in its own block header, can it be linked To the current block. Therefore, when a block data of the blockchain is modified or deleted, the terminal device 1 will correspondingly hash the value in the first verification field preset in the block header of the block The verification method is changed to the verification method of super user signature + hash value.
  • Step S504 Delete the corresponding transaction information in the block body of the current block according to the data deletion request, and store the deletion operation information in the block header of the current block, where the deletion operation information includes The hash value of the current block and the super user signature before the deletion operation.
  • the terminal device 1 performs data deletion on the current block on the blockchain according to the current block data deletion request .
  • the terminal device 1 although the user has authenticated the user when logging in to the terminal device 1, the terminal device 1 still requests the user for authentication when performing block data deletion, and then Obtain the user's signature information, and compare the signature against the digital certificate with the super user's public key stored in the block, and respond when the user's signature is consistent with the information of the super user's signature
  • the user's operation instruction performs data deletion on the block.
  • the terminal device 1 will also store the deletion operation information in the block header of the current block.
  • the deletion operation information includes the current block hash value and the super user signature before the deletion operation.
  • Step S506 Record the transaction information deleted in the current block, the version number corresponding to the deleted transaction information, and the version verification information in the block header of the current block by the super user signature.
  • the terminal device 1 after deleting the data information of the current block, the terminal device 1 will also record the transaction information deleted in the current block, the version number corresponding to the deleted transaction information, and the super user signature to the Version verification information in the block header of the current block.
  • the version verification information is used to skip verification when it is verified by other transaction information on the version number of the deleted transaction information and determine that verification is passed.
  • the stored data information in the blocks in the blockchain that is, the transaction image
  • the transaction information of the latter block is based on the transaction information of the previous block. Based on. Therefore, in the definition of the blockchain, the transaction information in the block includes a version number, and the version number serves as the unique identifier of the transaction information.
  • the terminal device 1 records the transaction information deleted in the current block, the version number corresponding to the deleted transaction information, and the version verification information in the block header of the current block by the super user signature.
  • the B transaction information of the block occurs based on the A transaction information deleted by the current block, then when the B transaction information of the subsequent block is verified, the version verification stored in the block header of the current block can be found Delete the version number in the transaction information in the information, and then judge whether the super user signature in the version verification information is legal, that is, sign the preset super user, and when the super user signature is legal, the version number is verified Skip the verification directly and judge that the verification is passed.
  • Step S508 Synchronize the deleted block information to other block nodes in the form of broadcast.
  • the terminal device 1 deletes the data information of the current block on the blockchain to be deleted, it will also synchronize the deleted block information to other block nodes in the form of broadcasting.
  • the block deletion method of the blockchain proposed in this embodiment can confirm the user's super user authority after receiving the user's block data deletion request, and verify the block when the user is a super user Change the super user signature + hash value verification method, and then delete the corresponding transaction information in the block body of the block, and store the deletion operation information in the block header of the current block, so the block can be implemented Block data deletion.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种区块链区块删除方法、装置、终端设备及计算机可读存储介质,该方法包括:接收用户输入的当前区块数据删除请求;确认所述用户是否为超级用户;将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头。所述区块链区块删除方法、装置、终端设备及计算机可读存储介质能够根据超级用户权限在区块的区块头中设置超级用户签名+哈希值的验证方式以代替哈希值验证方式,从而实现区块链中区块的数据删除以及数据删除之后仍然保证区块之间的链接。

Description

区块链区块删除方法、装置以及终端设备
本申请要求于2018年11月08日提交中国专利局、申请号为201811323377.5、发明名称为“区块链区块删除方法、装置以及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及区块链技术领域,尤其涉及一种区块链区块删除方法、装置、终端设备及计算机可读存储介质。
背景技术
区块链是由区块链网络中所有节点共同参与维护的去中心化分布式数据库系统,它是由一系列基于密码学方法产生的数据块组成,每个数据块即为区块链中的一个区块。根据产生时间的先后顺序,区块被有序地链接在一起,形成一个数据链条,被形象地称为区块链。区块链有其特有的区块产生、交易产生和验证协议,具有不可更改、不可伪造和完全可追溯等安全特性。
但是,随着区块链应用行业的进一步扩大,设备产生的数据将会爆发性增长。而由于目前区块链网络维护整个账本的信息,数据的爆发性增长将会导致区块链网络具有很大的负载,并且区块链网络中区块的数据过期或者废弃之后该区块确无法进行删除,因此耗费了不必要的存储和传输的资源。
发明内容
有鉴于此,本申请提出一种用户区块链区块删除方法、装置、终端设备及计算机可读存储介质,能够在接收到用户的区块数据删除请求后确认所述用户的超级用户权限,当所述用户为超级用户时将该区块的验证途径更改超级用户签名+哈希值的验证方式,然后删除该区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,因此可以实现区块中区块数据的删除。
首先,为实现上述目的,本申请提供一种区块链区块删除方法,该方法应用于终端设 备,所述方法包括:
接收用户输入的当前区块数据删除请求;确认所述用户是否为超级用户;当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;以及根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
此外,为实现上述目的,本申请还提供一种区块链区块删除装置,所述装置包括:
接收模块,用于接收用户输入的当前区块数据删除请求;判断模块,用于确认所述用户是否为超级用户;设置模块,用于当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;删除模块,用于根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
进一步地,本申请还提出一种终端设备,所述终端设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现以下步骤:
接收用户输入的当前区块数据删除请求;确认所述用户是否为超级用户;当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;以及根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
进一步地,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序可被至少一个处理器执行,以使所述至少一个处理器执行以下步骤:
接收用户输入的当前区块数据删除请求;确认所述用户是否为超级用户;当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改 为超级用户签名+哈希值的验证方式;以及根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
相较于现有技术,本申请所提出的区块链区块删除方法、装置、终端设备及计算机可读存储介质,能够在接收到用户的区块数据删除请求后确认所述用户的超级用户权限,当所述用户为超级用户时将该区块的验证途径更改超级用户签名+哈希值的验证方式,然后删除该区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,因此可以实现区块中区块数据的删除。
附图说明
图1是本申请终端设备一可选的硬件架构的示意图;
图2是本申请区块链区块删除装置一实施例的程序模块示意图;
图3是本申请区块链区块删除方法一实施例的流程示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
参阅图1所示,是本申请终端设备1一可选的硬件架构的示意图。
所述终端设备1可以包括诸如手机、平板电脑、笔记本电脑、掌上电脑、个人数字助理 (Personal Digital Assistant,PDA)、便捷式媒体播放器(Portable Media Player,PMP)、导航装置、可穿戴设备、智能手环、计步器等移动终端,以及诸如数字TV、台式计算机、用户设备(User Equipment,UE)、车辆(vehicle)等固定终端。
本实施例中,所述终端设备1可包括,但不仅限于,可通过系统总线相互通信连接存储器11、处理器12和网络接口13。
所述终端设备1通过网络接口13连接网络(图1未标出),通过网络连接到其他终端如PC端,移动终端等。所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi、通话网络等无线或有线网络。
需要指出的是,图1仅示出了具有组件11-13的终端设备1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器11可以是所述终端设备1的内部存储单元,例如该终端设备1的硬盘或内存。在另一些实施例中,所述存储器11也可以是所述终端设备1的外部存储设备,例如该终端设备1配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器11还可以既包括所述终端设备1的内部存储单元也包括其外部存储设备。本实施例中,所述存储器11通常用于存储安装于所述终端设备1的操作系统和各类应用软件,包括区块链区块删除装置200的程序代码等。此外,所述存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述终端设备1的总体操作,例如执行数据交互或者通信相关的控制和处理等。本实施例中,所述处理 器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行所述区块链区块删除装置200的程序等。
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述终端设备1与其他终端设备之间建立通信连接,所述终端设备1与其他终端设备共同组成一个区块链系统。
本实施例中,所述终端设备1内安装有所述区块链区块删除装置200时,能够在接收到用户的区块数据删除请求后确认所述用户的超级用户权限,当所述用户为超级用户时将该区块的验证途径更改超级用户签名+哈希值的验证方式,然后删除该区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,因此可以实现区块中区块数据的删除。
至此,己经详细介绍了本申请各个实施例的应用环境和相关设备的硬件结构和功能。下面,将基于上述应用环境和相关设备,提出本申请的各个实施例。
首先,本申请提出一种区块链区块删除装置。
参阅图2所示,是本申请区块链区块删除装置200一实施例的程序模块图。
本实施例中,所述区块链区块删除装置200包括一系列的存储于存储器11上的计算机程序指令,当该计算机程序指令被处理器12执行时,可以实现本申请各实施例的区块链区块删除操作。在一些实施例中,基于该计算机程序指令各部分所实现的特定的操作,区块链区块删除装置200可以被划分为一个或多个模块。例如,在图2中,所述区块链区块删除程序200可以被分割成接收模块201、判断模块202、设置模块203和删除模块204。其中:
所述接收模块201,用于接收用户输入的当前区块数据删除请求。
具体地,区块链由一个个相连的区块(block)组成。区块用于记录数据,写入数据到区块链实际上就是新建一个区块,然后将数据写入到新建的区块,新建的区块链接到所述区块链的最尾端成为区块链的一部分。而区块链系统,包括多个区块节点,每一个区块节点都可以是如所述终端设备1一样的终端设备。用户通过区块节点对区块链执行数据访问,以及区块的新建和区块数据的写入。在本实施例中,用户通过所述终端设备1接收用户输入的当前区块数据删除请求。当然,所述接收模块201在接收用户输入的当前区块数据删除请 求之前,所述接收模块201还用于接收用户的注册信息,然后将包括用户的公钥信息的数字签名存储到创世区块,并同步到其他所有区块。其中,所述创区块就是所述区块链的第一个区块。
所述判断模块202,用于确认所述用户是否为超级用户。
具体地,区块链虽然是去中心管理控制,但由于区块链在不断增加区块的过程中,难免会出现最先创建的区块数据已过期或者失效的情形,而失效或者过期的数据却始终占有区块的存储空间,以及传输带宽。因此,在本实施例中,用户通过区块链系统的区块节点,即通过所述终端设备1访问区块链上的数据,或者新建区块,写入数据。区块链系统可以预先设置至少一名超级用户,所述超级用户的权限设置为能够对所述区块链上的任一区块进行数据删除,或者删除后写入新的内容。
在本实施例中,当用户通过所述终端设备1发送访问区块链请求时,所述判断模块202根据每个用户在注册时预先提交的包含用户公钥的数字证书要求该用户进行身份验证,从而确认所述用户是否为超级用户。其中,所述判断模块202的判断过程包括:获取所述用户输入的私钥信息,根据所述私钥信息查找出包括与所述私钥信息匹配的公钥信息的数字签名,当所述数字签名存在预设的超级用户签名列表中,则判断所述用户为超级用户。在本实施例中,当用户输入私钥后,所述判断模块202则将用户输入的私钥与存储的所有所述数字证书携带的公钥进行匹配,从而确认该用户的身份及权限,当所述判断模块202确认出该用户为超级用户时,则对所述用户开发超级用户权限,就可以执行删除或者更改区块链上任一区块的内容。
所述设置模块203,用于当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式。
具体地,区块链中的每个区块都包括两个部分:区块头(Head)和区块体(Body)。所述区块头包括该版本号、时间戳、上一区块的哈希值、该区块的区块体的哈希值,以及该区块被执行的操作信息等等;区块体(Body)用于记录实际数据。其中,哈希值就是计算机可以对任意内容计算出的一个长度相同的特征值,对于不同的数据,其对应的哈希值也不一样。因此,任一区块的区块体或者区块头的内容发生改变必然会导致哈希值的改变, 而且该区块的上一区块的区块头或者区块体的内容发生改变也会导致本区块的哈希值的改变。
由于区块链中的区块从后向前有序链接起来的数据结构,每个区块根据区块头中存储的上一区块的哈希值能够准确地指向上一个区块。因此,在这种单向验证链接的过程中,哈希值验证是必不可少的步骤。在本实施例中,当当前区块的区块体或者区块头的内容发生改变之后,哈希值发生改变,因此在数据同步过程中,当前区块的后一区块将不能够链接到当前区块。因此,所述设置模块203可以预先重新设置每一区块链接到上一区块的规则,比如包括两种方式:1哈希值验证;2超级用户签名+哈希值的验证。具体地,所述设置模块203在所述当前区块的区块头中预设的第一验证栏位,第一验证栏位用于在所述当前区块的后一区块链接所述当前区块前,定义所述后一区块对所述当前区块进行的哈希值验证途径,所述哈希验证途径包括:哈希值验证方式,包括:后一区块对当前区块的哈希值与所述后一区块存储的当前区块哈希值进行一致性验证;超级用户签名+哈希值的验证方式,包括:后一区块将当前区块记录的删除操作信息中的删除操作前当前区块哈希值与所述后一区块存储的当前区块哈希值进行一致性验证,以及当前区块记录的删除操作信息中的超级用户签名是否合法。
适应性地,所述设置模块203预先设置区块链执行数据同步时,后一区块根据获取当前区块的区块头的第一验证栏位的述哈希验证途径,然后根据所述述哈希验证途径的验证方式进行验证,并在验证通过之后链接到当前区块。在本实施例中,所述设置模块203将所述哈希验证途径设置为一个标识码,具有两种状态,例如状态M表示选择哈希值验证方式,状态N表示选择超级用户签名+哈希值的验证方式。当所述当前区块的所述验证选择码为M时,则所述后一区块计算所述当前区块的哈希值,并与自身区块头中存储的“上一区块哈希值”进行比较,当一致时则链接到所述当前区块。当所述验证选择码为N时,则所述后一区块获取所述当前区块中的删除操作信息,所述删除操作信息包括所述删除操作前当前区块哈希值和超级用户签名。当所述删除操作信息中的用户签名信息为超级用户的签名信息且所述删除操作前当前区块哈希值与自身区块头中存储的“上一区块哈希值”一致时,才能链接到所述当前区块。因此,当所述区块链的某一区块数据被修改或者删除后,所述设置模 块203则会相应地将该区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式。
所述删除模块204,用于根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
具体地,当所述判断模块202判断出所述用户是否为超级用户之后,所述删除模块204则会根据所述当前区块数据删除请求对所述区块链上的当前区块执行数据删除。在本实施例中,虽然用户在登陆到所述终端设备1的时候所述判断模块203已经对该用户进行了权限认证,所述删除模块204在执行区块数据进行删除时仍会请求所述用户进行认证,然后获取所述用户的签名信息,并根据区块中存储的带有超级用户公钥的数字证书对所述签名进行比对,当所述用户签名与所述超级用户签名的信息一致时,则响应所述用户的操作指令对该区块进行数据删除的操作。同时,所述删除模块204还会将删除操作信息存储到所述当前区块的区块头,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
另外,在所述删除模块204对当前区块的数据信息进行删除之后,所述设置模块203还会将当前区块删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息。所述版本验证信息用于在其他交易信息对所述删除的交易信息进行版本号验证时跳过验证并判断为验证通过。在本实施例中,由于区块链中的区块中的所存储的数据信息即交易形象都可能存在关联性,例如后一区块的交易信息建立在前一区块的某条交易信息的基础之上。因此,在区块链的定义中,区块中的交易信息都包括一个版本号,所述版本号作为所述交易信息的唯一标识。因此,当区块中的交易信息删除之后,那么基于所述删除的交易信息的其他交易信息在进行验证时,所述其他交易信息就“无迹可循”了,也就不可信了。因此,所述设置模块203将当前区块删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息,当后一区块的B交易信息是基于所述当前区块删除的A交易信息发生的,那么所述后一区块的B交易信息进行验证时,则可以找到当前区块的区块头中存储的版本验证信息中的删除的交易信息中的版本号,然后再判断所述版本验证信息中的超级 用户签名是否合法,即是为预设的超级用户签名,当所述超级用户签名合法,那么版本号验证时直接跳过验证并判断为验证通过。
最后,所述删除模块204在执行删除操作之后,还会将所述删除后的区块信息以广播的形式同步到其他区块节点。
从上文可知,所述终端设备1能够在接收到用户的区块数据删除请求后确认所述用户的超级用户权限,当所述用户为超级用户时将该区块的验证途径更改超级用户签名+哈希值的验证方式,然后删除该区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,因此可以实现区块中区块数据的删除。
此外,本申请还提出一种区块链区块删除方法,所述方法应用于终端设备1。
参阅图3所示,是本申请区块链区块删除方法一实施例的流程示意图。在本实施例中,根据不同的需求,图3所示的流程图中的步骤的执行顺序可以改变,某些步骤可以省略。
步骤S500,接收用户输入的当前区块数据删除请求,确认所述用户是否为超级用户。
具体地,区块链由一个个相连的区块组成。区块用于记录数据,写入数据到区块链实际上就是新建一个区块,然后将数据写入到新建的区块,新建的区块链接到所述区块链的最尾端成为区块链的一部分。而区块链系统,包括多个区块节点,每一个区块节点都可以是如所述终端设备1一样的终端设备。用户通过区块节点对区块链执行数据访问,以及区块的新建和区块数据的写入。在本实施例中,用户通过所述终端设备1接收用户输入的当前区块数据删除请求。当然,在接收用户输入的当前区块数据删除请求之前,所述终端设备1还接收用户的注册信息,然后将包括用户的公钥信息的数字签名存储到创世区块,并同步到其他所有区块。其中,所述创区块就是所述区块链的第一个区块。
在本实施例中,区块链虽然是去中心管理控制,但由于区块链在不断增加区块的过程中,难免会出现最先创建的区块数据已过期或者失效的情形,而失效或者过期的数据却始终占有区块的存储空间,以及传输带宽。因此,在本实施例中,用户通过区块链系统的区块节点,即通过所述终端设备1访问区块链上的数据,或者新建区块,写入数据。区块链系统可以预先设置至少一名超级用户,所述超级用户的权限设置为能够对所述区块链上的任一区块进行数据删除,或者删除后写入新的内容。
因此,当用户通过所述终端设备1发送访问区块链请求时,所述终端设备1发根据每个用户在注册时预先提交的包含用户公钥的数字证书要求该用户进行身份验证,从而确认所述用户是否为超级用户。其中,判断过程包括:获取所述用户输入的私钥信息,根据所述私钥信息查找出包括与所述私钥信息匹配的公钥信息的数字签名,当所述数字签名存在预设的超级用户签名列表中,则判断所述用户为超级用户。在本实施例中,当用户输入私钥后,所述终端设备1则将用户输入的私钥与存储的所有所述数字证书携带的公钥进行匹配,从而确认该用户的身份及权限,当确认出该用户为超级用户时,则对所述用户开发超级用户权限,就可以执行删除或者更改区块链上任一区块的内容。
步骤S502,当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式。
具体地,区块链中的每个区块都包括两个部分:区块头和区块体。所述区块头包括该版本号、时间戳、上一区块的哈希值、该区块的区块体的哈希值,以及该区块被执行的操作信息等等;区块体用于记录实际数据。其中,哈希值就是计算机可以对任意内容计算出的一个长度相同的特征值,对于不同的数据,其对应的哈希值也不一样。因此,任一区块的区块体或者区块头的内容发生改变必然会导致哈希值的改变,而且该区块的上一区块的区块头或者区块体的内容发生改变也会导致本区块的哈希值的改变。
由于区块链中的区块从后向前有序链接起来的数据结构,每个区块根据区块头中存储的上一区块的哈希值能够准确地指向上一个区块。因此,在这种单向验证链接的过程中,哈希值验证是必不可少的步骤。在本实施例中,当当前区块的区块体或者区块头的内容发生改变之后,哈希值发生改变,因此在数据同步过程中,当前区块的后一区块将不能够链接到当前区块。因此,所述终端设备1可以预先重新设置每一区块链接到上一区块的规则,比如包括两种方式:1哈希值验证;2超级用户签名+哈希值的验证。具体地,所述终端设备1在所述当前区块的区块头中预设的第一验证栏位,第一验证栏位用于在所述当前区块的后一区块链接所述当前区块前,定义所述后一区块对所述当前区块进行的哈希值验证途径,所述哈希验证途径包括:哈希值验证方式,包括:后一区块对当前区块的哈希值与所述后一区块存储的当前区块哈希值进行一致性验证;超级用户签名+哈希值的验证方式,包 括:后一区块将当前区块记录的删除操作信息中的删除操作前当前区块哈希值与所述后一区块存储的当前区块哈希值进行一致性验证,以及当前区块记录的删除操作信息中的超级用户签名是否合法。
适应性地,所述终端设备1预先设置区块链执行数据同步时,后一区块根据获取当前区块的区块头的第一验证栏位的述哈希验证途径,然后根据所述述哈希验证途径的验证方式进行验证,并在验证通过之后链接到当前区块。在本实施例中,所述终端设备1将所述哈希验证途径设置为一个标识码,具有两种状态,例如状态M表示选择哈希值验证方式,状态N表示选择超级用户签名+哈希值的验证方式。当所述当前区块的所述验证选择码为M时,则所述后一区块计算所述当前区块的哈希值,并与自身区块头中存储的“上一区块哈希值”进行比较,当一致时则链接到所述当前区块。当所述验证选择码为N时,则所述后一区块获取所述当前区块中的删除操作信息,所述删除操作信息包括所述删除操作前当前区块哈希值和超级用户签名。当所述删除操作信息中的用户签名信息为超级用户的签名信息且所述删除操作前当前区块哈希值与自身区块头中存储的“上一区块哈希值”一致时,才能链接到所述当前区块。因此,当所述区块链的某一区块数据被修改或者删除后,所述终端设备1则会相应地将该区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式。
步骤S504,根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
具体地,当所述终端设备1判断出所述用户是否为超级用户之后,所述终端设备1则会根据所述当前区块数据删除请求对所述区块链上的当前区块执行数据删除。在本实施例中,虽然用户在登陆到所述终端设备1的时候已经对该用户进行了权限认证,所述终端设备1在执行区块数据进行删除时仍会请求所述用户进行认证,然后获取所述用户的签名信息,并根据区块中存储的带有超级用户公钥的数字证书对所述签名进行比对,当所述用户签名与所述超级用户签名的信息一致时,则响应所述用户的操作指令对该区块进行数据删除的操作。同时,所述终端设备1还会将删除操作信息存储到所述当前区块的区块头,所述删除操 作信息包括删除操作前当前区块哈希值和超级用户签名。
步骤S506,将当前区块删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息。
具体地,在对当前区块的数据信息进行删除之后,所述终端设备1还会将当前区块删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息。所述版本验证信息用于在其他交易信息对所述删除的交易信息进行版本号验证时跳过验证并判断为验证通过。在本实施例中,由于区块链中的区块中的所存储的数据信息即交易形象都可能存在关联性,例如后一区块的交易信息建立在前一区块的某条交易信息的基础之上。因此,在区块链的定义中,区块中的交易信息都包括一个版本号,所述版本号作为所述交易信息的唯一标识。因此,当区块中的交易信息删除之后,那么基于所述删除的交易信息的其他交易信息在进行验证时,所述其他交易信息就“无迹可循”了,也就不可信了。因此,所述终端设备1将当前区块删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息,当后一区块的B交易信息是基于所述当前区块删除的A交易信息发生的,那么所述后一区块的B交易信息进行验证时,则可以找到当前区块的区块头中存储的版本验证信息中的删除的交易信息中的版本号,然后再判断所述版本验证信息中的超级用户签名是否合法,即是为预设的超级用户签名,当所述超级用户签名合法,那么版本号验证时直接跳过验证并判断为验证通过。
步骤S508,将所述删除后的区块信息以广播的形式同步到其他区块节点。
具体地,所述终端设备1在对区块链上的当前区块的待删除的数据信息进行删除之后,还会将删除后的区块信息以广播的形式同步到其他区块节点。
本实施例所提出的区块链区块删除方法,能够在接收到用户的区块数据删除请求后确认所述用户的超级用户权限,当所述用户为超级用户时将该区块的验证途径更改超级用户签名+哈希值的验证方式,然后删除该区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,因此可以实现区块中区块数据的删除。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,终端设备,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种区块链区块删除方法,应用于区块链系统,所述区块链系统包括多个区块节点,其特征在于,所述方法包括步骤:
    接收用户输入的当前区块数据删除请求;
    确认所述用户是否为超级用户;
    当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;以及
    根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
  2. 如权利要求1所述的区块链区块删除方法,其特征在于,所述第一验证栏位用于在所述当前区块的后一区块链接所述当前区块前,定义所述后一区块对所述当前区块进行的哈希值验证途径,所述哈希验证途径包括:
    哈希值验证方式包括:后一区块对当前区块的哈希值与所述后一区块存储的当前区块哈希值进行一致性验证;
    超级用户签名+哈希值的验证方式包括:后一区块将当前区块记录的删除操作信息中的删除操作前当前区块哈希值与所述后一区块存储的当前区块哈希值进行一致性验证,以及当前区块记录的删除操作信息中的超级用户签名是否合法。
  3. 如权利要求1所述的区块链区块删除方法,其特征在于,所述方法还包括步骤:
    在执行删除操作之后,将所述删除后的区块信息以广播的形式同步到其他区块节点。
  4. 如权权利要求1所述的区块链区块删除方法,其特征在于,在所述“接收用户输入的当前区块数据删除请求”的步骤之前,还包括步骤:接收用户的注册信息,将包括用户的公钥信息的数字签名存储到创世区块,并同步到其他所有区块。
  5. 如权利要求1所述的区块链区块删除方法,其特征在于,所述“确认所述用户是否为超级用户”的步骤包括:
    获取所述用户输入的私钥信息;
    根据所述私钥信息查找出包括与所述私钥信息匹配的公钥信息的数字签名;
    当所述数字签名存在预设的超级用户签名列表中,则判断所述用户为超级用户。
  6. 如权利要求1所述的区块链区块删除方法,其特征在于,所述方法还包括步骤:将所述删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息。
  7. 如权利要求6所述的区块链区块删除方法,其特征在于,所述版本验证信息用于在其他交易信息对所述删除的交易信息进行版本号验证时跳过验证并判断为验证通过。
  8. 一种区块链区块删除装置,其特征在于,所述装置包括:
    接收模块,用于接收用户输入的当前区块数据删除请求;
    判断模块,用于确认所述用户是否为超级用户;
    设置模块,用于当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;
    删除模块,用于根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
  9. 如权利要求8所述的区块链区块删除装置,其特征在于,所述第一验证栏位用于在所述当前区块的后一区块链接所述当前区块前,定义所述后一区块对所述当前区块进行的哈希值验证途径,所述哈希验证途径包括:
    哈希值验证方式包括:后一区块对当前区块的哈希值与所述后一区块存储的当前区块哈希值进行一致性验证;
    超级用户签名+哈希值的验证方式包括:后一区块将当前区块记录的删除操作信息中的删除操作前当前区块哈希值与所述后一区块存储的当前区块哈希值进行一致性验证,以及当前区块记录的删除操作信息中的超级用户签名是否合法。
  10. 如权利要求8所述的区块链区块删除装置,其特征在于,所述删除模块还用于:在执行删除操作之后,将所述删除后的区块信息以广播的形式同步到其他区块节点。
  11. 如权利要求8所述的区块链区块删除装置,其特征在于,所述接收模块模块还用于:接收用户的注册信息,将包括用户的公钥信息的数字签名存储到创世区块,并同步到其他所有区块。
  12. 如权利要求8所述的区块链区块删除装置,其特征在于,所述判断模块确认所述用户是否为超级用户的过程包括:
    获取所述用户输入的私钥信息;
    根据所述私钥信息查找出包括与所述私钥信息匹配的公钥信息的数字签名;
    当所述数字签名存在预设的超级用户签名列表中,则判断所述用户为超级用户。
  13. 如权利要求8所述的区块链区块删除装置,其特征在于,所述设置模块还用于:
    将所述删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息。
  14. 如权利要求13所述的区块链区块删除装置,其特征在于,所述版本验证信息用于在其他交易信息对所述删除的交易信息进行版本号验证时跳过验证并判断为验证通过。
  15. 一种终端设备,其特征在于,所述终端设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现以下步骤:
    接收用户输入的当前区块数据删除请求;
    确认所述用户是否为超级用户;
    当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;以及
    根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
  16. 如权利要求15所述的终端设备,其特征在于,所述第一验证栏位用于在所述当前区块的后一区块链接所述当前区块前,定义所述后一区块对所述当前区块进行的哈希值验证途径,所述哈希验证途径包括:
    哈希值验证方式包括:后一区块对当前区块的哈希值与所述后一区块存储的当前区块哈希值进行一致性验证;
    超级用户签名+哈希值的验证方式包括:后一区块将当前区块记录的删除操作信息中的删除操作前当前区块哈希值与所述后一区块存储的当前区块哈希值进行一致性验证,以及当前区块记录的删除操作信息中的超级用户签名是否合法。
  17. 如权利要求15所述的终端设备,其特征在于,所述计算机程序被所述处理器执行时还实现以下步骤:
    在所述“接收用户输入的当前区块数据删除请求”的步骤之前,接收用户的注册信息,将包括用户的公钥信息的数字签名存储到创世区块,并同步到其他所有区块。
  18. 如权利要求15所述的终端设备,其特征在于,所述“确认所述用户是否为超级用户”的步骤包括:
    获取所述用户输入的私钥信息;
    根据所述私钥信息查找出包括与所述私钥信息匹配的公钥信息的数字签名;
    当所述数字签名存在预设的超级用户签名列表中,则判断所述用户为超级用户。
  19. 如权利要求15所述的终端设备,其特征在于,所述计算机程序被所述处理器执行时还实现以下步骤:
    将所述删除的交易信息、所述删除的交易信息对应的版本号,以及超级用户签名记录到所述当前区块的区块头中的版本验证信息,其中,所述版本验证信息用于在其他交易信息对所述删除的交易信息进行版本号验证时跳过验证并判断为验证通过;
    在执行删除操作之后,将所述删除后的区块信息以广播的形式同步到其他区块节点。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序可被至少一个处理器执行,以使所述至少一个处理器执行以下步骤:
    接收用户输入的当前区块数据删除请求;
    确认所述用户是否为超级用户;
    当所述用户为超级用户时,将所述当前区块的区块头中预设的第一验证栏位中的哈希值验证方式更改为超级用户签名+哈希值的验证方式;以及
    根据所述数据删除请求删除所述当前区块的区块体中的对应的交易信息,并将删除操作信息存储到所述当前区块的区块头,其中,所述删除操作信息包括删除操作前当前区块哈希值和超级用户签名。
PCT/CN2018/124670 2018-11-08 2018-12-28 区块链区块删除方法、装置以及终端设备 WO2020093565A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811323377.5A CN109493044A (zh) 2018-11-08 2018-11-08 区块链区块删除方法、装置以及终端设备
CN201811323377.5 2018-11-08

Publications (1)

Publication Number Publication Date
WO2020093565A1 true WO2020093565A1 (zh) 2020-05-14

Family

ID=65695367

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124670 WO2020093565A1 (zh) 2018-11-08 2018-12-28 区块链区块删除方法、装置以及终端设备

Country Status (2)

Country Link
CN (1) CN109493044A (zh)
WO (1) WO2020093565A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913978A (zh) * 2020-09-02 2020-11-10 上海优扬新媒信息技术有限公司 一种区块删除方法、装置及系统

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245006B (zh) * 2019-05-07 2023-05-02 深圳壹账通智能科技有限公司 区块链事务的处理方法、装置、设备及存储介质
CN111966696B (zh) * 2019-05-20 2023-10-13 深圳市网安计算机安全检测技术有限公司 一种区块链中数据的更新方法和装置以及设备
CN112132574B (zh) * 2019-06-25 2024-08-02 华为技术有限公司 区块链数据校验方法、数据处理方法、装置及设备
CN112153085B (zh) * 2019-06-26 2022-05-17 华为技术有限公司 一种数据处理方法、节点及区块链系统
CN110474776B (zh) * 2019-07-19 2022-06-07 上海朝夕网络技术有限公司 一种可信的区块数据动态删减方法
CN110555017A (zh) * 2019-07-25 2019-12-10 深圳壹账通智能科技有限公司 区块链数据清理方法、装置、计算机设备和存储介质
EP3825864A1 (de) * 2019-11-20 2021-05-26 Akarion AG Verfahren und zugehöriges computersystem zum erzeugen von daten einer datenstruktur
CN113221157B (zh) * 2020-02-04 2023-09-26 北京京东振世信息技术有限公司 一种设备升级方法和装置
CN111447069B (zh) * 2020-03-23 2021-10-26 腾讯科技(深圳)有限公司 一种基于区块链的低频访问数据处理方法
CN111488345A (zh) * 2020-04-08 2020-08-04 北京瑞策科技有限公司 业务数据区块链的存储优化方法及装置
CN111340496B (zh) * 2020-05-20 2020-10-27 南京如般量子科技有限公司 一种自动优化历史交易数据的区块链系统及方法
CN111444216A (zh) * 2020-06-15 2020-07-24 支付宝(杭州)信息技术有限公司 一种基于中心化块链式账本的数据块删除方法
CN113378213B (zh) * 2021-04-20 2022-06-21 华南农业大学 一种可记录可追朔的区块链安全删改方法
CN113783839B (zh) * 2021-08-06 2023-04-07 华润数字科技有限公司 区块链数据更新方法、装置、计算机设备及存储介质
CN113627938B (zh) * 2021-08-24 2024-05-28 上海点融信息科技有限责任公司 一种区块链的数据删除方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108075895A (zh) * 2016-11-15 2018-05-25 深圳银链科技有限公司 一种基于区块链的节点许可方法和系统
WO2018103850A1 (en) * 2016-12-08 2018-06-14 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for creating a finite blockchain
CN108270836A (zh) * 2017-01-03 2018-07-10 华为技术有限公司 基于区块链的数据处理方法、设备和系统
CN108615156A (zh) * 2018-05-09 2018-10-02 上海魅联信息技术有限公司 一种基于区块链的数据结构
WO2018184447A1 (zh) * 2017-04-05 2018-10-11 中国移动通信有限公司研究院 基于区块链的数字证书删除方法、装置及系统、存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012167392A2 (en) * 2011-06-06 2012-12-13 ETH Zürich Method and devices for secure deletion of data in a log structured file system
CN106251216B (zh) * 2016-07-18 2020-12-25 恒宝股份有限公司 一种用于缓解节点存储压力的方法和系统
KR101937216B1 (ko) * 2017-02-01 2019-01-11 주식회사 데일리인텔리전스 블록체인을 인증서 발급기관으로 이용해서 인증서를 관리하는 장치 및 방법
CN107480555B (zh) * 2017-08-01 2020-03-13 中国联合网络通信集团有限公司 基于区块链的数据库访问权限控制方法及设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108075895A (zh) * 2016-11-15 2018-05-25 深圳银链科技有限公司 一种基于区块链的节点许可方法和系统
WO2018103850A1 (en) * 2016-12-08 2018-06-14 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for creating a finite blockchain
CN108270836A (zh) * 2017-01-03 2018-07-10 华为技术有限公司 基于区块链的数据处理方法、设备和系统
WO2018184447A1 (zh) * 2017-04-05 2018-10-11 中国移动通信有限公司研究院 基于区块链的数字证书删除方法、装置及系统、存储介质
CN108615156A (zh) * 2018-05-09 2018-10-02 上海魅联信息技术有限公司 一种基于区块链的数据结构

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913978A (zh) * 2020-09-02 2020-11-10 上海优扬新媒信息技术有限公司 一种区块删除方法、装置及系统
CN111913978B (zh) * 2020-09-02 2023-07-25 度小满科技(北京)有限公司 一种区块删除方法、装置及系统

Also Published As

Publication number Publication date
CN109493044A (zh) 2019-03-19

Similar Documents

Publication Publication Date Title
WO2020093565A1 (zh) 区块链区块删除方法、装置以及终端设备
CN111901121B (zh) 跨区块链的认证方法及装置、电子设备
CN110175840B (zh) 联盟链中实现轻钱包机制的方法、客户端、联盟链及系统
CN110912707B (zh) 基于区块链的数字证书处理方法、装置、设备及存储介质
WO2020211496A1 (zh) 一种块链式账本中的签名验证方法、系统、装置及设备
US20240022571A1 (en) Blockchain folding
WO2018112940A1 (zh) 区块链节点的业务执行方法、装置及节点设备
CN110059089B (zh) 数据同步方法、装置、存储介质及电子设备
WO2022134951A1 (zh) 一种数据同步方法、装置、设备以及计算机可读存储介质
EP4191498A1 (en) Data communication method and apparatus, computer device, and storage medium
CN110995446B (zh) 证据验证方法、装置、服务器及存储介质
CN111597567B (zh) 数据处理方法、装置、节点设备及存储介质
CN110866289B (zh) 基于区块链的数据处理方法、装置、服务器及存储介质
CN110598452B (zh) 基于区块链的证据信息处理方法、装置、存储介质和设备
CN110597820B (zh) 基于区块链的信息处理方法、装置、存储介质和设备
CN110620776B (zh) 一种数据转移信息传输方法及其装置
US20240163118A1 (en) Blockchain-based data processing method, device, and readable storage medium
CN102761940A (zh) 一种802.1x认证方法和设备
CN112182009B (zh) 区块链的数据更新方法及装置、可读存储介质
CN111695098B (zh) 多分布式集群访问方法及装置
CN110598477A (zh) 基于区块链的信息处理方法、装置、存储介质和设备
CN113497762A (zh) 数据报文的传输方法及装置
CN115982279A (zh) 数据同步方法、装置、系统和计算机设备
CN118297594A (zh) 资源处理方法、装置、计算机设备和区块链系统
CN110597466B (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: 18939388

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06/08/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18939388

Country of ref document: EP

Kind code of ref document: A1