[go: up one dir, main page]

CN107577427B - data migration method, device and storage medium for blockchain system - Google Patents

data migration method, device and storage medium for blockchain system Download PDF

Info

Publication number
CN107577427B
CN107577427B CN201710769578.7A CN201710769578A CN107577427B CN 107577427 B CN107577427 B CN 107577427B CN 201710769578 A CN201710769578 A CN 201710769578A CN 107577427 B CN107577427 B CN 107577427B
Authority
CN
China
Prior art keywords
old
new
transaction
blockchain
block
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
CN201710769578.7A
Other languages
Chinese (zh)
Other versions
CN107577427A (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.)
Shanghai Insurance Exchange Ltd By Share Ltd
Original Assignee
Shanghai Insurance Exchange Ltd By Share 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 Shanghai Insurance Exchange Ltd By Share Ltd filed Critical Shanghai Insurance Exchange Ltd By Share Ltd
Priority to CN201710769578.7A priority Critical patent/CN107577427B/en
Publication of CN107577427A publication Critical patent/CN107577427A/en
Application granted granted Critical
Publication of CN107577427B publication Critical patent/CN107577427B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data migration method, equipment and a storage medium for a blockchain system. The data migration method comprises the following steps: creating a new created block of the new block chain in the new block chain system, and recording related information of an old block chain in an old block chain system of which data is to be migrated in the new created block, wherein the related information of the old block chain comprises range information of the data to be migrated of the old block chain; and converting each old transaction recorded in each old block in the old block chain into a new transaction conforming to the new transaction data structure of the new block chain according to the range information, and migrating the converted new transaction into the new block chain, wherein the new transaction data structure of the new block chain comprises the tracing information indicating the position of the old transaction corresponding to the new transaction in the old block chain.

Description

