CN111832069B - Multi-block chain on-chain data storage system and method based on cloud computing - Google Patents
Multi-block chain on-chain data storage system and method based on cloud computing Download PDFInfo
- Publication number
- CN111832069B CN111832069B CN202010504962.6A CN202010504962A CN111832069B CN 111832069 B CN111832069 B CN 111832069B CN 202010504962 A CN202010504962 A CN 202010504962A CN 111832069 B CN111832069 B CN 111832069B
- Authority
- CN
- China
- Prior art keywords
- block
- chain
- data
- cloud
- blockchain
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Bioethics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及云计算及区块链领域,具体涉及了一种基于云计算的多区块链的链上数据存储系统及方法。The present invention relates to the fields of cloud computing and block chains, in particular to an on-chain data storage system and method of multi-block chains based on cloud computing.
背景技术Background technique
在区块链网络中,众多计算节点构成一个对等网络,共同维护链上数据(或称为区块,block),该链上数据具有不可篡改、不可否认、可追踪等特征,通常以文件系统及键值数据库的形式存储在计算节点的本地存储空间。在以太坊(Ethereum)区块链网络环境中,计算节点在本地存储完整的链上数据,即所有的区块,并在本地建立所有区块的索引数据库和世界状态数据库,区块数据对于网络中的计算节点是完全可视的。在超级账本(Hyperledger)区块链网络环境中,计算节点在本地存储所参与的联盟链或私有链的链上数据,并建立键值数据库。由于Hyperledger的计算节点并不存储所有的链上数据,相对于Ethereum而言,数据规模相对较小。In the blockchain network, many computing nodes form a peer-to-peer network to jointly maintain the data on the chain (or called block, block). The system and the key-value database are stored in the local storage space of the computing node. In the Ethereum (Ethereum) blockchain network environment, computing nodes store complete on-chain data locally, that is, all blocks, and build index databases and world state databases of all blocks locally. Block data is important for the network Compute nodes in are fully visible. In the Hyperledger blockchain network environment, computing nodes locally store the on-chain data of participating consortium chains or private chains, and establish key-value databases. Since Hyperledger's computing nodes do not store all the on-chain data, the data scale is relatively small compared to Ethereum.
云存储从云计算演变而来,提供一种透明的、按需分配、弹性扩充的存储资源服务,存储容量可以超出单个计算节点的存储权限,是对计算节点本地存储的容量扩充。Cloud storage evolved from cloud computing and provides a transparent, on-demand, and elastically scalable storage resource service. The storage capacity can exceed the storage authority of a single computing node, which is an expansion of the local storage capacity of the computing node.
一个计算节点参与多个区块链网络是常见的应用场景,在此应用场景下计算节点需要存储多个区块链的链上数据。即使在Hyperledger区块链应用网络中,一个计算节点参与多个联盟链或私有链,也会导致链上数据的存储量激增,而且随着应用时间的增长,链上数据存储量必然越来越大,甚至超出单个计算节点的存储极限。It is a common application scenario for a computing node to participate in multiple blockchain networks. In this application scenario, the computing node needs to store on-chain data of multiple blockchains. Even in the Hyperledger blockchain application network, if a computing node participates in multiple consortium chains or private chains, the amount of data stored on the chain will increase sharply, and as the application time increases, the amount of data stored on the chain will inevitably increase. Large, even exceeding the storage limit of a single computing node.
发明内容Contents of the invention
本发明的目的在于至少解决现有技术中存在的技术问题之一,提供了一种基于云计算的多区块链的链上数据存储系统,该系统包括多个区块链网络、多个区块链客户端及云存储,多个一个或多个所述区块链客户端构成区块链的计算节点;所述云存储包括区块数据模块、用户数字证书模块、密码引擎模块、键值数据库及API接口;所述区块链客户端设置有一个或多个云存储,所述区块链客户端用于对多个区块链的链上数据通过所述区块数据模块、所述用户数字证书模块、所述密码引擎模块、所述键值数据库及所述API接口集中存储于所述云存储;所述区块链客户端设置有云存储接口,所述云存储接口与所述API接口进行通信。The purpose of the present invention is to at least solve one of the technical problems existing in the prior art, and provide a multi-block chain data storage system based on cloud computing. The system includes multiple block chain networks, multiple block chains Block chain client and cloud storage, one or more of the block chain clients constitute the computing node of the block chain; the cloud storage includes a block data module, a user digital certificate module, a cryptographic engine module, a key value Database and API interface; The block chain client is provided with one or more cloud storages, and the block chain client is used to pass the block data module, the block data to the chain data of multiple block chains The user digital certificate module, the cipher engine module, the key-value database and the API interface are stored centrally in the cloud storage; the block chain client is provided with a cloud storage interface, and the cloud storage interface is connected to the API interface for communication.
根据所述的基于云计算的多区块链的链上数据存储系统,其中区块数据模块用于对所述区块链客户端产生原始区块数据时,将所述原始区块数据及对应的编号、起始地址、长度及用户数字签名合并为所述区块数据。According to the cloud computing-based multi-block chain data storage system, when the block data module is used to generate the original block data for the block chain client, the original block data and the corresponding The number, start address, length and user digital signature of the block are combined into the block data.
根据所述的基于云计算的多区块链的链上数据存储系统,其中用户数字证书模块用于对原始数字证书进行封装,封装之后的所述用户数字证书至少包括原始数字证书、签发机构、签发时间、有效期、用户数字签名及有效状态。According to the multi-block chain data storage system based on cloud computing, the user digital certificate module is used to encapsulate the original digital certificate, and the encapsulated user digital certificate includes at least the original digital certificate, the issuing authority, Issue time, validity period, user digital signature and validity status.
根据所述的基于云计算的多区块链的链上数据存储系统,其中用户数字签名被配置为通过云存储传递数字证书时,通过自身私钥对原始数字证书、签发机构、签发时间、有效期的Hash值进行数字签名。According to the cloud computing-based multi-blockchain data storage system on the chain, where the user's digital signature is configured to pass the digital certificate through the cloud storage, the original digital certificate, the issuing authority, the issuing time, and the validity period are verified by its own private key The Hash value is digitally signed.
根据所述的基于云计算的多区块链的链上数据存储系统,其中密码引擎模块包括非对称密码器、随机数生成器、数字摘要计算器,用于对所述区块链客户端与所述云存储的交互进行加密验证,所述随机数生成器产生一次性的随机数以及唯一性标识编号;所述非对称密码器用于验证数字签名;所述数字摘要计算器用于计算Hash值。According to the multi-block chain data storage system based on cloud computing, the cryptographic engine module includes an asymmetric cipher, a random number generator, and a digital digest calculator, which are used to link the block chain client with the The interaction of the cloud storage is encrypted and verified, and the random number generator generates a one-time random number and a unique identification number; the asymmetric cipher is used to verify the digital signature; the digital digest calculator is used to calculate the Hash value.
根据所述的基于云计算的多区块链的链上数据存储系统,其中键值数据库用于对多个区块链的链上数据建立键-值数据库记录,对多个区块链的用户数字证书建立键-值数据库记录,其中多个区块链的链上数据共用一个数据库引擎。According to the cloud computing-based multi-block chain data storage system on the chain, wherein the key-value database is used to establish key-value database records for the data on the chain of multiple block chains, for users of multiple block chains Digital certificates establish key-value database records, in which data on chains of multiple blockchains share a database engine.
根据所述的基于云计算的多区块链的链上数据存储系统,其中API接口用于向所述区块链客户端提供链上数据、用户数字证书的访问、管理与维护功能,其中维护功能至少包括区块的初始化、注销、更新、写区块、检索及同步之一。According to the cloud computing-based multi-block chain data storage system on the chain, the API interface is used to provide the block chain client with data on the chain, user digital certificate access, management and maintenance functions, wherein the maintenance The function includes at least one of block initialization, logout, update, write block, retrieval and synchronization.
根据所述的基于云计算的多区块链的链上数据存储系统,其中API接口通过对应的通讯协议完成区块的初始化、注销、更新、写区块、检索及同步。According to the on-chain data storage system of multiple blockchains based on cloud computing, the API interface completes block initialization, logout, update, block writing, retrieval and synchronization through corresponding communication protocols.
根据所述的基于云计算的多区块链的链上数据存储系统,其中该系统还包括用户客户端,所述用户客户端用于通过一个或多个所述计算节点部署相同、部分相同、不同的所述区块链客户端,通过区块链客户端访问云存储的链上数据。According to the multi-block chain data storage system based on cloud computing, the system further includes a user client, and the user client is used to deploy the same, part of the same, The different blockchain clients access the on-chain data stored in the cloud through the blockchain clients.
本发明的技术方案还包括一种基于云计算的多区块链的链上数据存储方法,根据上述任一所述的基于云计算的多区块链的链上数据存储系统,其特征在于:设置一个或多个云存储,通过所述云存储对多个区块链的链上数据进行存储;对区块链的原始区块数据及原始数字证书进行封装并存储至所述云存储的对应空间;通过所述密码引擎模块完成所述区块链客户端与云存储的加密交互;通过所述键值数据库中对用户数字证书、区块数据建立键值数据库记录;通过所述API接口对区块链客户端至少提供区块链的初始化、更新、写区块、检索、同步、注销功能,以及,对链上数据、用户数字证书的管理与维护;以及,通过所述区块链客户端的云存储接口与所述云存储的API接口进行对接通信。The technical solution of the present invention also includes a cloud computing-based multi-block chain data storage method, according to any of the above cloud computing-based multi-block chain data storage systems, characterized in that: Set up one or more cloud storages, and store the chain data of multiple blockchains through the cloud storages; encapsulate the original block data and original digital certificates of the blockchains and store them in the corresponding cloud storages space; complete the encrypted interaction between the block chain client and cloud storage through the cryptographic engine module; establish key-value database records for user digital certificates and block data in the key-value database; The blockchain client at least provides blockchain initialization, update, block writing, retrieval, synchronization, and logout functions, as well as management and maintenance of data on the chain and user digital certificates; and, through the blockchain client The cloud storage interface on the terminal communicates with the API interface of the cloud storage.
本发明的有益效果为:为用户提供区块链链上数据的自定义存储方式,集中存储多个区块链的链上数据。The invention has the beneficial effects of: providing users with a custom storage method for data on the block chain, and centrally storing data on the chain of multiple block chains.
附图说明Description of drawings
下面结合附图和实施例对本发明进一步地说明;Below in conjunction with accompanying drawing and embodiment the present invention is further described;
图1为根据本发明实施方式的单用户的多区块链云存储示意图。Fig. 1 is a schematic diagram of multi-blockchain cloud storage for a single user according to an embodiment of the present invention.
图2为根据本发明实施方式的多区块链云存储结构图。Fig. 2 is a structural diagram of multi-blockchain cloud storage according to an embodiment of the present invention.
图3为根据本发明实施方式的云存储区块的结构图。FIG. 3 is a structural diagram of a cloud storage block according to an embodiment of the present invention.
图4为根据本发明实施方式的单用户云存储系统的数字证书结构图。Fig. 4 is a structural diagram of a digital certificate of a single-user cloud storage system according to an embodiment of the present invention.
图5为根据本发明实施方式的多区块链云存储初始化流程图。Fig. 5 is a flowchart of multi-blockchain cloud storage initialization according to an embodiment of the present invention.
图6为根据本发明实施方式的更新用户数字证书流程图。Fig. 6 is a flow chart of updating a user's digital certificate according to an embodiment of the present invention.
图7为根据本发明实施方式的存储链上数据流程图。Fig. 7 is a flow chart of storing data on the chain according to an embodiment of the present invention.
图8为根据本发明实施方式的是链上数据同步流程图。Fig. 8 is a flow chart of on-chain data synchronization according to an embodiment of the present invention.
图9为根据本发明实施方式的是释放区块数据及云存储空间流程图。FIG. 9 is a flow chart of releasing block data and cloud storage space according to an embodiment of the present invention.
图10为根据本发明实施方式的是多区块链云存储系统实施例Figure 10 is an embodiment of a multi-block chain cloud storage system according to an embodiment of the present invention
具体实施方式Detailed ways
本部分将详细描述本发明的具体实施例,本发明之较佳实施例在附图中示出,附图的作用在于用图形补充说明书文字部分的描述,使人能够直观地、形象地理解本发明的每个技术特征和整体技术方案,但其不能理解为对本发明保护范围的限制。This part will describe the specific embodiment of the present invention in detail, and the preferred embodiment of the present invention is shown in the accompanying drawings. Each technical feature and overall technical solution of the invention, but it should not be understood as a limitation on the protection scope of the present invention.
在本发明的描述中,若干的含义是一个或者多个,多个的含义是两个以上,大于、小于、超过等理解为不包括本数,以上、以下、以内等理解为包括本数。In the description of the present invention, several means one or more, and multiple means more than two. Greater than, less than, exceeding, etc. are understood as not including the original number, and above, below, within, etc. are understood as including the original number.
如图1所示,支持多区块链的链上数据云存储方法,将区块链客户端读写链上数据的操作映射到云存储系统。云存储系统独立部署在云端,例如IDC;计算节点可以是桌面型或移动型PC、移动电子设备(例如智能手机)等。用户可以使用多个计算节点(PC、智能手机等)来访问云存储系统,也就是说,用户拥有多个计算节点,这些计算节点部署相同、部分相同、不同的区块链客户端,通过区块链客户端访问云存储的链上数据。一个云存储系统由一个用户独占使用,一个用户可独占使用多个云存储系统。As shown in Figure 1, the chain data cloud storage method that supports multiple blockchains maps the operations of the blockchain client to read and write data on the chain to the cloud storage system. The cloud storage system is independently deployed on the cloud, such as IDC; computing nodes can be desktop or mobile PCs, mobile electronic devices (such as smart phones), etc. Users can use multiple computing nodes (PCs, smart phones, etc.) The blockchain client accesses the on-chain data stored in the cloud. One cloud storage system is exclusively used by one user, and one user can exclusively use multiple cloud storage systems.
多区块链的云存储由区块数据、键值数据库、用户数字证书、密码引擎和API接口构成,见图2所示。Multi-blockchain cloud storage consists of block data, key-value database, user digital certificate, cryptographic engine and API interface, as shown in Figure 2.
区块数据模块存储多个区块链的链上数据。链上数据以文件系统形式存储,不同区块链之间使用相互独立的文件系统存储区。每个区块链的第一个区块是创世区块,其他是普通区块。区块结构包括编号、起始地址、长度、用户数字签名和原始区块数据,见图3所示。其中,The block data module stores on-chain data of multiple blockchains. Data on the chain is stored in the form of a file system, and different blockchains use independent file system storage areas. The first block of each blockchain is the Genesis block, and the others are normal blocks. The block structure includes number, starting address, length, user digital signature and original block data, as shown in Figure 3. in,
原始区块数据是指区块链客户端产生的区块数据;The original block data refers to the block data generated by the blockchain client;
编号是单个云存储系统范围内唯一性标识,由API接口模块生成;The number is a unique identifier within the scope of a single cloud storage system, which is generated by the API interface module;
起始地址是指该区块在所属区块链的文件系统中的存储地址,创世区块的起始地址缺省为0,由API接口模块生成;The starting address refers to the storage address of the block in the file system of the blockchain to which it belongs. The default starting address of the genesis block is 0, which is generated by the API interface module;
用户数字签名是指用户使用自己的私钥对该区块进行数字签名;User digital signature means that the user uses his own private key to digitally sign the block;
长度是指包括编号、起始地址、长度、用户数字签名、原始区块在内的字节数量,由API接口模块计算生成。The length refers to the number of bytes including the number, starting address, length, user digital signature, and original block, and is calculated and generated by the API interface module.
用户数字证书模块存储用户在多个区块链上的数字证书,包括当前正使用的数字证书和失效的历史数字证书。属于同一个区块链的数字证书构成一个列表,以创世区块编号和用户数字证书序号作为索引键,每个数字证书包括原始数字证书、签发机构、签发时间、有效期、用户数字签名、有效状态,见图4所示,其中,The user digital certificate module stores the user's digital certificates on multiple blockchains, including the currently used digital certificates and invalid historical digital certificates. The digital certificates belonging to the same block chain form a list, with the genesis block number and the user digital certificate serial number as the index key. Each digital certificate includes the original digital certificate, issuing authority, issuing time, validity period, user digital signature, valid state, as shown in Figure 4, where,
原始数字证书,是区块链网络签发给用户的数字证书,例如Hyperledger的CAServer给用户签发的数字证书;The original digital certificate is the digital certificate issued to the user by the blockchain network, such as the digital certificate issued to the user by Hyperledger's CAServer;
签发机构,是原始数字证书的签发组织,能提供数字证书的有效性鉴别;The issuing organization is the issuing organization of the original digital certificate, which can provide the validity verification of the digital certificate;
签发时间,是原始数字证书的签发日期和时间;Issuing time is the date and time when the original digital certificate was issued;
有效期,是原始数字证书的有效使用的时间长度;The validity period is the length of time for valid use of the original digital certificate;
用户数字签名,是用户向云存储传递数字证书时用自己的私钥对原始数字证书、签发机构、签发时间、有效期的Hash值进行数字签名;User digital signature means that when the user transfers the digital certificate to the cloud storage, he uses his private key to digitally sign the hash value of the original digital certificate, issuing authority, issuing time, and validity period;
有效状态,是原始数字证书的有效使用状态,用户在每个区块链上最多有一个有效状态的数字证书,其他为失效数字证书。The valid state is the effective use state of the original digital certificate. The user has at most one valid digital certificate on each blockchain, and the others are invalid digital certificates.
密码引擎模块,包括非对称密码器、随机数生成器、数字摘要计算器。随机数生成器产生一次性的随机数以及唯一性标识编号;非对称密码器用于验证数字签名;数字摘要计算器用于计算信息散列值,即Hash值。Cryptographic engine modules, including asymmetric ciphers, random number generators, and digital digest calculators. The random number generator generates a one-time random number and unique identification number; the asymmetric cipher is used to verify the digital signature; the digital digest calculator is used to calculate the information hash value, that is, the Hash value.
键值数据库模块,对多个区块链的链上数据建立键-值数据库记录,对多个区块链的用户数字证书建立键-值数据库记录,多个区块链的链上数据共用一个数据库引擎。The key-value database module establishes key-value database records for the on-chain data of multiple blockchains, and establishes key-value database records for the user digital certificates of multiple blockchains. The on-chain data of multiple blockchains share one database engine.
API接口模块,向区块链客户端提供链上数据、用户数字证书的访问、管理与维护功能,至少包括初始化、注销、更新、写区块、检索、同步功能模块,见图2所示。其中,The API interface module provides access, management and maintenance functions of on-chain data and user digital certificates to the blockchain client, including at least initialization, logout, update, block writing, retrieval, and synchronization function modules, as shown in Figure 2. in,
初始化功能模块,提供申请分配云存储空间的功能。云存储系统从云存储资源池中分配必需的存储空间,初始化区块数据的文件系统、用户数字证书存储区,部署密码引擎和键值数据库引擎的配置,部署API接口模块,见图5所示。Initialize the function module and provide the function of applying for the allocation of cloud storage space. The cloud storage system allocates the necessary storage space from the cloud storage resource pool, initializes the block data file system and user digital certificate storage area, deploys the configuration of the password engine and the key-value database engine, and deploys the API interface module, as shown in Figure 5 .
更新功能模块,提供更新用户数字证书的功能。有2种更新接口,第1种是新用户向云存储上传第1个用户数字证书,更新流程见图6所示。The update function module provides the function of updating user digital certificates. There are two update interfaces. The first one is for a new user to upload the first user digital certificate to the cloud storage. The update process is shown in Figure 6.
通信协议1:数字证书更新1Communication Protocol 1: Digital Certificate Update 1
步骤:(1)区块链客户端提交用户数字证书及其私钥签名,用户数字证书结构见图4所示;Steps: (1) The blockchain client submits the user's digital certificate and its private key signature, and the structure of the user's digital certificate is shown in Figure 4;
(2)更新功能模块用数字证书中的公钥验证签名,如果成功则转入(3),否则转入(5);(2) update the functional module with the public key verification signature in the digital certificate, if successful then turn to (3), otherwise turn to (5);
(3)更新功能模块在签发机构鉴别数字证书的有效性,如果成功则转入(4),否则转入(5);(3) Update the functional module to verify the validity of the digital certificate in the issuing authority, if successful, then go to (4), otherwise go to (5);
(4)调用密码引擎的随机数生成器,产生一个唯一性创世区块编号,新建一个用户数字证书列表,将用户数字证书写入列表,转入(5);(4) Call the random number generator of the cryptographic engine to generate a unique creation block number, create a new list of user digital certificates, write the user digital certificates into the list, and transfer to (5);
(5)如果成功,返回创世区块编号,否则返回失败,结束。(5) If successful, return the genesis block number, otherwise return failure and end.
第2种是用新数字证书更新旧数字证书,在旧数字证书即将或已失效的情况下使用,更新流程见图6所示。The second is to update the old digital certificate with the new digital certificate, which is used when the old digital certificate is about to expire or has expired. The update process is shown in Figure 6.
通信协议2:数字证书更新2Communication Protocol 2: Digital Certificate Update 2
步骤:(1)区块链客户端提交新用户数字证书、创世区块编号及旧私钥签名,其中旧私钥签名是指,用旧数字证书中的私钥对新用户数字证书及创世区块编号的Hash值签名;Steps: (1) The blockchain client submits the new user's digital certificate, the genesis block number and the old private key signature, where the old private key signature refers to using the private key in the old digital certificate to authenticate the new user's digital certificate and the genesis block Hash value signature of the world block number;
(2)更新功能模块以创世区块编号找到指定区块链的有效数字证书,从中取出公钥验证旧私钥签名的有效性,如果成功则转入(3),否则转入(6);(2) Update the functional module to find the valid digital certificate of the specified blockchain with the genesis block number, take out the public key from it to verify the validity of the old private key signature, if successful, go to (3), otherwise go to (6) ;
(3)用新用户数字证书中的公钥验证新用户数字证书中的签名,如果成功则转入(4),否则转入(6);(3) verify the signature in the new user's digital certificate with the public key in the new user's digital certificate, if successful then turn to (4), otherwise turn to (6);
(4)检查新用户数字证书的有效日期,如果有效则转入(5),否则转入(6);(4) Check the valid date of the new user's digital certificate, if it is valid, turn to (5), otherwise turn to (6);
(5)将创世区块编号对应的有效数字证书置为失效,存入新用户数字证书并置为有效,转入(6);(5) invalidate the valid digital certificate corresponding to the genesis block number, store the digital certificate of the new user and make it valid, and transfer to (6);
(6)返回结果,结束。(6) Return the result and end.
写区块功能模块,向区块链客户端提供写入链上数据的功能,即将区块存储到区块数据对应的文件系统中,同时更新键值数据库。流程见图7所示。The block writing function module provides the block chain client with the function of writing data on the chain, that is, the block is stored in the file system corresponding to the block data, and the key-value database is updated at the same time. The process is shown in Figure 7.
通信协议3:写入链上数据Communication protocol 3: write data on the chain
步骤:(1)区块链客户端提交创世区块编号、新原始区块及数字签名,新原始区块及数字签名分别指图3的原始区块数据和用户数字签名;Steps: (1) The blockchain client submits the genesis block number, new original block and digital signature. The new original block and digital signature refer to the original block data and user digital signature in Figure 3 respectively;
(2)云存储系统依据创世区块编号取得用户数字证书的公钥,并验证数字签名,如果成功则转入(3),否则转入(5);(2) The cloud storage system obtains the public key of the user's digital certificate according to the genesis block number, and verifies the digital signature. If it succeeds, go to (3), otherwise go to (5);
(3)计算新区块的编号、长度和起始地址,区块编号规则为:创世区块编号+递增的正整数序号,起始地址为区块在区块链文件系统中的存储偏移量,长度是整个新区块的字节数量;(3) Calculate the number, length and starting address of the new block. The block numbering rule is: Genesis block number + incremental positive integer number, and the starting address is the storage offset of the block in the blockchain file system Amount, the length is the number of bytes of the entire new block;
(4)按图3格式填写新区块,写入区块链对应的文件系统,更新键值数据库的记录;(4) Fill in the new block according to the format in Figure 3, write it into the file system corresponding to the blockchain, and update the records in the key-value database;
(5)返回结果,结束。(5) Return the result and end.
检索功能模块,向区块链客户端提供检索链上数据的功能。区块链客户端提供创世区块编号及检索关键字,检索功能模块在指定的区块链存储区查找对应的区块并返回检索结果。检索关键字可以是区块编号、区块Hash、交易Hash等。The retrieval function module provides the blockchain client with the function of retrieving data on the chain. The blockchain client provides the genesis block number and search keywords, and the search function module searches for the corresponding block in the designated blockchain storage area and returns the search results. The search key can be block number, block Hash, transaction Hash, etc.
同步功能模块,用于单用户独占使用多个云存储系统的场景,在多个云存储系统之间同步指定区块链的链上数据及用户在该区块链的数字证书,其中被同步的云存储系统标以主标识,同步到的云存储系统标以从标识,见图8所示。The synchronization function module is used in the scenario where a single user exclusively uses multiple cloud storage systems, and synchronizes the on-chain data of the specified blockchain and the user's digital certificate in the blockchain between multiple cloud storage systems, among which the synchronized The cloud storage system is marked with a master mark, and the cloud storage system to be synchronized is marked with a slave mark, as shown in FIG. 8 .
通信协议4:同步Communication Protocol 4: Synchronization
步骤:(1)区块链客户端向云存储2发起请求,传递云存储1地址、创世区块编号、从标识;Steps: (1) The blockchain client initiates a request to Cloud Storage 2, passing the address of Cloud Storage 1, the genesis block number, and the slave ID;
(2)云存储2应答就绪;(2) Cloud Storage 2 is ready for response;
(3)区块链客户端向云存储1发起请求,传递云存储2地址、创世区块编号、主标识;(3) The blockchain client initiates a request to Cloud Storage 1, passing the address of Cloud Storage 2, the genesis block number, and the main identifier;
(4)云存储1应答就绪;(4) Cloud storage 1 is ready for response;
(5)云存储1向云存储2建立连接,云存储2响应连接;(5) Cloud Storage 1 establishes a connection to Cloud Storage 2, and Cloud Storage 2 responds to the connection;
(6)云存储1向云存储2发送指定区块链的用户数字证书列表;(6) Cloud storage 1 sends the list of user digital certificates of the specified blockchain to cloud storage 2;
(7)云存储2接收并更新用户数字证书列表,应答;(7) Cloud Storage 2 receives and updates the list of user digital certificates, and responds;
(8)云存储1向云存储2发送指定区块链的所有区块;(8) Cloud storage 1 sends all blocks of the specified blockchain to cloud storage 2;
(9)云存储2接收并更新本地区块及数据库,应答;(9) Cloud storage 2 receives and updates the local block and database, and responds;
(10)云存储1向区块链客户端发送同步确认;(10) Cloud storage 1 sends a synchronization confirmation to the blockchain client;
(11)云存储2向区块链客户端发送同步确认;(11) Cloud storage 2 sends a synchronization confirmation to the blockchain client;
(12)结束。(12) END.
注销功能模块,提供删除指定区块链的链上数据的功能,如果删除最后一个区块链的链上数据,则释放云存储空间,见图9所示。The logout function module provides the function of deleting the on-chain data of the specified blockchain. If the on-chain data of the last blockchain is deleted, the cloud storage space will be released, as shown in Figure 9.
通信协议5:注销Communication Protocol 5: Logout
步骤:(1)区块链客户端发送创世区块编号;Steps: (1) The blockchain client sends the genesis block number;
(2)注销功能模块调用随机数生成器产生1个随机数,依据创世区块编号用对应区块链的有效数字证书的公钥加密,发送密文;(2) The logout function module calls the random number generator to generate a random number, encrypts it with the public key of the valid digital certificate corresponding to the block chain according to the genesis block number, and sends the ciphertext;
(3)区块链客户端用私钥解密获得随机数,发回随机数;(3) The blockchain client decrypts the random number with the private key, and sends back the random number;
(4)注销功能模块对比前后2个随机数,如一致则转入(5),否则转发(8);(4) The logout function module compares the two random numbers before and after, if they are consistent, then transfer to (5), otherwise forward (8);
(5)清除创世区块编号指定的区块链的区块数据及其数据库记录,清除对应的用户数字证书;(5) Clear the block data and database records of the block chain specified by the genesis block number, and clear the corresponding user digital certificate;
(6)检查云存储的区块数据是否为空,如是转入(7),否则转入(8);(6) Check whether the block data of cloud storage is empty, if so, transfer to (7), otherwise transfer to (8);
(7)释放云存储空间,归还到存储资源池;(7) Release the cloud storage space and return it to the storage resource pool;
(8)返回结果,结束。(8) Return the result and end.
以太坊(Ethereum)区块链网络以及超级账本(Hyperledger)区块链网络的链上数据缺省存储在区块链客户端的本地存储空间,区块数据存储在文件系统的一个或多个文件中。Hyperledger的客户端是Fabric,以Hyperledger区块链网络为例说明本发明的具体实施方式。The on-chain data of the Ethereum blockchain network and the Hyperledger blockchain network are stored in the local storage space of the blockchain client by default, and the block data is stored in one or more files in the file system . The Hyperledger client is Fabric, and the Hyperledger block chain network is taken as an example to illustrate the specific implementation of the present invention.
Fabric缺省将链上数据存储在本地的文件系统,首先改造Fabric读写区块文件系统的本地存储接口,新增一个云存储系统的模块接口,即图10所示的云存储接口,按照图2所示API接口的各功能模块实施区块链客户端与云存储系统之间的接口,接口通信采用WebService、gRPC或者其他形式实施。By default, Fabric stores the data on the chain in the local file system. First, modify the local storage interface of the Fabric read-write block file system, and add a module interface of the cloud storage system, which is the cloud storage interface shown in Figure 10. Each functional module of the API interface shown in 2 implements the interface between the blockchain client and the cloud storage system, and the interface communication is implemented in WebService, gRPC or other forms.
在Hyperledger区块链网络中,采用Docker容器实施单用户多区块链的云存储系统,1个Docker容器实例对应1个云存储系统,单用户可以独占使用多个Docker容器。也可以采用VMware、VirtualBox或KVM虚拟机实施云存储系统,1个虚拟机实例对应1个云存储系统。在云存储系统内,采用Web Service、gPRC或者其他形式实施接口通信,与Fabric的通信方式保持一致。In the Hyperledger blockchain network, Docker containers are used to implement a single-user multi-blockchain cloud storage system. One Docker container instance corresponds to one cloud storage system, and a single user can exclusively use multiple Docker containers. The cloud storage system can also be implemented by using VMware, VirtualBox or KVM virtual machine, and one virtual machine instance corresponds to one cloud storage system. In the cloud storage system, use Web Service, gPRC or other forms to implement interface communication, which is consistent with the communication method of Fabric.
在云存储系统内,采用文件系统存储多个区块链的链上数据,即所有的区块。每个区块链的链上数据存储到一个或者多个文件中,并规定多个文件的先后顺序。图3所示的起始地址实施为区块在多个文件中的存储偏移量,相邻区块在文件中的存储位置相邻。不同区块链的文件相互隔离,采用文件夹的形式加以分类存储,也可采用不同文件系统分区存储,或者采用RAID磁盘阵列存储。In the cloud storage system, the file system is used to store the chain data of multiple blockchains, that is, all blocks. The on-chain data of each blockchain is stored in one or more files, and the sequence of multiple files is specified. The starting addresses shown in FIG. 3 are implemented as storage offsets of blocks in multiple files, and the storage positions of adjacent blocks in the files are adjacent. The files of different blockchains are isolated from each other, and are classified and stored in the form of folders. They can also be stored in different file system partitions, or stored in RAID disk arrays.
在云存储系统内,采用文件系统存储所有的用户数字证书,每个用户数字证书对应2个文件。其中1个文件是用户数字证书原始文件,其内容是图4所示的原始数字证书,另1个文件记录对应原始数字证书的其他信息,2个文件的文件名相同,以扩展名区分。不同区块链的用户数字证书可采用文件夹的形式分类存储。用户数字证书也可采用关系型数据库加以存储,用表和记录表示用户数字证书。In the cloud storage system, the file system is used to store all user digital certificates, and each user digital certificate corresponds to 2 files. One of the files is the original file of the user's digital certificate, and its content is the original digital certificate shown in Figure 4. The other file records other information corresponding to the original digital certificate. The file names of the two files are the same, and they are distinguished by extensions. User digital certificates of different blockchains can be classified and stored in the form of folders. User digital certificates can also be stored in a relational database, and user digital certificates are represented by tables and records.
在云存储系统内,键值数据库采用LevelDB、CouchDB或其他适宜的数据库引擎加以实施,主要存储图3所示的区块数据,即区块链的链上数据。采用区块编号、原始区块Hash、交易Hash等关键字作为键(Key),采用区块起始地址作为值(Value)。键值数据库能够依据区块编号、原始区块Hash、交易Hash提供基本的区块检索与定位功能,还可根据实际需要扩充其他关键字的检索与查询。In the cloud storage system, the key-value database is implemented using LevelDB, CouchDB or other suitable database engines, and mainly stores the block data shown in Figure 3, that is, the on-chain data of the blockchain. Key words such as block number, original block Hash, and transaction Hash are used as the key (Key), and the starting address of the block is used as the value (Value). The key-value database can provide basic block retrieval and positioning functions based on the block number, original block Hash, and transaction Hash, and can also expand the retrieval and query of other keywords according to actual needs.
在云存储系统内,密码引擎至少提供随机数生成器、非对称密码器、Hash计算器。密码引擎可以由硬件实施,例如TPM芯片或者TCM芯片,也可以由程序代码实施伪随机数、非对称密码计算和Hash计算功能。根据实际需要,密码引擎可扩充其他计算功能,例如对称密码计算器等。In the cloud storage system, the cryptographic engine at least provides a random number generator, an asymmetric cipher, and a Hash calculator. The cryptographic engine can be implemented by hardware, such as a TPM chip or a TCM chip, or can be implemented by program codes to perform functions of pseudo-random number, asymmetric cryptographic calculation and Hash calculation. According to actual needs, the encryption engine can expand other calculation functions, such as symmetric encryption calculator, etc.
在云存储系统内,API接口是对外提供云存储服务的接口,至少包含初始化、更新、写区块、检索、同步、注销等功能模块,每个云存储系统包括1个独立的API接口,并分配1个IP地址和独立的端口。根据实际需要,API接口可扩充其他的管理与业务功能模块。In the cloud storage system, the API interface is an interface that provides cloud storage services externally, and at least includes functional modules such as initialization, update, block writing, retrieval, synchronization, and logout. Each cloud storage system includes an independent API interface, and Assign 1 IP address and separate port. According to actual needs, the API interface can expand other management and business function modules.
在Ethereum区块链网络中,区块链客户端Geth在读写链上数据方面具有类似于Fabric的部分特性,可采用类似的实施方式,即在Geth内部增加1个云存储接口,并按本发明的通信协议实施接口功能。In the Ethereum blockchain network, the blockchain client Geth has some characteristics similar to Fabric in terms of reading and writing data on the chain, and a similar implementation method can be adopted, that is, adding a cloud storage interface inside Geth, and according to this The invented communication protocol implements the interface function.
上面结合附图对本发明实施例作了详细说明,但是本发明不限于上述实施例,在技术领域普通技术人员所具备的知识范围内,还可以在不脱离本发明宗旨的前提下做出各种变化。The embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments, and various Variety.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010504962.6A CN111832069B (en) | 2020-06-05 | 2020-06-05 | Multi-block chain on-chain data storage system and method based on cloud computing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010504962.6A CN111832069B (en) | 2020-06-05 | 2020-06-05 | Multi-block chain on-chain data storage system and method based on cloud computing |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111832069A CN111832069A (en) | 2020-10-27 |
| CN111832069B true CN111832069B (en) | 2023-08-29 |
Family
ID=72898465
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010504962.6A Active CN111832069B (en) | 2020-06-05 | 2020-06-05 | Multi-block chain on-chain data storage system and method based on cloud computing |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111832069B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111783133B (en) * | 2020-06-02 | 2023-06-30 | 广东科学技术职业学院 | A network resource management method based on block chain technology |
| CN115114603B (en) * | 2021-03-17 | 2024-06-11 | 中国移动通信集团福建有限公司 | Base station equipment data management method and device and electronic equipment |
| CN114329633A (en) * | 2021-12-31 | 2022-04-12 | 深圳依时货拉拉科技有限公司 | Data storage and access method and device and computer equipment |
Citations (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102857558A (en) * | 2012-08-13 | 2013-01-02 | 广东科学技术职业学院 | Dynamically constructed and autonomously managed mobile cloud storage cluster system |
| CN103248479A (en) * | 2012-02-06 | 2013-08-14 | 中兴通讯股份有限公司 | Cloud storage safety system, data protection method and data sharing method |
| CN105721543A (en) * | 2015-06-15 | 2016-06-29 | 清华大学深圳研究生院 | Cross-protocol distribution-type cloud storage system based on operation control unit and data management method |
| CN107295002A (en) * | 2017-07-12 | 2017-10-24 | 联动优势科技有限公司 | The method and server of a kind of high in the clouds data storage |
| CN107770154A (en) * | 2017-09-22 | 2018-03-06 | 中国科学院信息工程研究所 | Block chain reliable data storage method, terminal and system based on cloud storage |
| CN108964911A (en) * | 2018-09-18 | 2018-12-07 | 苏州米特希赛尔人工智能有限公司 | A kind of stream media service system based on block chain and quantum flow data block technology |
| CN109102401A (en) * | 2018-07-23 | 2018-12-28 | 上海点融信息科技有限责任公司 | Method and apparatus for running intelligent contract in block chain network |
| CN109215751A (en) * | 2018-08-10 | 2019-01-15 | 暨南大学 | Medical electronics case history distributed management system and its building method based on block chain |
| CN109326337A (en) * | 2018-09-06 | 2019-02-12 | 西安电子科技大学 | Model and method of electronic medical record storage and sharing based on blockchain |
| CN110377323A (en) * | 2019-06-19 | 2019-10-25 | 广东科学技术职业学院 | A kind of block chain DAPP management system |
| WO2020029844A1 (en) * | 2018-08-08 | 2020-02-13 | 华为技术有限公司 | Blockchain node and transaction method |
| WO2020051710A1 (en) * | 2018-09-12 | 2020-03-19 | Joe Jay | System and process for managing digitized security tokens |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10402792B2 (en) * | 2015-08-13 | 2019-09-03 | The Toronto-Dominion Bank | Systems and method for tracking enterprise events using hybrid public-private blockchain ledgers |
| US10255342B2 (en) * | 2017-04-12 | 2019-04-09 | Vijay K. Madisetti | Method and system for tuning blockchain scalability, decentralization, and security for fast and low-cost payment and transaction processing |
| US11138608B2 (en) * | 2018-06-28 | 2021-10-05 | International Business Machines Corporation | Authorizing multiparty blockchain transactions via one-time passwords |
| WO2019179538A2 (en) * | 2019-07-11 | 2019-09-26 | Alibaba Group Holding Limited | Shared blockchain data storage |
-
2020
- 2020-06-05 CN CN202010504962.6A patent/CN111832069B/en active Active
Patent Citations (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103248479A (en) * | 2012-02-06 | 2013-08-14 | 中兴通讯股份有限公司 | Cloud storage safety system, data protection method and data sharing method |
| CN102857558A (en) * | 2012-08-13 | 2013-01-02 | 广东科学技术职业学院 | Dynamically constructed and autonomously managed mobile cloud storage cluster system |
| CN105721543A (en) * | 2015-06-15 | 2016-06-29 | 清华大学深圳研究生院 | Cross-protocol distribution-type cloud storage system based on operation control unit and data management method |
| CN107295002A (en) * | 2017-07-12 | 2017-10-24 | 联动优势科技有限公司 | The method and server of a kind of high in the clouds data storage |
| CN107770154A (en) * | 2017-09-22 | 2018-03-06 | 中国科学院信息工程研究所 | Block chain reliable data storage method, terminal and system based on cloud storage |
| CN109102401A (en) * | 2018-07-23 | 2018-12-28 | 上海点融信息科技有限责任公司 | Method and apparatus for running intelligent contract in block chain network |
| WO2020029844A1 (en) * | 2018-08-08 | 2020-02-13 | 华为技术有限公司 | Blockchain node and transaction method |
| CN110827008A (en) * | 2018-08-08 | 2020-02-21 | 华为技术有限公司 | A blockchain node and transaction method |
| CN109215751A (en) * | 2018-08-10 | 2019-01-15 | 暨南大学 | Medical electronics case history distributed management system and its building method based on block chain |
| CN109326337A (en) * | 2018-09-06 | 2019-02-12 | 西安电子科技大学 | Model and method of electronic medical record storage and sharing based on blockchain |
| WO2020051710A1 (en) * | 2018-09-12 | 2020-03-19 | Joe Jay | System and process for managing digitized security tokens |
| CN108964911A (en) * | 2018-09-18 | 2018-12-07 | 苏州米特希赛尔人工智能有限公司 | A kind of stream media service system based on block chain and quantum flow data block technology |
| CN110377323A (en) * | 2019-06-19 | 2019-10-25 | 广东科学技术职业学院 | A kind of block chain DAPP management system |
Non-Patent Citations (1)
| Title |
|---|
| Verification of Cryptocurrency Mining Using Ethereum;DONG-HER SHIH 等;IEEE Access 2020;第8卷;第120351-120360页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111832069A (en) | 2020-10-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113169880B (en) | Computer-implemented systems and methods for storing data on a blockchain | |
| CN112667749B (en) | Data processing method, device, equipment and storage medium | |
| CN106874461B (en) | A kind of workflow engine supports multi-data source configuration security access system and method | |
| CN110502916B (en) | Sensitive data processing method and system based on block chain | |
| CN111726343A (en) | A method for secure transmission of electronic documents based on IPFS and blockchain | |
| CN111832069B (en) | Multi-block chain on-chain data storage system and method based on cloud computing | |
| WO2018176406A1 (en) | Top-level domain name management method and system based on alliance chain | |
| CN103442057A (en) | Cloud storage system based on user collaboration cloud | |
| TWI714414B (en) | Method and device for obtaining block chain data in stages | |
| CN108923932A (en) | A kind of decentralization co-verification model and verification algorithm | |
| CN107612910A (en) | A kind of distributed document data access method and system | |
| CN109858272A (en) | Blacklist data processing system based on block chain | |
| CN111770149A (en) | Novel alliance chain based on distributed storage | |
| CN105808977A (en) | Processing methods and apparatuses for file reading and writing operations | |
| Patsonakis et al. | Implementing a smart contract PKI | |
| CN110750541A (en) | Data storage indexing system and method based on block chain | |
| CN113221175A (en) | Authorization method and system based on block chain | |
| CN107094075A (en) | A kind of data block dynamic operation method based on convergent encryption | |
| CN117688088A (en) | Trusted storage method of distributed data based on blockchain in cloud and edge environment | |
| CN106506613A (en) | The data storage location encryption method of distributed key value storage systems | |
| CN111800460A (en) | Data synchronization method, device, device and storage medium for LDAP service node | |
| CN114338081B (en) | Multi-block-chain unified identity authentication method, device and computer equipment | |
| US20250156584A1 (en) | Data processing method and apparatus based on hierarchical chain network | |
| CN117786742B (en) | Document management system and method based on distributed control and blockchain | |
| Song et al. | Smart contract-based trusted content retrieval mechanism for NDN |
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 | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250408 Address after: No. 210-0021, South Tower, 2nd Floor, Building 1, Courtyard 6, Yinhe Street, Shijingshan District, Beijing 100040 Patentee after: Beijing Wuba Cloud Computing Co.,Ltd. Country or region after: China Address before: On the south side of Zhuhai Avenue in Guangdong city of Zhuhai province Jinwan District 519090 Patentee before: GUODONG POLYTECHNIC OF SCIENCE AND TECHNOLOGY Country or region before: China |