CN109669709B - Data migration method and data migration system for block chain upgrading - Google Patents

Data migration method and data migration system for block chain upgrading Download PDF

Info

Publication number
CN109669709B
CN109669709B CN201811416627.XA CN201811416627A CN109669709B CN 109669709 B CN109669709 B CN 109669709B CN 201811416627 A CN201811416627 A CN 201811416627A CN 109669709 B CN109669709 B CN 109669709B
Authority
CN
China
Prior art keywords
version
data
new
original
historical data
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
CN201811416627.XA
Other languages
Chinese (zh)
Other versions
CN109669709A (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.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower 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 Hangzhou Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN201811416627.XA priority Critical patent/CN109669709B/en
Publication of CN109669709A publication Critical patent/CN109669709A/en
Application granted granted Critical
Publication of CN109669709B publication Critical patent/CN109669709B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention provides a data migration method for block chain upgrading and a data migration system for block chain upgrading, wherein the method comprises the following steps: configuring a new executable file, and replacing an original executable file in the original primary directory with the new executable file; executing the executable file of the new version, and reading the historical data of the original version according to the version rule corresponding to the executable file of the original version; and selecting at least part of the original version historical data as new version historical data and storing the new version historical data into a new block. According to the technical scheme of the invention, when the block chain is upgraded at the later stage, the original data of the block chain is smoothly transferred to the new block, so that a user can still inherit the original data before upgrading after the block chain is upgraded; and ensure block chains with inconsistent block heights in the alliance chain, and can simultaneously carry out data migration.

Description

Data migration method and data migration system for block chain upgrading
Technical Field
The present application relates to the field of network technologies, and in particular, to a data migration method and a data migration system for upgrading a block chain.
Background
The blockchain technique, also known as distributed ledger technique, is essentially a decentralized distributed internet database. A network constructed using blockchain technology can be considered as a blockchain network, where the blockchain network includes a plurality of blockchain nodes, and any blockchain node can correspond to at least one blockchain, and any blockchain can include at least one block.
The block chain has the characteristics of never stopping and not losing data, and can be used as a distributed decentralized database to provide reliable service for users. In the long-term operation process, the product has the requirement of repairing defects or adding new functions, so that the block chain product needs to be upgraded, and the inheritance of original data is necessarily guaranteed while upgrading. The public chain is characterized in that the chain is unique, correspondingly, the block height is also unique, so that the soft branching method and the hard branching method are used when the current public chain takes the block height as a front and back distinguishing point in the upgrading process.
In a federation chain, different federations may each operate their own blockchain, or the same federation may operate multiple blockchains. The block height of each block chain is from the height of the created block to zero, so that the block height is not unique during later upgrading, the problem of data and logic incompatibility exists, original data on the chain cannot be smoothly migrated, and normal service cannot be provided for users.
Therefore, it is desirable to find a data migration method and a data migration system for blockchain upgrade, which implement smooth migration of original data in blockchain upgrade, maintain and provide query services of the original chain, and overcome the above-mentioned problems.
Disclosure of Invention
The embodiment of the application provides a data migration method and a data migration system for block chain upgrading, which are used for realizing smooth migration of original data in the block chain upgrading, being compatible with block chain data of new and old versions, and maintaining and providing query service of the original chain.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme:
in a first aspect, a data migration method for blockchain upgrade is provided, where the method includes:
configuring a new version executable file, and replacing an original version executable file in an original primary directory by using the new version executable file, wherein the primary directory is created when a block chain is established for the first time and is used for storing data and a storage address on the chain;
executing the new version executable file, and reading the original version historical data according to the version rule corresponding to the original version executable file;
and selecting at least part of the original version historical data as new version historical data and storing the new version historical data into a new block.
In a second aspect, a data migration system for blockchain upgrade is provided, including:
the configuration module is used for configuring a new version executable file and replacing an original version executable file in an original primary directory by using the new version executable file, wherein the primary directory is created when a block chain is established for the first time and is used for storing data and a storage address on the chain;
the execution module is used for executing the new version executable file and reading the original version historical data according to the version rule corresponding to the original version executable file;
and the migration module is used for selecting at least part of the original version historical data as new version historical data and storing the new version historical data into a new block.
In a third aspect, the present application provides an electronic system comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor for performing the method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the method of the first aspect.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme provided by the embodiment of the application, when each block chain of the alliance chain is upgraded at the later stage, original data are smoothly migrated to a new block, so that a user can still inherit the original data before upgrading after the block chain is upgraded; and ensuring a block chain with inconsistent block heights in the alliance chain, and simultaneously carrying out data migration.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative efforts.
Fig. 1 is a flowchart of a data migration method for block chain upgrade according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a data migration system for block chain upgrade according to an embodiment of the present disclosure;
fig. 3 is a data flow diagram of a data migration system for block chain upgrade according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
The block chain has the characteristics of never stopping and not losing data, and can be used as a distributed decentralized database to provide reliable service for users. In the long-term operation process, the product has the requirement of repairing defects or adding new functions, so that the block chain product needs to be upgraded, and the inheritance of original data is necessarily guaranteed while upgrading. The public chain is characterized in that the chain is unique, correspondingly, the block height is also unique, so that the soft branching method and the hard branching method are used when the current public chain takes the block height as a front and back distinguishing point in the upgrading process.
In a federation chain, different federations may each operate their own blockchain, or the same federation may operate multiple blockchains. The block height of each block chain is from the height of the created block to zero, so that the block height is not unique during later upgrading, the problem of data and logic incompatibility exists, original data on the chain cannot be smoothly migrated, and normal service cannot be provided for users.
In view of the foregoing problems, embodiments of the present application provide a data migration method and a decentralized application device for blockchain upgrade, so as to implement smooth migration of original data in blockchain upgrade, and maintain and provide query service of an original chain.
Example one
Fig. 1 is a flowchart of a data migration method for blockchain upgrade provided in an embodiment of the present application, and as shown in fig. 1, the data migration method for blockchain upgrade provided in the embodiment of the present application includes the following steps:
step S1, configuring a new version executable file, and replacing the original version executable file in the original primary directory with the new version executable file, where the primary directory is created when the block chain is first created and is used to store data and a storage address on the chain.
And step S2, executing the new version executable file, and reading the original version historical data according to the version rule corresponding to the original version executable file.
And step S3, selecting at least a part of the original version history data as new version history data and storing the new version history data into a new block.
According to the technical scheme of the embodiment, when each block chain of the alliance chain is upgraded at the later stage, original data before the block chain is forked is smoothly migrated to a new block, so that a user can still inherit the original data before the block chain is upgraded; and ensure block chains with inconsistent block heights in the alliance chain, and can simultaneously carry out data migration. Thus, after an upgrade, the user is still able to use the historical data prior to the upgrade.
Specifically, in this embodiment, the detailed steps of the data migration method for block chain upgrade are as follows:
establishing a block chain, establishing a primary directory corresponding to the block chain, putting linked data and a storage address of the block chain into the primary directory, and calling an original version executable file of the linked data and the storage address, wherein the block chain is operated by adopting the original version executable file.
It should be noted that the step of establishing the block chain and the primary directory is not a necessary step of the present invention, and by using the data migration method of this embodiment, data migration can be performed in the upgrade process of the established block chain, which is not limited by the present invention.
And configuring a new version executable file, and replacing the original version executable file in the original primary directory with the new version executable file. In this embodiment, the original version executable file and the new version executable file are both operation files of a blockchain manager, the blockchain manager uses the new version executable file to replace the original version executable file in the original primary directory, and the new version manager permission file can read all original version history data according to an original version rule. However, the present invention is not limited to this, and the original version executable file and the new version executable file may also be operation files that share the right for each node on the blockchain.
And executing the new version executable file, and reading the original version historical data according to the version rule corresponding to the original version executable file. Specifically, in the present embodiment, the read history data of all original versions includes the transaction hash value, the transaction content, and the state function of the original version. However, the invention is not limited in this regard, and in other embodiments, the read original version history data may also include a transaction hash value.
It should be further noted that, in this embodiment, the original version rule includes a data format or processing logic of the original version.
Specifically, in this embodiment, the primary directory corresponds to a plurality of subdirectories, and the step of reading all the original version history data according to the original version rules includes: and the new-version executable file reads a storage address in a configuration file in the first-level directory, reads required historical data from a corresponding subdirectory according to the storage address, stores the historical data into a memory of the current host, and stores metadata information of the historical data into a cache.
An implementable partial migration scheme, the step of converting the history data into new data in a new version executable file format and storing the new blocks comprising: and selecting a unique identifier of the transaction from the historical data, converting the unique identifier of the transaction into data in a new version format, and storing the data in a new block. The method has the advantages that the converted data are less, the upgrading speed is high, and the user can know important historical data before the block chain is upgraded after the upgrading only through the unique identification conversion of the transaction.
Specifically, in this embodiment, the unique identifier is a transaction hash value.
In this embodiment, the step of storing the new block with the data in the new version executable file format includes: and converting the historical data according to the data format of the new version.
According to the data migration method for updating the blockchain, provided by the embodiment, at a blockchain manager, all original version historical data are read according to original version rules by configuring a new version executable file; and converting the historical data into new version data which can be identified by the new version, and storing the new version data into a new block, so that the user terminal can conveniently keep the historical data before the block chain is upgraded, such as transaction data.
In particular, in a federation chain, different federations may each operate their own blockchain, and the same federation may also operate multiple blockchains. The block height of each block chain is zero from the created block height, so that the block height is not unique during later upgrading, the problem of data and logic incompatibility exists, original data on the chain cannot be smoothly migrated, and by adopting the data migration method for block chain upgrading provided by the embodiment, an administrator can uniformly perform historical data migration on unused block chains in the alliance chain, after upgrading, a user can conveniently inquire historical data before upgrading, and part of the block chains cannot be abandoned due to different selections of the user, so that the use experience of a user end in the alliance chain is improved.
It should be noted that, in this embodiment, after the new data that can be identified by the new version of executable file converted from the historical data is stored in the new block, the original node on the block chain is converted into a read-only node, and the read-only node is isolated from the identification mechanism, the transaction processing, and the new block chain, and maintains the query service of the original node.
In this embodiment, the data migration method for blockchain upgrade is used for a decentralized transaction system constructed by blockchain technology, such as an electronic money transaction system like bitcoin, but the invention does not limit the specific application form of the data migration method for blockchain upgrade.
Another achievable partial migration scheme is that the step of selecting at least part of the original version history data as new version history data and storing the new version history data into a new block comprises: and selecting transaction content data from the historical data, converting the transaction content data into new version data, and storing the new version data into a new block, wherein the transaction content data at least comprises one of transaction amount, intelligent contract type and contract creation type.
This has the advantage that after a federation chain upgrade, the user is able to gain a better understanding of the transactional content data prior to the upgrade.
Therefore, the partial migration scheme carries out version conversion on partial historical data to enable the partial historical data to become data in a new version format, and the method has the advantages that on the aspect of a block chain manager, the calling and the query of the data on the block chain are more convenient, and when a user needs to call the historical data before upgrading, the operation of the manager is not needed, and the data after the version conversion can be directly identified.
Another all-migration scheme that can be implemented is that at least part of the original version history data is selected as new version history data, and the step of storing a new block includes: and selecting all historical data from the historical data, taking all historical data as new version historical data, and directly storing the new version historical data into a new block.
Therefore, when the block chain is upgraded, all the historical data are used as new version historical data and directly stored in a new block, and a user can still inquire the historical data. In the method, when a user reads the historical data each time, an inquiry request is sent to a blockchain manager, and the new version execution file of the blockchain manager identifies the historical data in a new block, so that inquiry service is provided for the user.
Example two
An embodiment of the present application provides a data migration system for blockchain upgrade, and fig. 2 is a schematic structural diagram of the data migration system for blockchain upgrade provided in the embodiment of the present application. Referring to fig. 2, the data migration system 100 for block chain upgrade according to this embodiment includes:
and the configuration module 10 is used for configuring the new version executable file and replacing the original version executable file in the original primary directory with the new version executable file. The primary directory is created when the block chain is established for the first time and is used for storing data and storage addresses on the chain.
And the execution module 11 is configured to execute the new version executable file, and read the original version history data according to a version rule corresponding to the original version executable file.
And the migration module 12 is configured to select at least a part of the original version history data as a new version history data and store the new version history data in a new block.
According to the technical scheme of the embodiment, when each block chain of the alliance chain is upgraded at the later stage, the original data before the block chain is forked is smoothly migrated to a new block by adopting an upgrade package, so that a user can still inherit the original data before upgrading after upgrading the block chain; and ensure block chains with inconsistent block heights in the alliance chain, and can simultaneously carry out data migration. Thus, after an upgrade, the user is still able to use the historical data prior to the upgrade.
Specifically, fig. 3 is a data flow diagram of the data migration system with a blockchain upgrade provided in the embodiment of the present application, and with reference to fig. 2 and fig. 3, the step of performing data migration by using the data migration system with a blockchain upgrade provided in the embodiment includes:
establishing a block chain 101, establishing a primary directory 102 corresponding to the block chain 101, storing chain data and storage addresses of the block chain 101 in the primary directory 102, and calling an original version executable file 103 of the chain data and the storage addresses, wherein the block chain 101 can be operated by using the original version executable file.
Specifically, in this embodiment, the original version executable file 103 and the new version executable file 104 are operation files of a blockchain manager, the blockchain manager uses the new version executable file 104 to replace the original version executable file 103 in the original primary directory 102, and the new version executable file 104 can read all original version history data according to original version rules. However, the present invention is not limited to this, and the original version executable file 103 and the new version executable file 104 may also be operation files sharing the right for each node on the block chain.
And executing the new version executable file 104, and reading the original version history data according to the version rule corresponding to the original version executable file 103. Specifically, in the present embodiment, the read history data of all original versions includes the transaction hash value, the transaction content, and the state function of the original version. However, the invention is not limited in this regard and in other embodiments, the read original version history data may include only the transaction hash value.
It should be further noted that, in this embodiment, the original version rule includes a data format or processing logic of the original version.
Specifically, in this embodiment, the primary directory 102 corresponds to a plurality of subdirectories, and the specific step of reading all the original version history data according to the original version rules includes: the new-version executable file 104 reads a storage address from the configuration file in the first-level directory, reads the required history data from the corresponding subdirectory according to the storage address, stores the history data into the memory of the current host, and stores the metadata information of the history data into the cache.
Converting the historical data into new data in a new version executable file format, and storing the new data in a new block, wherein the step comprises the following steps: and selecting a unique identifier of the transaction from the historical data, converting the unique identifier of the transaction into data in a new version format, and storing the data in a new block. The method has the advantages that the converted data are less, the upgrading speed is high, and the user can know important historical data before the block chain is upgraded after the upgrading only through the unique identification conversion of the transaction.
Specifically, in this embodiment, the unique identifier is a transaction hash value.
In this embodiment, the step of storing the new block with the data in the new version executable file format includes: and converting the historical data according to the data format of the new version.
Adopting a data migration system upgraded by a block chain, and reading all original version historical data by configuring a new version executable file at a block chain manager end according to an original version rule; and converting the historical data into new version data which can be identified by the new version, and storing the new version data into a new block, so that the user terminal can conveniently keep the historical data before the block chain is upgraded, such as transaction data.
In particular, in a federation chain, different federations may each operate their own blockchain, and the same federation may also operate multiple blockchains. The block height of each block chain is zero from the created block height, so that the block height is not unique during later upgrading, the problem of data and logic incompatibility exists, original data on the chain cannot be smoothly migrated, and by adopting the data migration system for upgrading the block chains, an administrator can uniformly migrate the historical data of unused block chains in the alliance chain, after upgrading, a user can conveniently inquire the historical data before upgrading, and part of the block chains cannot be abandoned due to different selections of the user, so that the use experience of a user end in the alliance chain is improved.
It should be further noted that, in this embodiment, the data migration system for blockchain upgrade further includes a conversion module (not shown) configured to convert an original node on the blockchain into a read-only node after the migration module 12 selects at least a part of the original version history data from the original version history data to store in a new block as a new version history data.
The read-only node is isolated from the common recognition mechanism, the transaction processing and the new block uplink, maintains new data which can be identified by a new version executable file converted from historical data by the query service of the original node, stores the new data into the new block, converts the original node on the block chain into the read-only node, and is isolated from the common recognition mechanism, the transaction processing and the new block uplink and maintains the query service of the original node.
In this embodiment, the data migration method for blockchain upgrade is used for a decentralized transaction system constructed by blockchain technology, such as an electronic money transaction system like bitcoin, but the invention does not limit the specific application form of the data migration method for blockchain upgrade.
Therefore, according to the data migration system for blockchain upgrade provided by the embodiment, at the blockchain administrator, all the historical data of the original version are read according to the original version rules by configuring the executable file of the new version; and converting part or all of the historical data into new version data which can be identified by the new version user authority file, and storing the new version data into a new block, so that the user side can conveniently keep the historical data before the block chain is upgraded, such as transaction data. In particular, in a federation chain, different federations may each operate their own blockchain, and the same federation may also operate multiple blockchains. The block height of each block chain is zero from the created block height, so that the block height is not unique during later upgrading, the problem of data and logic incompatibility exists, original data on the chain cannot be smoothly migrated, and by adopting the data migration method for block chain upgrading provided by the embodiment, an administrator can uniformly perform historical data migration on unused block chains in the alliance chain, after upgrading, partial block chains cannot be abandoned due to different selections of users, the use experience of a user end in the alliance chain is improved, and after upgrading, the users can still use the historical data before upgrading.
EXAMPLE III
The electronic system of the embodiments of the present specification is described in detail below. On the hardware level, the electronic system comprises a processor and optionally an internal bus, a network interface and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least 1 disk Memory. Of course, the electronic system may also include hardware needed for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the memory is used to store programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the decentralized application account recovery device on the logic level. And the processor is used for executing the program stored in the memory and is specifically used for executing the method operation executed when the server is taken as an execution main body.
The method disclosed in the embodiment of fig. 1 in the present specification may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic system may also execute the method of fig. 1 and implement the functions of the decentralized application system in the embodiment shown in fig. 1, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic system of the embodiment of the present disclosure does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Example four
Embodiments of the present specification also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic system including a plurality of application programs, cause the electronic system to perform the method of embodiment one. And will not be described in detail herein.
The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are all described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (10)

1. A method for data migration for blockchain upgrades, the method comprising:
configuring a new version executable file, and replacing an original version executable file in an original primary directory by using the new version executable file, wherein the primary directory is created when a block chain is established for the first time and is used for storing data and a storage address on the chain;
executing the new version executable file, and reading the original version historical data according to the version rule corresponding to the original version executable file;
selecting at least part of the original version historical data as new version historical data, and storing the new version historical data in a new block;
the first-level directory corresponds to a plurality of subdirectories, and the reading of the original version historical data according to the version rule corresponding to the original version executable file comprises the following steps: and the new-version executable file reads a storage address in a configuration file in the first-level directory, reads required historical data from a corresponding subdirectory according to the storage address, stores the historical data into a memory of the current host, and stores metadata information of the historical data into a cache.
2. The method of claim 1, wherein selecting at least a portion of the original version history data as a new version history data for storage in a new block comprises:
selecting a unique identifier of a transaction from the original version historical data, converting the unique identifier of the transaction into data in the format of the executable file of the new version, and storing the data in a new block;
alternatively, the first and second electrodes may be,
and all the original version historical data are used as new version historical data and stored in a new block.
3. The method of claim 1 or 2, wherein after selecting at least a portion of the original version history data as a new version history data and storing the new version history data in a new block, the method further comprises:
converting the original node on the block chain into a read-only node; the read-only node is isolated from the common identification mechanism, transaction processing and new block uplink, and maintains the query service of the original node.
4. The method of claim 1, wherein when reading the original version history data according to the version rule corresponding to the original version executable file, reading the content at least comprises:
one or a combination of a transaction hash value, transaction content, and a state function.
5. The method of claim 2, wherein the version rules corresponding to the original version executable file at least comprise: the data format or processing logic of the original version executable file.
6. A system for data migration for blockchain upgrades, the system comprising:
the configuration module is used for configuring a new version executable file and replacing an original version executable file in an original primary directory by using the new version executable file, wherein the primary directory is created when a block chain is established for the first time and is used for storing data and a storage address on the chain;
the execution module is used for executing the new version executable file and reading the original version historical data according to the version rule corresponding to the original version executable file;
the migration module is used for selecting at least part of the original version historical data as new version historical data and storing the new version historical data into a new block;
the first-level directory corresponds to a plurality of subdirectories, and the execution module is further configured to: and the new-version executable file reads a storage address in a configuration file in the first-level directory, reads required historical data from a corresponding subdirectory according to the storage address, stores the historical data into a memory of the current host, and stores metadata information of the historical data into a cache.
7. The system of claim 6, wherein the migration module is specifically configured to:
selecting a unique identifier of a transaction from the original version historical data, converting the unique identifier of the transaction into data in the format of the executable file of the new version, and storing the data in a new block;
alternatively, the first and second electrodes may be,
and all the original version historical data are used as new version historical data and stored in a new block.
8. The system of claim 6 or 7, wherein the system further comprises:
the conversion module is used for converting the original node on the block chain into a read-only node after the migration module selects at least part of the original version historical data from the original version historical data to be stored into a new block as new version historical data;
the read-only node is isolated from the common identification mechanism, transaction processing and new block uplink, and maintains the query service of the original node.
9. An electronic device, characterized in that the electronic device comprises a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the method according to any one of claims 1-5.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method as set forth in any one of the claims 1-5.
CN201811416627.XA 2018-11-26 2018-11-26 Data migration method and data migration system for block chain upgrading Active CN109669709B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811416627.XA CN109669709B (en) 2018-11-26 2018-11-26 Data migration method and data migration system for block chain upgrading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811416627.XA CN109669709B (en) 2018-11-26 2018-11-26 Data migration method and data migration system for block chain upgrading

Publications (2)

Publication Number Publication Date
CN109669709A CN109669709A (en) 2019-04-23
CN109669709B true CN109669709B (en) 2022-04-08

Family

ID=66143299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811416627.XA Active CN109669709B (en) 2018-11-26 2018-11-26 Data migration method and data migration system for block chain upgrading

Country Status (1)

Country Link
CN (1) CN109669709B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134668B (en) * 2019-04-28 2023-08-01 创新先进技术有限公司 Data migration method, device and equipment applied to blockchain
CN110392042A (en) * 2019-06-19 2019-10-29 深圳壹账通智能科技有限公司 System environments resource allocation information acquisition methods, device and block chain node
US11036720B2 (en) 2019-06-28 2021-06-15 Advanced New Technologies Co., Ltd. Blockchain-based hierarchical data storage
CN110334154B (en) * 2019-06-28 2020-07-21 阿里巴巴集团控股有限公司 Block chain based hierarchical storage method and device and electronic equipment
CN110287170B (en) * 2019-06-28 2021-05-11 杭州复杂美科技有限公司 Database upgrading method, state data calling method, device and storage medium
US10789222B2 (en) 2019-06-28 2020-09-29 Alibaba Group Holding Limited Blockchain-based hierarchical data storage
CN111522561B (en) * 2020-03-06 2023-06-06 杜晓楠 Method for smooth backward compatible upgrade in DBFT distributed network, computer readable storage medium and DBFT network
CN111506327B (en) * 2020-04-15 2023-04-21 深圳市迅雷网络技术有限公司 Block chain node hot upgrading method and related equipment
CN112540969B (en) * 2020-11-26 2023-07-14 南京纯白矩阵科技有限公司 Data migration method of intelligent contracts among heterogeneous block chains
CN113065867B (en) * 2021-03-30 2023-06-30 上海万向区块链股份公司 System, method and medium for upgrading incompatible blockchain based on data replay

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850427A (en) * 2015-04-22 2015-08-19 深圳市元征科技股份有限公司 Method and device for upgrading code
CN106406940A (en) * 2016-09-05 2017-02-15 广东欧珀移动通信有限公司 System upgrading method, system upgrading apparatus, and terminal
CN107577427A (en) * 2017-08-31 2018-01-12 上海保险交易所股份有限公司 For the data migration method of block catenary system, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150379510A1 (en) * 2012-07-10 2015-12-31 Stanley Benjamin Smith Method and system to use a block chain infrastructure and Smart Contracts to monetize data transactions involving changes to data included into a data supply chain.

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850427A (en) * 2015-04-22 2015-08-19 深圳市元征科技股份有限公司 Method and device for upgrading code
CN106406940A (en) * 2016-09-05 2017-02-15 广东欧珀移动通信有限公司 System upgrading method, system upgrading apparatus, and terminal
CN107577427A (en) * 2017-08-31 2018-01-12 上海保险交易所股份有限公司 For the data migration method of block catenary system, equipment and storage medium

Also Published As

Publication number Publication date
CN109669709A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109669709B (en) Data migration method and data migration system for block chain upgrading
US11204915B2 (en) Blockchain-based data storage and query method and device
CN107395659B (en) Method and device for service acceptance and consensus
CN107450981B (en) Block chain consensus method and equipment
CN107426169B (en) Service processing method and device based on permission
US11626972B2 (en) Data processing method and apparatus
CN107622091B (en) Database query method and device
CN108268609B (en) File path establishing and accessing method and device
CN107066519B (en) Task detection method and device
CN110032568B (en) Data structure reading and updating method and device, and electronic equipment
CN116305298B (en) Method and device for managing computing power resources, storage medium and electronic equipment
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
CN113888173B (en) Intelligent contract calling method, device and equipment based on block chain
CN111651467A (en) Block chain link point interface issuing and calling method and device
CN113821307B (en) Method, device and equipment for quickly importing virtual machine images
CN111949297B (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN108647102B (en) Service request processing method and device of heterogeneous system and electronic equipment
CN106156050B (en) Data processing method and device
CN110647463B (en) Method and device for restoring test breakpoint and electronic equipment
CN110992039A (en) Transaction processing method, device and equipment
CN114064594B (en) Data processing method and device
CN115033551A (en) Database migration method and device, electronic equipment and storage medium
CN112749189A (en) Data query method and device
CN110659105A (en) Virtualized resource processing method, device, equipment and storage medium
CN110321250B (en) Disaster recovery method and device for application

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
TA01 Transfer of patent application right

Effective date of registration: 20200311

Address after: 310012 no.1001, 10 / F, block a, Huaxing Times Square, No.478, Wensan Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Xita Technology Co.,Ltd.

Address before: 310013 A 1301, Huaxing Times Square, 478 Wensanlu Road, Xihu District, Hangzhou, Zhejiang.

Applicant before: CRYPTAPE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant