Internet of Things data sharing method and system based on block chain
Abstract
The invention relates to an Internet of Things data sharing method and system based on a block chain. The system comprises a certificate management module, a gateway module and a channel. The method comprises the steps that Internet of Things equipment applies for registration to a CA through a gateway module, and the CA returns a certificate to the gateway module and stores the certificate in a certificate management module in the gateway module; the gateway module receives and processes the data information and sends the data information to the node through the Fabric SDK; the node carries out endorsement and returns the endorsement to the Fabric SDK; the Fabric SDK sends the collected data information to a sorting service according to an endorsement strategy, and the sorting service sorts the data information according to a time sequence, packages the data information into blocks and broadcasts the blocks to nodes in a channel; and after receiving the block, the node verifies the block and writes the block into a local account book. On the premise that a single credible centralization mechanism is not used, the method helps participants to directly establish trust, guarantees that data can be safely shared, improves the value transmission efficiency, and reduces the risk that the data is tampered through a block chain data structure.

Term
12.5 yearsto projected expiry
Projected expiry 9 April 2039, counted from filing; an application has no term until it is granted.
- Priority and filed
- Published
- Today
- Projected expiry
10 claims: 2 independent, 8 dependent
- 11 A blockchain-based Internet of Things data sharing method, which is characterized by including the following steps:Step 1: The Internet of Things device applies to a first CA for registration through a gateway module, and the first CA returns a certificate to the gateway module and stores it in The certificate management module in the gateway module;Step 2: The gateway module receives the data information of the Internet of Things device, processes the data information, and sends the processed data information to the nodes in the channel through the Fabric SDK;Step 3: In the channel After the node receives the data information sent by the Fabric SDK, it endorses the data information and returns the endorsed data information to the Fabric SDK;Step 4: Fabric SDK sends the collected endorsed data information to the sorting service according to the endorsement strategy , The sorting service sorts the received data information in chronological order and packs them into blocks, and broadcasts them to the nodes in the channel;Step 5: After the nodes in the channel receive the blocks, they will verify them, and they will pass the verified The block is written into the local ledger. 1 .一种基于区块链的物联网数据共享方法,其特征在于,包括以下步骤: 步骤1:物联网设备通过网关模块向第一CA申请注册,第一CA向网关模块返回证书,并 存储于网关模块内的证书管理模块; 步骤2:网关模块接收物联网设备的数据信息,对数据信息进行处理,并将处理后的数 据信息通过Fabric SDK发送给通道内的节点; 步骤3:通道内的节点收到Fabric SDK发送的数据信息后,对数据信息进行背书,并将 背书后的数据信息返回给Fabric SDK; 步骤4:Fabric SDK根据背书策略将收集到的背书后的数据信息发送给排序服务,排序 服务对收到的数据信息按时间顺序进行排序后打包成区块,广播给通道内的节点; 步骤5:通道内的节点收到区块后,对其进行验证,将通过验证后的区块写入本地账本。
- 99 An Internet of Things data sharing system based on the method of any one of claims 1 to 8, characterized by comprising:an Internet of Things device, which is used to send a registration application and data information to a gateway module;and a gateway module, which is used to The registration application of the Internet of Things device applies to the first CA for registration, the certificate management module in the gateway module receives the certificate returned by the first CA;the data receiving and processing module in the gateway module receives the data information of the Internet of Things device, and processes the data information ;The Fabric SDK in the gateway module sends the processed data information to the nodes in the channel, and sends the collected endorsed data information to the sorting service in the channel according to the endorsement strategy;9 .一种基于权利要求1〜8任一项所述方法的物联网数据共享系统,其特征在于,包括: 物联网设备,用于向网关模块发送注册申请以及数据信息; 网关模块,用于根据物联网设备的注册申请向第一CA申请注册,网关模块内的证书管 理模块接收第一CA返回的证书;网关模块内的数据接收与处理模块接收物联网设备的数据 信息,对数据信息进行处理;网关模块内的Fabric SDK将处理后的数据信息发送给通道内 的节点,并根据背书策略将收集到的背书后的数据信息发送给通道内的排序服务; The channel includes several nodes and ordering services. After receiving the data information sent by the Fabric SDK, the node endorses the data information and returns the endorsed data information to the Fabric SDK;the ordering service orders the received data information in chronological order After sorting, they are packed into blocks and broadcast to the nodes in the channel;after the nodes in the channel receive the blocks, they verify them, and write the verified blocks into the local ledger. 通道,包括若干节点和排序服务,其中节点收到Fabric SDK发送的数据信息后,对数据 信息进行背书,并将背书后的数据信息返回给Fabric SDK;排序服务对收到的数据信息按 时间顺序进行排序后打包成区块,广播给通道内的节点;通道内的节点收到区块后,对其进 行验证,将通过验证后的区块写入本地账本。
Independent claims2
71 paragraphs, as filed
A blockchain-based Internet of Things data sharing method and system technical field
[0001] The present invention relates to the field of blockchain technology and the field of Internet of Things technology, and specifically to a method and system for sharing Internet of Things data based on blockchain.
Background technique
[0002] The Internet of Things is a network in which objects are connected to share information through the Internet. With the development of the Internet of Things technology, the structure of the network has become increasingly complex, the amount of collected data has shown explosive growth, and the problem of information islands has become increasingly prominent. How to safely share data between different parties has become a huge challenge. A typical approach is to introduce a trusted centralized organization that is responsible for collecting, transmitting and managing data, but this solution has some significant flaws:
[0003] 1. The centralized organization needs to be responsible for equipment management, data storage and transmission. Once it fails, the entire system will be paralyzed.
[0004] 2. The centralized organization is opaque to the participants and has too much power. If it is attacked by an external party, the data may be tampered with.
[0005] 3. Data transmission must go through a centralized organization, and some private data of the data provider may prefer to be directly shared with the data demander.
[0006] Blockchain originated from Bitcoin. It is a distributed ledger technology maintained by multiple parties and whose data cannot be changed. It has features such as decentralization, joint maintenance, non-tampering, and encryption security. It can enable participants to establish mutual trust without being decentralized. This advantage is suitable for improving the existing architecture of the Internet of Things. The blockchain ensures the consistency of the ledger data through a consensus mechanism, and no participant can absolutely obtain control of the ledger. It packs data into blocks in chronological order, and each block contains the summary information of the previous block, thus forming a chained data structure, and cryptographically guarantees that the data on the chain is not tampered with or forged. The blockchain generally also contains smart contracts (also called chain codes), which can code rules or contracts as programs and deploy them on the blockchain, and automatically execute them according to the prior agreement after triggering the conditions.
[0007] According to the different permissions of participants, blockchains are generally divided into public chains, private chains, and consortium chains. The open source Hyperledger Fabric is the representative of the consortium chain. On the basis of retaining the advantages of the blockchain to the greatest extent, it adds support for authority management and identity authentication, and is designed to be pluggable and extensible. Its consensus mechanism, member services, and encryption algorithms , The underlying database, etc. can be flexibly replaced to facilitate the use of different scenarios. Hyperledger Fabric uses CA (Certificate Authority) to implement authority management, and uses a channel mechanism to isolate different participants.
[0008] Due to the introduction of a centralized organization in the prior art, a single point of failure is common, data sharing is not transparent, there is a risk of tampering, and the availability and security of data cannot be guaranteed. The technical solution of this application uses the decentralized characteristics of the blockchain to disperse the nodes that provide services and reduce the risk of single points of failure; the use of the non-tamperable data structure of the blockchain improves the transparency of sharing and ensures Data integrity and reliability.
Summary of the invention
[0009] In view of the shortcomings of the prior art, the present invention provides a blockchain-based Internet of Things data sharing method and system, which effectively avoids single point of failure, improves data sharing efficiency, and its authority management scheme ensures system safety
And privacy, the blockchain data structure reduces the risk of data tampering.
[0010] The technical solutions adopted by the present invention to achieve the above objectives are:
[0011] A blockchain-based Internet of Things data sharing method includes the following steps:
[0012] Step 1: The Internet of Things device applies for registration to the first CA through the gateway module, and the first CA returns a certificate to the gateway module, which is stored in the certificate management module in the gateway module;
[0013] Step 2: The gateway module receives the data information of the Internet of Things device, processes the data information, and sends the processed data information to the nodes in the channel through the Fabric SDK;
[0014] Step 3: After receiving the data information sent by the Fabric SDK, the nodes in the channel endorse the data information, and return the endorsed data information to the Fabric SDK;
[0015] Step 4: The Fabric SDK sends the collected endorsed data information to the sorting service according to the endorsement strategy, and the sorting service sorts the received data information in chronological order and packs them into blocks, and broadcasts them to the nodes in the channel ;
[0016] Step 5: After receiving the block, the node in the channel verifies it, and writes the verified block into the local ledger.
[0017] The application for registration of the Internet of Things device with the first CA through the gateway module includes the following processes:
[0018] The gateway module sends an HTTP POST request to the enroll interface of the first CA. After the first CA receives the request, the first CA performs verification. If it is legal, it generates a certificate locally and returns it to the gateway. If it is illegal, it sends back an illegal prompt to the gateway module. .
[0019] The processing of data information includes: format conversion, data cleaning, and data normalization.
[0020] The endorsement is: the node checks the legitimacy and authority of the data information sent by the Fabric SDK, and if the check passes, then simulates the status change generated by receiving the data information, and if the simulated data result is legal, then Guarantee the data information.
[0021] The verification includes: transaction message structure, signature integrity, whether it is repeated, and whether the read-write set version matches.
[0022] It also includes a query module applying for a certificate from the second CA, and carrying the certificate to access the ledger in the channel by invoking the chain code.
[0023] The gateway module includes:
[0024] The certificate management module is used to store the certificate of the Internet of Things device;
[0025] The data receiving and processing module is used to receive and process the data information of the Internet of Things device, and send the processed data information to the Fabric SDK;
[0026] Fabric SDK is used to interact with the channel.
[0027] The sorting service is: performing a global sorting for all legal data information in the network, and combining the sorted data information in batches to generate a block structure.
[0028] A blockchain-based IoT data sharing system includes:
[0029] The Internet of Things device is used to send a registration application and data information to the gateway module;
[0030] The gateway module is used to apply for registration with the first CA according to the registration application of the Internet of Things device, the certificate management module in the gateway module receives the certificate returned by the first CA; the data receiving and processing module in the gateway module receives the Internet of Things device Process the data information; the Fabric SDK in the gateway module sends the processed data information to the nodes in the channel, and sends the collected endorsed data information to the sorting service in the channel according to the endorsement strategy;
[0031] The channel includes a number of nodes and an ordering service. After receiving the data information sent by the Fabric SDK, the node endorses the data information, and returns the endorsed data information to the Fabric SDK; the ordering service responds to the received data information After sorting in chronological order, they are packaged into blocks and broadcast to the nodes in the channel; after the nodes in the channel receive the block, they
It performs verification and writes the verified blocks into the local ledger.
[0032] It also includes a query module, which applies for a certificate from the second CA, and carries the certificate to access the ledger in the channel by invoking the chain code.
[0033] The present invention has the following beneficial effects and advantages:
[0034] 1. The topology of the Internet of Things is decentralized, and the nodes are highly autonomous. Even if some nodes fail, the system as a whole can still work normally;
[0035] 2. CA provides a safe and flexible rights management scheme to ensure that only authorized members read and write data, and data can be safely shared between different participants;
[0036] 3. The data is jointly maintained by multiple parties, the tampering of the data by one party will not be accepted by the system as a whole, and the written data cannot be changed.
Description of the drawings
[0037] FIG. 1 is a schematic diagram of the system of the present invention.
Detailed ways
[0038] The present invention will be further described in detail below with reference to the drawings and embodiments.
[0039] In order to make the above objectives, features and advantages of the present invention more obvious and easy to understand, the following describes the specific embodiments of the present invention in detail with reference to the accompanying drawings. In the following description, many specific details are explained in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the invention. Therefore, the present invention is not limited by the specific implementation disclosed below.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention. The terms used in the invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.
[0041] Figure 1 shows a schematic diagram of the system of the present invention.
[0042] A blockchain-based Internet of Things data sharing method, which is characterized by:
[0043] The blockchain network is constructed based on Hyperledger Fabric, and the Internet of Things participants negotiate the configuration of the network and maintain them together; the participants belong to their respective organizations, and the organization conducts membership management through CA, and maintains sorting services and nodes, The ledger in the node uses the data structure of the blockchain to store data in an immutable manner; the organizations are isolated from the outside by establishing channels to share data within the channels; these data are not controlled by a single party, but based on a negotiated channel strategy Collective maintenance
[0044] The gateway module is responsible for processing and transmitting data between the IoT device and the blockchain network, including a certificate management module, a data receiving and processing module, and Fabric SDK; the certificate management module helps newly added IoT devices Apply for a certificate from the CA, after receiving the certificate returned by the CA, encrypt it and store it in the local database, and record the correspondence between the certificate and the IoT device; the data receiving and processing module performs necessary cleaning of the data collected by the IoT device , Format conversion, packaging, etc.; The Fabric SDK uses the certificate of the corresponding IoT device to sign the data processed in the previous step, encapsulates it and sends it to the corresponding channel; the Fabric SDK is a set of development tools that encapsulate The service interface provided by the node.
[0045] The query module is for the data demander to query the data; the query module carries its own certificate, calls the chain code to access the data recorded on the ledger, and the relevant personnel or equipment can further use it.
[0046] The gateway module monitors various events in the blockchain network, and takes the next step based on the event.
[0047] An auxiliary channel capable of recording query logs is created for the channel to form a double-chain system; each query of data on the channel is performed by calling the chain code of the auxiliary channel in the chain code to combine the query items and the query Information such as time is written into the auxiliary channel; once the data of the channel is leaked, the weak link and the scope of the leak can be traced by analyzing the records of the auxiliary channel.
[0048] For more fine-grained control of private data, when the gateway module sends data to the channel, the private data is stored in a special domain, and the chain code on the node detects the special domain and automatically calculates the private data Afterwards, only the hash value is broadcast to the channel, and the real value is stored in the nodes local database; when the data demander wants to access private data, it can request the node. If the data demander is granted permission, the node After reading the data locally or requesting from other nodes that store the data, the data is returned. The data demander calculates the hash value of the received data, and compares the value with the value recorded in the ledger to confirm the authenticity of the data.
[0049] Embodiment:
[0050] The Internet of Things device uses a DHT22 temperature and humidity sensor in the embodiment, which is connected to the gateway through GPIO pins.
[0051] The gateway uses the Raspberry Pi 3B, is equipped with a Raspbian Stretch Lite system, and is connected to the CA and the blockchain network through a wireless network. Among them, CA is implemented by Fabric CA and runs on the server. A Python script is run on the gateway to receive data from the GPIO pins and process it. The subsequent steps for the gateway to interact with the CA are as follows:
[0052] 1. The gateway confirms the identity of the newly added IoT device, obtains metadata such as its device type, and sets the device ID.
[0053] 2. If the confirmation is correct, the gateway calls the RESTful API of the Fabric CA to apply for the identity certificate of the device from the CA of the organization.
[0054] 3. After receiving the application, the CA generates necessary certificate materials and returns them to the gateway. CA has been authorized in the configuration of the channels, ordering services, nodes and other components in the blockchain network in advance, so the ECerts (registration certificates) and TCerts (transaction certificates) issued by it can be used in the network.
[0055] 4. After receiving the certificate, the gateway delivers it to the local certificate management module, which is encrypted and stored in the local database by the certificate management module, and records the correspondence between the certificate and the Internet of Things device.
[0056] The aforementioned blockchain network includes 1 channel and 1 group of sorting services on Apache Kafka, which belong to several nodes organized by Org1 and Org2. Org1 provides data, and Org2 obtains data. These components are deployed on different servers and communicate through the gRPC protocol.
[0057] There are permission policies in the configuration files of the blockchain network and channels, which limit members to have specific permissions.
[0058] The gateway uses the certificate corresponding to the Internet of Things device to sign the processed data, encapsulates it into a transaction proposal, and sends it to the nodes in the channel through the Fabric SDK.
[0059] The node and the ordering service endorse and order the received transactions, and finally broadcast them to all nodes in the channel and write them into the local ledger.
[0060] Preferably, the gateway monitors various events in the blockchain network, and takes the next step based on the event.
[0061] Preferably, an auxiliary channel capable of recording query logs is created for the channel, and then the related chain code for calling the chain code of the auxiliary channel is instantiated on the channel, so that each query of the data, the query range and the queryers The information is recorded to the auxiliary channel.
[0062] Preferably, when the gateway module sends data to the node of the channel, the private data is stored in the transient area.
In a special domain, the chain code on the node detects the special domain, automatically calculates the hash value of the private data, and then only broadcasts the hash value to the channel, and the real value is stored in the node's local private database. When the data demander wants to access private data, it can request it from the node. If the data demander is granted permission, the node will read the data locally or request the data from other nodes that store the data and return the data. The data demander will receive Calculate the hash value of the data, and compare the value with the value recorded in the ledger to confirm the authenticity of the data.
[0063] The query module is a Web application, and the bottom layer calls the query chain code through the API provided by the Fabric SDK to provide the data requester with data allowed by the channel policy.
1 sheet
Sheet 1
Every citation, both ways
| Document | Relation | Office | Category | Cited during | Relevant claims |
|---|---|---|---|---|---|
| CN111563089A | Cited by | China | – | Search report | – |
| CN110933187A | Cited by | China | – | Search report | – |
| CN113065147A | Cited by | China | – | Search report | – |
| CN114338728A | Cited by | China | – | Search report | – |
| CN117319422A | Cited by | China | – | Search report | – |
| CN112995992A | Cited by | China | – | Search report | – |
| CN112671580A | Cited by | China | – | Search report | – |
| CN111245861A | Cited by | China | – | Search report | – |
| CN111626853A | Cited by | China | – | Search report | – |
| CN112202775A | Cited by | China | – | Search report | – |
| CN111294349A | Cited by | China | – | Search report | – |
| CN113704722A | Cited by | China | – | Search report | – |
| CN113656498A | Cited by | China | – | Search report | – |
| CN110866272A | Cited by | China | – | Search report | – |
| CN111767568A | Cited by | China | – | Search report | – |
| CN111935174A | Cited by | China | – | Search report | – |
| CN111586069A | Cited by | China | – | Search report | – |
| CN115484030A | Cited by | China | – | Search report | – |
| CN115840787A | Cited by | China | – | Search report | – |
| CN115114339A | Cited by | China | – | Search report | – |
| CN110730081A | Cited by | China | – | Search report | – |
| CN112671840A | Cited by | China | – | Search report | – |
| CN112116475A | Cited by | China | – | Search report | – |
| CN111669267A | Cited by | China | – | Search report | – |
| CN113364771A | Cited by | China | – | Search report | – |
| CN112463265A | Cited by | China | – | Search report | – |
| CN108052530A | Cites | China | A | Search report | 1-10 |
| CN108632293A | Cites | China | A | Search report | 1-10 |
| CN108683705A | Cites | China | A | Search report | 1-10 |
| CN108737348A | Cites | China | A | Search report | 1-10 |
| CN109243548A | Cites | China | A | Search report | 1-10 |
| CN109493063A | Cites | China | A | Search report | 1-10 |
| EP3355217A1 | Cites | European Patent Office (EPO) | A | Search report | 1-10 |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 201910280490 | China | A | |
| CN20191280490 | – | – | – |
6 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Patent grantGrantedGR01 | GR01 | |
| Patent grantGrantedGR01 | GR01 | |
| Entry into force of request for substantive examinationSE01 | SE01 | |
| Entry into force of request for substantive examinationSE01 | SE01 | |
| PublicationPB01 | PB01 | |
| PublicationPB01 | PB01 |
Numbers
- Publication
- 110012015
- Publication, DOCDB
- 110012015
- Publication, EPODOC
- CN110012015
- Application
- 102804908
- Application, DOCDB
- 201910280490
- Application, EPODOC
- CN201910280490
Titles2
- Chinese
- 一种基于区块链的物联网数据共享方法及系统
- English
- A blockchain-based Internet of Things data sharing method and system
Classification
- CPC, 4
- H04L63/0823
- H04L67/12
- H04L9/3268
- H04L9/50
- IPC, 3
- H04L29 06
- H04L9 32
- H04L29 08