CN113312362B - Block chain data modification method, device, equipment and storage medium - Google Patents

Block chain data modification method, device, equipment and storage medium Download PDF

Info

Publication number
CN113312362B
CN113312362B CN202010119745.5A CN202010119745A CN113312362B CN 113312362 B CN113312362 B CN 113312362B CN 202010119745 A CN202010119745 A CN 202010119745A CN 113312362 B CN113312362 B CN 113312362B
Authority
CN
China
Prior art keywords
target
block
transaction
data
chain
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010119745.5A
Other languages
Chinese (zh)
Other versions
CN113312362A (en
Inventor
王玉操
肖伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010119745.5A priority Critical patent/CN113312362B/en
Publication of CN113312362A publication Critical patent/CN113312362A/en
Application granted granted Critical
Publication of CN113312362B publication Critical patent/CN113312362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • 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/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data modification method, device and equipment of a blockchain and a storage medium, and relates to the technical field of blockchains. The specific implementation scheme is as follows: determining a target transaction to be modified and a target modification mode according to a data modification transaction request transmitted in a block chain network; modifying the block data state of the target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, wherein the modified block data are used for indicating a block generating node to repackage the block data of the target block chain, generating a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain. By modifying the block data state of the target block chain in the local area through each node, the block generating node can directly repackage the original block chain without the need of consensus verification, and the block chain data modifying speed is greatly improved.

Description

Block chain data modification method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of blockchains, and specifically relates to a data modification method, device, equipment and storage medium of a blockchain.
Background
The decentralised storage mode of the blockchain system leads to the fact that data cannot be modified after being uplinked, and further leads to the fact that illegal information or error information cannot be modified or cleared forever after being uplinked, and negative influence is brought to a supervision organization or a blockchain server. At present, although the modification of the blockchain data can be realized through a consensus mechanism, the data modification efficiency is lower, and the normal operation of the blockchain service is affected.
Disclosure of Invention
The embodiment of the application provides a data modification method, device and equipment of a blockchain and a storage medium, which can improve the data modification speed of the blockchain.
In a first aspect, an embodiment of the present application provides a method for modifying data of a blockchain, performed by a blockchain link point, the method including:
Determining a target transaction to be modified and a target modification mode according to a data modification transaction request transmitted in a block chain network;
Modifying the block data state of a target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, wherein the modified block data are used for indicating a block generation node to repackage the block data of the target block chain, generating a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain.
One embodiment of the above application has the following advantages or benefits: by modifying the block data state of the target block chain in the local area through each node, the block generating node can directly repackage the original block chain under the condition that the common identification verification is not needed, namely, before the new chain is not constructed, the modifying action has an effect, and the block chain data modifying speed is greatly improved.
Optionally, before modifying the block data state of the target block chain in the local area according to the target transaction and the target modification mode, the method further includes:
determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
Traversing the target blockchain from the target initial block to obtain an associated transaction affected by the target transaction;
Stopping receiving the uplink request depending on the target transaction and/or the associated transaction.
One embodiment of the above application has the following advantages or benefits: in the process of modifying the block data, the external uplink request is still normally responded, but the receiving of the uplink request depending on the target transaction and/or the associated transaction is stopped, so that the error uplink of the data is avoided under the condition that the normal operation of the block chain is not influenced.
Optionally, the modifying the block data state of the target block chain in the local area according to the target transaction and the target modification mode includes:
Rolling back the target transaction and the related transaction influenced by the target transaction to an original data state before the target transaction occurs;
Modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data;
And re-executing the target transaction and the associated transaction in the target block chain according to the target modification data to obtain a modified transaction processing result in the block.
One embodiment of the above application has the following advantages or benefits: the block chain node is modified after data rollback, so that the consistency of data modification in the block chain is ensured, only target transactions and related transactions are re-executed, a modified transaction processing result in the block is obtained, re-execution of transaction data in all the blocks is avoided, the transaction processing amount is reduced, and the block data modification efficiency is improved.
Optionally, after the obtaining the modified transaction result in the block, the method further includes:
Initiating receipt of a request to be uplink dependent on the target transaction and/or the associated transaction.
One embodiment of the above application has the following advantages or benefits: after each block chain link point completes the block data modification, even if a target bifurcation chain is not constructed currently, any uplink transaction request can be responded normally, and the normal operation of the block chain and the correctness of the transaction data can be guaranteed rapidly.
Optionally, the method further comprises:
receiving a repackaged new block sent by the block generating node;
and generating a target bifurcation chain of the target block chain according to the new block without consensus verification.
One embodiment of the above application has the following advantages or benefits: because each block chain node is equivalent to completing the verification of the block data in advance when modifying the block data, and then when the block chain generation node repacks and constructs the target bifurcation chain, a complex and time-consuming common identification verification process is not needed, and the block chain data modification speed is improved.
In a second aspect, an embodiment of the present application provides a data modification method of a blockchain, performed by a blockgenerating node, the method including:
responding to a data modification transaction request, and acquiring block data after modifying a target block chain by a block chain link point according to a target transaction and a target modification mode;
Repackaging the block data of the target blockchain to generate a target bifurcation chain of the target blockchain, and replacing the target blockchain with the target bifurcation chain.
One embodiment of the above application has the following advantages or benefits: in the process of modifying the block chain data, the block generating node only needs to directly repackage the block data to construct the target bifurcation chain, namely, before the target bifurcation chain is not constructed, the modifying action of each block chain node has an effect, and the modifying speed of the block chain data is greatly improved.
Optionally, the repackaging the block data of the target blockchain includes:
determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
repackaging the transaction data in the target initial block and the subsequent blocks to generate new blocks and transmitting to a blockchain network.
One embodiment of the above application has the following advantages or benefits: the block generating node repacks the first block where the target transaction is located, namely generates a bifurcation chain at the position of the last block of the target initial block so as to replace the block where the target transaction is located and the subsequent blocks thereof, thereby realizing the modification of the block chain data.
Optionally, the repackaging the block data of the target blockchain includes:
and repackaging the block data of the target block chain according to the one-to-one correspondence between the target bifurcation chain and the blocks in the target block chain based on the block structure of the target block chain.
One embodiment of the above application has the following advantages or benefits: the block one-to-one repackaging is carried out based on the block structure of the target block chain, so that the Hash and the signature in the new chain are ensured to be complete and verifiable, and the original physical structure of the target block chain is reserved.
Optionally, the repackaging the block data of the target blockchain includes:
and repackaging the block data of the target block chain according to the upper limit of the block transaction capacity.
One embodiment of the above application has the following advantages or benefits: and the block data is repackaged based on the upper limit of the block transaction capacity, so that the packing efficiency is improved, and the waste of storage is avoided.
Optionally, the replacing the target blockchain with the target bifurcation chain includes:
And in the target bifurcation chain and the target blockchain, if the fact that the transaction data in the new block packed currently is consistent is detected, triggering main chain switching at the next block height, and replacing the target blockchain by the target bifurcation chain.
One embodiment of the above application has the following advantages or benefits: and detecting the transaction in the current package block in the target bifurcation chain and the target blockchain, triggering the main chain switching when the target bifurcation chain is detected to catch up with the target blockchain, and modifying the blockchain data.
In a third aspect, an embodiment of the present application provides a data modification apparatus for a blockchain node, the apparatus including:
the modification target determining module is used for determining a target transaction to be modified and a target modification mode according to the data modification transaction request transmitted in the blockchain network;
The local block data modification module is used for modifying the block data state of a target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, and is used for indicating a block generation node to repackage the block data of the target block chain to generate a target bifurcation chain of the target block chain and replacing the target block chain with the target bifurcation chain.
In a fourth aspect, an embodiment of the present application provides a data modification apparatus for a blockchain configured at a blockgenerating node, the apparatus including:
the block data acquisition module is used for responding to the data modification transaction request, and acquiring block data after the block chain link point modifies the target block chain according to the target transaction and the target modification mode;
And the main chain switching module is used for repackaging the block data of the target block chain to generate a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain.
In a fifth aspect, an embodiment of the present application provides an electronic device, including:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data modification method of a blockchain of any embodiment of the first aspect of the application or to perform the data modification method of a blockchain of any embodiment of the second aspect of the application.
In a sixth aspect, embodiments of the present application provide a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method for modifying data of a blockchain according to any embodiment of the first aspect of the present application, or to perform the method for modifying data of a blockchain according to any embodiment of the second aspect of the present application.
One embodiment of the above application has the following advantages or benefits: the method comprises the steps that a target transaction and a target modification mode to be modified are determined by a block chain node according to a data modification transaction request, block data state modification is conducted on a target block chain to be modified locally based on the target transaction and the target modification mode, block data after modification in the target block chain are obtained, therefore, the block data of the target block chain are directly repackaged by a current block generation node, a target bifurcation chain taking the target block chain as a main chain is generated, and the target bifurcation chain is adopted to replace an original main chain to achieve block chain data modification. According to the embodiment of the application, the block data state of the target block chain in the local area is modified by each node, so that the block generation node can directly repackage the original block chain under the condition that common identification verification is not needed, namely, before the new chain is not constructed, the modification action has an effect, and the data modification speed of the block chain is greatly improved.
Other effects of the above alternative will be described below in connection with specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a flow chart of a data modification method of a blockchain in accordance with a first embodiment of the present application;
FIG. 2 is a flow chart of a data modification method of a blockchain in accordance with a second embodiment of the present application;
FIG. 3 is a diagram comparing this embodiment with the prior art according to a second embodiment of the present application;
FIG. 4 is a flow chart of a data modification method of a blockchain in accordance with a third embodiment of the present application;
FIG. 5 is a block chain data modification apparatus according to a fourth embodiment of the present application;
FIG. 6 is a schematic diagram of a block chain data modification apparatus according to a fifth embodiment of the present application;
FIG. 7 is a block diagram of an electronic device for implementing a data modification method of a blockchain of embodiments of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
First embodiment
Fig. 1 is a flowchart of a data modification method of a blockchain according to a first embodiment of the present application, where the method is applicable to modifying transaction data in the blockchain, and the method is performed by blockchain nodes, and may be performed by a blockchain data modification device, which is implemented in software and/or hardware, and is preferably configured in an electronic device in which the blockchain nodes are deployed. As shown in fig. 1, the method specifically includes the following steps:
S110, determining a target transaction to be modified and a target modification mode according to the data modification transaction request transmitted in the blockchain network.
In a specific embodiment of the present application, the data modification transaction request is used to trigger the blockchain to modify the transaction data stored in the blockchain, which may be a control instruction for modifying the blockdata, or may be a transaction request for initiating modification data. The data modification transaction request includes, but is not limited to, a target transaction to be modified, a target modification mode of the target transaction, modification initiator information, modification time, and the like. The target transaction can be any transaction data or transaction logic; the target modification may include an addition, change, or deletion of the target transaction.
In this embodiment, the data modification transaction request may be presented in at least two ways.
In the first mode, in the consensus mechanism, authority mechanisms such as public security and the like are taken as specific accounts which are approved by all nodes and have data modification authority, and based on verification of account identities, the specific accounts are allowed to access a system-level data modification interface, so that the specific accounts initiate data modification transaction requests to a blockchain network through the interface, and the consensus nodes participating in consensus execute block data modification.
And secondly, generating a data modification transaction request by the node with proposal initiating authority, and initiating a voting proposal transaction in the blockchain network according to the data modification transaction request. The voting proposal transaction can comprise transaction ID, voting deadline height and other information. And then the consensus nodes or communities respond to the voting proposal transaction to vote, and if the voting passes, the consensus nodes participating in the consensus respond to the data modification transaction request to execute block data modification.
Specifically, after a specific account with data modification authority or a node with proposal initiation authority transmits a data modification transaction request to the blockchain network, other nodes in the blockchain network can receive the data modification transaction request, so as to analyze the data modification transaction request and at least obtain a target transaction to be modified and a target modification mode.
S120, modifying the block data state of the target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, wherein the modified block data are used for indicating a block generation node to repackage the block data of the target block chain, generating a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain.
In an embodiment of the present application, the target blockchain in the local area refers to the blockchain of the data to be modified in the blockchain node. The target bifurcation chain is a bifurcation chain constructed by repackaging the modified block data in the target bifurcation chain with pointers, and is generated from the last block of the target initial block storing the target transaction.
The key point of the embodiment is that each blockchain node respectively modifies the block data in the local target blockchain. The modification operation may include rollback of the blockchain data, modification of the blockchain data, and re-execution of the transactions in the blocks, and the modification operation is only performed for the target transaction and the related transactions affected by the target transaction, and other transaction data may not be processed, thereby saving computation and storage during data modification.
Yet another key to this embodiment is that the target blockchain is constructed by the blocklet generation node repackaging the blocklet data of the target blocklet to generate new blocks as the data modification is made by the various blocklet nodes. In the process of constructing the target bifurcation chain, the block generating node performs modification operation on each block chain link point, which is equivalent to completing consensus verification based on the block chain node, namely, before the new target bifurcation chain is not constructed, the modification action has an effect, so that the consensus verification operation when the block generating node constructs the target bifurcation chain is omitted, the block generating node directly repacks and constructs the target bifurcation chain, and the speed of modifying the block chain data is greatly improved.
Specifically, the block link point rolls back the target transaction and the related transaction influenced by the target transaction to the original data state before the target transaction occurs; modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data; and re-executing the target transaction and the associated transaction in the target blockchain according to the target modification data to obtain a modified transaction processing result in the block. The block generation node acquires block data after the block chain node modifies the target block chain, and repacks the block data of the target block chain from the target initial block where the target transaction is located to generate a new block. Accordingly, the blockchain node directly constructs the target bifurcation chain of the target blockchain without consensus verification after receiving the new blockchain. The final blockgenerating node replaces the portion of the backbone in the target blockchain that forms the bifurcation with the target bifurcation chain. Each blockchain node physically deletes the replaced part of the main chain in the target blockchain in the bottom database stored in the target blockchain, does not leave any data of the original transaction, and does not generate any modification trace.
In the prior art, when the data modification of the blockchain is realized, the current block generating node responds to the data modification transaction request, namely: based on the target blockchain, the block generating node sequentially executes the operations of data modification, re-execution, repacking, consensus verification and the like for each block from the first block of the target transaction, thereby causing the problem of very slow data modification of the blockchain.
In addition, in the process of modifying the block data by each block chain node, the embodiment can normally respond to an external uplink request, but the subsequent uplink request depending on any transaction in the affected transaction list is not accepted any more, so that the error uplink of the transaction data is avoided. When each block chain node completes the block data modification, the current target bifurcation chain can start to receive the uplink request depending on the target transaction and/or the associated transaction even if the current target bifurcation chain is not constructed, so that the normal operation of the target block chain is ensured to the maximum extent. Wherein blocks generated in response to the uplink request remain attached to the target blockchain because the target bifurcation chain does not catch up with the target blockchain. But because the construction speed of the target bifurcation chain is higher, the target bifurcation chain can be quickly caught up, transaction data in a new block currently packed by the target bifurcation chain and the target bifurcation chain are consistent, and the main chain switching is triggered, so that the target bifurcation chain replaces the part of the main chain forming bifurcation in the target bifurcation chain.
According to the technical scheme of the embodiment, the block chain node determines a target transaction to be modified and a target modification mode according to the data modification transaction request, and based on the target transaction and the target modification mode, block data state modification is performed on a local target block chain to be modified to obtain block data after modification in the target block chain, so that the current block generation node directly repacks the block data of the target block chain to generate a target bifurcation chain taking the target block chain as a main chain, and the target bifurcation chain is adopted to replace an original main chain to realize block chain data modification. According to the embodiment of the application, the block data state of the target block chain in the local area is modified by each node, so that the block generation node can directly repackage the original block chain under the condition that common identification verification is not needed, namely, before the new chain is not constructed, the modification action has an effect, and the data modification speed of the block chain is greatly improved.
Second embodiment
FIG. 2 is a flowchart of a method for modifying data of a blockchain according to a second embodiment of the present application, where the modification of blockchain data is further explained based on the first embodiment, and each blockchain node is capable of rolling back a target transaction and an associated transaction affected by the target transaction to an original data state before the target transaction occurs; modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data; and re-executing the target transaction and the associated transaction in the target blockchain according to the target modification data to obtain a modified transaction processing result in the block. As shown in fig. 2, the method specifically includes the following steps:
S210, determining a target transaction to be modified and a target modification mode according to the data modification transaction request transmitted in the blockchain network.
S220, rolling back the target transaction and the related transaction influenced by the target transaction to the original data state before the target transaction occurs.
In a specific embodiment of the present application, the associated transaction affected by the target transaction refers to a transaction that performs a transaction depending on the transaction result of the target transaction. The associated transaction may be in the same block as the target transaction or in a block subsequent to the first block in which the target transaction is located. Since the modification to the target transaction necessarily affects the transaction processing results of the subsequent associated transactions when the blockchain data is modified, the target transaction and the associated transactions need to be modified together in order to ensure the cleanliness of the blockchain overall data. Wherein, depending on the specifics of the transaction data in the blockchain, there may be no associated transaction.
In this embodiment, rollback (Rollback) refers to an action of restoring data to the last state. In order to fundamentally ensure the cleanness of the blockchain data during data modification, firstly, according to the occurrence reverse order of the target transaction and the associated transaction, rolling back the target transaction and the associated transaction in each block to the original data state before the target transaction occurs from back to front until the first block where the target transaction is located.
Optionally, before modifying the block data state of the target blockchain in the local area according to the target transaction and the target modification mode, determining a target initial block for recording the target transaction in the target blockchain according to the target transaction; traversing the target blockchain from the target initial block to obtain an associated transaction affected by the target transaction; the receipt of the uplink request depending on the target transaction and/or the associated transaction is stopped.
In this embodiment, the target initial block refers to the first block where the target transaction is located. Before modifying the block data state of the target block chain in the local area according to the target transaction and the target modification mode, a target initial block for recording the target transaction in the target block chain can be determined first, and the target block chain is traversed from the target initial block to obtain the associated transaction influenced by the target transaction. In the process of modifying the block data, the external uplink request is still normally responded, but the receiving of the uplink request depending on the target transaction and/or the associated transaction is stopped, so that the error uplink of the data is avoided under the condition that the normal operation of the block chain is not influenced.
S230, modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data.
In the embodiment of the application, the target transaction and the associated transaction are modified based on the original data state on the basis of the rollback of the data to the original data state, so that the consistency of the data before and after modification is ensured, and the target modification data after modification of the target transaction and the associated transaction is obtained.
S240, re-executing the target transaction and the associated transaction in the target block chain according to the target modification data to obtain a modified transaction processing result in the block.
In a specific embodiment of the present application, in order to ensure the correctness of the transaction result after data modification in the block, the target transaction and the associated transaction need to be re-executed according to the target modification data, so as to obtain the modified transaction result consistent with the data modification in the block. In order to further improve the data modification efficiency, the computing processing operation in the blockchain is reduced, and only the target transaction and the associated transaction are re-executed, and other transactions in the block are still reserved.
Illustratively, after the data rollback, from the target initial block, both the target transaction in the blockchain and the related data in the associated transaction are rolled back to the original data state. If the target modification mode is data modification, the original data state is modified to obtain target modification data, and the target transaction and the associated transaction in the block are re-executed to obtain a modified transaction processing result in the block. If the target modification mode is deletion, both the target transaction and the associated transaction in the blockchain are deleted, and accordingly, the operations do not need to be re-executed.
Optionally, the initiation receives a request to rely on the target transaction and/or the associated transaction.
In this embodiment, after each block link point completes the block data modification, the receiving of the uplink request depending on the target transaction and/or the associated transaction may be restarted. The method and the device can normally respond to any uplink transaction request even if the target bifurcation chain is not constructed at present, namely, the modification of the block chain data is not completed, and the normal operation of the block chain and the correctness of the transaction data can be rapidly ensured.
S250, receiving the repackaged new blocks sent by the block generation node.
In a specific embodiment of the present application, the modified transaction result in the block is used to instruct the current block generating node to package each block one by one from the target initial block. The block data in the block where the target transaction and the associated transaction are located are changed, and the corresponding block header information such as the Hash digest in the blocks is changed. And since the block header information of the next block is closely related to the previous block, the block chain structure of all blocks is changed from the target initial block. Therefore, the block generating node needs to repackage each block to ensure the correctness of the block chain structure in the block chain. Specifically, after repackaging to generate a new block, the block generating node may transmit the new block to the blockchain network, and the repackaged new block may be received by other block link points.
S260, according to the new block, the target bifurcation chain of the target block chain is generated without the common identification.
In the embodiment of the present application, the target bifurcation chain is a bifurcation chain constructed with the target blockchain as a main chain from the previous block of the target initial block. Wherein the target bifurcation chain is composed of new blocks after repackaging.
In this embodiment, after receiving a new block, the blockchain node performs consensus verification on the new block, and after the verification is passed, the new block can be added into the blockchain, so that the problem of slower adding speed of the new block into the blockchain is caused. In view of the fact that each blockchain node is equivalent to completing verification of the blockdata in advance when modifying the blockdata, and further, when the blockchain generation node repacks and constructs the target bifurcation chain, a complex and time-consuming common verification process is not needed, each blockchain node can construct the target bifurcation chain directly according to the new block, and the construction speed of the target bifurcation chain is greatly improved.
Accordingly, the target bifurcation chain will quickly catch up with the target blockchain because of the faster construction speed of the target bifurcation chain. And further, based on a main chain switching rule preset in the consensus mechanism, when the blockchain generating node detects that the transaction data in the new block currently packed in the target bifurcation chain and the target blockchain are consistent, triggering main chain switching at the next block height, and replacing the part of main chain from the target initial block in the target blockchain by the target bifurcation chain. That is, in the underlying code, pointers to the target blockchain are adjusted to point to the target bifurcation chain, and the portion of the backbone data that is to be replaced from the underlying database of the blockchain is physically deleted.
Among them, for the consensus algorithm originally supporting the generation of the bifurcation chain, such as PoW (Proof of Work), poS (Proof of equity), DPoS (DELEGATED PROOF OF STAKE, proof of equity), the data modification of the blockchain can be implemented according to the above flow. Whereas the class BFT (Byzantine Fault Tolerance, bayer fault tolerance algorithm) such as PBFT (PRACTICAL BYZANTINE FAULT TOLERANCE, practical bayer fault tolerance algorithm) does not support the common-knowledge algorithm generated by the bifurcation chain, state judgment logic may be added to such common-knowledge algorithm in advance. If the node broadcasting data modification transaction to the blockchain network is detected based on the modified consensus mechanism in the original blockchain process of the algorithm, after the consensus node generates consensus on the data modification transaction, stopping the blockservice, reversely reversing to the target initial block, repackaging the block on the target blockchain, and generating the block on the bifurcation chain.
Fig. 3 is a diagram illustrating the comparison between the present embodiment and the prior art. As shown in fig. 3, the upper diagram in fig. 3 is a schematic diagram of a prior art implementation, and when the blockchain data is modified, according to the execution sequence of the labels in the diagram, each block is subjected to data modification, re-execution, repacking and consensus verification by the block generating node so as to generate a bifurcation chain. Among them, formula verification is a very time-consuming procedure. The lower diagram in fig. 3 is a schematic diagram implemented in this embodiment, after performing data rollback, data modification and re-execution on the local target blockchain, each blockchain node is repackaged by the block generating node based on the modified transaction result in the block without common authentication, so as to generate a bifurcation chain. Therefore, compared with the prior art, the embodiment transfers the essential behavior of data modification to each block chain node machine, not only disperses the calculation force, but also can properly perform parallel processing in time without mutual influence, thereby greatly improving the block chain data modification speed.
According to the technical scheme of the embodiment, the block chain node determines a target transaction to be modified and a target modification mode according to the data modification transaction request, and sequentially performs data rollback, data modification and transaction re-execution on the target block chain to obtain a modified transaction processing result in the block, so that the current block generation node directly repacks the block data of the target block chain, each block chain node receives the repackaged new block sent by the block generation node, generates a target bifurcation chain taking the target block chain as a main chain, and provides a basis for main chain switching. According to the embodiment of the application, the block data state of the target block chain in the local area is modified by each node, so that the block generation node can directly repackage the original block chain under the condition that common identification verification is not needed, namely, before the new chain is not constructed, the modification action has an effect, and the data modification speed of the block chain is greatly improved.
Third embodiment
Fig. 4 is a flowchart of a data modification method of a blockchain according to a third embodiment of the present application, where the method is applicable to modifying transaction data in the blockchain, and the method is performed by a blockchain generation node, and may be performed by a blockchain data modification device, which is implemented in software and/or hardware, and is preferably configured in an electronic device in which a blockchain consensus node is deployed. As shown in fig. 4, the method specifically includes the following steps:
S410, responding to the data modification transaction request, and acquiring block data after modifying the target block chain by the block chain link point according to the target transaction and the target modification mode.
In a specific embodiment of the present application, the block data after the modification of the target blockchain refers to the block data obtained after the local target blockchain is subjected to data rollback, data modification and re-execution by each blockchain node according to the target transaction and the target modification mode in the data modification transaction request. Correspondingly, the block generating node directly acquires the partial block data.
S420, repackaging the block data of the target block chain to generate a target bifurcation chain of the target block chain, and replacing the target block chain with the target bifurcation chain.
In the embodiment of the application, as the block data in the block where the target transaction and the related transaction are located are changed, the block header information such as the Hash digest in the corresponding blocks is changed. And since the block header information of the next block is closely related to the previous block, the block chain structure of all blocks is changed from the first block where the target transaction is located. Therefore, the block generating node needs to repackage each block and regenerate the block header information of each block to ensure the correctness of the block chain structure in the block chain.
Specifically, according to a target transaction, determining a target initial block for recording the target transaction in a target block chain; the transaction data in the target initial block and the subsequent blocks are repackaged to generate new blocks and transmitted to the blockchain network. Correspondingly, the link points of other blocks receive the repackaged new blocks sent by the block generation node, and after being directly connected to the previous block of the target initial block, the link of the new blocks is one by one so as to generate the target bifurcation chain taking the target block chain as the main chain. And replacing the part of the target blockchain from the target initial block with the target bifurcation chain after the last block of the target initial block based on a main chain switching rule preset in a consensus mechanism.
And if the transaction data in the new block currently packed is detected to be consistent in the target bifurcation chain and the target blockchain, triggering main chain switching at the next block height, and replacing the target blockchain by the target bifurcation chain. Because the target bifurcation chain is generated based on the target blockchain, when the transaction data in the new chunk currently packed is consistent, i.e., the target bifurcation chain catches up with the target blockchain, the target bifurcation chain is used to replace the target blockchain at the next blockheight.
Optionally, based on the block structure of the target blockchain, the block data of the target blockchain is repackaged according to the one-to-one correspondence between the target bifurcation chain and the blocks in the target blockchain.
In the repacking process, the embodiment can completely follow the original block chain structure of the target block chain, namely, repacking the block data in each block on the target block chain according to the one-to-one correspondence between the target bifurcation chain and the blocks in the target block chain to generate a new corresponding block on the target bifurcation chain. Such packing ensures that the target bifurcation chain is exactly the same block height as the target blockchain. Accordingly, the target blockchain may be replaced with the target bifurcation chain when the block height of the target bifurcation chain catches up with the block height of the target blockchain.
Optionally, the block data of the target blockchain is repackaged according to the upper limit of the block transaction capacity.
In the repacking process, the original block chain structure of the target block chain can be ignored, and the block data can be sequentially extracted from each block of the target block chain according to the fast packing principle, so that the extracted block data can not be repacked into a new block until the extracted block data reaches the upper limit of the block transaction capacity. On the basis of conforming to the block chain structure, the packing mode fully utilizes the storage space in each block, has larger stored transaction density, improves packing efficiency and avoids the waste of storage. Accordingly, in the target bifurcation chain and the target blockchain, the target bifurcation chain is adopted to replace the target blockchain only when the coincidence of the transaction data in the new block currently packed is detected.
According to the technical scheme of the embodiment, when responding to a data modification transaction request, a block generation node acquires block data after a block chain link point modifies a target block chain according to a target transaction and a target modification mode, directly repackages the block data of the target block chain, generates a target bifurcation chain taking the target block chain as a main chain, and replaces an original main chain with the target bifurcation chain to realize block chain data modification. In the embodiment of the application, in the process of modifying the block chain data, the block generation node only needs to directly repackage the block data to construct the target bifurcation chain, namely, before the target bifurcation chain is not constructed, the modifying action of each block chain node has an effect, thereby greatly improving the modifying speed of the block chain data.
Fourth embodiment
Fig. 5 is a schematic structural diagram of a data modification apparatus for a blockchain according to a fourth embodiment of the present application, where the apparatus is configured in a blockchain node and the method for modifying data of a blockchain according to any embodiment of the present application can be applied to a situation where transaction data in the blockchain is modified. The apparatus 500 specifically includes the following:
a modification target determining module 510, configured to determine a target transaction to be modified and a target modification mode according to a data modification transaction request transmitted in the blockchain network;
The local block data modification module 520 is configured to modify a block data state of a target block chain in the local area according to the target transaction and the target modification manner, so as to obtain modified block data in the target block chain, instruct a block generating node to repackage the block data of the target block chain, generate a target bifurcation chain of the target block chain, and replace the target block chain with the target bifurcation chain.
Further, the apparatus 500 further includes a uplink control module 530, specifically configured to:
Before modifying the block data state of a target block chain in the local area according to the target transaction and the target modification mode, determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
Traversing the target blockchain from the target initial block to obtain an associated transaction affected by the target transaction;
Stopping receiving the uplink request depending on the target transaction and/or the associated transaction.
Optionally, the local block data modification module 520 is specifically configured to:
Rolling back the target transaction and the related transaction influenced by the target transaction to an original data state before the target transaction occurs;
Modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data;
And re-executing the target transaction and the associated transaction in the target block chain according to the target modification data to obtain a modified transaction processing result in the block.
Optionally, the uplink control module 530 is specifically configured to:
and after the modified transaction processing result in the obtained block, starting to receive a uplink request depending on the target transaction and/or the associated transaction.
Optionally, the local block data modification module 520 is specifically further configured to:
receiving a repackaged new block sent by the block generating node;
and generating a target bifurcation chain of the target block chain according to the new block without consensus verification.
According to the technical scheme of the embodiment, the functions of response of the data modification transaction request, determination of the target transaction, determination of the target modification mode, rollback of data, modification of the data, re-execution of transaction data, control of a uplink, receiving of a new block, construction of a target bifurcation chain and the like are realized through mutual coordination among the functional modules. According to the embodiment of the application, the block data state of the target block chain in the local area is modified by each node, so that the block generation node can directly repackage the original block chain under the condition that common identification verification is not needed, namely, before the new chain is not constructed, the modification action has an effect, and the data modification speed of the block chain is greatly improved.
Fifth embodiment
Fig. 6 is a schematic structural diagram of a data modification apparatus for a blockchain according to a fifth embodiment of the present application, where the apparatus is configured in a block generating node and the method for modifying data of a blockchain according to any embodiment of the present application can be applied to a situation where transaction data in a blockchain is modified. The apparatus 600 specifically includes the following:
the block data obtaining module 610 is configured to obtain, in response to the data modification transaction request, block data after the block link point modifies the target block chain according to the target transaction and the target modification mode;
The main chain switching module 620 is configured to repackage the block data of the target blockchain to generate a target bifurcation chain of the target blockchain, and replace the target blockchain with the target bifurcation chain.
Optionally, the main chain switching module 620 is specifically configured to:
determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
repackaging the transaction data in the target initial block and the subsequent blocks to generate new blocks and transmitting to a blockchain network.
Optionally, the main chain switching module 620 is specifically configured to:
and repackaging the block data of the target block chain according to the one-to-one correspondence between the target bifurcation chain and the blocks in the target block chain based on the block structure of the target block chain.
Optionally, the main chain switching module 620 is specifically configured to:
and repackaging the block data of the target block chain according to the upper limit of the block transaction capacity.
Optionally, the main chain switching module 620 is specifically configured to:
And in the target bifurcation chain and the target blockchain, if the fact that the transaction data in the new block packed currently is consistent is detected, triggering main chain switching at the next block height, and replacing the target blockchain by the target bifurcation chain.
According to the technical scheme, the functions of response of the data modification transaction request, acquisition of block data, repacking of the blocks, construction of a target bifurcation chain, switching of a main chain and the like are achieved through mutual coordination among the functional modules. In the embodiment of the application, in the process of modifying the block chain data, the block generation node only needs to directly repackage the block data to construct the target bifurcation chain, namely, before the target bifurcation chain is not constructed, the modifying action of each block chain node has an effect, thereby greatly improving the modifying speed of the block chain data.
Sixth embodiment
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
As shown in fig. 7, is a block diagram of an electronic device of a data modification method of a blockchain according to an embodiment of the application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 7, the electronic device includes: one or more processors 701, memory 702, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of a graphical user interface (GRAPHICAL USER INTERFACE, GUI) on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations, e.g., as a server array, a set of blade servers, or a multiprocessor system. One processor 701 is illustrated in fig. 7.
Memory 702 is a non-transitory computer readable storage medium provided by the present application. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the data modification method of the blockchain provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the data modification method of the blockchain provided by the present application.
The memory 702 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the data modification method of the blockchain in the embodiment of the present application, for example, the modification target determination module 510, the local blockdata modification module 520, and the uplink control module 530 shown in fig. 5, or the blockdata acquisition module 610 and the main chain switching module 620 shown in fig. 6. The processor 701 executes various functional applications of the server and data processing, i.e., implements the data modification method of the blockchain in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 702.
Memory 702 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device of the data modification method of the blockchain, and the like. In addition, the memory 702 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 702 optionally includes memory remotely located relative to processor 701, which may be connected to the electronic device of the blockchain data modification method through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the data modification method of the blockchain may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or otherwise, in fig. 7 by way of example.
The input device 703 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the blockchain data modification method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output means 704 may include a display device, an auxiliary lighting means such as a light emitting Diode (LIGHT EMITTING Diode, LED), a tactile feedback means, and the like; haptic feedback devices such as vibration motors and the like. The display device may include, but is not limited to, a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), an LED display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, application SPECIFIC INTEGRATED Circuitry (ASIC), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs, also referred to as programs, software applications, or code, include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device for providing machine instructions and/or data to a programmable processor, e.g., magnetic discs, optical disks, memory, programmable logic devices (Programmable Logic Device, PLD), including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device for displaying information to a user, for example, a Cathode Ray Tube (CRT) or an LCD monitor; and a keyboard and pointing device, such as a mouse or trackball, by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component, e.g., a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, middleware, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include: local area networks (Local Area Network, LANs), wide area networks (Wide Area Network, WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the block data state of the target block chain in the local area is modified by each node, so that the block generating node can directly repackage the original block chain under the condition that common identification verification is not needed, namely, before the new chain is not constructed, the modification action has an effect, and the data modification speed of the block chain is greatly improved.
In addition, in the process of modifying the block data, the external uplink request is still normally responded, but the receiving of the uplink request depending on the target transaction and/or the associated transaction is stopped, so that the error uplink of the data is avoided under the condition that the normal operation of the block chain is not influenced.
In addition, the block chain node ensures the consistency of data modification in the block chain through data rollback, so that only target transactions and related transactions are re-executed to obtain modified transaction processing results in the blocks, the re-execution of transaction data in all the blocks is avoided, the transaction processing amount is reduced, and the block data modification efficiency is improved.
In addition, after the block data modification is completed at each block link point, even if a target bifurcation chain is not constructed at present, any uplink transaction request can be normally responded, and the normal operation of the block chain and the correctness of the transaction data can be rapidly ensured.
In addition, when each block chain node modifies the block data, the verification of the block data is finished in advance, so that when the block chain generation node repacks and constructs the target bifurcation chain, a complex and time-consuming common-knowledge verification process is not needed, and the block chain data modification speed is improved.
According to the technical scheme of the embodiment of the application, in the process of modifying the block chain data, the block generation node only needs to directly repackage the block data to construct the target bifurcation chain, namely, before the target bifurcation chain is not constructed, the modifying action of each block chain node has an effect, and the modifying speed of the block chain data is greatly improved.
In addition, the block generating node repacks from the first block where the target transaction is located, namely, generates a bifurcation chain at the position of the last block of the target initial block so as to replace the block where the target transaction is located and the subsequent blocks, thereby realizing the modification of the block chain data.
In addition, the one-to-one repackaging of the blocks is performed based on the block structure of the target block chain, so that the Hash and the signature in the new chain are guaranteed to be complete and verifiable, and the original physical structure of the target block chain is reserved.
In addition, the block data is repackaged based on the upper limit of the block transaction capacity, so that the packing efficiency is improved, and the waste of storage is avoided.
In addition, by detecting the transaction in the current package block in the target bifurcation chain and the target blockchain, when the target bifurcation chain is detected to catch up with the target blockchain, the main chain switching is triggered, so that the modification of the blockchain data is realized.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (13)

1. A method of modifying data of a blockchain, performed by a blocklink point, the method comprising:
Determining a target transaction to be modified and a target modification mode according to a data modification transaction request transmitted in a block chain network;
Modifying the block data state of a target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, wherein the modified block data are used for indicating a block generation node to repackage the block data of the target block chain, generating a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain; the modification operation of each blockchain node comprises rollback of the blockchain data, modification of the blockchain data and re-execution of a target transaction in a block and an associated transaction influenced by the target transaction, wherein the modification operation is only executed for the target transaction and the associated transaction influenced by the target transaction, and other transaction data are not processed;
receiving a repackaged new block sent by the block generating node;
and generating a target bifurcation chain of the target block chain according to the new block without consensus verification.
2. The method of claim 1, further comprising, prior to said modifying the block data state of the locally targeted blockchain in accordance with the targeted transaction and the targeted modification means:
determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
Traversing the target blockchain from the target initial block to obtain an associated transaction affected by the target transaction;
Stopping receiving the uplink request depending on the target transaction and/or the associated transaction.
3. The method of claim 1, wherein modifying the block data state of the locally targeted blockchain based on the targeted transaction and the targeted modification comprises:
Rolling back the target transaction and the related transaction influenced by the target transaction to an original data state before the target transaction occurs;
Modifying the target transaction and the associated transaction according to the original data state and the target modification mode to obtain target modification data;
And re-executing the target transaction and the associated transaction in the target block chain according to the target modification data to obtain a modified transaction processing result in the block.
4. The method of claim 3, further comprising, after said obtaining the modified transaction result in the block:
Initiating receipt of a request to be uplink dependent on the target transaction and/or the associated transaction.
5. A method of modifying data of a blockchain, performed by a blockgenerating node, the method comprising:
Responding to a data modification transaction request, and acquiring block data after modifying a target block chain by a block chain link point according to a target transaction and a target modification mode; the modification operation of each blockchain node comprises rollback of the blockchain data, modification of the blockchain data and re-execution of a target transaction in a block and an associated transaction influenced by the target transaction, wherein the modification operation is only executed for the target transaction and the associated transaction influenced by the target transaction, and other transaction data are not processed;
Repackaging the block data of the target block chain to generate a target bifurcation chain of the target block chain, and replacing the target block chain with the target bifurcation chain;
and sending the repackaged new block to a block chain node so that the block chain link point generates a target bifurcation chain of the target block chain according to the new block without consensus verification.
6. The method of claim 5, wherein repacking the block data of the target blockchain comprises:
determining a target initial block for recording the target transaction in the target block chain according to the target transaction;
repackaging the transaction data in the target initial block and the subsequent blocks to generate new blocks and transmitting to a blockchain network.
7. The method of claim 5, wherein repacking the block data of the target blockchain comprises:
and repackaging the block data of the target block chain according to the one-to-one correspondence between the target bifurcation chain and the blocks in the target block chain based on the block structure of the target block chain.
8. The method of claim 6, wherein repacking the block data of the target blockchain comprises:
and repackaging the block data of the target block chain according to the upper limit of the block transaction capacity.
9. The method of claim 6, wherein said replacing the target blockchain with the target bifurcation chain comprises:
And in the target bifurcation chain and the target blockchain, if the fact that the transaction data in the new block packed currently is consistent is detected, triggering main chain switching at the next block height, and replacing the target blockchain by the target bifurcation chain.
10. A data modification apparatus for a blockchain, the apparatus comprising:
the modification target determining module is used for determining a target transaction to be modified and a target modification mode according to the data modification transaction request transmitted in the blockchain network;
The local block data modification module is used for modifying the block data state of a target block chain in the local area according to the target transaction and the target modification mode to obtain modified block data in the target block chain, and is used for indicating a block generation node to repackage the block data of the target block chain to generate a target bifurcation chain of the target block chain and replacing the target block chain by the target bifurcation chain; the modification operation of each blockchain node comprises rollback of the blockchain data, modification of the blockchain data and re-execution of a target transaction in a block and an associated transaction influenced by the target transaction, wherein the modification operation is only executed for the target transaction and the associated transaction influenced by the target transaction, and other transaction data are not processed;
the local block data modification module is specifically further configured to: receiving a repackaged new block sent by the block generating node; and generating a target bifurcation chain of the target block chain according to the new block without consensus verification.
11. A data modification apparatus for a blockchain, the apparatus configured at a blockgenerating node, the apparatus comprising:
The block data acquisition module is used for responding to the data modification transaction request, and acquiring block data after the block chain link point modifies the target block chain according to the target transaction and the target modification mode; the modification operation of each blockchain node comprises rollback of the blockchain data, modification of the blockchain data and re-execution of a target transaction in a block and an associated transaction influenced by the target transaction, wherein the modification operation is only executed for the target transaction and the associated transaction influenced by the target transaction, and other transaction data are not processed;
The main chain switching module is used for repackaging the block data of the target block chain to generate a target bifurcation chain of the target block chain, and replacing the target block chain by the target bifurcation chain;
The data modifying device of the block chain is further used for sending the repackaged new block to the block chain node so that the block chain link point can generate a target bifurcation chain of the target block chain according to the new block without consensus verification.
12. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data modification method of the blockchain of any of claims 1-4 or the data modification method of the blockchain of any of claims 5-9.
13. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the data modification method of the blockchain of any of claims 1-4 or the data modification method of the blockchain of any of claims 5-9.
CN202010119745.5A 2020-02-26 2020-02-26 Block chain data modification method, device, equipment and storage medium Active CN113312362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010119745.5A CN113312362B (en) 2020-02-26 2020-02-26 Block chain data modification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010119745.5A CN113312362B (en) 2020-02-26 2020-02-26 Block chain data modification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113312362A CN113312362A (en) 2021-08-27
CN113312362B true CN113312362B (en) 2024-07-19

Family

ID=77369981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010119745.5A Active CN113312362B (en) 2020-02-26 2020-02-26 Block chain data modification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113312362B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672635B (en) * 2021-09-01 2024-09-10 支付宝(杭州)信息技术有限公司 Correction method and system for data in block chain

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213900A (en) * 2018-09-18 2019-01-15 百度在线网络技术(北京)有限公司 A kind of data modification method, device, equipment and the medium of block chain

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108282539A (en) * 2018-02-06 2018-07-13 北京奇虎科技有限公司 Decentralization storage system based on double-layer network
US10592873B2 (en) * 2018-05-21 2020-03-17 Microsoft Technology Licensing, Llc Edit transactions for blockchains
CN108805569A (en) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 Transaction processing method and device, electronic equipment based on block chain
US11095433B2 (en) * 2018-07-02 2021-08-17 International Business Machines Corporation On-chain governance of blockchain
CN108921556B (en) * 2018-07-02 2022-04-19 上海达家迎信息科技有限公司 Block chain verification method, device, equipment and storage medium
CN108985934B (en) * 2018-07-06 2021-12-17 深圳源码智能科技有限公司 Block chain modification method and device
CN109344631B (en) * 2018-09-18 2020-11-06 百度在线网络技术(北京)有限公司 Data modification and block verification method, device, equipment and medium for block chain
CN109241192B (en) * 2018-09-18 2021-06-15 百度在线网络技术(北京)有限公司 Data modification and block verification method, device, equipment and medium for block chain
CN110427385B (en) * 2019-08-02 2022-06-10 中国工商银行股份有限公司 Block chain data updating method, related node and block chain
GB2588812A (en) * 2019-11-08 2021-05-12 Jitsuin Ltd Data block modification

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213900A (en) * 2018-09-18 2019-01-15 百度在线网络技术(北京)有限公司 A kind of data modification method, device, equipment and the medium of block chain

Also Published As

Publication number Publication date
CN113312362A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
KR102510195B1 (en) Transaction Processing Methods, Devices and Appliances, and Computer Storage Media
CN110806923B (en) Parallel processing method and device for block chain tasks, electronic equipment and medium
US20200019543A1 (en) Method, apparatus and device for updating data, and medium
US20120179645A1 (en) Transaction support for distributed data
KR102077898B1 (en) Data storage upon database failure
EP3869377A1 (en) Method and apparatus for data processing based on smart contract, device and storage medium
CN111625552B (en) Data collection method, device, equipment and readable storage medium
CN107193672B (en) Cross-block asynchronous contract calling system
CN111368326A (en) Vehicle data processing method and device, electronic equipment and storage medium
CN111260474B (en) Asset transaction method, device, equipment, system and storage medium of cross-blockchain
US20220100777A1 (en) Transaction request construction method and apparatus, transaction request processing method and apparatus, device and storage medium
US11544245B2 (en) Transaction processing method, apparatus, and device and computer storage medium
CN108874912A (en) A kind of cancellation method and server
US20190034285A1 (en) Asynchronous session storing
CN110413687A (en) The distributed transaction fault handling method and relevant device of verification are mutually demonstrate,proved based on node
WO2023115836A1 (en) Method and apparatus for controlling distributed operation system, and device, medium and program product
CN113312362B (en) Block chain data modification method, device, equipment and storage medium
CN115220876A (en) Virtual resource creating method, device, program product, medium and electronic equipment
CN112596801A (en) Transaction processing method, device, equipment, storage medium and database
CN111598571A (en) Transaction processing method, device, equipment and storage medium of block chain
CN115952561A (en) Data processing method, device, equipment and medium applied to rail transit system
CN114691781A (en) Data synchronization method, system, device, equipment and medium
CN111475572B (en) Block generation method, device, equipment and medium
CN110515622B (en) Button state control method and device, electronic equipment and storage medium
CN114579260A (en) Transaction processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant