WO2020248981A1 - 一种基于区块链的物联网iot设备间通信的方法及装置 - Google Patents

一种基于区块链的物联网iot设备间通信的方法及装置 Download PDF

Info

Publication number
WO2020248981A1
WO2020248981A1 PCT/CN2020/095199 CN2020095199W WO2020248981A1 WO 2020248981 A1 WO2020248981 A1 WO 2020248981A1 CN 2020095199 W CN2020095199 W CN 2020095199W WO 2020248981 A1 WO2020248981 A1 WO 2020248981A1
Authority
WO
WIPO (PCT)
Prior art keywords
iot device
chain
smart contract
belongs
packet
Prior art date
Application number
PCT/CN2020/095199
Other languages
English (en)
French (fr)
Inventor
王晨旭
汪雅伟
范瑞彬
张开翔
李辉忠
李成博
Original Assignee
深圳前海微众银行股份有限公司
西安交通大学
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 深圳前海微众银行股份有限公司, 西安交通大学 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2020248981A1 publication Critical patent/WO2020248981A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions

Definitions

  • the embodiments of the present invention relate to the field of financial technology (Fintech), and in particular, to a method and device for communication between IOT (Internet of Things) devices based on a block chain (BlockChain).
  • Fintech financial technology
  • IOT Internet of Things
  • BlockChain block chain
  • a blockchain is a chain composed of a series of blocks. Each block records the data of the block and the hash value of the previous block. In this way, all blocks form a chain one after another.
  • the cryptographic technology and decentralized ideas on which the blockchain is based make the historical information on the chain unable to be tampered with.
  • FIG. 1 shows an Internet of Things system based on the Bitcoin system in the prior art.
  • the Internet of Things system includes a smart gateway, IOT equipment, and a cloud storage platform.
  • the smart gateway is a miner node in the Internet of Things system. When communication between IoT devices is required, the miner node will generate a shared key and distribute it to the IOT device to be communicated, so that encrypted communication can be performed between the IOT devices to be communicated.
  • the miner node needs to generate a shared key and distribute it to the IOT device to be communicated.
  • the miner node needs to perform a large amount of work of generating and distributing the shared key, and the workload of the miner node is too large.
  • the embodiment of the present invention provides a method and device for communication between IOT devices based on the blockchain, which are used to improve communication efficiency without distributing a shared key when communicating between IOT devices.
  • the method for communication between IOT devices based on the blockchain provided in the embodiment of the present invention is applicable to a consortium chain including a routing chain and at least one packet chain;
  • the method includes:
  • the acquisition request is used to acquire the first data of the second IOT device;
  • the packet chain to which the second IOT device belongs is determined through the routing chain; the routing chain is used to return to the second IOT device after determining that the first IOT device passes the first identity verification Belonging to the group chain;
  • the response response of the acquisition request is acquired through the packet chain to which the second IOT device belongs; the packet chain to which the second IOT device belongs is used to determine that the first IOT device passes the second identity After verification, a response response to the acquisition request is returned; the response response is used to acquire the first data.
  • the first IOT device accesses the second IOT device through the alliance chain, and the first IOT device sends an acquisition request for acquiring the first data of the second IOT device to the alliance chain, and determines the second IOT through the routing chain according to the acquisition request.
  • the packet chain to which the device belongs, and the response response is obtained through the packet chain to which the second IOT device belongs.
  • the first IOT device and the second IOT device do not need to communicate directly, and there is no need to distribute the shared key. 2.
  • the response response of the IOT device is used to obtain the first data and improve the communication efficiency between the first IOT device and the second IOT device.
  • This technical solution is suitable for communication between a large number of IOT devices in a large-scale Internet of Things system.
  • the routing chain is used to perform the first identity verification on the first IOT device, and the packet chain is used to perform the second identity verification on the first IOT device, which is equivalent to two layers of data access control, which improves the security of data access.
  • the routing chain is provided with a first smart contract
  • the determining, according to the obtaining request, the packet chain to which the second IOT device belongs through the routing chain includes:
  • call the first smart contract determine through the first smart contract that the first IOT device is an IOT device authenticated by the routing chain, and determine through the first smart contract that the The packet chain to which the second IOT device belongs.
  • calling the first smart contract of the routing chain is equivalent to using the first smart contract to realize the diversification of routing chain functions.
  • the judgment function of the first smart contract it is judged whether the first IOT device is certified by the routing chain. IOT device; and using the first smart contract as a routing table in the routing chain for determining the packet chain to which the second IOT device belongs.
  • the packet chain is provided with a second smart contract belonging to each IOT device of the packet chain;
  • the obtaining the response response of the obtaining request through the packet chain to which the second IOT device belongs according to the obtaining request includes:
  • call the second smart contract of the second IOT device determine through the second smart contract of the second IOT device that the first IOT device has the right to access the second IOT device, and The response response is obtained through the second smart contract of the second IOT device.
  • the packet chain is provided with a second smart contract belonging to each IOT device of the packet chain.
  • the second smart contract of the second IOT device is called, which is equivalent to using the second smart contract to realize the function of the packet chain.
  • the response is a hash value of the first data
  • the hash value of the first data is the hash value returned by the distributed storage system after the second IOT device stores the first data in the distributed storage system.
  • the hash value of the first data can be returned to the first IOT device, and the first IOT device can be based on the hash value of the first data.
  • Hope obtains the first data of the second IOT from the distributed storage system.
  • the distributed storage system is used to distribute and store the data of the second IOT device on each server to ensure the security of the data.
  • the distributed storage system is adopted to download the data by the first IOT device through the hash value of the first data. Data integrity and high-speed download of the first data can be achieved.
  • the method further includes:
  • the on-chain request includes a hash value of the second data of the second IOT device
  • the uplink request determine the packet chain to which the second IOT device belongs through the routing chain
  • the hash value of the second data is stored through the packet chain to which the second IOT device belongs.
  • the second IOT device records the hash value of the second data in the link request and sends it to the consortium chain.
  • the consortium chain determines the packet chain to which the second IOT device belongs according to the link request and the routing chain, and according to the second
  • the group chain to which the IoT device belongs stores the hash value of the second data, which is equivalent to storing the hash value of the second data of the second IOT device in the group chain to which it belongs according to the alliance chain and the group chain, so that different types of IOT devices are grouped and the data of different types of IOT devices are stored in the grouping chain to which they belong, so as to efficiently manage each IOT device in the Internet of Things system.
  • the method before the receiving the acquisition request of the first IOT device, the method further includes:
  • the IOT device ID of the first IOT device is authenticated through the routing chain, and after the authentication is passed, the identity certificate of the first IOT device and the identity certificate of the first IOT device are determined Packet chain
  • the identity certificate of the first IOT device and the information of the packet chain to which the first IOT device belongs are stored in the first smart contract; the information of the packet chain to which the first IOT device belongs records the The address of the second smart contract of the first IOT device in the packet chain to which it belongs.
  • the first IOT device may send a registration request to the alliance chain, and the routing chain authenticates the IOT device ID of the first IOT device, and after the authentication is passed, generates the identity certificate of the first IOT device; the routing chain determines the first IOT device ID.
  • a packet chain to which the IOT device belongs, and the second smart contract of the first IOT device is determined through the packet chain; the identity certificate of the first IOT device and the information of the packet chain to which the first IOT device belongs are stored in the first smart contract, After the registration is completed, the data of the first IOT device is uploaded to the chain and the first identity verification and the second identity verification when accessing other visited IOT devices.
  • the first smart contract records the correspondence between the service type of the IOT device, the network ID to which the IOT device belongs, the packet chain ID to which the IOT device belongs, and the packet chain ID to which the IOT device belongs, the IOT device ID, and the IOT.
  • the corresponding relationship between the IOT device ID, the time stamp, and the hash value of the data of the IOT device is recorded in the second smart contract.
  • a preset corresponding relationship is recorded in the first smart contract to determine the complete path of each IOT device in the Internet of Things system.
  • the first corresponding relationship is the service type of the IOT device, the IOT.
  • the second correspondence is the relationship between the packet chain ID to which the IOT device belongs, the IOT device ID and the address of the second smart contract of the IOT device in the packet chain to which it belongs Correspondence.
  • the packet chain to which the accessed IOT device belongs can be determined, and the second smart contract of the accessed IOT device is The address in the belonging packet chain, so that the second smart contract of the accessed IOT device can be called. Further, the second smart contract also records a preset corresponding relationship, which is used to determine the hash value of the data of the accessed IOT device, and the corresponding relationship is the accessed IOT device ID, timestamp, and the accessed IOT device's hash value.
  • the hash value of the data through the corresponding relationship preset in the second smart contract, after obtaining the time information and the ID of the accessed IOT device, the hash value of the data of the accessed IOT device can be determined, so that the IOT will be accessed
  • the hash value of the data of the device is returned to the accessed IOT device, so that the access to the IOT device can obtain the data of the accessed IOT device.
  • the embodiment of the present invention also provides a block chain-based device for communication between IOT devices, which is suitable for a consortium chain including a routing chain and at least one packet chain;
  • the device includes:
  • a receiving unit configured to receive an acquisition request of a first IOT device; the acquisition request is used to acquire first data of a second IOT device;
  • the processing unit is configured to determine, through the routing chain, the packet chain to which the second IOT device belongs according to the acquisition request; the routing chain is configured to return to the office after determining that the first IOT device passes the first identity verification The packet chain to which the second IOT device belongs;
  • the processing unit is further configured to obtain the response response of the acquisition request through the packet chain to which the second IOT device belongs according to the acquisition request; the packet chain to which the second IOT device belongs is used to determine the After the first IOT device passes the second identity verification, it returns a response response to the acquisition request; the response response is used to acquire the first data.
  • the routing chain is provided with a first smart contract
  • the processing unit is specifically used for:
  • call the first smart contract determine through the first smart contract that the first IOT device is an IOT device authenticated by the routing chain, and determine through the first smart contract that the The packet chain to which the second IOT device belongs.
  • the packet chain is provided with a second smart contract belonging to each IOT device of the packet chain;
  • the processing unit is specifically used for:
  • call the second smart contract of the second IOT device determine through the second smart contract of the second IOT device that the first IOT device has the right to access the second IOT device, and The response response is obtained through the second smart contract of the second IOT device.
  • the response is a hash value of the first data
  • the hash value of the first data is the hash value returned by the distributed storage system after the second IOT device stores the first data in the distributed storage system.
  • processing unit is further configured to:
  • the on-chain request includes the hash value of the second data of the second IOT device;
  • the uplink request determine the packet chain to which the second IOT device belongs through the routing chain
  • the hash value of the second data is stored through the packet chain to which the second IOT device belongs.
  • processing unit is further configured to:
  • the IOT device ID of the first IOT device is authenticated through the routing chain, and after the authentication is passed, the identity certificate of the first IOT device and the identity certificate of the first IOT device are determined Packet chain
  • the identity certificate of the first IOT device and the information of the packet chain to which the first IOT device belongs are stored in the first smart contract; the information of the packet chain to which the first IOT device belongs records the The address of the second smart contract of the first IOT device in the packet chain to which it belongs.
  • the first smart contract records the correspondence between the service type of the IOT device, the network ID to which the IOT device belongs, the packet chain ID to which the IOT device belongs, and the packet chain ID to which the IOT device belongs, the IOT device ID, and the IOT.
  • the corresponding relationship between the IOT device ID, the time stamp, and the hash value of the data of the IOT device is recorded in the second smart contract.
  • an embodiment of the present invention also provides a computing device, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, and execute the above-mentioned blockchain-based IOT device communication method according to the obtained program.
  • an embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned blockchain-based The method of communication between IOT devices.
  • the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the above-mentioned method of communication between IOT devices based on the blockchain.
  • Figure 1 is an IoT system based on the Bitcoin system in the prior art
  • FIG. 2 is a schematic diagram of a system architecture provided by an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for communication between IOT devices based on blockchain according to an embodiment of the present invention
  • FIG. 4 shows that the routing chain provided by an embodiment of the present invention performs identity authentication on the first IOT device
  • FIG. 5 is a schematic flowchart of registration of a first IOT device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a process of uploading a hash value of data of a second IOT device according to an embodiment of the present invention
  • FIG. 7 is a schematic flowchart of another method for communication between IOT devices based on blockchain according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of another system architecture provided by an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an apparatus for communication between IOT devices based on a blockchain according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a computing device provided by this application.
  • the financial field usually involves multiple systems, such as office systems, production systems, operation and maintenance systems, etc.
  • the office system can be used to perform various internal affairs in the financial field, and the production system can be used to perform business generated in the financial field;
  • the operation and maintenance system can supervise the office system and the production system to ensure the normal operation of the office system and the production system.
  • the coordinated operation of multiple systems can ensure the rapid and healthy development of the financial sector.
  • each device in the office system, production system, and operation and maintenance system is combined into an Internet of Things system, and combined with the method of communication between IOT devices based on the blockchain provided by the embodiment of the present invention, it is possible to realize the integration of IOT devices in the financial field. Efficient communication between the two and to ensure data security.
  • FIG. 2 exemplarily shows the system architecture of the Internet of Things system to which the method for communication between IOT devices based on the blockchain provided by an embodiment of the present invention is applicable.
  • the system architecture includes a consortium chain, a distributed storage system, and an IOT device cluster , Application server.
  • the alliance chain includes a routing chain and at least one packet chain; the IOT device cluster includes multiple IOT devices.
  • the IOT device saves data to the distributed storage system through the application server, and stores the information of the stored data in the alliance chain.
  • the devices communicate with each other through the application server and the alliance chain; the application server can be used as a separate server or integrated into the alliance chain.
  • the application server can be integrated into the alliance chain.
  • the alliance chain communicates directly; the distributed storage system can be an IPFS (InterPlanetary File System) system.
  • two IOT devices are taken as an example for description, which are the first IOT device and the second IOT device respectively.
  • the first IOT device is an accessing IOT device or actively accessing an IOT device
  • the second IOT device is an IOT device to be accessed or an IOT device being accessed.
  • the consortium chain receives the acquisition request of the first IOT device, and the routing chain in the consortium chain is used to perform the first identity verification on the first IOT device and determine the identity of the second IOT device
  • the packet chain; the packet chain in the alliance chain is used to perform a second identity verification on the first IOT device and determine the response to the above-mentioned acquisition request.
  • two smart contracts can be set in the routing chain to implement the above two functions respectively, such as the routing chain calling the first smart contract to perform the first identity verification on the first IOT device, and calling the second smart contract to determine The packet chain to which the second IOT device belongs.
  • a smart contract can also be set in the routing chain, which can be called the first smart contract.
  • the routing chain calls the first smart contract to perform the first identity verification on the first IOT device and determine the packet chain to which the second IOT device belongs.
  • the first smart contract when the first smart contract performs the first identity verification on the first IOT device, it is equivalent to judging whether the first IOT device is a registered device in the Internet of Things system, or judging the first IOT device Whether it is an IOT device that has been authenticated by the routing chain, if so, it is determined that the first IOT device passes the first identity verification of the first smart contract.
  • the registration process of the first IOT device is described in detail in the following embodiments.
  • the first smart contract determines the packet chain to which the second IOT device belongs, it can be determined based on the complete path of each IOT device in the Internet of Things system recorded in the first smart contract, and the complete path can be implemented through a preset correspondence relationship .
  • the preset correspondence can be understood as a routing table.
  • the first correspondence is the correspondence between the service type of the IOT device, the network ID to which the IOT device belongs, and the packet chain ID to which the IOT device belongs;
  • the second correspondence is the packet chain ID to which the IOT device belongs, the IOT device ID and The correspondence between the addresses of the second smart contract of the IoT device in the packet chain to which it belongs.
  • the first smart contract of the routing chain can record the path information of the IOT device through two Maps (Map1 and Map2).
  • Map1 Map1[servicetype][netID], where the first key is the IOT device
  • the second key is the network ID to which the IOT device belongs, and the value is set chainID, which is the ID of the packet chain to which the IOT device belongs
  • Map2 Map2[set chainID][deviceID]
  • the first key is The ID of the packet chain to which the IoT device belongs
  • the second key is the ID of the IOT device
  • the value is the address of the second smart contract of the IOT device in the packet chain to which it belongs.
  • the packet chain is used to perform the second identity verification on the first IOT device and determine the response response of the acquisition request, where the response response is used to acquire the data of the second IOT device.
  • the packet chain is provided with smart contracts belonging to each IOT device of the packet chain, that is, each IOT device corresponds to its own smart contract.
  • Each IOT device can set two smart contracts to implement the second smart contract for the first IOT device.
  • You can also set up a smart contract, which can be called a second smart contract.
  • the routing chain calls the second smart contract to perform the second identity verification on the first IOT device and confirm the response.
  • the routing chain calls the second smart contract of the second IOT device to perform the second identity verification on the first IOT device, which is equivalent to judging whether the first IOT device has the authority to access the data of the first IOT device, and if so, the first IOT device is determined Pass the second identity verification of the second smart contract.
  • the data of the second IOT device may be operating data, parameter information, etc. of the second IOT device.
  • the second smart contract can record the correspondence between the device ID, timestamp, and data storage location of the second IOT device, then the response at this time is the data storage location; the second smart contract can also record the first 2.
  • the correspondence between the device ID of the IOT device, the time stamp, and the hash value of the data, then the response at this time is the hash value of the data, where the hash value of the data is that the second IOT device stores the data to the distribution In a distributed storage system, the distributed storage system returns the hash value of the data.
  • the routing chain can record the hash value of the data of the IOT device through a Map(Map3).
  • Map3 The structure of Map3 is Map[deviceID][timestamp], the first key is the IOT device ID, and the second key is The timestamp when the IoT device uploads data, and the value is the hash value of the data returned by IPFS.
  • FIG. 3 exemplarily shows the flow of a method for communication between IOT devices based on a blockchain according to an embodiment of the present invention, and the flow can be executed by a device for communication between IOT devices based on the blockchain. .
  • the process specifically includes:
  • Step 301 Receive an acquisition request from the first IOT device.
  • the acquisition request is used to acquire the first data of the second IOT device.
  • the acquisition request may record parameter information of the first IOT device and parameter information of the second IOT device.
  • the parameter information may include the device of the IOT device. ID, of course, the parameter information can also include the device serial number, service type, network ID, service type, etc. of the IOT device.
  • Step 302 According to the acquisition request, determine the packet chain to which the second IOT device belongs through the routing chain.
  • the first smart contract in the routing chain determines whether the first IOT device passes the first identity verification, which is equivalent to calling the first smart contract to determine whether the first IOT device is an IOT device authenticated by the routing chain If yes, determine the packet chain to which the second IOT device belongs through the first smart contract; otherwise, return a rejection message to the first IOT device.
  • the first identity verification of the first IOT device when the first IOT device accesses the data of the second IOT device through the alliance chain, the first identity verification of the first IOT device must be performed first to ensure that only the IOT device that has been authenticated by the routing chain can access the second IOT. The device guarantees the security of the data of the second IOT device.
  • the routing chain before the routing chain performs the first identity verification on the first IOT device, there may be a routing chain to authenticate the first IOT device, which is equivalent to registering the first IOT device into the alliance chain, specifically, receiving the first IOT
  • the registration request sent by the device authenticates the IOT device ID of the first IOT device through the routing chain, and after the authentication is passed, determines the identity certificate of the first IOT device and the packet chain to which the first IOT device belongs, and passes
  • the packet chain to which the first IOT device belongs determines the second smart contract of the first IOT device, and stores the identity certificate of the first IOT device and the information of the packet chain to which the first IOT device belongs in the first smart contract;
  • the information of the packet chain to which the IOT device belongs records the address of the second smart contract of the first IOT device in the packet chain to which it belongs.
  • the first IOT device may be registered, and a registration request sent by the first IOT device may be received.
  • the registration request may include parameter information of the first IOT device, such as device ID, device serial number, Service type, network ID, organization, etc., as shown in Figure 4, the arbitration node in the routing chain can perform identity authentication on the first IOT device, and sign after confirming that the first IOT device has passed identity authentication. , Use the signed certificate as the identity certificate of the first IOT device.
  • the identity certificate records the device ID, device serial number, service type, network ID, organization, etc. of the first IOT device.
  • the identity certificate is stored in the first smart contract.
  • the first smart contract when the first smart contract is called to determine whether the first IOT device is an IOT device authenticated by the routing chain, it can be determined whether there is an identity certificate of the first IOT device in the first smart contract, and if so, the first IOT device can be determined.
  • the IoT device passes the first identity verification.
  • the routing chain After the routing chain generates the identity certificate of the first IOT device, it can also determine the packet chain to which the first IOT device belongs based on information such as the service type of the first IOT device, the network ID to which it belongs, and the identity certificate of the first IOT device,
  • the packet chain information to which the first IOT device belongs is stored together in the first smart contract.
  • the second smart contract of the first IOT device is determined by the packet chain to which the first IOT device belongs.
  • the packet chain to which the first IOT device belongs returns the address of the second smart contract of the first IOT device to the routing chain, and the routing chain uses the 2.
  • the address of the smart contract is stored in the first smart contract as the group chain information to which it belongs, so that the first smart contract can generate the complete path of the first IOT device according to the information of the group chain to which the first IOT device belongs.
  • Step 501 The first IOT device sends a registration request to the routing chain.
  • Step 502 The arbitration node in the routing chain signs the first IOT device, and the signed certificate serves as the identity certificate of the first IOT device;
  • Step 503 The routing chain determines the packet chain to which the first IOT device belongs
  • Step 504 The routing chain sends a transaction for deploying the second smart contract to the packet chain;
  • Step 505 The packet chain deploys the second smart contract of the first IOT device
  • Step 506 The packet chain sends the address of the second smart contract to the routing chain
  • Step 507 The routing chain records the path information of the first IOT device through two Maps
  • Step 508 The routing chain stores the identity certificate and path information of the first IOT device in the first smart contract
  • Step 509 The routing chain sends a registration success message to the first IOT device.
  • the nodes with arbitration properties in the routing chain may include three types of nodes, namely, an organization node, an arbitration node, and a certificate deposit node. After the first IOT device sends a registration request, the three types of nodes respectively respond to the first IOT device. The parameter information of an IOT device is verified and signed after the verification is passed. The routing chain uses the certificate with the signature of the three types of nodes as the identity certificate of the first IOT device.
  • nodes with arbitration properties in the routing chain can include not only organization nodes, arbitration nodes, and certificate deposit nodes, but also other nodes such as supervisory nodes.
  • the second IOT device is a device registered with the alliance chain, and the complete path of the second IOT device is recorded in the first smart contract of the routing chain, that is, according to the device information of the second IOT device, such as the second The service type of the IOT device, the network ID to which the IOT device belongs, and the device ID determine the complete path of the second IOT device, that is, determine the group chain ID to which the second IOT device belongs and the group to which the second smart contract of the second IOT device belongs The address in the chain.
  • the device information of the second IOT device such as the second The service type of the IOT device, the network ID to which the IOT device belongs, and the device ID determine the complete path of the second IOT device, that is, determine the group chain ID to which the second IOT device belongs and the group to which the second smart contract of the second IOT device belongs The address in the chain.
  • Step 303 According to the obtaining request, obtain a response to the obtaining request through the packet chain to which the second IOT device belongs.
  • the packet chain to which the second IOT device belongs first performs the second identity verification on the first IOT device, which is equivalent to calling the second smart contract of the second IOT device to determine whether the first IOT device has the permission to access the data of the second IOT device. , The response is determined through the second smart contract of the first IOT device; otherwise, a rejection message is returned to the first IOT device.
  • whether the first IOT device has the authority to access the data of the second IOT device is understood to mean that the first IOT device can provide a token value for accessing the data of the second IOT device, or pay corresponding money to the second IOT device.
  • the second IOT device after the second IOT device is registered with the alliance chain, it can store the generated second data in the distributed storage system, and receive the hash value of the second data returned by the distributed storage system.
  • the second IOT device records the hash value of the second data in the link request and sends it to the routing chain to request linking.
  • the hash value of the second data may be data encrypted by the key of the second IOT device.
  • the alliance chain system receives the on-chain request sent by the second IOT device, determines the packet chain to which the second IOT device belongs through the routing chain according to the on-chain request, and then uses the packet chain to which the second IOT device belongs according to the on-chain request Store the hash value of the second data.
  • the packet chain to which the second IOT device belongs invokes the second smart contract of the second IOT device, and stores the hash value of the second data in the second smart contract.
  • Step 601 The second IOT device sends the second data to the distributed storage system.
  • Step 602 The distributed storage system stores the second data, and generates a hash value of the second data.
  • Step 603 The distributed storage system sends the hash value of the second data to the second IOT device.
  • Step 604 The second IOT device encrypts the hash value of the second data to generate an on-chain request
  • Step 605 The second IOT device sends the link request to the routing chain
  • Step 606 The routing chain determines the identity certificate of the second IOT device according to the link request.
  • Step 607 The routing chain determines the packet chain to which the second IOT device belongs in the first smart contract according to the service type and network ID in the identity certificate of the second IOT device.
  • Step 608 The routing chain determines the address of the second smart contract of the second IOT device in the first smart contract according to the packet chain ID to which the second IOT device belongs and the device ID of the second IOT device.
  • Step 609 The routing chain sends the encrypted hash value of the second data to the packet chain;
  • step 610 the block chain stores the hash value of the encrypted second data into the second smart contract.
  • the first IOT device sends a request to the consortium chain system to obtain the hash value of the first data of the second IOT device. After determining that the first IOT device has passed the first identity verification and the second identity verification, the first IOT device can An IOT device returns the hash value of the first data, and the first IOT device can obtain the first data of the second IOT from the distributed storage system according to the hash value of the first data.
  • Step 701 The first IOT device sends an acquisition request to the routing chain
  • Step 702 The routing chain performs first identity verification on the first IOT device according to the first smart contract
  • Step 703 The routing chain determines that the first IOT device passes the first identity verification, and determines the address of the second smart contract of the second IOT device from the first smart contract;
  • Step 704 The routing chain sends the address of the second smart contract to the packet chain
  • Step 705 The packet chain performs a second identity verification on the first IOT device according to the second smart contract.
  • Step 706 The packet chain determines that the first IOT device passes the second identity verification, and determines the hash value of the first data from the second smart contract.
  • Step 707 The packet chain sends the hash value of the first data to the first IOT device.
  • Step 708 The first IOT device sends the hash value of the first data to the distributed storage system.
  • Step 709 The distributed storage system returns the first data to the first IOT device.
  • the second data of the second IOT device can be stored in the distributed storage system
  • the second data of the second IOT device can also be stored on the cloud storage system, such as using a third-party
  • the cloud storage system stores data.
  • an embodiment of the present invention also provides a schematic diagram of a system architecture, as shown in FIG. 8.
  • the distributed storage system distributes and stores the second data of the second IOT device on each server to ensure the security of the second data.
  • it adopts a distributed storage system to allow the first IOT device to pass the second data.
  • the first IOT device accesses the second IOT device through the alliance chain, and the first IOT device sends an acquisition request for acquiring the first data of the second IOT device to the alliance chain, and determines the second IOT through the routing chain according to the acquisition request.
  • the packet chain to which the device belongs, and the response response is obtained through the packet chain to which the second IOT device belongs.
  • the first IOT device and the second IOT device do not need to communicate directly, and there is no need to distribute the shared key. Instead, the first IOT device is obtained through the routing chain and the packet chain. 2.
  • the response response of the IOT device is used to obtain the first data and improve the communication efficiency between the first IOT device and the second IOT device.
  • This technical solution is suitable for communication between a large number of IOT devices in a large-scale Internet of Things system. Further, the routing chain is used to perform the first identity verification on the first IOT device, and the packet chain is used to perform the second identity verification on the first IOT device, which is equivalent to two layers of data access control, which improves the security of data access.
  • FIG. 9 exemplarily shows the structure of an apparatus for communication between IOT devices based on a blockchain provided by an embodiment of the present invention, which can execute a method for communication between IOT devices based on the blockchain Process.
  • the device is suitable for a consortium chain including a routing chain and at least one packet chain; the device includes:
  • the receiving unit 901 is configured to receive an acquisition request of a first IOT device; the acquisition request is used to acquire first data of a second IOT device;
  • the processing unit 902 is configured to determine the packet chain to which the second IOT device belongs through the routing chain according to the acquisition request; the routing chain is configured to return after determining that the first IOT device passes the first identity verification The packet chain to which the second IOT device belongs;
  • the processing unit 902 is further configured to obtain the response response of the acquisition request through the packet chain to which the second IOT device belongs according to the acquisition request; the packet chain to which the second IOT device belongs is used to determine the After the first IOT device passes the second identity verification, it returns a response response to the acquisition request; the response response is used to acquire the first data.
  • the routing chain is provided with a first smart contract
  • the processing unit 902 is specifically configured to:
  • call the first smart contract determine through the first smart contract that the first IOT device is an IOT device authenticated by the routing chain, and determine through the first smart contract that the The packet chain to which the second IOT device belongs.
  • the packet chain is provided with a second smart contract belonging to each IOT device of the packet chain;
  • the processing unit 902 is specifically configured to:
  • call the second smart contract of the second IOT device determine through the second smart contract of the second IOT device that the first IOT device has the right to access the second IOT device, and The response response is obtained through the second smart contract of the second IOT device.
  • the response is a hash value of the first data
  • the hash value of the first data is the hash value returned by the distributed storage system after the second IOT device stores the first data in the distributed storage system.
  • processing unit 902 is further configured to:
  • the on-chain request includes the hash value of the second data of the second IOT device;
  • the uplink request determine the packet chain to which the second IOT device belongs through the routing chain
  • the hash value of the second data is stored through the packet chain to which the second IOT device belongs.
  • processing unit 902 is further configured to:
  • the IOT device ID of the first IOT device is authenticated through the routing chain, and after the authentication is passed, the identity certificate of the first IOT device and the identity certificate of the first IOT device are determined Packet chain
  • the identity certificate of the first IOT device and the information of the packet chain to which the first IOT device belongs are stored in the first smart contract; the information of the packet chain to which the first IOT device belongs records the The address of the second smart contract of the first IOT device in the packet chain to which it belongs.
  • the first smart contract records the correspondence between the service type of the IOT device, the network ID to which the IOT device belongs, the packet chain ID to which the IOT device belongs, and the packet chain ID to which the IOT device belongs, the IOT device ID, and the IOT.
  • the corresponding relationship between the IOT device ID, the time stamp, and the hash value of the data of the IOT device is recorded in the second smart contract.
  • the present application also provides a computing device.
  • the computing device includes at least one processor 1020 for implementing the method in FIG. Any method.
  • the computing device 1000 may also include at least one memory 1030 for storing program instructions and/or data.
  • the memory 1030 and the processor 1020 are coupled.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units, or modules, and may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
  • the processor 1020 may cooperate with the memory 1030 to operate.
  • the processor 1020 may execute program instructions stored in the memory 1030. At least one of the at least one memory may be included in the processor.
  • the steps of the above method can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
  • the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability.
  • the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processing circuit (digital signal processor, DSP), a dedicated integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processing circuit
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • Programming logic devices discrete gates or transistor logic devices, discrete hardware components.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the memory in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • static random access memory static random access memory
  • dynamic RAM dynamic random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate synchronous dynamic random access memory double data rate SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • serial link DRAM SLDRAM
  • direct rambus RAM direct rambus RAM
  • the computing device 1000 may further include a communication interface 1010 for communicating with other devices through a transmission medium, so that the device used in the computing device 1000 can communicate with other devices.
  • the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.
  • the transceiver when the communication interface is a transceiver, the transceiver may include an independent receiver and an independent transmitter; it may also be a transceiver with integrated transceiver functions, or an interface circuit.
  • the computing device 1000 may also include a communication line 1040.
  • the communication interface 1010, the processor 1020, and the memory 1030 may be connected to each other through a communication line 1040;
  • the communication line 1040 may be a peripheral component interconnection standard (peripheral component interconnect, PCI for short) bus or an extended industry standard architecture (extended industry standard architecture) , Referred to as EISA) bus and so on.
  • the communication line 1040 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 10 to represent, but it does not mean that there is only one bus or one type of bus.
  • embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned region-based The method of communication between IOT devices of the block chain.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the above-mentioned blockchain-based inter-IOT device communication method.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种基于区块链的物联网IOT设备间通信的方法及装置,适用于包括路由链和至少一个分组链的联盟链,其中,方法包括:接收第一IOT设备的获取请求,根据获取请求,通过路由链确定第二IOT设备所属的分组链,根据获取请求,通过第二IOT设备所属的分组链获取获取请求的应答响应。在IOT设备间通信时,无需分发共享密钥,提高了通信效率。

Description

一种基于区块链的物联网IOT设备间通信的方法及装置
相关申请的交叉引用
本申请要求在2019年06月13日提交中国专利局、申请号为201910509596.0、申请名称为“一种基于区块链的物联网IOT设备间通信的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种基于区块链(BlockChain)的IOT(Internet of Things,物联网)设备间通信的方法及装置。
背景技术
区块链是由一系列区块组成的一条链,每个区块记录本块的数据及上一块的哈希值,所有区块通过这种方式前后相继组成一条链。区块链所基于的密码学技术和去中心化思想使链上的历史信息无法被篡改。
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,物联网技术也不例外,但由于金融、支付行业的安全性、实时性要求,也对技术提出的更高的要求。
如图1为现有技术中的基于比特币***组建的物联网***,该物联网***中包括智能网关、IOT设备和云存储平台,其中,智能网关为该物联网***中的矿工节点,当IOT设备之间需要通信时,矿工节点会生成共享密钥并分发至该待通信的IOT设备,以使得该待通信的IOT设备之间可以进行加密通信。
但该种方式中,每次IOT设备之间需要通信时,都需要矿工节点生成共享密钥,并分发至该待通信的IOT设备。该方式中,若物联网***中存在大量待通信的IOT设备,则矿工节点需要执行大量的生成、分发共享密钥的工作,矿工节点的工作负荷过大。
发明内容
本发明实施例提供一种基于区块链的IOT设备间通信的方法及装置,用以在IOT设备间通信时,无需分发共享密钥,且提高通信效率的方式。
本发明实施例提供的一种基于区块链的IOT设备间通信的方法,适用于包括路由链和至少一个分组链的联盟链;
所述方法包括:
接收第一IOT设备的获取请求;所述获取请求用于获取第二IOT设备的第一数据;
根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链;所述路由链用于在确定所述第一IOT设备通过第一身份验证后返回所述第二IOT设备所属的分组链;
根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应;所述第二IOT设备所属的分组链用于在确定所述第一IOT设备通过第二身份验证后,返回所述获取请求的应答响应;所述应答响应用于获取所述第一数据。
上述技术方案中,第一IOT设备通过联盟链访问第二IOT设备,第一IOT设备向联盟链发送获取第二IOT设备的第一数据的获取请求,并根据获取请求通过路由链确定第二 IOT设备所属的分组链,以及通过第二IOT设备所属的分组链获取应答响应,第一IOT设备与第二IOT设备无需直接通信,则无需分发共享密钥,而是经过路由链和分组链获取第二IOT设备的应答响应,用于获取第一数据,提高了第一IOT设备和第二IOT设备之间的通信效率,该技术方案适用于大规模的物联网***中大量IOT设备间的通信。进一步的,路由链用于对第一IOT设备进行第一身份验证,分组链用于对第一IOT设备进行第二身份验证,相当于两层数据访问控制,提高了数据访问的安全性。
可选的,所述路由链设置有第一智能合约;
所述根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链,包括:
根据所述获取请求,调用所述第一智能合约,通过所述第一智能合约确定所述第一IOT设备为经过所述路由链认证的IOT设备,并通过所述第一智能合约确定所述第二IOT设备所属的分组链。
上述技术方案中,调用路由链的第一智能合约,相当于采用第一智能合约实现路由链功能的多样化,通过第一智能合约的判断功能,判断第一IOT设备是否为经过路由链认证的IOT设备;以及将第一智能合约作为路由链中的路由表,用于确定第二IOT设备所属的分组链。
可选的,所述分组链设置有归属于所述分组链的各IOT设备的第二智能合约;
所述根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应,包括:
根据所述获取请求,调用所述第二IOT设备的第二智能合约,通过所述第二IOT设备的第二智能合约确定所述第一IOT设备具有访问所述第二IOT设备的权限,并通过所述第二IOT设备的第二智能合约得到所述应答响应。
上述技术方案中,分组链设置有归属于分组链的各IOT设备的第二智能合约,根据获取请求,调用第二IOT设备的第二智能合约,相当于采用第二智能合约实现分组链功能的多样化,通过第二智能合约的判断功能,判断第一IOT设备是否具有访问第二IOT设备的权限;以及根据第二智能合约中的对应关系,确定出第二IOT设备的应答响应。
可选的,所述应答响应为所述第一数据的哈希值;
所述第一数据的哈希值是所述第二IOT设备将所述第一数据存储至分布式存储***后,所述分布式存储***返回的哈希值。
上述技术方案中,在确定第一IOT设备通过第一身份验证和第二身份验证之后,可以向第一IOT设备返回第一数据的哈希值,第一IOT设备可以根据该第一数据的哈希值从分布式存储***中获取第二IOT的第一数据。采用分布式存储***将第二IOT设备的数据分布存储于各服务器上,保障了数据的安全性,同时采用分布式存储***,在第一IOT设备通过第一数据的哈希值下载数据时,可以实现数据的完整性以及高速下载第一数据。
可选的,所述方法还包括:
接收所述第二IOT设备发送的上链请求;所述上链请求包括所述第二IOT设备的第二数据的哈希值;
根据所述上链请求,通过所述路由链确定所述第二IOT设备所属的分组链;
根据所述上链请求,通过所述第二IOT设备所属的分组链存储所述第二数据的哈希值。
上述技术方案中,第二IOT设备将第二数据的哈希值记录在上链请求中发送至联盟链,联盟链根据上链请求、路由链确定第二IOT设备所属的分组链以及根据第二IOT设备所属 的分组链存储第二数据的哈希值,相当于根据联盟链和分组链,将第二IOT设备的第二数据的哈希值存储至所属的分组链中,实现将不同类型的IOT设备进行分组,以及将不同类型的IOT设备的数据存储至所属的分组链中,从而高效的管理物联网***中的各IOT设备。
可选的,在所述接收第一IOT设备的获取请求之前,还包括:
接收所述第一IOT设备发送的注册请求;
根据所述注册请求,通过所述路由链对所述第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链;
通过所述第一IOT设备所属的分组链确定所述第一IOT设备的第二智能合约;
将所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链的信息存储至所述第一智能合约中;所述第一IOT设备所属的分组链的信息中记录有所述第一IOT设备的第二智能合约在所属的分组链中的地址。
上述技术方案中,第一IOT设备可以向联盟链发送注册请求,路由链对第一IOT设备的IOT设备ID进行认证,并在认证通过后,生成第一IOT设备的身份证书;路由链确定第一IOT设备所属的分组链,并通过分组链确定第一IOT设备的第二智能合约;将第一IOT设备的身份证书及第一IOT设备所属的分组链的信息存储至第一智能合约中,用于在注册完成后,第一IOT设备的数据上链以及访问其他被访问IOT设备时的第一身份验证和第二身份验证。
可选的,所述第一智能合约中记录有IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系,以及IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系;
所述第二智能合约中记录有IOT设备ID、时间戳和IOT设备的数据的哈希值的对应关系。
上述技术方案中,第一智能合约中记录有预设的对应关系,用于确定物联网***中各IOT设备的完整路径,该对应关系中,第一个对应关系为IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系;第二个对应关系为IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系,通过第一智能合约中预设的对应关系,可以在获取到被访问IOT设备的信息时,确定出被访问IOT设备所属的分组链,以及该被访问IOT设备的第二智能合约在所属分组链中的地址,从而可以调用该被访问IOT设备的第二智能合约。进一步的,第二智能合约中同样记录有预设的对应关系,用于确定该被访问IOT设备的数据的哈希值,该对应关系为被访问IOT设备ID、时间戳和被访问IOT设备的数据的哈希值,通过第二智能合约中预设的对应关系,可以在获取到时间信息和被访问IOT设备ID后,确定出被访问IOT设备的数据的哈希值,从而将被访问IOT设备的数据的哈希值返回访问IOT设备,实现访问IOT设备获取被访问IOT设备的数据。
相应的,本发明实施例还提供了一种基于区块链的IOT设备间通信的装置,适用于包括路由链和至少一个分组链的联盟链;
所述装置包括:
接收单元,用于接收第一IOT设备的获取请求;所述获取请求用于获取第二IOT设备的第一数据;
处理单元,用于根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分 组链;所述路由链用于在确定所述第一IOT设备通过第一身份验证后返回所述第二IOT设备所属的分组链;
所述处理单元,还用于根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应;所述第二IOT设备所属的分组链用于在确定所述第一IOT设备通过第二身份验证后,返回所述获取请求的应答响应;所述应答响应用于获取所述第一数据。
可选的,所述路由链设置有第一智能合约;
所述处理单元,具体用于:
根据所述获取请求,调用所述第一智能合约,通过所述第一智能合约确定所述第一IOT设备为经过所述路由链认证的IOT设备,并通过所述第一智能合约确定所述第二IOT设备所属的分组链。
可选的,所述分组链设置有归属于所述分组链的各IOT设备的第二智能合约;
所述处理单元,具体用于:
根据所述获取请求,调用所述第二IOT设备的第二智能合约,通过所述第二IOT设备的第二智能合约确定所述第一IOT设备具有访问所述第二IOT设备的权限,并通过所述第二IOT设备的第二智能合约得到所述应答响应。
可选的,所述应答响应为所述第一数据的哈希值;
所述第一数据的哈希值是所述第二IOT设备将所述第一数据存储至分布式存储***后,所述分布式存储***返回的哈希值。
可选的,所述处理单元,还用于:
控制所述接收单元接收所述第二IOT设备发送的上链请求;所述上链请求包括所述第二IOT设备的第二数据的哈希值;
根据所述上链请求,通过所述路由链确定所述第二IOT设备所属的分组链;
根据所述上链请求,通过所述第二IOT设备所属的分组链存储所述第二数据的哈希值。
可选的,所述处理单元,还用于:
在控制所述接收单元接收第一IOT设备的获取请求之前,接收所述第一IOT设备发送的注册请求;
根据所述注册请求,通过所述路由链对所述第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链;
通过所述第一IOT设备所属的分组链确定所述第一IOT设备的第二智能合约;
将所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链的信息存储至所述第一智能合约中;所述第一IOT设备所属的分组链的信息中记录有所述第一IOT设备的第二智能合约在所属的分组链中的地址。
可选的,所述第一智能合约中记录有IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系,以及IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系;
所述第二智能合约中记录有IOT设备ID、时间戳和IOT设备的数据的哈希值的对应关系。
相应的,本发明实施例还提供了一种计算设备,包括:
存储器,用于存储程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述基于区块链的IOT设备间通信的方法。
相应的,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述基于区块链的IOT设备间通信的方法。
相应的,本申请提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述基于区块链的IOT设备间通信的方法。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中的基于比特币***组建的物联网***;
图2为本发明实施例提供的一种***架构的示意图;
图3为本发明实施例提供的一种基于区块链的IOT设备间通信的方法的流程示意图;
图4为本发明实施例提供的路由链对第一IOT设备进行身份认证;
图5为本发明实施例提供的第一IOT设备注册的流程示意图;
图6为本发明实施例提供的第二IOT设备的数据哈希值上链的流程示意图;
图7为本发明实施例提供的另一种基于区块链的IOT设备间通信的方法的流程示意图;
图8为本发明实施例提供的另一种***架构的示意图;
图9为本发明实施例提供的一种基于区块链的IOT设备间通信的装置的结构示意图;
图10为本申请提供的一种计算设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
金融领域中通常涉及到多个***,比如办公***、生产***、运维***等,办公***可以用于执行金融领域内部的各项事务,而生产***可以用于执行金融领域中产生的业务;相应地,运维***可以对办公***和生产***进行监督,从而保证办公***和生产***的正常运行。通过多个***的协同运作,可以保证金融领域快速、健康地发展。基于此,将办公***、生产***、运维***中各设备组成物联网***,并结合本发明实施例提供的基于区块链的IOT设备间通信的方法,可实现金融领域内各IOT设备之间的高效通信以及保障数据的安全性。
图2示例性的示出了本发明实施例提供的基于区块链的IOT设备间通信的方法所适用的物联网***的***架构,该***架构包括联盟链、分布式存储***、IOT设备集群、应用程序服务器。
联盟链包括路由链和至少一个分组链;IOT设备集群中包括多个IOT设备,IOT设备 通过应用程序服务器将数据保存至分布式存储***中,且将存储数据的信息存储至联盟链中,IOT设备之间通过应用程序服务器、联盟链进行通信;应用程序服务器可以作为单独的服务器,也可以集成于联盟链中,为方便下述描述,可以将应用程序服务器集成于联盟链中,IOT设备与联盟链直接通信;分布式存储***可以是IPFS(InterPlanetary File System,星际文件***)***。
为方便描述,IOT设备间通信的方法中,以两个IOT设备为例进行说明,分别为第一IOT设备和第二IOT设备。其中,第一IOT设备为访问IOT设备或主动访问IOT设备,第二IOT设备为待访问IOT设备或被访问IOT设备。在第一IOT设备通过联盟链访问第二IOT设备时,联盟链接收第一IOT设备的获取请求,联盟链中路由链用于对第一IOT设备进行第一身份验证以及确定第二IOT设备所属的分组链;联盟链中分组链用于对第一IOT设备进行第二身份验证以及确定上述获取请求的应答响应。
具体的,路由链中可以设置有两个智能合约,分别实现上述两种功能,如路由链调用第一个智能合约对第一IOT设备的进行第一身份验证,以及调用第二个智能合约确定第二IOT设备所属的分组链。路由链中还可以设置一个智能合约,可以叫做第一智能合约,路由链调用该第一智能合约用于对第一IOT设备进行第一身份验证以及确定第二IOT设备所属的分组链。
本发明实施例中,第一智能合约在对第一IOT设备进行第一身份验证时,相当于判断该第一IOT设备是否为该物联网***中的已注册设备,或判断该第一IOT设备是否为经过路由链认证的IOT设备,若是,则确定该第一IOT设备通过第一智能合约的第一身份验证。第一IOT设备的注册过程在下述实施例中进行具体描述。
第一智能合约在确定第二IOT设备所属的分组链时,可以根据第一智能合约中记录的该物联网***中各IOT设备的完整路径进行确定,该完整路径可以通过预设的对应关系实现,该预设的对应关系可以理解为一张路由表。具体的,第一个对应关系为IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系;第二个对应关系为IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系。
具体实现中,路由链的第一智能合约可以通过两个Map(Map1和Map2)来记录IOT设备的路径信息,Map1的结构为Map1[servicetype][netID],其中,第一个key为IOT设备的服务类型,第二个key为IOT设备所属网络ID,value值为set chainID,即IOT设备所属的分组链ID;Map2的结构为Map2[set chainID][deviceID],其中,第一个key为IOT设备所属的分组链ID,第二个key为IOT设备ID,value值为IOT设备的第二智能合约在所属的分组链中的地址。
分组链用于对第一IOT设备进行第二身份验证以及确定获取请求的应答响应,其中,应答响应用于获取第二IOT设备的数据。具体的,分组链设置有归属于分组链的各IOT设备的智能合约,即各IOT设备对应自己的智能合约,每个IOT设备可以设置两个智能合约,分别实现对第一IOT设备的第二身份验证以及确定应答响应两种功能,也可以设置一个智能合约,可以叫做第二智能合约,路由链调用该第二智能合约用于对第一IOT设备进行第二身份验证以及确定应答响应。
路由链调用第二IOT设备的第二智能合约对第一IOT设备进行第二身份验证,相当于判断第一IOT设备是否有权限访问第一IOT设备的数据,若是,则确定该第一IOT设备 通过第二智能合约的第二身份验证。
第二IOT设备的数据可以为第二IOT设备的运行数据、参数信息等。第二智能合约中可以记录有该第二IOT设备的设备ID、时间戳和数据存储位置三者的对应关系,则此时应答响应为数据存储位置;第二智能合约中也可以记录有该第二IOT设备的设备ID、时间戳和数据的哈希值三者的对应关系,则此时应答响应为数据的哈希值,其中,数据的哈希值是第二IOT设备将数据存储至分布式存储***时,分布式存储***返回给该数据的哈希值。
具体实现中,路由链可以通过一个Map(Map3)来记录IOT设备的数据的哈希值,Map3的结构为Map[deviceID][timestamp],第一个key为IOT设备ID,第二个key为IOT设备上传数据时的时间戳,value值为IPFS返回的数据的哈希值。
基于上述描述,图3示例性的示出了本发明实施例提供的一种基于区块链的IOT设备间通信的方法的流程,该流程可以由基于区块链的IOT设备间通信的装置执行。
如图3所示,该流程具体包括:
步骤301,接收第一IOT设备的获取请求。
本发明实施例中,获取请求用于获取第二IOT设备的第一数据,获取请求中可以记录有第一IOT设备的参数信息、第二IOT设备的参数信息,参数信息可以包括IOT设备的设备ID,当然,参数信息还可以包括IOT设备的设备序列号、服务类型、所属网络ID、所属服务类型等。
步骤302,根据获取请求,通过路由链确定第二IOT设备所属的分组链。
可选的,根据获取请求,调用路由链中的第一智能合约判断第一IOT设备是否通过第一身份验证,相当于调用第一智能合约确定第一IOT设备是否为经过路由链认证的IOT设备,若是,则通过第一智能合约确定第二IOT设备所属的分组链;否则,向该第一IOT设备返回拒绝消息。该技术方案中,在第一IOT设备通过联盟链访问第二IOT设备的数据时,先要对第一IOT设备进行第一身份验证,确保只有被路由链认证通过的IOT设备才能访问第二IOT设备,保障了第二IOT设备的数据的安全性。
也就是说,路由链在对第一IOT设备进行第一身份验证之前,可以存在路由链对第一IOT设备进行认证,相当于将第一IOT设备注册进联盟链,具体的,接收第一IOT设备发送的注册请求,根据注册请求,通过路由链对第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定第一IOT设备的身份证书及第一IOT设备所属的分组链,通过第一IOT设备所属的分组链确定第一IOT设备的第二智能合约,将第一IOT设备的身份证书及第一IOT设备所属的分组链的信息存储至第一智能合约中;其中,第一IOT设备所属的分组链的信息中记录有第一IOT设备的第二智能合约在所属的分组链中的地址。
在一种可以实现的方式中,可以对第一IOT设备进行注册,接收第一IOT设备发送的注册请求,该注册请求中可以包括第一IOT设备的参数信息,如设备ID、设备序列号、服务类型、所属网络ID、所属组织等,如图4所示,路由链中具有仲裁性质的节点可以对该第一IOT设备进行身份认证,并分别在确定该第一IOT设备通过身份认证后签名,将签名的存证作为该第一IOT设备的身份证书,身份证书中记录该第一IOT设备的设备ID、设备序列号、服务类型、所属网络ID、所属组织等,将第一IOT设备的身份证书存储至第一智能合约中。也就是说,在调用第一智能合约确定第一IOT设备是否是经过路由链认证的IOT设备时,可以判断第一智能合约中是否存在有第一IOT设备的身份证书,若是,则确定第一IOT设备经过第一身份验证。在路由链生成该第一IOT设备的身份证书之后,还可 以根据第一IOT设备的服务类型、所属网络ID等信息,确定第一IOT设备所属的分组链,将第一IOT设备的身份证书、第一IOT设备所属的分组链信息一起存储至第一智能合约中。通过第一IOT设备所属的分组链确定第一IOT设备的第二智能合约,第一IOT设备所属的分组链将第一IOT设备的第二智能合约的地址返回至路由链,路由链将该第二智能合约的地址作为所属的分组链信息一起存储至第一智能合约中,从而第一智能合约可以根据第一IOT设备所属的分组链的信息生成第一IOT设备的完整路径。
结合图5,第一IOT设备注册的具体流程如下:
步骤501,第一IOT设备向路由链发送注册请求。
步骤502,路由链中具有仲裁性质的节点对第一IOT设备进行签名,签名后的存证作为第一IOT设备的身份证书;
步骤503,路由链确定第一IOT设备所属的分组链;
步骤504,路由链向分组链发送部署第二智能合约的交易;
步骤505,分组链部署第一IOT设备的第二智能合约;
步骤506,分组链向路由链发送第二智能合约的地址;
步骤507,路由链通过两个Map来记录第一IOT设备的路径信息;
步骤508,路由链将第一IOT设备的身份证书和路径信息存储至第一智能合约中;
步骤509,路由链发送注册成功消息至第一IOT设备。
本发明实施例中,路由链中具有仲裁性质的节点可以包括三类节点,分别是组织节点、仲裁节点、存证节点,在第一IOT设备发送注册请求后,该三类节点分别对该第一IOT设备的参数信息进行验证,并在验证通过后进行签名,路由链将具有该三类节点签名的存证作为该第一IOT设备的身份证书。此外,路由链中具有仲裁性质的节点不仅可以包括组织节点、仲裁节点、存证节点,还可以包括如监管节点等其他节点。
需要说明的是,第二IOT设备为联盟链进行注册后的设备,路由链的第一智能合约中记录有第二IOT设备的完整路径,即可以根据第二IOT设备的设备信息,如第二IOT设备的服务类型、IOT设备所属网络ID、设备ID确定出第二IOT设备的完整路径,即确定出第二IOT设备所属的分组链ID和第二IOT设备的第二智能合约在所属的分组链中的地址。
步骤303,根据获取请求,通过第二IOT设备所属的分组链获取获取请求的应答响应。
第二IOT设备所属的分组链先对第一IOT设备进行第二身份验证,相当于调用第二IOT设备的第二智能合约确定第一IOT设备是否具有访问第二IOT设备的数据的权限,若是,则通过第一IOT设备的第二智能合约确定应答响应;否则,向该第一IOT设备返回拒绝消息。
此处,第一IOT设备是否具有访问第二IOT设备的数据的权限,理解为,第一IOT设备可以提供访问第二IOT设备的数据的Token值,或者向第二IOT设备支付相应的金钱。
本发明实施例中,第二IOT设备经联盟链进行注册后,可以将生成的第二数据存储至分布式存储***中,并接收分布式存储***返回的该第二数据的哈希值,第二IOT设备将该第二数据的哈希值记录在上链请求中发送至路由链以请求上链,第二数据的哈希值可以是经第二IOT设备的密钥加密后的数据。相应的,联盟链***接收第二IOT设备发送的上链请求,根据上链请求,通过路由链确定第二IOT设备所属的分组链,再根据上链请求,通过第二IOT设备所属的分组链存储该第二数据的哈希值。可选的,第二IOT设备所属的 分组链调用第二IOT设备的第二智能合约,将第二数据的哈希值存储至第二智能合约中。
结合图6,第二IOT设备的数据的哈希值上链的具体流程如下:
步骤601,第二IOT设备将第二数据发送至分布式存储***;
步骤602,分布式存储***存储第二数据,并生成第二数据的哈希值;
步骤603,分布式存储***将第二数据的哈希值发送至第二IOT设备;
步骤604,第二IOT设备将第二数据的哈希值加密,生成上链请求;
步骤605,第二IOT设备将上链请求发送至路由链;
步骤606,路由链根据上链请求确定第二IOT设备的身份证书;
步骤607,路由链根据第二IOT设备的身份证书中的服务类型和网络ID在第一智能合约中确定第二IOT设备所属的分组链;
步骤608,路由链根据第二IOT设备所属的分组链ID、第二IOT设备的设备ID在第一智能合约中确定第二IOT设备的第二智能合约的地址;
步骤609,路由链将加密后的第二数据的哈希值发送至分组链;
步骤610,分组链将该加密后的第二数据的哈希值存储至第二智能合约中。
基于上述描述,第一IOT设备向联盟链***发送获取第二IOT设备的第一数据的哈希值的请求,在确定第一IOT设备通过第一身份验证和第二身份验证之后,可以向第一IOT设备返回第一数据的哈希值,第一IOT设备可以根据该第一数据的哈希值从分布式存储***中获取第二IOT的第一数据。
为了更好的解释本发明实施例,下面将在具体的实施场景下描述该基于区块链的IOT设备间通信的流程,如图7所示,具体如下:
步骤701,第一IOT设备向路由链发送获取请求;
步骤702,路由链根据第一智能合约对第一IOT设备进行第一身份验证;
步骤703,路由链确定第一IOT设备通过第一身份验证,从第一智能合约中确定第二IOT设备的第二智能合约的地址;
步骤704,路由链将第二智能合约的地址发送至分组链;
步骤705,分组链根据第二智能合约对第一IOT设备进行第二身份验证;
步骤706,分组链确定第一IOT设备通过第二身份验证,从第二智能合约中确定第一数据的哈希值;
步骤707,分组链将第一数据的哈希值发送至第一IOT设备;
步骤708,第一IOT设备将第一数据的哈希值发送至分布式存储***;
步骤709,分布式存储***返回第一数据至第一IOT设备。
此外,上述实施例中不仅可以将第二IOT设备的第二数据存储至分布式存储***中,当然,还可以将第二IOT设备的第二数据存储至云存储***上,如采用第三方的云存储***来存储数据,相应的,本发明实施例还提供一种***架构的示意图,可以如图8所示。相比于云存储***,分布式存储***将第二IOT设备的第二数据分布存储于各服务器上,保障了第二数据的安全性,同时采用分布式存储***,在第一IOT设备通过第二数据的哈希值下载数据时,可以实现第二数据的完整性以及高速下载第二数据。
上述技术方案中,第一IOT设备通过联盟链访问第二IOT设备,第一IOT设备向联盟链发送获取第二IOT设备的第一数据的获取请求,并根据获取请求通过路由链确定第二IOT设备所属的分组链,以及通过第二IOT设备所属的分组链获取应答响应,第一IOT设 备与第二IOT设备无需直接通信,则无需分发共享密钥,而是经过路由链和分组链获取第二IOT设备的应答响应,用于获取第一数据,提高了第一IOT设备和第二IOT设备之间的通信效率,该技术方案适用于大规模的物联网***中大量IOT设备间的通信。进一步的,路由链用于对第一IOT设备进行第一身份验证,分组链用于对第一IOT设备进行第二身份验证,相当于两层数据访问控制,提高了数据访问的安全性。
基于同一发明构思,图9示例性的示出了本发明实施例提供的一种基于区块链的IOT设备间通信的装置的结构,该装置可以执行基于区块链的IOT设备间通信的方法的流程。
该装置适用于包括路由链和至少一个分组链的联盟链;该装置包括:
接收单元901,用于接收第一IOT设备的获取请求;所述获取请求用于获取第二IOT设备的第一数据;
处理单元902,用于根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链;所述路由链用于在确定所述第一IOT设备通过第一身份验证后返回所述第二IOT设备所属的分组链;
所述处理单元902,还用于根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应;所述第二IOT设备所属的分组链用于在确定所述第一IOT设备通过第二身份验证后,返回所述获取请求的应答响应;所述应答响应用于获取所述第一数据。
可选的,所述路由链设置有第一智能合约;
所述处理单元902,具体用于:
根据所述获取请求,调用所述第一智能合约,通过所述第一智能合约确定所述第一IOT设备为经过所述路由链认证的IOT设备,并通过所述第一智能合约确定所述第二IOT设备所属的分组链。
可选的,所述分组链设置有归属于所述分组链的各IOT设备的第二智能合约;
所述处理单元902,具体用于:
根据所述获取请求,调用所述第二IOT设备的第二智能合约,通过所述第二IOT设备的第二智能合约确定所述第一IOT设备具有访问所述第二IOT设备的权限,并通过所述第二IOT设备的第二智能合约得到所述应答响应。
可选的,所述应答响应为所述第一数据的哈希值;
所述第一数据的哈希值是所述第二IOT设备将所述第一数据存储至分布式存储***后,所述分布式存储***返回的哈希值。
可选的,所述处理单元902,还用于:
控制所述接收单元901接收所述第二IOT设备发送的上链请求;所述上链请求包括所述第二IOT设备的第二数据的哈希值;
根据所述上链请求,通过所述路由链确定所述第二IOT设备所属的分组链;
根据所述上链请求,通过所述第二IOT设备所属的分组链存储所述第二数据的哈希值。
可选的,所述处理单元902,还用于:
在控制所述接收单元901接收第一IOT设备的获取请求之前,接收所述第一IOT设备发送的注册请求;
根据所述注册请求,通过所述路由链对所述第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链;
通过所述第一IOT设备所属的分组链确定所述第一IOT设备的第二智能合约;
将所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链的信息存储至所述第一智能合约中;所述第一IOT设备所属的分组链的信息中记录有所述第一IOT设备的第二智能合约在所属的分组链中的地址。
可选的,所述第一智能合约中记录有IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系,以及IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系;
所述第二智能合约中记录有IOT设备ID、时间戳和IOT设备的数据的哈希值的对应关系。
基于与上述图3所示的方法相同的构思,本申请还提供一种计算设备,如图10所示,该计算设备包括至少一个处理器1020,用于实现本申请实施例提供的图3中任一方法。
计算设备1000还可以包括至少一个存储器1030,用于存储程序指令和/或数据。存储器1030和处理器1020耦合。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。处理器1020可能和存储器1030协同操作。处理器1020可能执行存储器1030中存储的程序指令。所述至少一个存储器中的至少一个可以包括于处理器中。
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
应注意,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理电路(digital signal processor,DSP)、专用集成芯片(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态 随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的***和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
计算设备1000还可以包括通信接口1010,用于通过传输介质和其它设备进行通信,从而用于计算设备1000中的装置可以和其它设备进行通信。在本申请实施例中,通信接口可以是收发器、电路、总线、模块或其它类型的通信接口。在本申请实施例中,通信接口为收发器时,收发器可以包括独立的接收器、独立的发射器;也可以集成收发功能的收发器、或者是接口电路。
计算设备1000还可以包括通信线路1040。其中,通信接口1010、处理器1020以及存储器1030可以通过通信线路1040相互连接;通信线路1040可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述通信线路1040可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述基于区块链的IOT设备间通信的方法。
基于同一发明构思,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述基于区块链的IOT设备间通信的方法。
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (17)

  1. 一种基于区块链的物联网IOT设备间通信的方法,其特征在于,适用于包括路由链和至少一个分组链的联盟链;所述方法包括:
    接收第一IOT设备的获取请求;所述获取请求用于获取第二IOT设备的第一数据;
    根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链;所述路由链用于在确定所述第一IOT设备通过第一身份验证后返回所述第二IOT设备所属的分组链;
    根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应;所述第二IOT设备所属的分组链用于在确定所述第一IOT设备通过第二身份验证后,返回所述获取请求的应答响应;所述应答响应用于获取所述第一数据。
  2. 如权利要求1所述的方法,其特征在于,所述路由链设置有第一智能合约;
    所述根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链,包括:
    根据所述获取请求,调用所述第一智能合约,通过所述第一智能合约确定所述第一IOT设备为经过所述路由链认证的IOT设备,并通过所述第一智能合约确定所述第二IOT设备所属的分组链。
  3. 如权利要求1所述的方法,其特征在于,所述分组链设置有归属于所述分组链的各IOT设备的第二智能合约;
    所述根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应,包括:
    根据所述获取请求,调用所述第二IOT设备的第二智能合约,通过所述第二IOT设备的第二智能合约确定所述第一IOT设备具有访问所述第二IOT设备的权限,并通过所述第二IOT设备的第二智能合约得到所述应答响应。
  4. 如权利要求1至3任一项所述的方法,其特征在于,所述应答响应为所述第一数据的哈希值;
    所述第一数据的哈希值是所述第二IOT设备将所述第一数据存储至分布式存储***后,所述分布式存储***返回的哈希值。
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    接收所述第二IOT设备发送的上链请求;所述上链请求包括所述第二IOT设备的第二数据的哈希值;
    根据所述上链请求,通过所述路由链确定所述第二IOT设备所属的分组链;
    根据所述上链请求,通过所述第二IOT设备所属的分组链存储所述第二数据的哈希值。
  6. 如权利要求4所述的方法,其特征在于,在所述接收第一IOT设备的获取请求之前,还包括:
    接收所述第一IOT设备发送的注册请求;
    根据所述注册请求,通过所述路由链对所述第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链;
    通过所述第一IOT设备所属的分组链确定所述第一IOT设备的第二智能合约;
    将所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链的信息存储至所述第一智能合约中;所述第一IOT设备所属的分组链的信息中记录有所述第一IOT设备的第二智能合约在所属的分组链中的地址。
  7. 如权利要求6所述的方法,其特征在于,所述第一智能合约中记录有IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系,以及IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系;
    所述第二智能合约中记录有IOT设备ID、时间戳和IOT设备的数据的哈希值的对应关系。
  8. 一种基于区块链的物联网IOT设备间通信的装置,其特征在于,适用于包括路由链和至少一个分组链的联盟链;所述装置包括:
    接收单元,用于接收第一IOT设备的获取请求;所述获取请求用于获取第二IOT设备的第一数据;
    处理单元,用于根据所述获取请求,通过所述路由链确定所述第二IOT设备所属的分组链;所述路由链用于在确定所述第一IOT设备通过第一身份验证后返回所述第二IOT设备所属的分组链;
    所述处理单元,还用于根据所述获取请求,通过所述第二IOT设备所属的分组链获取所述获取请求的应答响应;所述第二IOT设备所属的分组链用于在确定所述第一IOT设备通过第二身份验证后,返回所述获取请求的应答响应;所述应答响应用于获取所述第一数据。
  9. 如权利要求8所述的装置,其特征在于,所述路由链设置有第一智能合约;
    所述处理单元,具体用于:
    根据所述获取请求,调用所述第一智能合约,通过所述第一智能合约确定所述第一IOT设备为经过所述路由链认证的IOT设备,并通过所述第一智能合约确定所述第二IOT设备所属的分组链。
  10. 如权利要求8所述的装置,其特征在于,所述分组链设置有归属于所述分组链的各IOT设备的第二智能合约;
    所述处理单元,具体用于:
    根据所述获取请求,调用所述第二IOT设备的第二智能合约,通过所述第二IOT设备的第二智能合约确定所述第一IOT设备具有访问所述第二IOT设备的权限,并通过所述第二IOT设备的第二智能合约得到所述应答响应。
  11. 如权利要求8至10任一项所述的装置,其特征在于,所述应答响应为所述第一数据的哈希值;
    所述第一数据的哈希值是所述第二IOT设备将所述第一数据存储至分布式存储***后,所述分布式存储***返回的哈希值。
  12. 如权利要求11所述的装置,其特征在于,所述处理单元,还用于:
    控制所述接收单元接收所述第二IOT设备发送的上链请求;所述上链请求包括所述第二IOT设备的第二数据的哈希值;
    根据所述上链请求,通过所述路由链确定所述第二IOT设备所属的分组链;
    根据所述上链请求,通过所述第二IOT设备所属的分组链存储所述第二数据的哈希值。
  13. 如权利要求11所述的装置,其特征在于,所述处理单元,还用于:
    在控制所述接收单元接收第一IOT设备的获取请求之前,接收所述第一IOT设备发送的注册请求;
    根据所述注册请求,通过所述路由链对所述第一IOT设备的IOT设备ID进行认证,并在认证通过后,确定所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链;
    通过所述第一IOT设备所属的分组链确定所述第一IOT设备的第二智能合约;
    将所述第一IOT设备的身份证书及所述第一IOT设备所属的分组链的信息存储至所述第一智能合约中;所述第一IOT设备所属的分组链的信息中记录有所述第一IOT设备的第二智能合约在所属的分组链中的地址。
  14. 如权利要求13所述的装置,其特征在于,所述第一智能合约中记录有IOT设备的服务类型、IOT设备所属网络ID、IOT设备所属的分组链ID的对应关系,以及IOT设备所属的分组链ID、IOT设备ID与IOT设备的第二智能合约在所属的分组链中的地址的对应关系;
    所述第二智能合约中记录有IOT设备ID、时间戳和IOT设备的数据的哈希值的对应关系。
  15. 一种计算设备,其特征在于,包括:
    存储器,用于存储程序指令;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至7任一项所述的方法。
  16. 一种计算机可读非易失性存储介质,其特征在于,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利要求1至7任一项所述的方法。
  17. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1至7任一所述方法。
PCT/CN2020/095199 2019-06-13 2020-06-09 一种基于区块链的物联网iot设备间通信的方法及装置 WO2020248981A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910509596.0 2019-06-13
CN201910509596.0A CN110278255B (zh) 2019-06-13 2019-06-13 一种基于区块链的物联网iot设备间通信的方法及装置

Publications (1)

Publication Number Publication Date
WO2020248981A1 true WO2020248981A1 (zh) 2020-12-17

Family

ID=67960765

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/095199 WO2020248981A1 (zh) 2019-06-13 2020-06-09 一种基于区块链的物联网iot设备间通信的方法及装置

Country Status (2)

Country Link
CN (1) CN110278255B (zh)
WO (1) WO2020248981A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297618A (zh) * 2021-05-28 2021-08-24 广东工业大学 基于区块链的抗攻击访问控制方法、***、设备及介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110278255B (zh) * 2019-06-13 2021-10-15 深圳前海微众银行股份有限公司 一种基于区块链的物联网iot设备间通信的方法及装置
CN113206817B (zh) * 2020-02-03 2022-07-12 中移物联网有限公司 一种设备连接确认方法和区块链网络
CN111600896A (zh) * 2020-05-21 2020-08-28 昆明大棒客科技有限公司 基于aws云平台的数据上链方法、装置、设备及***

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254905A1 (en) * 2015-11-30 2018-09-06 Sam Gu Chun Iot-based things management system and method using block-chain authentication
CN108540536A (zh) * 2018-03-16 2018-09-14 深圳前海微众银行股份有限公司 基于区块链的网络海量业务处理方法、设备及存储介质
CN109446830A (zh) * 2018-11-13 2019-03-08 中链科技有限公司 基于区块链的数据中心环境信息处理方法及装置
CN109492380A (zh) * 2019-01-11 2019-03-19 四川虹微技术有限公司 一种设备认证方法、装置及区块链节点
CN110278255A (zh) * 2019-06-13 2019-09-24 深圳前海微众银行股份有限公司 一种基于区块链的物联网iot设备间通信的方法及装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10298396B1 (en) * 2015-11-10 2019-05-21 Wells Fargo Bank, N.A. Identity management service via virtual passport
US10679215B2 (en) * 2016-02-22 2020-06-09 Bank Of America Corporation System for control of device identity and usage in a process data network
CN107306183B (zh) * 2016-04-22 2021-12-21 索尼公司 客户端、服务端、方法和身份验证***
CN107592293A (zh) * 2017-07-26 2018-01-16 阿里巴巴集团控股有限公司 区块链节点间通讯方法、数字证书管理方法、装置和电子设备
CN107682331B (zh) * 2017-09-28 2020-05-12 复旦大学 基于区块链的物联网身份认证方法
US20190114637A1 (en) * 2017-10-13 2019-04-18 John D. Rome Method and system to unlock account access via effort metrics
CN108521418B (zh) * 2018-04-04 2020-08-18 广州广电运通金融电子股份有限公司 一种融合区块链及生物特征识别的身份认证方法和***
CN108632268B (zh) * 2018-04-28 2021-04-09 腾讯科技(深圳)有限公司 区块链访问的鉴权方法和装置、存储介质、电子装置
CN109033406B (zh) * 2018-08-03 2020-06-05 上海点融信息科技有限责任公司 用于搜索区块链数据的方法、装置及存储介质
CN109583184B (zh) * 2018-10-09 2020-08-04 阿里巴巴集团控股有限公司 身份验证方法及装置和电子设备
CN109447643B (zh) * 2018-10-31 2022-12-20 ***股份有限公司 一种基于区块链的数据共享***及数据共享方法
CN109815657B (zh) * 2018-12-14 2022-10-28 深圳壹账通智能科技有限公司 基于联盟链的身份认证方法、装置、计算机可读存储介质及终端设备
CN109617896B (zh) * 2018-12-28 2021-07-13 浙江省公众信息产业有限公司 一种基于智能合约的物联网访问控制方法和***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254905A1 (en) * 2015-11-30 2018-09-06 Sam Gu Chun Iot-based things management system and method using block-chain authentication
CN108540536A (zh) * 2018-03-16 2018-09-14 深圳前海微众银行股份有限公司 基于区块链的网络海量业务处理方法、设备及存储介质
CN109446830A (zh) * 2018-11-13 2019-03-08 中链科技有限公司 基于区块链的数据中心环境信息处理方法及装置
CN109492380A (zh) * 2019-01-11 2019-03-19 四川虹微技术有限公司 一种设备认证方法、装置及区块链节点
CN110278255A (zh) * 2019-06-13 2019-09-24 深圳前海微众银行股份有限公司 一种基于区块链的物联网iot设备间通信的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHOU, WEI: "Research on Security Authentication Method for Internet of Things", INFORMATION SCIENCE AND TECHNOLOGY, CHINESE MASTER’S THESES FULL-TEXT DATABASE, no. 05, 15 May 2019 (2019-05-15), pages 1 - 80, XP055764484, ISSN: 1674-0246 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297618A (zh) * 2021-05-28 2021-08-24 广东工业大学 基于区块链的抗攻击访问控制方法、***、设备及介质

Also Published As

Publication number Publication date
CN110278255B (zh) 2021-10-15
CN110278255A (zh) 2019-09-24

Similar Documents

Publication Publication Date Title
WO2020248981A1 (zh) 一种基于区块链的物联网iot设备间通信的方法及装置
WO2021047445A1 (zh) 区块链网络中的数据处理方法、装置、存储介质和计算机设备
CN111010382B (zh) 在区块链网络中处理数据请求的方法和装置
CN110933187B (zh) 基于区块链共识加密机制的物联网数据传输***
US20190312877A1 (en) Block chain mining method, device, and node apparatus
CN110266764B (zh) 基于网关的内部服务调用方法、装置及终端设备
CN108810137A (zh) 一种联盟区块链***
DE112019003309T5 (de) Vorrichtung für einen sicheren sendungsempfang mit delegierungskette
CN107493280A (zh) 用户认证的方法、智能网关及认证服务器
CN103384237A (zh) 一种共享IaaS业务云账号的方法、及共享平台和网络装置
CN111800410B (zh) 基于区块链的数据访问控制方法、电子设备和存储介质
CN110992178A (zh) 区块链节点的验证方法、装置、计算机设备及存储介质
CN110445765B (zh) 基于区块链的数据共享方法、终端设备及介质
CN113255014B (zh) 一种基于区块链的数据处理方法以及相关设备
CN110908812A (zh) 业务数据处理方法、装置、可读存储介质和计算机设备
DE102017122227A1 (de) System, insbesondere authentizitätssystem
CN110933173A (zh) 一种基于区块链技术的组网方法和装置
CN110910110A (zh) 一种数据处理方法、装置及计算机存储介质
CN111260421B (zh) 一种基于区块链的电子***管控方法及装置
CN111970253A (zh) Pep的配置方法、装置、电子设备和存储介质
CN116382675A (zh) 一种接口配置与调用方法、装置、***及介质
CN113988787B (zh) 网络配置方法及装置、存储介质
CN112436946B (zh) 一种基于区块链的通信授权方法、装置、设备和存储介质
CN116192393A (zh) 车辆管理的方法、装置、设备以及存储介质
CN114722429A (zh) 身份标识共享方法、装置、电子设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20822699

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20822699

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09/08/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20822699

Country of ref document: EP

Kind code of ref document: A1