Data migration method, device and storage medium for blockchain system
Technical Field
The present invention relates to a blockchain system, and more particularly, to a data migration method, apparatus, and storage medium for a blockchain system.
Background
The blockchain is an innovative application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm in the internet era.
In a narrow sense, the blockchain is a distributed account book which is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence and is guaranteed in a cryptographic mode and cannot be tampered and forged. Broadly speaking, the blockchain technique is a completely new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secure data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data. Two major characteristics of block chain technology are traceability and non-tamper-ability.
Disclosure of Invention
However, with the rapid development of blockchain technology, the blockchain system itself needs to be upgraded and modified, especially in the case of modification of the underlying data structure of the blockchain, the upgraded and updated new blockchain system cannot identify the data left by the old blockchain system. Therefore, data left over by the old blockchain system needs to be migrated to the new blockchain system. However, due to the non-falsifiable characteristic of the blockchain system, the data timestamp in the new blockchain system is updated to the timestamp at migration instead of the timestamp at the time of occurrence of the service, which is an inevitable technical problem and also causes a serious trust problem in using the blockchain system. There is currently no feasible solution to these problems.
therefore, the present application proposes a new technical solution to at least one of the above problems.
According to a first aspect of the present invention, there is provided a data migration method for a blockchain system, comprising: creating a new created block of a new block chain in a new block chain system, and recording related information of an old block chain in an old block chain system of which data is to be migrated in the new created block, wherein the related information of the old block chain comprises range information of the data to be migrated of the old block chain; and according to the range information, converting each old transaction recorded in each old block in the old block chain into a new transaction which conforms to a new transaction data structure of the new block chain, and migrating the converted new transaction into the new block chain, wherein the new transaction data structure of the new block chain comprises tracing information indicating the position of the old transaction corresponding to the new transaction in the old block chain.
preferably, the extent information comprises an old block identity of a last old block to be migrated in the old block chain.
Preferably, the step of converting comprises: reading each old block in the old block chain in turn starting from the first old block in the old block chain until the last old block to be migrated in the old block chain; for each read old block, sequentially reading each old transaction recorded in the old block according to the sequence of each old transaction recorded in the old block; and for each read old transaction, parsing the old transaction, and converting the parsed old transaction into a new transaction conforming to the new transaction data structure of the new blockchain.
Preferably, the related information of the old blockchain further includes at least one of the following information: the system comprises an old blockchain system, a block head of an old created block of the old blockchain, a block head of a last block to be migrated in the old blockchain, and world state information of the old blockchain.
Preferably, the access mode information of the old blockchain system includes at least one of the following information: the information of the networking mode of the old blockchain system, the node information of all nodes in the old blockchain system, the Internet Protocol (IP) address information of all nodes in the old blockchain system, and the address information of the application program access interface of the old blockchain system.
Preferably, the tracing information includes: the calling address information of the old block chain, the old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, and the old block identifier of the old block in which the old transaction corresponding to the new transaction in the old block chain is located.
preferably, the call address information of the old blockchain includes at least one of the following information: the application program of the old blockchain system accesses interface address information and calling address information of one or more nodes in the old blockchain system.
preferably, the new created block of the new blockchain is created using a configuration file at the start of the new blockchain.
Preferably, the migrating the converted new transaction to the new blockchain includes: and executing the converted new transaction in the new blockchain system according to the execution sequence of the old transaction corresponding to the converted new transaction in the old blockchain system.
Preferably, the data migration method further includes: after the data migration from the old blockchain to the new blockchain is completed, using a new transaction identifier of a new transaction in the new blockchain, querying an old transaction in the old blockchain corresponding to the new transaction by using an intelligent contract deployed on the new blockchain.
Preferably, the step of querying comprises: querying the tracing information included in a new transaction data structure of the new transaction in the new block chain by using the new transaction identifier of the new transaction in the new block chain; and querying an old transaction corresponding to the new transaction in the old block chain by utilizing the tracing information.
Preferably, the step of querying an old transaction in the old block chain corresponding to the new transaction by using the trace back information includes: inquiring and returning old transaction information of an old transaction corresponding to the new transaction in the old block chain by utilizing the calling address information of the old block chain and an old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, which are included in the tracing information; and inquiring and returning the old block information of the old block in which the old transaction corresponding to the new transaction in the old block chain is located by utilizing the calling address information of the old block chain and the old block identifier of the old block in which the old transaction corresponding to the new transaction in the old block chain is located, which are included in the tracing information.
Preferably, the data migration method further includes: after the data migration from the old blockchain to the new blockchain is completed, the data migration from the new blockchain to the next new blockchain is carried out by utilizing the data migration method, so that the data migration of the blockchain is realized for multiple times.
According to a second aspect of the present invention, there is provided a computer storage medium having stored thereon computer instructions which, when executed by a computer, cause the computer to perform a data migration method for a blockchain system as described in any one of the preceding.
According to a third aspect of the present invention, there is provided a computer-implemented data migration apparatus for a blockchain, comprising: a memory storing computer instructions; and a processor, coupled to the memory, executing the computer instructions to perform the data migration method for the blockchain system as described in any one of the preceding items.
According to some embodiments of the present invention, in a case where new and old blockchains are incompatible due to modification of an underlying data structure of the blockchain, data left from the old blockchain system can be migrated into the new blockchain system, and the new blockchain can also inherit the credibility of the old blockchain, so that the new blockchain system also has traceable and non-tamperable characteristics.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
Fig. 1 is a flowchart schematically illustrating a data migration method for a blockchain system according to an embodiment of the present invention.
FIG. 2 is a flow diagram that schematically illustrates a process for converting an old transaction in an old block to a new transaction in a new block, in accordance with an embodiment of the present invention.
Fig. 3A is a schematic diagram schematically illustrating a configuration of an old blockchain according to an embodiment of the present invention.
Fig. 3B is a diagram that schematically illustrates an old transaction data structure in an old blockchain, in accordance with an embodiment of the present invention.
Fig. 4A is a schematic diagram schematically illustrating a configuration of a new blockchain according to an embodiment of the present invention.
FIG. 4B is a diagram that schematically illustrates a new transaction data structure in a new blockchain, in accordance with an embodiment of the present invention.
Fig. 4C is a diagram that schematically illustrates trace-back information in a new transaction structure in a new blockchain, in accordance with an embodiment of the present invention.
Fig. 5 is a flowchart schematically illustrating a data migration method for a blockchain system according to another embodiment of the present invention.
FIG. 6 is a flow diagram that schematically illustrates a query process, in accordance with another embodiment of the present invention.
Fig. 7 is a flow diagram schematically illustrating a concrete query process according to another embodiment of the present invention.
FIG. 8 is a diagram schematically illustrating a process of multiple data migrations to a blockchain system according to yet another embodiment of the present invention.
Fig. 9 is a schematic block diagram showing an information processing apparatus that can be used to implement the data migration method for the blockchain system according to the embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the modules and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
FIG. 1 is a flow diagram that schematically illustrates a method 100 for data migration in a blockchain system, in accordance with an embodiment of the present invention.
As shown in fig. 1, in step S101, a new created block of a new block chain may be created in a new block chain system, and information about an old block chain in an old block chain system whose data is to be migrated is recorded in the new created block, where the information about the old block chain includes range information of the data to be migrated of the old block chain.
According to one embodiment of the invention, a new created tile of the new blockchain may be created using the configuration file at the start of the new blockchain. That is, the configuration file may be used to create a new created block of the new blockchain when the new blockchain is started.
The configuration of the new blockchain created in the new blockchain system is described below in conjunction with fig. 4A. Fig. 4A is a schematic diagram schematically illustrating a configuration of a new blockchain according to an embodiment of the present invention.
As shown in fig. 4A, the new block chain includes a new created block, and a new block 1, a new block 2, a new block. The newly created block includes a block header and a block body. Each of the new block 1, the new block 2, the new block M, etc. includes a block head and a block body. The hash value of the newly created block may be recorded in the block header of the newly created block. In addition, a pointer to the new chunk 1 may be recorded in the chunk header of the newly created chunk, for example, the pointer to the new chunk 1 may be a hash value of the new chunk 1. The hash value of each new chunk itself may be recorded in the chunk header of the new chunk. Specifically, for example, a hash value of the new block 1 itself may be recorded in the block header of the new block 1. In addition, the chunk header of each new chunk may record a pointer to the next new chunk, e.g., the pointer to the next new chunk may be the hash value of the next new chunk. Specifically, for example, a pointer to the new block 2 may be recorded in the block header of the new block 1, and for example, the pointer to the new block 2 may be a hash value of the new block 2. Thus, the newly created block and each new block (i.e., new block 1, new block 2, new.
as shown in fig. 4A, the block body of the newly created block may record therein the information related to the old blockchain in the old blockchain system whose data is to be migrated. That is, when a new created block of the new block chain is created in the new block chain system, information about an old block chain in the old block chain system whose data is to be migrated may be recorded in the new created block, particularly, for example, in a block body of the new created block. In general, new transactions in the form of ordinary transactions may not be included in the newly created block. New transactions in the form of one or more common transactions may be recorded in the block of each new block (i.e., new block 1, new block 2,..., new block M, etc.). For example, new transaction 1 and new transaction 2 may be recorded in the block of new block 1, new transaction 3 and new transaction 4 may be recorded in the block of new block 2, new transaction 2M-1 and new transaction 2M may be recorded in the block of new block M, and so on. It will be appreciated by those skilled in the art that the number of new transactions recorded in each new chunk may be the same or different.
the configuration of an old blockchain in an old blockchain system whose data is to be migrated is described below in conjunction with fig. 3A. Fig. 3A is a schematic diagram schematically illustrating a configuration of an old blockchain according to an embodiment of the present invention. The configuration of the old blockchain is similar to the configuration of the new blockchain.
As shown in fig. 3A, the old block chain includes the old created block, and an old block 1, an old block 2, an old. The surname block includes a block header and a block body. Each of old block 1, old block 2, old block N, etc. includes a block header and a block body. The hash value of the surrendered block may be recorded in the block header of the surrendered block. In addition, a pointer to the old chunk 1 may be recorded in the chunk header of the old created chunk, for example, the pointer to the old chunk 1 may be a hash value of the old chunk 1. The hash value of each old block itself may be recorded in the block header of the old block. Specifically, for example, a hash value of the old block 1 itself may be recorded in the block header of the old block 1. In addition, the chunk header of each old chunk may record a pointer to the next old chunk, e.g., the pointer to the next old chunk may be the hash value of the next old chunk. Specifically, for example, a pointer to old chunk 2 may be recorded in the chunk header of old chunk 1, for example, the pointer to old chunk 2 may be a hash value of old chunk 2. Thus, the old founder block and the various old blocks (i.e., old block 1, old block 2, the.
As shown in fig. 3A, in general, old transactions in the form of normal services may not be included in the old created block. In addition, the block of each old block (i.e., old block 1, old block 2, old block N, etc.) may have one or more old transactions in the form of ordinary transactions recorded therein. For example, old transaction 1, old transaction 2, and old transaction 3 may be recorded in the block of old block 1, old transaction 4, old transaction 5, and old transaction 6 may be recorded in the block of old block 2, old transaction 2N-1, and old transaction 2N may be recorded in the block of old block N, and so on. It will be understood by those skilled in the art that the number of old transactions recorded in each of the old blocks may be the same or different. In addition, those skilled in the art will appreciate that the number of old transactions recorded in each old block may be the same as or different from the number of new transactions recorded in the new block.
According to an embodiment of the present invention, the related information of the old blockchain may include range information of data to be migrated of the old blockchain. For example, the relevant information of the old blockchain may include various information regarding various aspects of the old blockchain whose data is to be migrated, such as configuration, status, and the like.
In general, the range of data of the old blockchain to be migrated to the new blockchain is limited. Also, after migrating a range of data of the old blockchain to the new blockchain, the old blockchain may continue to run, thereby generating additional data. However, these additional data are not included in the new blockchain. Thus, the extent of data of the old blockchain to be migrated to the new blockchain should be confidently confirmed.
In order to confirm the range of data of the old blockchain to be migrated to the new blockchain, the new blockchain itself may be employed to record range information indicating the range according to an embodiment of the present invention. Specifically, for example, the range information indicating the range of data to be migrated to the old blockchain of the new blockchain may be recorded in the newly created block of the new blockchain.
According to one embodiment of the invention, the extent information may include an old block identification of the last old block to be migrated in the old block chain.
Referring back to fig. 3A, for example, if it is desired to migrate old block 1 through old block N in the old block chain to the new block chain, the last old block to be migrated in the old block chain is "old block N", where the old block of the last old block "old block N" is identified as "N". Thus, the above range information may include the old block identification "N" of the last old block "old block N" to be migrated in the old block chain.
It should be understood by those skilled in the art that the range information is not limited to the above-described embodiments, but other information may be employed as the above-described range information. For example, a hash value of the last old chunk to be migrated in the old chunk chain may be employed as the above range information, and so on.
According to an embodiment of the present invention, the information related to the old blockchain may further include at least one of the following information: access mode information of the old blockchain system, information recorded in a block header of an old created block of the old blockchain, information recorded in a block header of a last block to be migrated in the old blockchain, and world state information of the old blockchain.
The related information of the old blockchain may include other various information related to the old blockchain in addition to the above range information.
For example, the information related to the old blockchain may further include access mode information of the old blockchain system. In general, the access mode information of the old blockchain system may include a full amount of all information related to the architecture, access addresses, etc. of the old blockchain system.
According to an embodiment of the present invention, the access mode information of the old blockchain system may include at least one of the following information: networking mode information of the old blockchain system, node information of all nodes in the old blockchain system, Internet Protocol (IP) address information of all nodes in the old blockchain system, and application access interface (API) address information of the old blockchain system.
For example, the access mode information of the old blockchain system may include networking mode information of the old blockchain system. In general, the blockchain system may employ various network forms, such as a peer-to-peer network (i.e., a P2P network), to organize the various nodes participating in data verification and accounting that are dispersed throughout the locality. Therefore, the networking mode information of the old blockchain system may include information on a network adopted by the old blockchain system and connection relationships between respective nodes in the network.
As another example, the access pattern information of the old blockchain system may include node information of all nodes in the old blockchain system. As described above, in general, a blockchain system may include various nodes dispersed throughout that participate in data verification and accounting. Thus, the node information of all nodes in the old blockchain system may include information about each node in the old blockchain system, such as the location where the node is located, the organization to which the node belongs, the type of the node, and so on. With respect to the type of node, for example, the nodes in the blockchain system may include consensus nodes, accounting nodes, and the like.
As another example, the access pattern information of the old blockchain system may include internet protocol IP address information of all nodes in the old blockchain system. As described above, in general, the blockchain system may employ various network forms such as a peer-to-peer network (i.e., P2P network) to organize the various nodes participating in data verification and accounting scattered around the locality. Thus, each node in a blockchain system typically has an IP address on the network so that the node can be accessed by its IP address.
Also for example, the access mode information of the old blockchain system may include application access interface address information of the old blockchain system. Typically, the blockchain system has an application access interface address such that the blockchain system can be accessed by the application access interface address of the blockchain system.
It should be understood by those skilled in the art that the access manner information of the old blockchain system is not limited to the above-listed examples of information, but may include various other information related to the architecture, access address, etc. of the old blockchain system.
According to an embodiment of the present invention, for example, the related information of the old blockchain may further include information recorded in a block header of an old created block of the old blockchain. Referring back to fig. 3A, information recorded in the block header of the old created block of the old block chain may be recorded in the new created block of the new block chain as related information of the old block chain. In general, the information recorded in the block header of the created block of the old block chain is proof of initialization of the old block chain, and may include the hash value and the like of the created block of the old block chain.
According to an embodiment of the present invention, for example, the related information of the old blockchain may further include information recorded in a block header of a last block to be migrated in the old blockchain. For example, the information recorded in the block header of the last block to be migrated in the old block chain may include a block identification of the last old block to be migrated in the old block chain, or a hash value of the last old block itself to be migrated in the old block chain, or the like. Referring back to fig. 3A, if it is desired to migrate old block 1 through old block N in the old block chain to the new block chain, the last old block in the old block chain to be migrated is "old block N". Therefore, the information recorded in the block header of the last old block "old block N" to be migrated in the old block chain can be recorded in the newly created block of the new block chain as the related information of the old block chain. In fact, the information recorded in the block header of the last block to be migrated in the old block chain is evidence indicating the range of data of the old block chain to be migrated to the new block chain.
According to an embodiment of the present invention, the related information of the old blockchain may further include World State (World State) information of the old blockchain, for example. Generally, the World State (World State) of the old blockchain is obtained by generating a hash algorithm by hashing the book data of the old blockchain using Merkele Tree (Merkele Tree) while the old blockchain is running. In fact, the block headers of the first block (see fig. 3A, old created block) and the last block (see fig. 3A, old block N) to be migrated in the old block chain may be the simplest evidence.
It should be understood by those skilled in the art that the related information of the old blockchain is not limited to the above-listed examples, but may include various information related to various aspects of the old blockchain, such as configuration, status, and the like.
According to an embodiment of the present invention, whether data in an old blockchain is tampered can be determined according to related information of the old blockchain recorded in a newly created block of a new blockchain.
For example, to determine whether the data in the old blockchain is tampered with, a synchronization certification may be performed on the old blockchain, that is, all blocks in the old blockchain are synchronized from the first block (see fig. 3A, old created block) in the old blockchain to the last block (see fig. 3A, old block N). Then, the hash value obtained from the last block of the synchronization (see fig. 3A, old block N) may be compared with the hash value recorded in the block header of the last block to be migrated in the old block chain recorded in the newly created block of the new block chain, and the world state information of the old block chain run through the synchronization may be compared with the world state (WorldState) information of the old block chain recorded in the newly created block of the new block chain, and if they are consistent, it indicates that the data in the old block chain has not been tampered, otherwise, the data in the old block chain has been tampered.
referring back to fig. 1, after step S101, the data migration method 100 for the blockchain system proceeds to step S102. In step S102, each old transaction recorded in each old block in the old block chain may be converted into a new transaction conforming to the new transaction data structure of the new block chain according to the range information, and the converted new transaction is migrated into the new block chain, wherein the new transaction data structure of the new block chain includes trace-back information indicating a position of the old transaction corresponding to the new transaction in the old block chain.
for example, from the extent information, it can be determined which data in the old blockchain needs to be migrated into the new blockchain. After determining the range of data in the old blockchain that needs to be migrated, all data in the old blockchain within the range can be migrated to the new blockchain.
The old transaction data structure in the old blockchain and the new transaction data structure in the new blockchain are described below in conjunction with fig. 3B and 4B, respectively. Fig. 3B is a diagram that schematically illustrates an old transaction data structure in an old blockchain, in accordance with an embodiment of the present invention. In addition, FIG. 4B is a diagram that schematically illustrates a new transaction data structure in a new blockchain, in accordance with an embodiment of the present invention.
As shown in FIG. 3B, the old transaction data structure for each old transaction in the old blockchain may include the following two fields: an old transaction identifier 301, which may be, for example, a 32-bit hash value, and an old transaction itself 303, which may include, for example, transaction data running in an old blockchain system, a creator signature of an old transaction, a creator identifier of an old transaction, a creation time of an old transaction, etc. For example, referring back to fig. 3A, for an old transaction 1 recorded in an old bank 1 in an old bank chain, the old transaction identification 301 included in the old transaction data structure of the old transaction 1 may be a "first hash value", and the old transaction itself 303 included in the old transaction data structure of the old transaction 1 may be "transaction data contained in the old transaction 1 itself, a creator signature of the old transaction 1, a creator identification of the old transaction 1, a creation time of the old transaction 1, and the like".
In addition, as shown in FIG. 4B, the new transaction data structure for each new transaction in the new blockchain may include the following three fields: new transaction identification 401, trace back information 403, and new transaction itself 405, where the new transaction identification may be, for example, a 32-bit hash value, the trace back information may indicate the location of the old transaction in the old blockchain corresponding to the new transaction, and the new transaction itself 405 may include, for example, transaction data running in the new blockchain system, a creator signature of the new transaction, a creator identification of the new transaction, a creation time of the new transaction, etc. For example, referring back to fig. 4A, for a new transaction 1 recorded in a new block 1 in a new block chain, a new transaction identifier 401 included in a new transaction data structure of the new transaction 1 may be a "second hash value", a trace-back information 403 included in the new transaction data structure of the new transaction 1 may indicate a position of an old transaction 1 corresponding to the new transaction 1 in the old block chain, and a new transaction itself 405 included in the new transaction data structure of the new transaction 1 may be "transaction data included in the new transaction 1 itself, a creator signature of the new transaction 1, a creator identifier of the new transaction 1, a creation time of the new transaction 1, and the like".
In the process of migrating data in an old blockchain into a new blockchain, since a new transaction data structure of the new blockchain is different from an old transaction data structure of the old blockchain, an old transaction conforming to the old transaction data structure of the old blockchain needs to be converted into a new transaction conforming to the new transaction data structure of the new blockchain, that is, format conversion from the old transaction data structure of the old blockchain to the new transaction data structure of the new blockchain needs to be performed.
For example, for an old transaction 1 in an old block chain, the old transaction data structure for the old transaction 1 may include an old transaction identification 301 (e.g., a "first hash value") for the old transaction 1 and an old transaction itself 303 for the old transaction 1 (e.g., "transaction data contained in the old transaction 1 itself, a creator signature for the old transaction 1, a creator identification for the old transaction 1, a creation time for the old transaction 1, etc.). The old transaction data structure of the old transaction 1 may be converted into a new transaction data structure of a new transaction 1 corresponding to the old transaction 1, the new transaction data structure of the new transaction 1 may include a new transaction identification 401 (e.g., "second hash value") of the new transaction 1 corresponding to the old transaction 1, trace-back information 403 indicating a location of the old transaction 1 corresponding to the new transaction 1 in an old block chain, and a new transaction itself 405 (e.g., "transaction data contained in the new transaction 1 itself, creator signature of the new transaction 1, creator identification of the new transaction 1, creation time of the new transaction 1, etc.) of the new transaction 1 corresponding to the old transaction 1, wherein the old transaction identification 301 (e.g.," first hash value ") of the old transaction 1 may be included in the trace-back information 403, and the old transaction itself 303 (e.g., "transaction data contained in the old transaction 1 itself, creator signature of the old transaction 1, creator identification of the old transaction 1, creation time of the old transaction 1, etc") is converted into the new transaction itself 405 of the new transaction 1 (e.g., "transaction data contained in the new transaction 1 itself, creator signature of the new transaction 1, creator identification of the new transaction 1, creation time of the new transaction 1, etc").
The process of converting an old transaction in an old block to a new transaction in a new block is described in detail below in conjunction with FIG. 2. FIG. 2 is a flow diagram that schematically illustrates a process 200 for converting an old transaction in an old block to a new transaction in a new block, in accordance with an embodiment of the present invention.
As shown in fig. 2, in step S201, each old block in the old block chain may be read in turn starting from the first old block in the old block chain until the last old block to be migrated in the old block chain.
For example, referring to fig. 3A, if it is desired to migrate the data of old block 1 to old block N in the old block chain to the new block chain, each of the old blocks in the old block chain may be read in turn starting from the first old block "old block 1" in the old block chain until the last old block "old block N" in the old block chain to be migrated.
After step S201, the process 200 proceeds to step S203. In step S203, for each read old block, each old transaction recorded in the old block may be read sequentially according to the sequence of the old transactions recorded in the old block.
For example, referring to fig. 3A, for the read old block 1, the old transaction 2, and the old transaction 3 recorded in the old block 1 may be read sequentially in the order of the respective old transactions "old transaction 1, old transaction 2, and old transaction 3" recorded in the old block 1.
After step S203, the process 200 proceeds to step S205. In step S205, for each read old transaction, the old transaction may be parsed, and the parsed old transaction is converted into a new transaction conforming to the new transaction data structure of the new block chain.
For example, referring to FIG. 3A, for read old transaction 1, the old transaction 1 can be resolved, and the resolved old transaction 1 is converted into a new transaction 1 that conforms to the new transaction data structure of the new blockchain. Note that in resolving the read old transaction, the old transaction can be resolved according to its old transaction data structure.
According to one embodiment of the invention, after the above-described format conversion from the old transaction data structure of the old blockchain to the new transaction data structure of the new blockchain is completed, the converted new transaction may be migrated into the new blockchain.
according to an embodiment of the present invention, migrating the converted new transaction into the new blockchain may include: and executing the converted new transaction in the new blockchain system according to the execution sequence of the old transaction corresponding to the converted new transaction in the old blockchain system.
For example, referring to fig. 3A and 4B, assuming that old transaction 1, old transaction 2, and old transaction 3 are executed in the old blockchain system in the order of executing old transaction 1, executing old transaction 2, and executing old transaction 3, and old transaction 1, old transaction 2, and old transaction 3 are converted into new transaction 1, new transaction 2, and new transaction 3, respectively, the converted new transaction 1, new transaction 2, and new transaction 3 are executed in the new blockchain system in the following order: new transaction 1 is executed first, then new transaction 2, and finally new transaction 3.
Note that the above-described purpose of executing the converted new transaction in the new blockchain system strictly in the order of execution of the old transaction in the old blockchain system is to avoid conflicts between the migrated new transactions. That is to say, in order to avoid conflicts between new transactions after migration, if there is an execution sequence between new transactions after migration, the execution sequence of the old transaction in the old blockchain system needs to be strictly followed, and after the previous new transaction is executed, the subsequent new transaction is executed again.
Referring back to fig. 3B and 4B, by comparing fig. 3B and 4B, the new transaction data structure for each new transaction in the new blockchain may be increased by a field "traceback information" to indicate the location in the old blockchain of the old transaction corresponding to the new transaction, as compared to the old transaction data structure for each old transaction in the old blockchain. By the trace back information, the position of the old transaction corresponding to the new transaction in the old block chain can be known, for example, the old transaction corresponding to the new transaction in which old block chain the old transaction is.
According to an embodiment of the present invention, the trace back information may include: the calling address information of the old block chain, the old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, and the old block identifier of the old block in the old block chain where the old transaction corresponding to the new transaction is located.
The trace back information in the new transaction structure in the new blockchain is described below in conjunction with FIG. 4C. Fig. 4C is a diagram that schematically illustrates trace-back information in a new transaction structure in a new blockchain, in accordance with an embodiment of the present invention.
As shown in fig. 4C, the trace back information 403 may include the following three fields: call address information 4031, an old transaction identifier 4033, and an old block identifier 4035 of the old block chain, where the call address information 4031 of the old block chain may indicate a call address of the old block chain in which an old transaction corresponding to the new transaction is located, the old transaction identifier 4033 may be an old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, and the old block identifier 4035 may be an old block identifier of an old block chain in which the old transaction corresponding to the new transaction is located.
For example, referring back to fig. 3A and 4A, for a new transaction 1 recorded in a new chunk 1 in a new chunk chain, the trace back information 403 included in the new transaction data structure of the new transaction 1 may include: call address information 4031 of the old block chain, which may indicate a call address of the old block chain in which the old transaction 1 corresponding to the new transaction 1 is located; an old transaction identifier 4033, which may be an old transaction identifier "first hash value" of the old transaction 1 in the old blockchain corresponding to the new transaction 1; and an old block identification 4035, which may be the old block identification "old block 1" of the old block 1 in the old block chain where the old transaction 1 corresponding to the new transaction 1 is located.
Through the call address information 4031 of the old block chain in the trace-back information 403 in the new transaction structure of the new transaction in the new block chain, the call address of the old block chain in which the old transaction 1 corresponding to the new transaction 1 is located can be obtained.
Since the new transaction 1 recorded in the new chunk 1 in the new chunk chain is actually migrated from the old transaction 1 recorded in the old chunk 1 in the old chunk chain, the old transaction 1 corresponding to the new transaction 1 should have an old transaction identification "first hash value" in the old chunk chain, which is also direct evidence that the old transaction 1 corresponding to the new transaction 1 is in the old chunk chain. Therefore, by the old transaction id 4033 in the trace-back information 403 in the new transaction structure of the new transaction in the new blockchain, the old transaction id of the old transaction corresponding to the new transaction in the old blockchain can be obtained.
In addition, the old block identifier "old block 1" of the old block 1 in which the old transaction 1 corresponding to the new transaction 1 is located in the old block chain is also important information in the proof for determining whether the old transaction 1 exists in the old block chain. Therefore, the old block id 4035 in the trace-back information 403 in the new transaction structure of the new transaction in the new block chain can obtain the old block id "old block 1" of the old block 1 in the old block chain where the old transaction 1 corresponding to the new transaction 1 is located.
it will be appreciated by those skilled in the art that the traceback information in the new transaction structure in the new blockchain is not limited to the above-listed examples, but may include various information capable of indicating the location of the old transaction corresponding to the new transaction in the old blockchain.
According to an embodiment of the present invention, the call address information of the old blockchain may include at least one of the following information: the application of the old blockchain system accesses the interface address information and the call address information of one or more nodes in the old blockchain system.
For example, the call address information of the old blockchain may include application access interface address information of the old blockchain system. As described above, typically, the blockchain system has an application access interface address, such that the blockchain system can be accessed through the application access interface address of the blockchain system.
As another example, the call address information of the old blockchain may include call address information of one or more nodes in the old blockchain system. As described above, in general, the blockchain system may employ various network forms such as a peer-to-peer network (i.e., P2P network) to organize various nodes participating in data verification and accounting scattered around, and each node may store thereon a blockchain in the blockchain system. Therefore, one or more nodes in the old blockchain system can be called by calling address information of one or more nodes in the old blockchain system, and the old blockchain in the old blockchain system stored on the one or more nodes can be called.
it should be understood by those skilled in the art that the call address information of the old blockchain is not limited to the above-listed examples, but may include various call address information capable of calling to the old blockchain.
A data migration method for a blockchain system according to another embodiment of the present invention is described below with reference to fig. 5. FIG. 5 is a flow diagram that schematically illustrates a method 500 for data migration in a blockchain system, in accordance with another embodiment of the present invention.
As shown in fig. 5, in step S501, a new created block of the new block chain may be created in the new block chain system, and information about an old block chain in an old block chain system whose data is to be migrated is recorded in the new created block, where the information about the old block chain includes range information of the data to be migrated of the old block chain.
After step S501, the data migration method 500 for the blockchain system described above may proceed to step S503. In step S503, each old transaction recorded in each old block in the old block chain may be converted into a new transaction conforming to the new transaction data structure of the new block chain according to the range information, and the converted new transaction is migrated into the new block chain, wherein the new transaction data structure of the new block chain includes the trace-back information indicating the position of the old transaction corresponding to the new transaction in the old block chain.
Note that the contents of steps S501 and S502 in fig. 5 are the same as the contents of steps S101 and S103 in fig. 1, respectively, and the specific details thereof are not described herein again.
After step S503, the data migration method 500 for the blockchain system described above may proceed to step S505. In step S505, after the data migration from the old blockchain to the new blockchain is completed, an old transaction in the old blockchain corresponding to the new transaction may be queried using an intelligent contract deployed on the new blockchain with a new transaction identification of the new transaction in the new blockchain.
For example, after completing the migration of data from the old blockchain to the new blockchain, an intelligent contract for querying the old blockchain for old transactions corresponding to the new transactions in the old blockchain may be deployed on the new blockchain. Therefore, when an old transaction corresponding to a new transaction needs to be traced, the old transaction corresponding to the new transaction can be queried in the old blockchain by using the intelligent contract, so that data in the old blockchain can be traced.
The query process according to another embodiment of the present invention is described in detail below with reference to fig. 6. FIG. 6 is a flow diagram that schematically illustrates a query process 600, in accordance with another embodiment of the present invention.
As shown in fig. 6, in step S601, the trace back information included in the new transaction data structure of the new transaction in the new blockchain may be queried with the new transaction identification of the new transaction in the new blockchain.
For example, referring to fig. 4A and 4B, the trace-back information 403 contained in the new transaction data structure of the new transaction 1 in the new blockchain and corresponding to the new transaction identification 401 (e.g., "second hash value") of the new transaction 1 may be queried in the new transaction data structure of the new transaction 1 in the new blockchain using the new transaction identification 401 (e.g., "second hash value") of the new transaction 1 in the new blockchain.
After step S601, the above-described inquiry process 600 may proceed to step S603. In step S603, the old transaction in the old blockchain corresponding to the new transaction may be queried using the trace back information.
For example, referring to fig. 4A and 4B, after obtaining the above-mentioned trace back information 403 by querying, the old transaction 1 corresponding to the new transaction 1 in the old blockchain can be queried by using the trace back information 403.
A specific query process for querying an old transaction in an old blockchain corresponding to the new transaction using trace back information according to another embodiment of the present invention is described in detail below with reference to fig. 7. FIG. 7 is a flow diagram that schematically illustrates a concrete query process 700, in accordance with another embodiment of the present invention.
as shown in fig. 7, in step S701, the old transaction information of the old transaction corresponding to the new transaction in the old block chain may be queried and returned by using the calling address information of the old block chain included in the trace back information and the old transaction identifier of the old transaction corresponding to the new transaction in the old block chain.
For example, referring to fig. 3A, 3B, and 4C, the old transaction information of the old transaction 1 corresponding to the new transaction 1 may be queried in the old blockchain using the call address information 4031 of the old blockchain included in the trace back information 403 and the old transaction identifier 4033 (e.g., "first hash value") of the old transaction 1 corresponding to the new transaction 1 in the old blockchain, and the queried old transaction information of the old transaction 1 may be returned to the user.
In addition, in step S703, the old block information of the old block in the old block chain where the old transaction corresponding to the new transaction is located may be queried and returned by using the calling address information of the old block chain and the old block identifier of the old block in the old block chain where the old transaction corresponding to the new transaction is located, which are included in the tracing information.
For example, referring to fig. 3A, 3B, and 4C, the old block chain may be queried for the old block information of the old block 1 in which the old transaction 1 corresponding to the new transaction 1 is located, by using the call address information 4031 of the old block chain included in the trace back information 403 and the old block identifier 4035 (for example, "old block 1") of the old block 1 in which the old transaction 1 corresponding to the new transaction 1 is located.
According to an embodiment of the present invention, after data migration from an old blockchain to a new blockchain is completed, data migration from the new blockchain to a next new blockchain may be performed by using a data migration method, so as to implement multiple data migrations of blockchains.
The process of performing multiple data migrations for a blockchain system according to yet another embodiment of the present invention is described in detail below with reference to fig. 8. FIG. 8 is a diagram schematically illustrating a process of multiple data migrations to a blockchain system according to yet another embodiment of the present invention.
As shown in fig. 8, the data in the blockchain a may be migrated into the blockchain B by using the data migration method for the blockchain system disclosed in the present application, and then the data in the blockchain B may be migrated into the blockchain C by using the same data migration method for the blockchain system disclosed in the present application. By analogy, multiple data migrations of the blockchain can be realized.
Fig. 9 is a schematic block diagram showing an information processing apparatus that can be used to implement the data migration method for the blockchain system according to the embodiment of the present invention.
In fig. 9, a Central Processing Unit (CPU)901 performs various processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 to a Random Access Memory (RAM) 903. In the RAM 903, data necessary when the CPU 901 executes various processes and the like is also stored as necessary. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output interface 905 is also connected to bus 904.
The following components are connected to the input/output interface 905: an input section 906 (including a keyboard, a mouse, and the like), an output section 907 (including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like), a storage section 908 (including a hard disk, and the like), a communication section 909 (including a network interface card such as a LAN card, a modem, and the like). The communication section 909 performs communication processing via a network such as the internet. The driver 910 may also be connected to the input/output interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted in the storage section 908 as necessary.
In the case where the series of processes described above is realized by software, a program constituting the software is installed from a network such as the internet or a storage medium such as the removable medium 911.
It will be understood by those skilled in the art that such a storage medium is not limited to the removable medium 911 shown in fig. 9 in which the program is stored, distributed separately from the apparatus to provide the program to the user. Examples of the removable medium 911 include a magnetic disk (including a floppy disk (registered trademark)), an optical disk (including a compact disc-read only memory (CD-ROM) and a Digital Versatile Disc (DVD)), a magneto-optical disk (including a mini-disk (MD) (registered trademark)), and a semiconductor memory. Alternatively, the storage medium may be the ROM 902, a hard disk included in the storage section 908, or the like, in which programs are stored, and which is distributed to users together with the device including them.
The instruction codes are read by a machine and can execute the method according to the embodiment of the invention when being executed.
computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
it will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
these computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It is noted that some details known in the art have not been described in order to avoid obscuring the concepts of the present invention. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
The present application may also be configured as follows:
(1) The data migration method for the blockchain system comprises the following steps:
Creating a new created block of a new block chain in a new block chain system, and recording related information of an old block chain in an old block chain system of which data is to be migrated in the new created block, wherein the related information of the old block chain comprises range information of the data to be migrated of the old block chain;
Converting each old transaction recorded in each old block in the old block chain into a new transaction conforming to a new transaction data structure of the new block chain according to the range information, and migrating the converted new transaction into the new block chain,
wherein the new transaction data structure of the new blockchain includes traceback information indicating a location in the old blockchain of an old transaction corresponding to the new transaction.
(2) the data migration method according to (1), wherein the range information includes an old block identifier of a last old block to be migrated in the old block chain.
(3) The data migration method according to (2), wherein the converting step includes:
Reading each old block in the old block chain in turn starting from the first old block in the old block chain until the last old block to be migrated in the old block chain;
for each read old block, sequentially reading each old transaction recorded in the old block according to the sequence of each old transaction recorded in the old block; and
For each old transaction read, parsing the old transaction, and converting the parsed old transaction into a new transaction conforming to the new transaction data structure of the new blockchain.
(4) The data migration method according to (1), wherein the information related to the old blockchain further includes at least one of the following information: the system comprises an old blockchain system, a block head of an old created block of the old blockchain, a block head of a last block to be migrated in the old blockchain, and world state information of the old blockchain.
(5) The data migration method according to (4), wherein the access mode information of the old blockchain system includes at least one of the following information: the information of the networking mode of the old blockchain system, the node information of all nodes in the old blockchain system, the Internet Protocol (IP) address information of all nodes in the old blockchain system, and the address information of the application program access interface of the old blockchain system.
(6) The data migration method according to (1), wherein the trace back information includes: the calling address information of the old block chain, the old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, and the old block identifier of the old block in which the old transaction corresponding to the new transaction in the old block chain is located.
(7) The data migration method according to (6), wherein the call address information of the old block chain includes at least one of the following information: the application program of the old blockchain system accesses interface address information and calling address information of one or more nodes in the old blockchain system.
(8) The data migration method according to any one of (1) to (7), wherein a newly created block of the new block chain is created using a configuration file at a time of starting the new block chain.
(9) The data migration method according to any one of (1) - (7), wherein the migrating the converted new transaction to the new blockchain includes:
And executing the converted new transaction in the new blockchain system according to the execution sequence of the old transaction corresponding to the converted new transaction in the old blockchain system.
(10) the data migration method according to any one of (1) to (7), further comprising:
After the data migration from the old blockchain to the new blockchain is completed, using a new transaction identifier of a new transaction in the new blockchain, querying an old transaction in the old blockchain corresponding to the new transaction by using an intelligent contract deployed on the new blockchain.
(11) The data migration method according to (10), wherein the querying step includes:
querying the tracing information included in a new transaction data structure of the new transaction in the new block chain by using the new transaction identifier of the new transaction in the new block chain; and
and querying an old transaction corresponding to the new transaction in the old block chain by utilizing the tracing information.
(12) the data migration method according to (11), wherein the step of querying an old transaction corresponding to the new transaction in the old block chain by using the trace back information includes:
Inquiring and returning old transaction information of an old transaction corresponding to the new transaction in the old block chain by utilizing the calling address information of the old block chain and an old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, which are included in the tracing information; and
And querying and returning the old block information of the old block in the old block chain, which is corresponding to the new transaction, by using the calling address information of the old block chain and the old block identifier of the old block in the old block chain, which is corresponding to the new transaction, of the old block in the old block chain.
(13) The data migration method according to any one of (1) to (7), further comprising:
After the data migration from the old blockchain to the new blockchain is completed, the data migration from the new blockchain to the next new blockchain is carried out by utilizing the data migration method, so that the data migration of the blockchain is realized for multiple times.
(14) A computer storage medium having stored thereon computer instructions which, when executed by a computer, cause the computer to perform the data migration method for a blockchain system according to any one of (1) to (13).
(15) A computer-implemented data migration apparatus for blockchains, comprising:
a memory storing computer instructions; and
A processor, coupled to the memory, that executes the computer instructions to perform the data migration method for the blockchain system as described in any one of (1) - (13).
Although some specific embodiments of the present invention have been described in detail by way of illustration, it should be understood by those skilled in the art that the above illustration is only for the purpose of illustration and is not intended to limit the scope of the invention. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims (16)

1. A method of data migration for a blockchain system, comprising:
Creating a new created block of a new block chain in a new block chain system, and recording related information of an old block chain in an old block chain system of which data is to be migrated in the new created block, wherein the related information of the old block chain comprises range information of the data to be migrated of the old block chain;
Converting each old transaction recorded in each old block in the old block chain into a new transaction conforming to a new transaction data structure of the new block chain according to the range information, and migrating the converted new transaction into the new block chain,
Wherein the new transaction data structure of the new blockchain includes traceback information indicating a location in the old blockchain of an old transaction corresponding to the new transaction.
2. The data migration method of claim 1, wherein the extent information comprises an old block identification of a last old block to be migrated in the chain of old blocks.
3. the data migration method of claim 2, wherein the step of converting comprises:
Reading each old block in the old block chain in turn starting from the first old block in the old block chain until the last old block to be migrated in the old block chain;
For each read old block, sequentially reading each old transaction recorded in the old block according to the sequence of each old transaction recorded in the old block; and
For each old transaction read, parsing the old transaction, and converting the parsed old transaction into a new transaction conforming to the new transaction data structure of the new blockchain.
4. the data migration method of claim 1, wherein the information about the old blockchain further comprises at least one of: the system comprises an old blockchain system, a block head of an old created block of the old blockchain, a block head of a last block to be migrated in the old blockchain, and world state information of the old blockchain.
5. The data migration method of claim 4, wherein the access mode information of the old blockchain system comprises at least one of the following information: networking mode information of the old blockchain system, node information of all nodes in the old blockchain system, and application program access interface address information of the old blockchain system.
6. The data migration method of claim 5, wherein the node information of all nodes in the old blockchain system includes Internet Protocol (IP) address information of all nodes in the old blockchain system.
7. the data migration method of claim 1, wherein the tracing information comprises: the calling address information of the old block chain, the old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, and the old block identifier of the old block in which the old transaction corresponding to the new transaction in the old block chain is located.
8. The data migration method of claim 7, wherein the call address information of the old blockchain includes at least one of: the application program of the old blockchain system accesses interface address information and calling address information of one or more nodes in the old blockchain system.
9. the data migration method of any of claims 1-8, wherein a newly created block of the new blockchain is created using a configuration file at startup of the new blockchain.
10. The data migration method of any of claims 1-8, wherein the migrating the converted new transaction into the new blockchain comprises:
And executing the converted new transaction in the new blockchain system according to the execution sequence of the old transaction corresponding to the converted new transaction in the old blockchain system.
11. The data migration method of any of claims 1-8, further comprising:
After the data migration from the old blockchain to the new blockchain is completed, using a new transaction identifier of a new transaction in the new blockchain, querying an old transaction in the old blockchain corresponding to the new transaction by using an intelligent contract deployed on the new blockchain.
12. The data migration method of claim 11, wherein the querying step comprises:
Querying the tracing information included in a new transaction data structure of the new transaction in the new block chain by using the new transaction identifier of the new transaction in the new block chain; and
And querying an old transaction corresponding to the new transaction in the old block chain by utilizing the tracing information.
13. the data migration method of claim 12, wherein the step of querying the old transaction in the old blockchain corresponding to the new transaction using the trace back information comprises:
inquiring and returning old transaction information of an old transaction corresponding to the new transaction in the old block chain by utilizing the calling address information of the old block chain and an old transaction identifier of the old transaction corresponding to the new transaction in the old block chain, which are included in the tracing information; and
And querying and returning the old block information of the old block in the old block chain, which is corresponding to the new transaction, by using the calling address information of the old block chain and the old block identifier of the old block in the old block chain, which is corresponding to the new transaction, of the old block in the old block chain.
14. The data migration method of any of claims 1-8, further comprising:
After the data migration from the old blockchain to the new blockchain is completed, the data migration from the new blockchain to the next new blockchain is carried out by utilizing the data migration method, so that the data migration of the blockchain is realized for multiple times.
15. A computer storage medium having stored thereon computer instructions which, when executed by a computer, cause the computer to perform the method of data migration for a blockchain system according to any one of claims 1 to 14.
16. A computer-implemented data migration apparatus for blockchains, comprising:
A memory storing computer instructions; and
A processor, coupled to the memory, that executes the computer instructions to perform the method for data migration for a blockchain system of any of claims 1-14.
CN201710769578.7A 2017-08-31 2017-08-31 data migration method, device and storage medium for blockchain system Active CN107577427B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710769578.7A CN107577427B (en) 2017-08-31 2017-08-31 data migration method, device and storage medium for blockchain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710769578.7A CN107577427B (en) 2017-08-31 2017-08-31 data migration method, device and storage medium for blockchain system

Publications (2)

Publication Number Publication Date
CN107577427A CN107577427A (en) 2018-01-12
CN107577427B true CN107577427B (en) 2019-12-13

Family

ID=61030084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710769578.7A Active CN107577427B (en) 2017-08-31 2017-08-31 data migration method, device and storage medium for blockchain system

Country Status (1)

Country Link
CN (1) CN107577427B (en)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256354B (en) * 2018-01-29 2022-02-22 张天 Test data-based storage method and storage medium
CN108519862B (en) * 2018-03-30 2020-03-17 百度在线网络技术(北京)有限公司 Storage method, device and system of block chain system and storage medium
CN110799966A (en) * 2018-04-22 2020-02-14 因特比有限公司 Method and system for hosting a new blockchain using existing blockchain nodes
EP3570489B1 (en) * 2018-05-18 2020-04-08 Siemens Aktiengesellschaft Device and method for transforming blockchain data blocks
CN108829350B (en) 2018-05-31 2020-02-21 阿里巴巴集团控股有限公司 Data migration method and device based on block chain
CN109144414B (en) * 2018-07-27 2020-07-07 阿里巴巴集团控股有限公司 Multi-level storage method and device for blockchain data
CN109241357A (en) * 2018-08-08 2019-01-18 深圳市金泽智联信息技术有限公司 Chain structure model and its construction method, system and terminal device
CN109298835B (en) * 2018-08-16 2022-04-26 北京京东尚科信息技术有限公司 Data archiving processing method, device, equipment and storage medium of block chain
CN109213730B (en) * 2018-09-14 2020-10-30 莆田市烛火信息技术有限公司 File storage service address changing method and system of associated block chain main chain
CN109446383A (en) * 2018-10-18 2019-03-08 尚维斯 A kind of method that multichannel recurrence seeks block on block chain
CN109447805A (en) * 2018-10-18 2019-03-08 尚维斯 A method of dissolving new chain block group new block chain automatically
CN109543455B (en) * 2018-11-06 2021-07-13 联动优势科技有限公司 Data archiving method and device for block chain
CN109669709B (en) * 2018-11-26 2022-04-08 杭州溪塔科技有限公司 Data migration method and data migration system for block chain upgrading
CN110209347B (en) * 2019-04-04 2020-08-11 特斯联(北京)科技有限公司 A traceable data storage method
CN110134668B (en) * 2019-04-28 2023-08-01 创新先进技术有限公司 Data migration method, device and equipment applied to blockchain
CN110232080B (en) * 2019-05-23 2021-06-29 智慧谷(厦门)物联科技有限公司 Rapid retrieval method based on block chain
CN110517041B (en) * 2019-07-09 2022-06-03 咪咕文化科技有限公司 Block chain management method and device, electronic equipment and storage medium
CN110704392B (en) * 2019-08-21 2023-03-31 平安科技(深圳)有限公司 Block chain network upgrading method and device, storage medium and electronic equipment
SG11202002364TA (en) 2019-09-12 2020-04-29 Alibaba Group Holding Ltd Log-structured storage systems
CN111886591A (en) 2019-09-12 2020-11-03 创新先进技术有限公司 Log structure storage system
CN111309711A (en) 2020-03-13 2020-06-19 财付通支付科技有限公司 Cross-blockchain data migration method, device, device and storage medium
CN112540969B (en) * 2020-11-26 2023-07-14 南京纯白矩阵科技有限公司 Data migration method of intelligent contracts among heterogeneous block chains
CN112650733A (en) * 2020-12-28 2021-04-13 杭州趣链科技有限公司 Intelligent contract state data processing method, system and device
CN113806335A (en) * 2021-09-28 2021-12-17 杭州溪塔科技有限公司 A method and device for data migration applied to blockchain
CN113987598A (en) * 2021-11-08 2022-01-28 支付宝(杭州)信息技术有限公司 Block migration method and device
CN114265826B (en) * 2021-12-14 2025-05-13 蚂蚁区块链科技(上海)有限公司 Blockchain business migration method, device, platform and electronic equipment
CN115630046B (en) * 2022-12-22 2023-03-21 国网数字科技控股有限公司 Method and device for blockchain migration
CN116614513A (en) * 2023-03-31 2023-08-18 中国工商银行股份有限公司 Block chain data migration method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598490A (en) * 2016-11-25 2017-04-26 深圳前海微众银行股份有限公司 Access method for block chain data and block chain management system
CN106970921A (en) * 2016-01-14 2017-07-21 阿里巴巴集团控股有限公司 A kind of data migration method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321434A1 (en) * 2015-05-01 2016-11-03 Monegraph, Inc. Digital content rights transactions using block chain systems
US20160321676A1 (en) * 2015-05-01 2016-11-03 Monegraph, Inc. Sharing content within social network services
US20170134161A1 (en) * 2015-11-06 2017-05-11 Cable Television Laboratories, Inc Blockchaining for media distribution

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106970921A (en) * 2016-01-14 2017-07-21 阿里巴巴集团控股有限公司 A kind of data migration method and device
CN106598490A (en) * 2016-11-25 2017-04-26 深圳前海微众银行股份有限公司 Access method for block chain data and block chain management system

Also Published As

Publication number Publication date
CN107577427A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
CN107577427B (en) data migration method, device and storage medium for blockchain system
CN110442652B (en) Cross-chain data processing method and device based on block chain
CN110800255B (en) Updating block chain world state mercker patricia dictionary tree subtree
CN112767158B (en) Transaction execution method and device based on blockchain, and electronic device
US12010213B2 (en) Pruning entries in tamper-evident data stores
CN110874739B (en) Distributed computing and storage network implementing high integrity, high bandwidth, low latency, secure processing
US11853291B2 (en) Privacy preserving architecture for permissioned blockchains
US9990391B1 (en) Transactional messages in journal-based storage systems
TWI479341B (en) High throughput, reliable replication of transformed data in information systems
US10108658B1 (en) Deferred assignments in journal-based storage systems
US9589153B2 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
US20240232223A1 (en) Data synchronization method and system based on blockchain, and related device
US11379828B2 (en) Distributed computing and storage network implementing high integrity, high bandwidth, low latency, secure processing
US20200084041A1 (en) Automated Blockchain Protocol Update
CN110046523A (en) Intelligent contract checking method and device and electronic equipment
CN110442307A (en) Binding method, equipment and the storage medium of disk in a kind of linux system
CN109344268A (en) Graph database writing method, electronic device and computer-readable storage medium
GB2604000A (en) Blockchain selective world state database
EP4394619A1 (en) Data processing method and apparatus based on blockchain, and device and readable storage medium
CN118192897A (en) Data storage system, method and device
CN110209347A (en) A kind of retrospective date storage method
Falazi et al. Blockchain-based collaborative development of application deployment models
CN115221559A (en) Data account access authorization method and device
CN115203747A (en) Data account creation method and device
CN115203746A (en) Access authorization method and device for data account

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
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 200120 T3, 1788, 1800 Century Avenue, free trade Experimental Zone, Pudong New Area, Shanghai

Patentee after: Shanghai insurance exchange, Limited by Share Ltd

Address before: 200120 Shanghai Pudong New Area China 22 / F, financial information center, Dongyuan Road, Pudong New Area, Shanghai

Patentee before: Shanghai insurance exchange, Limited by Share Ltd