[go: up one dir, main page]

CN110062041A - A kind of method and device of the IOT equipment changing based on block chain - Google Patents

A kind of method and device of the IOT equipment changing based on block chain Download PDF

Info

Publication number
CN110062041A
CN110062041A CN201910292923.1A CN201910292923A CN110062041A CN 110062041 A CN110062041 A CN 110062041A CN 201910292923 A CN201910292923 A CN 201910292923A CN 110062041 A CN110062041 A CN 110062041A
Authority
CN
China
Prior art keywords
server
iot
theme
deployment
contract
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910292923.1A
Other languages
Chinese (zh)
Other versions
CN110062041B (en
Inventor
刘丽平
苏小康
张开翔
范瑞彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910292923.1A priority Critical patent/CN110062041B/en
Publication of CN110062041A publication Critical patent/CN110062041A/en
Priority to PCT/CN2020/079360 priority patent/WO2020207194A1/en
Application granted granted Critical
Publication of CN110062041B publication Critical patent/CN110062041B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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/10Protocols in which an application is distributed across nodes in the network
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Medical Informatics (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a kind of method and devices of IOT equipment changing based on block chain, this method is suitable for IOT equipment alliance system, this method comprises: first server generates the first transaction request, first transaction request is sent to block catenary system, block catenary system calls equipment management contract to generate and store the first transaction log, and second server determines whether to subscribe to the first IOT equipment theme according to the first transaction log.When changing equipment in systems, first server only needs to be written the transaction of change facility information in block catenary system, then second server can be by subscribing to equipment management theme, obtain the information of change equipment, and for the corresponding actions that change facility information executes, whole system changes the binding or mapping movement of equipment without bridge, and it avoids adhering to inconsistence problems present in different financial institutions separately as MQ and bridge service, O&M cost is reduced, suitable for fast-developing IOT group network system.

Description

一种基于区块链的IOT设备变更的方法及装置A method and device for changing IOT equipment based on blockchain

技术领域technical field

本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种基于区块链(BlockChain)的IOT(Internet of Things,物联网)设备变更的方法及装置。The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular, to a method and apparatus for changing an IOT (Internet of Things, Internet of Things) device based on a blockchain (BlockChain).

背景技术Background technique

MQTT(Message Queue Telemetry Transport,遥感传输)协议是ISO标准(ISO/IECPRF 20922)下基于发布/订阅范式的消息协议。MQTT协议工作在TCP/IP(TransmissionControl Protocol/Internet Protocol,传输控制协议/因特网互联协议)协议族上,是为硬件性能低下的远程设备以及在网络状况不理想的情况下设计的发布/订阅型消息协议。The MQTT (Message Queue Telemetry Transport) protocol is a message protocol based on the publish/subscribe paradigm under the ISO standard (ISO/IECPRF 20922). The MQTT protocol works on the TCP/IP (Transmission Control Protocol/Internet Protocol) protocol suite, and is a publish/subscribe message designed for remote devices with low hardware performance and under unsatisfactory network conditions. protocol.

金融科技领域中,基于MQTT协议构建的IOT设备联盟系统可以如图1所示,金融机构内部的组网可以为多个IOT设备通过MQTT集群与MQ(Message Queue,消息队列)连接,金融机构外部的组网为将本金融机构的MQ通过桥接方式与其他金融机构的MQ连接,例如,金融机构1的MQ1与金融机构2的MQ2之间通过桥接器连接,该桥接器用于从MQ1订阅事件发布至MQ2以及从MQ2订阅事件发布至MQ1。In the field of financial technology, the IOT device alliance system based on the MQTT protocol can be shown in Figure 1. The internal networking of a financial institution can connect multiple IOT devices to MQ (Message Queue, message queue) through an MQTT cluster. The networking is to connect the MQ of this financial institution with the MQ of other financial institutions through a bridge. For example, MQ1 of financial institution 1 and MQ2 of financial institution 2 are connected through a bridge, which is used to subscribe event publications from MQ1 To MQ2 and subscribe events from MQ2 to publish to MQ1.

现有IOT设备联盟系统中,一旦出现某金融机构变更设备,如新增设备、删除设备或者更新设备,则需要将该设备信息发送至其他金融机构,进一步的,金融机构之间的桥接器需要完成该变更设备的绑定或者映射动作,又由于MQ和桥接服务分属不同的金融机构,运维成本较高。In the existing IOT equipment alliance system, once a financial institution changes equipment, such as adding equipment, deleting equipment or updating equipment, the equipment information needs to be sent to other financial institutions. Further, the bridge between financial institutions needs to be To complete the binding or mapping action of the changed device, and because MQ and bridge services belong to different financial institutions, the operation and maintenance cost is high.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种基于区块链的IOT设备变更的方法及装置,在基于MQTT协议构建的IOT设备联盟系统中,降低IOT设备变更的运维成本。Embodiments of the present invention provide a method and device for changing an IOT device based on a blockchain, which reduces the operation and maintenance cost of changing an IOT device in an IOT device alliance system constructed based on the MQTT protocol.

本发明实施例提供的一种基于区块链的IOT设备变更的方法,适用于包括多个服务器的IOT设备联盟系统;每个服务器用于管理各自的IOT设备;所述多个服务器通过区块链系统进行IOT设备的信息交互;A method for changing an IOT device based on a blockchain provided by an embodiment of the present invention is applicable to an IOT device alliance system including multiple servers; each server is used to manage its own IOT device; The chain system conducts information exchange of IOT devices;

所述方法包括:The method includes:

第一服务器生成包含第一IOT设备信息的第一交易请求;所述第一IOT设备信息为所述第一服务器下变更的IOT设备的设备信息;所述第一服务器为所述多个服务器中的任一个;The first server generates a first transaction request including first IOT device information; the first IOT device information is the device information of the IOT device changed under the first server; the first server is one of the multiple servers. any of the;

所述第一服务器将所述第一交易请求发送至所述区块链系统;所述第一交易请求用于指示所述区块链系统调用设备管理合约生成并存储第一交易日志;所述第一交易日志记录有设备管理主题及所述第一IOT设备信息;所述IOT设备联盟系统中的任一服务器均订阅有所述设备管理主题;所述第一交易日志用于第二服务器确定是否订阅所述第一IOT设备信息指示的第一IOT设备主题;所述第二服务器为所述IOT设备联盟系统中除所述第一服务器以外的任一服务器。The first server sends the first transaction request to the blockchain system; the first transaction request is used to instruct the blockchain system to call a device management contract to generate and store a first transaction log; the The first transaction log records the device management topic and the first IOT device information; any server in the IOT device alliance system is subscribed to the device management topic; the first transaction log is used for the second server to determine Whether to subscribe to the first IOT device topic indicated by the first IOT device information; the second server is any server in the IOT device alliance system except the first server.

上述技术方案中,提供一种适用于IOT设备联盟系统的IOT设备变更的方法,具体的,在系统中变更设备,可以是在系统中新增设备、删除设备、更新设备等,可以将变更设备定义为第一IOT设备,第一服务器用于管理该第一IOT设备。第一服务器生成包含第一IOT设备信息的第一交易请求,发送至区块链系统,区块链系统接收第一交易请求,调用设备管理合约后生成记录有第一IOT设备信息的第一交易日志,将该第一交易日志存储在区块链系统中,第二服务器可以通过订阅设备管理主题,获取第一交易日志,并根据第一交易日志确定是否订阅第一IOT设备主题。若第二服务器订阅第一IOT设备主题,则可以实现第二服务器获取第一IOT设备发布的事件,该IOT设备联盟系统中,第二服务器获取到第一IOT设备发布的事件后,可以将事件发送至对应的IOT设备,从而实现第二服务器对应的IOT设备接收第一IOT设备发布的事件。在系统中变更设备时,第一服务器只需要在区块链系统中写入变更设备信息的交易,则第二服务器可以通过订阅设备管理主题,获取变更设备的信息,并针对变更设备信息执行的相应动作。整个系统无需桥接器进行变更设备的绑定或者映射动作,且避免由于MQ和桥接服务分属不同的金融机构所存在的不一致问题,降低运维成本,适用于快速发展的IOT组网系统。In the above technical solution, a method for changing an IOT device suitable for an IOT device alliance system is provided. Specifically, changing a device in the system may be adding a device, deleting a device, updating a device, etc. in the system, and changing the device can be performed. It is defined as the first IOT device, and the first server is used to manage the first IOT device. The first server generates a first transaction request containing the information of the first IOT device, and sends it to the blockchain system, and the blockchain system receives the first transaction request, invokes the device management contract, and generates a first transaction that records the information of the first IOT device. log, and store the first transaction log in the blockchain system. The second server can obtain the first transaction log by subscribing to the device management topic, and determine whether to subscribe to the first IOT device topic according to the first transaction log. If the second server subscribes to the topic of the first IOT device, the second server can obtain the event published by the first IOT device. In the IOT device alliance system, after the second server obtains the event published by the first IOT device, the event can be It is sent to the corresponding IOT device, so that the IOT device corresponding to the second server receives the event published by the first IOT device. When changing the device in the system, the first server only needs to write the transaction of changing the device information in the blockchain system, then the second server can obtain the information of the changed device by subscribing to the device management topic, and execute the transaction for the changed device information. Action accordingly. The whole system does not require a bridge to change the binding or mapping of devices, and avoids inconsistencies due to the fact that MQ and bridge services belong to different financial institutions, reducing operation and maintenance costs, and is suitable for rapidly developing IOT networking systems.

可选的,所述方法还包括:Optionally, the method further includes:

所述第一服务器从所述区块链系统中获取第二交易日志;所述第二交易日志是所述区块链系统基于所述第二服务器发送的第二交易请求调用所述设备管理合约生成的;所述第二交易日志中记录有第二IOT设备信息和所述设备管理主题,所述第二IOT设备信息是所述第二服务器下新增的IOT设备的设备信息;The first server obtains a second transaction log from the blockchain system; the second transaction log is that the blockchain system invokes the device management contract based on a second transaction request sent by the second server Generated; the second IOT device information and the device management theme are recorded in the second transaction log, and the second IOT device information is the device information of the newly added IOT device under the second server;

所述第一服务器根据所述第二交易日志中的第二IOT设备信息,向所述区块链系统订阅所述第二IOT设备信息所指示的第二IOT设备主题。The first server subscribes the second IOT device topic indicated by the second IOT device information to the blockchain system according to the second IOT device information in the second transaction log.

上述技术方案中,第一服务器还可以通过订阅设备管理主题,获取区块链系统中的第二交易日志,并根据第二交易日志中的第二IOT设备信息,向区块链系统订阅第二IOT设备主题。在第二IOT设备将事件发布至区块链系统中时,第一服务器可以获取到该发布事件,进一步的,第一服务器可以将该发布事件发送至与第一服务器对应的IOT设备中,以实现IOT设备之间的互联。此外,第一服务器在订阅第二IOT设备主题时,也无需执行新增设备的绑定或者映射动作,降低IOT设备联盟系统中新增设备的运维成本。In the above technical solution, the first server can also obtain the second transaction log in the blockchain system by subscribing to the device management topic, and subscribe the second transaction log to the blockchain system according to the second IOT device information in the second transaction log. IoT device theme. When the second IOT device publishes the event to the blockchain system, the first server can obtain the published event, and further, the first server can send the published event to the IOT device corresponding to the first server to Realize the interconnection between IoT devices. In addition, when the first server subscribes to the topic of the second IOT device, there is no need to perform binding or mapping actions for the newly added device, which reduces the operation and maintenance cost of the newly added device in the IOT device alliance system.

可选的,所述第一服务器生成包含第一IOT设备信息的第一交易请求之前,还包括:Optionally, before the first server generates the first transaction request including the first IOT device information, the method further includes:

所述第一服务器根据所述第一IOT设备信息,生成所述第一IOT设备主题;The first server generates the first IOT device topic according to the first IOT device information;

所述第一服务器根据所述第一IOT设备主题,生成并向所述区块链系统发送第一部署请求;所述第一部署请求用于指示所述区块链系统部署所述第一IOT设备主题的主题合约;The first server generates and sends a first deployment request to the blockchain system according to the theme of the first IOT device; the first deployment request is used to instruct the blockchain system to deploy the first IOT The theme contract for the device theme;

所述第一服务器接收所述区块链系统返回的第一部署结果,所述第一部署结果是所述区块链系统完成所述第一IOT设备主题的主题合约的部署后发送的;所述第一部署结果包括所述第一IOT设备主题的主题合约的合约地址。The first server receives the first deployment result returned by the blockchain system, and the first deployment result is sent after the blockchain system completes the deployment of the theme contract of the first IOT device theme; The first deployment result includes the contract address of the theme contract of the first IOT device theme.

上述技术方案中,第一服务器可以根据第一IOT设备主题生成第一部署请求,并发送至区块链系统,区块链系统部署相对应的主题合约,以及将部署完成的主题合约的合约地址返回至第一服务器,实现在区块链系统中部署与变更设备对应的主题合约,第二服务器可以订阅变更设备对应的主题。当变更设备调用区块链系统中对应的主题合约发布事件时,订阅该主题合约的第二服务器可以获取到变更设备发布的事件,并发送至与第二服务器对应的IOT设备,以实现将变更设备与其它IOT设备的互联。进一步的,在第一服务器生成第一交易请求之前生成第一IOT设备主题,则可以在生成第一交易请求时,将第一IOT设备主题记录在第一交易请求中,区块链系统根据第一交易请求生成记录有第一IOT设备主题的第一交易日志,以使得第二服务器可以根据第一交易日志中的第一IOT设备主题,从区块链系统中订阅第一IOT设备主题,以提高第二服务器订阅第一IOT设主题的效率。In the above technical solution, the first server can generate a first deployment request according to the theme of the first IOT device, and send it to the blockchain system. The blockchain system deploys the corresponding theme contract and the contract address of the theme contract to be deployed. Return to the first server to deploy the topic contract corresponding to the changing device in the blockchain system, and the second server can subscribe to the topic corresponding to the changing device. When the change device calls the corresponding topic contract in the blockchain system to publish the event, the second server subscribed to the theme contract can obtain the event published by the change device and send it to the IOT device corresponding to the second server to realize the change The interconnection of the device with other IoT devices. Further, if the first IOT device topic is generated before the first server generates the first transaction request, the first IOT device topic can be recorded in the first transaction request when the first transaction request is generated, and the blockchain system can record the first IOT device topic in the first transaction request according to the first transaction request. A transaction request generates a first transaction log recorded with a first IOT device topic, so that the second server can subscribe to the first IOT device topic from the blockchain system according to the first IOT device topic in the first transaction log, to The efficiency of the second server subscribing to the topic set by the first IOT is improved.

可选的,在所述第一服务器生成第一部署请求之前,还包括:Optionally, before the first server generates the first deployment request, the method further includes:

所述第一服务器向所述区块链系统发送第二部署请求;所述第二部署请求用于指示所述区块链系统部署系统合约;The first server sends a second deployment request to the blockchain system; the second deployment request is used to instruct the blockchain system to deploy a system contract;

所述第一服务器接收所述区块链系统返回的第二部署结果;所述第二部署结果是所述区块链系统完成所述系统合约的部署后发送的;The first server receives the second deployment result returned by the blockchain system; the second deployment result is sent after the blockchain system completes the deployment of the system contract;

在所述第一服务器接收所述区块链系统返回的第一部署结果之后,还包括:After the first server receives the first deployment result returned by the blockchain system, the method further includes:

所述第一服务器将所述第一IOT设备主题和所述第一IOT设备主题的主题合约的合约地址的对应关系更新至所述系统合约。The first server updates the correspondence between the first IOT device topic and the contract address of the topic contract of the first IOT device topic to the system contract.

上述技术方案中,第一服务器在生成第一部署请求之前,还可以向区块链系统发送用于指示区块链系统部署系统合约的交易请求,也就是说,区块链系统在部署主题合约之前,还可以先部署系统合约。当区块链系统部署完主题合约后,把主题合约的合约地址反馈至第一服务器,第一服务器可以将主题和主题合约的合约地址的对应关系更新至系统合约,以使得系统合约存储当前区块链系统中最新主题和合约地址的对应关系,相当于存储当前IOT设备联盟系统中全部IOT设备主题和合约地址的对应关系。在第一IOT设备发布事件时,第一服务器可以确定出待调用的第一IOT设备主题的主题合约的合约地址,以使得区块链系统根据该地址调用合约,完成第一IOT设备的事件发布。且第一IOT设备经第一服务器将事件发布是区块链系统中,可以防止事件被篡改,提高发布事件的安全性。In the above technical solution, before generating the first deployment request, the first server may also send a transaction request to the blockchain system for instructing the blockchain system to deploy the system contract, that is, the blockchain system is deploying the theme contract. Previously, system contracts could also be deployed first. After the blockchain system deploys the theme contract, it feeds back the contract address of the theme contract to the first server, and the first server can update the corresponding relationship between the theme and the contract address of the theme contract to the system contract, so that the system contract stores the current area The correspondence between the latest topics and contract addresses in the blockchain system is equivalent to storing the correspondence between the topics and contract addresses of all IOT devices in the current IOT device alliance system. When the first IOT device publishes an event, the first server can determine the contract address of the topic contract of the topic of the first IOT device to be called, so that the blockchain system can call the contract according to the address to complete the event publishing of the first IOT device . And the first IOT device publishes the event through the first server in the blockchain system, which can prevent the event from being tampered with and improve the security of publishing the event.

相应的,本发明实施例还提供了一种基于区块链的IOT设备变更的装置,包括:Correspondingly, an embodiment of the present invention also provides a blockchain-based device for changing an IOT device, including:

处理单元,用于生成包含第一IOT设备信息的第一交易请求;所述第一IOT设备信息为第一服务器下变更的IOT设备的设备信息;所述第一服务器为所述多个服务器中的任一个;a processing unit, configured to generate a first transaction request including first IOT device information; the first IOT device information is the device information of the IOT device changed under the first server; the first server is one of the multiple servers any of the;

收发单元,用于将所述第一交易请求发送至所述区块链系统;所述第一交易请求用于指示所述区块链系统调用设备管理合约生成并存储第一交易日志;所述第一交易日志记录有设备管理主题及所述第一IOT设备信息;所述IOT设备联盟系统中的任一服务器均订阅有所述设备管理主题;所述第一交易日志用于第二服务器确定是否订阅所述第一IOT设备信息指示的第一IOT设备主题;所述第二服务器为所述IOT设备联盟系统中除所述第一服务器以外的任一服务器。a transceiver unit, configured to send the first transaction request to the blockchain system; the first transaction request is used to instruct the blockchain system to call a device management contract to generate and store a first transaction log; the The first transaction log records the device management topic and the first IOT device information; any server in the IOT device alliance system is subscribed to the device management topic; the first transaction log is used for the second server to determine Whether to subscribe to the first IOT device topic indicated by the first IOT device information; the second server is any server in the IOT device alliance system except the first server.

可选的,所述处理单元还用于:Optionally, the processing unit is also used for:

从所述区块链系统中获取第二交易日志;所述第二交易日志是所述区块链系统基于所述第二服务器发送的第二交易请求调用所述设备管理合约生成的;所述第二交易日志中记录有第二IOT设备信息和所述设备管理主题,所述第二IOT设备信息是所述第二服务器下新增的IOT设备的设备信息;Obtain a second transaction log from the blockchain system; the second transaction log is generated by the blockchain system calling the device management contract based on the second transaction request sent by the second server; the The second transaction log records the second IOT device information and the device management topic, and the second IOT device information is the device information of the newly added IOT device under the second server;

根据所述第二交易日志中的第二IOT设备信息,向所述区块链系统订阅所述第二IOT设备信息所指示的第二IOT设备主题。According to the second IOT device information in the second transaction log, the second IOT device topic indicated by the second IOT device information is subscribed to the blockchain system.

可选的,所述处理单元还用于:Optionally, the processing unit is also used for:

在所述生成包含第一IOT设备信息的第一交易请求之前,根据所述第一IOT设备信息,生成所述第一IOT设备主题;Before generating the first transaction request including the first IOT device information, generating the first IOT device subject according to the first IOT device information;

根据所述第一IOT设备主题,生成并控制所述收发单元向所述区块链系统发送第一部署请求;所述第一部署请求用于指示所述区块链系统部署所述第一IOT设备主题的主题合约;According to the subject of the first IOT device, generate and control the transceiver unit to send a first deployment request to the blockchain system; the first deployment request is used to instruct the blockchain system to deploy the first IOT The theme contract for the device theme;

控制所述收发单元接收所述区块链系统返回的第一部署结果,所述第一部署结果是所述区块链系统完成所述第一IOT设备主题的主题合约的部署后发送的;所述第一部署结果包括所述第一IOT设备主题的主题合约的合约地址。Controlling the transceiver unit to receive the first deployment result returned by the blockchain system, where the first deployment result is sent after the blockchain system completes the deployment of the theme contract of the first IOT device theme; The first deployment result includes the contract address of the theme contract of the first IOT device theme.

可选的,所述处理单元还用于:Optionally, the processing unit is also used for:

在所述生成第一部署请求之前,控制所述收发单元向所述区块链系统发送第二部署请求;所述第二部署请求用于指示所述区块链系统部署系统合约;Before generating the first deployment request, control the transceiver unit to send a second deployment request to the blockchain system; the second deployment request is used to instruct the blockchain system to deploy a system contract;

控制所述收发单元接收所述区块链系统返回的第二部署结果;所述第二部署结果是所述区块链系统完成所述系统合约的部署后发送的;Controlling the transceiver unit to receive the second deployment result returned by the blockchain system; the second deployment result is sent after the blockchain system completes the deployment of the system contract;

所述处理单元还用于:The processing unit is also used to:

在控制所述收发单元接收所述区块链系统返回的第一部署结果之后,将所述第一IOT设备主题和所述第一IOT设备主题的主题合约的合约地址的对应关系更新至所述系统合约。After controlling the transceiver unit to receive the first deployment result returned by the blockchain system, update the correspondence between the first IOT device topic and the contract address of the topic contract of the first IOT device topic to the system contract.

相应的,本发明实施例还提供了一种计算设备,包括:Correspondingly, an embodiment of the present invention also provides a computing device, including:

存储器,用于存储程序指令;memory for storing program instructions;

处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述基于区块链的IOT设备变更的方法。The processor is configured to call the program instructions stored in the memory, and execute the above method for changing the IOT device based on the blockchain according to the obtained program.

相应的,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述基于区块链的IOT设备变更的方法。Correspondingly, an embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions, when the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned blockchain-based The method of changing the IOT device.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本发明实施例提供的第一种IOT设备联盟系统的示意图;1 is a schematic diagram of a first IOT device alliance system provided by an embodiment of the present invention;

图2为本发明实施例提供的第二种IOT设备联盟系统的示意图;2 is a schematic diagram of a second type of IOT device alliance system provided by an embodiment of the present invention;

图3为本发明实施例提供的第三种IOT设备联盟系统的示意图;3 is a schematic diagram of a third IOT device alliance system provided by an embodiment of the present invention;

图4为本发明实施例提供的第四种IOT设备联盟系统的示意图;4 is a schematic diagram of a fourth IOT device alliance system provided by an embodiment of the present invention;

图5为本发明实施例提供的一种IOT设备变更方法的流程示意图;5 is a schematic flowchart of a method for changing an IOT device according to an embodiment of the present invention;

图6为本发明实施例提供的具体场景下的IOT设备联盟系统的示意图;6 is a schematic diagram of an IOT device alliance system under a specific scenario provided by an embodiment of the present invention;

图7为本发明实施例提供的一种IOT设备变更装置的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus for changing an IOT device according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明实施例提供一种基于区块链的IOT设备联盟系统,该IOT设备联盟系统在MQTT协议的基础上,引入区块链技术,与本发明实施例提供的基于区块链的IOT设备变更的方法相适用。IOT设备联盟系统包括多个服务器,每个服务器用于管理各自的IOT设备,此处的服务器理解为用于消息发布和消息订阅的发布订阅服务器,多个发布订阅服务器通过区块链系统实现IOT设备的信息交互。The embodiment of the present invention provides a blockchain-based IOT device alliance system. The IOT device alliance system introduces blockchain technology on the basis of the MQTT protocol, and is changed from the blockchain-based IOT device provided by the embodiment of the present invention. method is applicable. The IOT device alliance system includes multiple servers, each of which is used to manage its own IOT device. The server here is understood as a publish and subscribe server used for message publishing and message subscription. Multiple publish and subscribe servers implement IOT through the blockchain system. Device information interaction.

图2示例性的示出了一种基于区块链的IOT设备联盟系统,包括多个发布订阅服务器,每个发布订阅服务器对应各自的IOT设备集群,每个发布订阅服务器用于管理自己对应的IOT设备集群中的IOT设备,发布订阅服务器与IOT设备集群通过MQTT集群进行连接,MQTT集群用于协议转换。进一步的,一个发布订阅服务器以及与该发布订阅服务器对应的IOT设备集群、MQTT集群同属于一个金融机构,也就是说,在IOT设备联盟系统中涉及多个金融机构,每个金融机构内部包括IOT设备集群、MQTT集群和发布订阅服务器,三者为对应关系,其中,IOT设备集群中包括至少一个IOT设备,MQTT集群中包括至少一个代理服务器,该代理服务器可以为开源消息代理软件Mosquitto的服务器。两个金融机构之间的发布订阅服务器通过区块链系统连接,发布订阅服务器可以向区块链系统中写入IOT设备的发布事件,也可以从区块链系统中读取事件发送至IOT设备。参照图2为例,金融机构1内部包括IOT设备集群1、MQTT集群1和发布订阅服务器1,金融机构2内部包括IOT设备集群2、MQTT集群2和发布订阅服务器2,发布订阅服务器1与发布订阅服务器2之间通过区块链系统连接,并通过区块链系统实现两金融机构之间IOT设备的信息交互。Figure 2 exemplarily shows a blockchain-based IOT device alliance system, including multiple publish and subscribe servers, each publish and subscribe server corresponds to its own IOT device cluster, and each publish and subscribe server is used to manage its corresponding The IOT device in the IOT device cluster, the publish-subscribe server and the IOT device cluster are connected through the MQTT cluster, and the MQTT cluster is used for protocol conversion. Further, a publish-subscribe server and the IOT device cluster and MQTT cluster corresponding to the publish-subscribe server belong to the same financial institution. That is to say, multiple financial institutions are involved in the IOT device alliance system, and each financial institution includes IOT. The device cluster, the MQTT cluster, and the publish-subscribe server have a corresponding relationship, wherein the IOT device cluster includes at least one IOT device, and the MQTT cluster includes at least one proxy server, and the proxy server can be the server of the open source message broker software Mosquitto. The publish-subscribe server between the two financial institutions is connected through the blockchain system. The publish-subscribe server can write the publishing events of the IOT device into the blockchain system, and can also read events from the blockchain system and send them to the IOT device. . Referring to FIG. 2 as an example, financial institution 1 includes IOT device cluster 1, MQTT cluster 1 and publish-subscribe server 1, financial institution 2 includes IOT device cluster 2, MQTT cluster 2 and publish-subscribe server 2, publish-subscribe server 1 and publish-subscribe server 2. The subscription servers 2 are connected through the blockchain system, and the information exchange of the IOT devices between the two financial institutions is realized through the blockchain system.

发布订阅服务器可以通过证书和公私钥访问区块链系统,以及通过账号和密码访问MQTT集群,从而保障各金融机构内部以及金融机构之间的信息安全性。The publish-subscribe server can access the blockchain system through certificates and public and private keys, and access the MQTT cluster through account numbers and passwords, thus ensuring information security within and between financial institutions.

区块链系统中存储有设备管理合约,该设备管理合约可以是在区块链系统中预先建立的合约,该设备管理合约对应固定的设备管理主题,每个发布订阅服务器都会订阅该设备管理主题,也就是说,任何写入该设备管理主题的事件,都会被IOT设备联盟系统中的任一个发布订阅服务器获取到。例如,设备管理主题为“com.aaaaaa.iot”,IOT设备联盟系统中的任一个发布订阅服务器都订阅主题“com.aaaaaa.iot”,若某一发布订阅服务器写入该主题对应的事件“com.aaaaaa.iot 1”,则其他发布订阅服务器即可以订阅到该事件“com.aaaaaa.iot 1”。A device management contract is stored in the blockchain system. The device management contract can be a pre-established contract in the blockchain system. The device management contract corresponds to a fixed device management topic, and each publish-subscribe server will subscribe to the device management topic. , that is to say, any event written to the device management topic will be acquired by any publish/subscribe server in the IOT device alliance system. For example, if the device management topic is "com.aaaaaa.iot", any publisher/subscriber server in the IOT device alliance system subscribes to the topic "com.aaaaaa.iot", if a publisher/subscriber server writes the event corresponding to the topic " com.aaaaaa.iot 1", other Publish Subscribers can subscribe to the event "com.aaaaaa.iot 1".

本发明实施例提供的IOT设备联盟系统通过采用区块链技术,实现将多个金融机构的发布订阅服务器连接,也就是说,每个金融机构的发布订阅服务器都与区块链系统连接,任意两个金融机构的发布订阅服务器都可以通过区块链系统进行通信。The IOT device alliance system provided by the embodiment of the present invention realizes the connection of the publish and subscribe servers of multiple financial institutions by using the blockchain technology, that is, the publish and subscribe servers of each financial institution are connected to the blockchain system, and any The publish-subscribe servers of both financial institutions can communicate through the blockchain system.

基于区块链技术的IOT设备联盟系统相比于图1示出的IOT设备联盟系统,组网方式简单且易维护。举例来说,当前有四个金融机构中的IOT设备进行组网,若采用图1的组网方式,IOT设备联盟系统则变为图3示出的架构,为了方便描述,将IOT设备联盟系统中的MQTT集群在图3中省略。图3中,每个金融机构的MQ在与外金融机构连接时,都要通过桥接器,若想实现四个金融机构的两两连接,则四个金融机构需要建立6条连接,且采用6个桥接器,例如,金融机构2的MQ2和金融机构3的MQ3之间需要桥接器23连接。而本发明实施例提供的IOT设备联盟系统,可以参照图4所示,每个金融机构的发布订阅服务器均与区块链系统连接,省去了各MQ之间的桥接。基于区块链技术的IOT设备联盟系统的星型组网,相比于图1示出的网状组网,组网方式简单且易维护。Compared with the IOT device alliance system shown in Figure 1, the IOT device alliance system based on blockchain technology has a simple networking method and is easy to maintain. For example, there are currently four IOT devices in financial institutions for networking. If the networking method in Figure 1 is adopted, the IOT device alliance system becomes the architecture shown in Figure 3. For the convenience of description, the IOT device alliance system is used. The MQTT cluster in Figure 3 is omitted. In Figure 3, when the MQ of each financial institution is connected to the foreign financial institution, it must pass through the bridge. For example, the bridge 23 needs to be connected between the MQ2 of the financial institution 2 and the MQ3 of the financial institution 3. For the IOT device alliance system provided by the embodiment of the present invention, as shown in FIG. 4 , the publish-subscribe server of each financial institution is connected to the blockchain system, eliminating the need for bridging between MQs. Compared with the mesh networking shown in Figure 1, the star networking of the IOT device alliance system based on blockchain technology is simple and easy to maintain.

此外,本发明实施例提供的基于区块链的IOT设备联盟系统相比图1示出的IOT设备联盟系统,更适用于快速发展的IOT组网,例如,图3中金融机构3新增IOT设备,则与MQ3相连接的桥接器均需要执行新增设备的绑定或者映射动作,具体的,桥接器34、桥接器13、桥接器23执行新增设备的绑定或者映射动作。但是采用本发明实施例提供的基于区块链的IOT设备联盟系统时,则无需执行新增设备的绑定或者映射动作,只需要将新增设备的信息写入区块链系统,其他金融机构的订阅服务器即可以完成订阅动作,具体的,图4中金融机构3新增设备,发布订阅服务器3将新增设备的信息写入区块链系统,则发布订阅服务器1、发布订阅服务器2、发布订阅服务器4即可以订阅到该新增设备的信息,具体实现过程在下述实施例中解释。In addition, the blockchain-based IOT device alliance system provided by the embodiment of the present invention is more suitable for the rapidly developing IOT networking system than the IOT device alliance system shown in FIG. 1 . For example, the financial institution 3 in FIG. 3 adds an IOT device, the bridges connected to MQ3 all need to perform the binding or mapping action of the newly added device. Specifically, the bridge 34, the bridge 13, and the bridge 23 perform the binding or mapping action of the newly added device. However, when the blockchain-based IOT device alliance system provided by the embodiment of the present invention is used, there is no need to perform binding or mapping actions for the newly added devices, and only the information of the newly added devices needs to be written into the blockchain system, and other financial institutions The subscription server can complete the subscription action. Specifically, in Figure 4, the financial institution 3 adds new equipment, and the publish and subscribe server 3 writes the information of the newly added device into the blockchain system, then publish and subscribe server 1, publish and subscribe server 2, The publish-subscribe server 4 can subscribe to the information of the newly added device, and the specific implementation process is explained in the following embodiments.

基于上述描述,图5示例性的示出了本发明实施例提供的一种基于区块链的IOT设备变更的方法的流程,该流程可以由基于区块链的IOT设备变更的装置执行,该装置可以位于发布订阅服务器中,也可以是该发布订阅服务器。Based on the above description, FIG. 5 exemplarily shows a flow of a method for changing an IOT device based on a blockchain provided by an embodiment of the present invention. The flow may be executed by an apparatus for changing an IOT device based on a blockchain. The apparatus may be located in a publish-subscribe server, or may be the publish-subscribe server.

为了方便描述,下述实施例中将发布订阅服务器简称为服务器,该流程涉及到两个金融机构(第一金融机构和第二金融机构)的发布订阅服务器,分别定义为第一服务器和第二服务器,第一服务器为IOT设备联盟系统中多个服务器中的任一个,第二服务器为除第一服务器以外的任一个服务器。其中,第一金融机构理解为存在变更IOT设备的金融机构,IOT设备的变更可以包括新增、删除、参数修改、连接关系变化等,以第一金融机构新增IOT设备进行说明,第一服务器用于将该新增IOT设备添加至对应的IOT设备集群中。第一服务器与第二服务器通过区块链系统连接,该流程涉及执行主体为第一服务器、第二服务器和区块链系统。For the convenience of description, in the following embodiments, the publish and subscribe servers are referred to as servers for short. This process involves the publish and subscribe servers of two financial institutions (a first financial institution and a second financial institution), which are defined as the first server and the second financial institution, respectively. Servers, the first server is any one of multiple servers in the IoT device alliance system, and the second server is any server except the first server. Among them, the first financial institution understands that there is a financial institution that changes the IOT device, and the change of the IOT device may include addition, deletion, parameter modification, connection relationship change, etc. Used to add the newly added IOT device to the corresponding IOT device cluster. The first server and the second server are connected through the blockchain system, and the process involves the execution subject being the first server, the second server and the blockchain system.

如图5所示,该流程具体包括:As shown in Figure 5, the process specifically includes:

步骤501,第一服务器生成包含第一IOT设备信息的第一交易请求。Step 501, the first server generates a first transaction request including the information of the first IOT device.

第一IOT设备信息理解为第一服务器下变更的IOT设备的设备信息。具体的,当第一服务器下存在新增的IOT设备时,第一服务器可以接收包含有第一IOT设备信息的添加指令,并根据添加指令中的第一IOT设备信息生成第一交易请求,该第一交易请求中包括第一IOT设备信息,第一IOT设备信息可以包括IOT设备的设备标识、设备类别、设备参数、所属金融机构等。添加指令可以是运维人员下发的也可以是待添加的IOT设备发送的。The first IOT device information is understood as device information of the IOT device changed under the first server. Specifically, when there is a newly added IOT device under the first server, the first server may receive an add instruction containing the information of the first IOT device, and generate a first transaction request according to the information of the first IOT device in the add instruction. The first transaction request includes first IOT device information, and the first IOT device information may include a device identifier of the IOT device, a device category, a device parameter, a financial institution to which it belongs, and the like. The addition instruction can be issued by the operation and maintenance personnel or sent by the IOT device to be added.

本发明实施例中,第一服务器在生成第一交易请求之前,还可以根据第一IOT设备信息,生成第一IOT设备信息对应的第一IOT设备主题,并根据第一IOT设备主题,生成第一部署请求,该第一部署请求用于指示区块链系统部署第一IOT设备主题的主题合约。第一服务器将第一部署请求发送至区块链系统,区块链系统根据第一部署请求部署第一IOT设备主题的主题合约,在部署完成后将第一部署结果发送至第一服务器,其中,该第一部署结果包括第一IOT设备主题的主题合约的合约地址。第一服务器接收区块链系统返回的第一部署结果,则第一服务器中包括有第一IOT设备主题和第一IOT设备主题的主题合约的合约地址。In this embodiment of the present invention, before generating the first transaction request, the first server may also generate a first IOT device topic corresponding to the first IOT device information according to the first IOT device information, and generate a first IOT device topic according to the first IOT device topic. A deployment request, where the first deployment request is used to instruct the blockchain system to deploy the theme contract of the first IOT device theme. The first server sends the first deployment request to the blockchain system, the blockchain system deploys the theme contract of the theme of the first IOT device according to the first deployment request, and sends the first deployment result to the first server after the deployment is completed, wherein , the first deployment result includes the contract address of the theme contract of the first IOT device theme. The first server receives the first deployment result returned by the blockchain system, and the first server includes the first IOT device topic and the contract address of the topic contract of the first IOT device topic.

上述实施例中,第一服务器在生成第一部署请求之前,还可以生成第二部署请求并发送至区块链系统,该第二部署请求用于指示区块链系统部署系统合约,区块链系统在接收到第二部署请求后,部署系统合约,并返回第二部署结果至第一服务器。其中,系统合约在初始状态下可以为空。进一步的,当第一服务器在接收到第一IOT设备主题的主题合约的合约地址后,可以将第一IOT设备主题和第一IOT设备主题的主题合约的合约地址的对应关系更新至系统合约中。也就是说,系统合约中存储有二者的对应关系,且在区块链系统中新增第一IOT设备主题的主题合约后,进行更新。In the above embodiment, before generating the first deployment request, the first server may also generate a second deployment request and send it to the blockchain system, where the second deployment request is used to instruct the blockchain system to deploy the system contract, and the blockchain After receiving the second deployment request, the system deploys the system contract, and returns the second deployment result to the first server. Among them, the system contract can be empty in the initial state. Further, after receiving the contract address of the theme contract of the first IOT device theme, the first server can update the correspondence between the first IOT device theme and the contract address of the theme contract of the first IOT device theme to the system contract. . That is to say, the corresponding relationship between the two is stored in the system contract, and after the theme contract of the first IOT device theme is added to the blockchain system, it is updated.

步骤502,第一服务器将第一交易请求发送至区块链系统。Step 502, the first server sends the first transaction request to the blockchain system.

步骤503,区块链系统调用设备管理合约生成并存储第一交易日志。Step 503, the blockchain system invokes the device management contract to generate and store the first transaction log.

本发明实施例中,第一交易请求中还可以包括与区块链系统中的设备管理合约相对应的设备管理主题,该第一交易请求用于指示区块链系统调用设备管理合约生成并存储第一交易日志。区块链系统调用设备管理合约后,生成第一交易日志存储至区块链系统中,第一交易日志记录有设备管理主题及第一IOT设备信息。由于IOT设备联盟系统中的任一服务器都订阅了设备管理主题,则可以确定出该区块链系统生成的第一交易日志可以被其它服务器(IOT设备联盟系统中除第一服务器以外的服务器)获取,也就是第一交易日志可以被第二服务器获取,相当于区块链系统将第一交易日志发送至第二服务器。In this embodiment of the present invention, the first transaction request may further include a device management topic corresponding to the device management contract in the blockchain system, and the first transaction request is used to instruct the blockchain system to call the device management contract to generate and store The first transaction log. After the blockchain system invokes the device management contract, a first transaction log is generated and stored in the blockchain system. The first transaction log records the device management topic and the first IOT device information. Since any server in the IoT device alliance system subscribes to the device management topic, it can be determined that the first transaction log generated by the blockchain system can be used by other servers (servers other than the first server in the IoT device alliance system) Obtaining, that is, the first transaction log can be obtained by the second server, is equivalent to the blockchain system sending the first transaction log to the second server.

步骤504,区块链系统将第一交易日志发送至第二服务器。Step 504, the blockchain system sends the first transaction log to the second server.

步骤505,第二服务器根据第一交易日志,确定是否订阅第一IOT设备信息指示的第一IOT设备主题。Step 505, the second server determines, according to the first transaction log, whether to subscribe to the first IOT device topic indicated by the first IOT device information.

第二服务器可以根据第一IOT设备的信息,确定第一IOT设备信息指示的第一IOT设备主题,并判断是否订阅该第一IOT设备主题,若是,则可以根据第一IOT设备主题向区块链系统发送监听请求,也就是说,一旦第一IOT设备发布对应主题的事件至区块链系统中,则可以被第二服务器监听到,第二服务器可以从区块链系统中获取该事件。当然,若第二服务器确定不订阅第一IOT设备主题,则可以忽略该第一交易日志,且不会获取到第一IOT设备发布的事件。The second server can determine the first IOT device topic indicated by the first IOT device information according to the information of the first IOT device, and determine whether to subscribe to the first IOT device topic, if so, it can send the block to the block according to the first IOT device topic The chain system sends a monitoring request, that is, once the first IOT device publishes the event of the corresponding topic to the blockchain system, it can be monitored by the second server, and the second server can obtain the event from the blockchain system. Of course, if the second server determines not to subscribe to the topic of the first IOT device, the first transaction log may be ignored, and the event published by the first IOT device will not be obtained.

本发明实施例中,第一服务器在生成第一交易请求之前,还可以根据第一IOT设备信息,生成第一IOT设备主题,并在生成第一交易请求时,将第一IOT设备主题记录在第一交易请求中,区块链系统根据第一交易请求生成记录有第一IOT设备主题的第一交易日志,也就是说,第一交易日志中还可以记录有第一IOT设备主题,第二服务器可以直接根据第一IOT设备主题,判断是否订阅该第一IOT设备主题,从而提高第二服务器订阅第一IOT设备主题的效率。In this embodiment of the present invention, before generating the first transaction request, the first server may also generate the first IOT device topic according to the first IOT device information, and when generating the first transaction request, record the first IOT device topic in the In the first transaction request, the blockchain system generates a first transaction log that records the subject of the first IOT device according to the first transaction request. That is to say, the first transaction log may also record the subject of the first IOT device, and the The server may directly determine whether to subscribe to the first IOT device topic according to the first IOT device topic, thereby improving the efficiency of the second server subscribing to the first IOT device topic.

进一步的,结合图6,对第二服务器判断是否订阅第一IOT设备主题做如下解释,图6为本发明实施例提供的一种具体场景下的IOT设备联盟系统的示意图,金融机构1的IOT设备包括交易统计设备,金融机构2的IOT设备包括用于进行交易的支付设备,如刷卡支付设备、扫码支付设备,本IOT设备联盟系统中,交易统计设备订阅刷卡支付设备的设备主题和扫码支付设备的设备主题。此时,若金融机构2新增IOT设备为刷脸支付设备,则第一服务器(发布订阅服务器2)接收包含有刷脸支付设备的设备信息的添加指令,生成第一交易请求并发送至区块链系统,区块链系统调用设备管理合约生成记录有刷脸支付设备的设备信息的第一交易日志,第二服务器(发布订阅服务器1)获取到该第一交易日志后,判断金融机构1的交易统计设备是否需要订阅该刷脸支付设备的设备主题,若是,则向区块链系统发送监听请求,从而监听刷脸支付设备发布的事件。Further, with reference to FIG. 6 , the following explanation is made for the second server to determine whether to subscribe to the subject of the first IOT device. FIG. 6 is a schematic diagram of an IOT device alliance system under a specific scenario provided by an embodiment of the present invention. The IOT of financial institution 1 The devices include transaction statistics devices, and the IOT devices of financial institutions 2 include payment devices used for transactions, such as card payment devices and scan code payment devices. In this IOT device alliance system, the transaction statistics device subscribes to the device theme and scan of the card payment device. Device theme for code payment devices. At this time, if the newly added IOT device of the financial institution 2 is a face-scanning payment device, the first server (publish and subscribe server 2) receives the addition instruction containing the device information of the face-scanning payment device, generates a first transaction request and sends it to the district The blockchain system, the blockchain system calls the device management contract to generate a first transaction log that records the device information of the face-swiping payment device. After the second server (publish and subscribe server 1) obtains the first transaction log, it determines the financial institution 1 Whether the transaction statistics device needs to subscribe to the device topic of the face-swiping payment device, and if so, send a monitoring request to the blockchain system to monitor events published by the face-swiping payment device.

本发明实施例中,第一交易日志中还可以包括IOT设备的类别、IOT设备所属金融机构、IOT设备的性能参数等,以用于第二服务器进行判断。第二服务器判断是否订阅第一IOT设备主题,可以通过第二服务器内部的逻辑进行判断;也可以将第一交易日志发送至第二服务器下的IOT设备,第二服务器下的IOT设备根据自己的逻辑进行判断是否需要获取第一IOT设备发布的事件,并将判断结果反馈给第二服务器;还可以将第一交易日志中的相关信息展示给运维人员,运维人员人工进行判断后反馈给第二服务器。In this embodiment of the present invention, the first transaction log may further include the category of the IOT device, the financial institution to which the IOT device belongs, and performance parameters of the IOT device, etc., so as to be used by the second server for judgment. The second server can judge whether to subscribe to the topic of the first IOT device through the internal logic of the second server; it can also send the first transaction log to the IOT device under the second server, and the IOT device under the second server can use its own Logic judges whether it is necessary to obtain the events published by the first IOT device, and feed back the judgment result to the second server; it can also display the relevant information in the first transaction log to the operation and maintenance personnel, and the operation and maintenance personnel manually judge and feed back to the second server. second server.

第一IOT设备发布对应主题的事件,此处发布的事件可以理解为第一IOT设备发送的交易参数、设备参数、控制指令等。如刷脸支付设备发布设备主题的事件,可以发布交易金额、交易卡片等。The first IOT device publishes an event corresponding to the theme, and the event published here may be understood as transaction parameters, device parameters, control instructions, etc. sent by the first IOT device. For example, when the face-swiping payment device publishes the event of the device theme, it can publish the transaction amount, transaction card, etc.

上述实施例具体阐述了第一服务器生成第一交易请求,并将第一交易请求发送至区块链系统,区块链系统调用设备管理合约,生成并存储记录有第一IOT设备信息的第一交易日志,以供第二服务器进行判断是否订阅第一IOT设备主题。此外,第一服务器也可以获取到区块链系统中的第二交易日志,并根据第二交易日志进行判断是否订阅第二IOT设备主题,具体如下述实施例。The above embodiment specifically describes that the first server generates the first transaction request, and sends the first transaction request to the blockchain system, and the blockchain system calls the device management contract to generate and store the first IOT device information recorded thereon. A transaction log for the second server to determine whether to subscribe to the topic of the first IOT device. In addition, the first server can also obtain the second transaction log in the blockchain system, and determine whether to subscribe to the second IOT device topic according to the second transaction log, as described in the following embodiments.

第一服务器订阅设备管理主题,当区块链系统中新增设备管理主题对应的交易日志时,第一服务器获取该交易日志。具体的,第二服务器下新增IOT设备后,第二服务器根据新增IOT设备的设备信息生成第二交易请求,该第二交易请求中包括第二IOT设备信息,第二IOT设备信息即第二服务器下新增的IOT设备的设备信息。第二服务器将第二交易请求发送至区块链系统,区块链系统调用设备管理合约生成第二交易日志并存储至区块链系统中,其中,该第二交易日志中记录有第二IOT设备信息,第一服务器在确定出区块链系统中存在新增的第二交易日志后,根据第二交易日志判断是否订阅第二IOT设备信息所指示的第二IOT设备主题,若是,则根据第二IOT设备主题向区块链系统发送监听请求,该监听请求用于获取第二IOT设备发布的新增事件。The first server subscribes to the device management topic, and when a transaction log corresponding to the device management topic is added to the blockchain system, the first server obtains the transaction log. Specifically, after adding an IOT device to the second server, the second server generates a second transaction request according to the device information of the newly added IOT device, where the second transaction request includes the second IOT device information, and the second IOT device information is the first transaction request. Device information of the newly added IOT device under the second server. The second server sends the second transaction request to the blockchain system, and the blockchain system calls the device management contract to generate a second transaction log and stores it in the blockchain system, wherein the second transaction log records the second IOT Device information, after determining that there is a new second transaction log in the blockchain system, the first server determines whether to subscribe to the second IOT device topic indicated by the second IOT device information according to the second transaction log, and if so, according to The second IOT device topic sends a monitoring request to the blockchain system, where the monitoring request is used to acquire new events published by the second IOT device.

进一步的,当第一服务器确定订阅第二IOT设备主题后,第一服务器对应的MQTT集群可以根据第二IOT设备主题进行相应的配置,以实现第一服务器获取第二IOT设备发布的新增事件后,第一服务器可以将新增事件通过MQTT集群发送至第一服务器下的IOT设备。以及第一服务器下的IOT设备也可以基于第二IOT设备主题进行相应配置,以实现在接收到第二IOT设备发布的新增事件之后,执行相关的操作。Further, after the first server determines to subscribe to the topic of the second IOT device, the MQTT cluster corresponding to the first server can perform corresponding configuration according to the topic of the second IOT device, so that the first server obtains new events published by the second IOT device. Afterwards, the first server may send the newly added event to the IOT device under the first server through the MQTT cluster. And the IOT device under the first server may also be configured accordingly based on the theme of the second IOT device, so as to implement related operations after receiving a new event published by the second IOT device.

本发明实施例中,第一服务器获取第二交易日志判断是否订阅第二IOT设备主题的具体实施方式和第二服务器获取第一交易日志判断是否订阅第一IOT设备主题的具体实施方式相似,在此不再赘述。In this embodiment of the present invention, the specific implementation of the first server acquiring the second transaction log to determine whether to subscribe to the topic of the second IOT device is similar to the specific implementation of the second server acquiring the first transaction log to determine whether to subscribe to the topic of the first IOT device. This will not be repeated here.

第二服务器可以为至少一个,且在不同实施例下第二服务器可以为不同的服务器。假设该IOT设备联盟系统中包括A、B、C、D四个发布订阅服务器,在一个实施例中,A发布订阅服务器对应的IOT设备集群中存在新增设备,则A发布订阅服务器即理解为第一服务器,B、C、D三个发布订阅服务器均理解为第二服务器,进一步的,A发布订阅服务器生成第一交易请求并发送至区块链系统中,区块链系统生成第一交易日志,该第一交易日志可以被B、C、D三个发布订阅服务器订阅,若此时,B、D两个发布订阅服务器确定订阅该新增设备的主题,则可以确定出B、D两个发布订阅服务器分别向区块链系统发送监听请求。在另一个实施例中,A发布订阅服务器为第一服务器,A发布订阅服务器订阅到第二交易日志,该第二交易日志是B发布订阅服务器向区块链系统中发送第二交易请求后区块链系统生成的,则此时B发布订阅服务器即为本实施例中的第二服务器。The second server may be at least one, and the second server may be different servers in different embodiments. Assuming that the IOT device alliance system includes four publish and subscribe servers A, B, C, and D, in one embodiment, if there is a new device in the IOT device cluster corresponding to the A publish and subscribe server, then the A publish and subscribe server is understood as The first server, the three publish and subscribe servers B, C, and D are all understood as the second server. Further, the publish and subscribe server A generates the first transaction request and sends it to the blockchain system, and the blockchain system generates the first transaction. log, the first transaction log can be subscribed by three publish and subscribe servers B, C and D. If at this time, two publish and subscribe servers B and D determine to subscribe to the topic of the newly added device, it can be determined that B and D Each publish-subscribe server sends monitoring requests to the blockchain system respectively. In another embodiment, the A publish and subscribe server is the first server, the A publish and subscribe server subscribes to the second transaction log, and the second transaction log is the area after the B publish and subscribe server sends the second transaction request to the blockchain system is generated by the blockchain system, then the B publish and subscribe server is the second server in this embodiment.

此外,第一服务器下的IOT设备还可以被删除,当第一服务器接收到删除指令后,根据删除指令中的待删除的IOT设备信息,生成第一交易请求,其中该第一交易请求中包括第一IOT设备信息,该第一IOT设备信息即待删除的IOT设备信息。具体的,第一服务器生成第一交易请求,并将第一交易请求发送至区块链系统,区块链系统调用设备管理合约生成并存储与设备管理主题对应的第一交易日志,第一交易日志中包括第一IOT设备信息。第二服务器获取第一交易日志,并根据第一交易日志,从区块链系统中取消订阅第一IOT设备主题。当然,IOT设备的变更不仅可以包括新增设备、删除设备,还可以包括更新设备,如设备的参数修改、连接关系变化等,相当于,第一服务器接收变更指令,该变更指令用于指示IOT设备的新增、删除或参数变化等。In addition, the IOT device under the first server can also be deleted. After the first server receives the deletion instruction, it generates a first transaction request according to the information of the IOT device to be deleted in the deletion instruction, wherein the first transaction request includes The first IOT device information, where the first IOT device information is the IOT device information to be deleted. Specifically, the first server generates a first transaction request, and sends the first transaction request to the blockchain system, and the blockchain system invokes the device management contract to generate and store the first transaction log corresponding to the device management topic. The log includes first IOT device information. The second server obtains the first transaction log, and unsubscribes the first IOT device topic from the blockchain system according to the first transaction log. Of course, the modification of an IOT device may include not only adding and deleting devices, but also updating devices, such as device parameter modification, connection relationship change, etc., which is equivalent to that the first server receives a modification instruction, and the modification instruction is used to instruct the IOT Equipment addition, deletion or parameter change, etc.

此外,第一服务器向区块链系统中发送交易请求后,第二服务器可以订阅或取消订阅第一IOT设备主题,第一服务器同样可以订阅或取消订阅第一IOT设备主题。举例来说,如图6中,金融机构2中存在新增设备为刷脸支付设备,第一服务器向区块链系统中发送第一交易请求后,区块链系统生成第一交易日志,第二服务器订阅该刷脸支付设备的设备主题,并在获取到刷脸支付设备的发布事件后发送至交易统计设备,此外,第一服务器也可以根据第一交易日志判断是否需要订阅该刷脸支付设备的设备主题,若第一服务器确定出扫码支付设备需要获取刷脸支付设备的发布事件,则第一服务器也可以订阅刷脸支付设备的设备主题,并在获取到刷脸支付设备的发布事件后发送至扫码支付设备。也就是说,第一服务器也可以根据第一交易日志中的第一IOT设备信息所指示的第一IOT设备主题确定是否订阅或取消订阅第一IOT设备主题,此外,第一服务器还可以根据变更指令中的第一IOT设备信息,直接确定出是否需要订阅或取消订阅第一IOT设备主题。In addition, after the first server sends a transaction request to the blockchain system, the second server can subscribe or unsubscribe from the topic of the first IOT device, and the first server can also subscribe or unsubscribe from the topic of the first IOT device. For example, as shown in Figure 6, there is a new device in financial institution 2 that is a face-scanning payment device. After the first server sends the first transaction request to the blockchain system, the blockchain system generates a first transaction log, and the first transaction log is generated. The second server subscribes to the device topic of the face-swiping payment device, and sends it to the transaction statistics device after acquiring the publishing event of the face-swiping payment device. In addition, the first server can also determine whether it needs to subscribe to the face-swiping payment device according to the first transaction log. The device topic of the device. If the first server determines that the code-scanning payment device needs to obtain the publication event of the face-scanning payment device, the first server can also subscribe to the device topic of the face-scanning payment device, and obtains the release event of the face-scanning payment device. After the event, it will be sent to the scan code payment device. That is to say, the first server can also determine whether to subscribe or unsubscribe from the first IOT device topic according to the first IOT device topic indicated by the first IOT device information in the first transaction log. The first IOT device information in the instruction directly determines whether to subscribe or unsubscribe from the first IOT device topic.

上述技术方案中,提供一种适用于IOT设备联盟系统的IOT设备变更的方法,具体的,在系统中变更设备,可以是在系统中新增设备、删除设备、更新设备等,可以将变更设备定义为第一IOT设备,第一服务器用于管理该第一IOT设备。第一服务器生成包含第一IOT设备信息的第一交易请求,发送至区块链系统,区块链系统接收第一交易请求,调用设备管理合约后生成记录有第一IOT设备信息的第一交易日志,将该第一交易日志存储在区块链系统中,第二服务器可以通过订阅设备管理主题,获取第一交易日志,并根据第一交易日志确定是否订阅第一IOT设备主题。若第二服务器订阅第一IOT设备主题,则可以实现第二服务器获取第一IOT设备发布的事件,该IOT设备联盟系统中,第二服务器获取到第一IOT设备发布的事件后,可以将事件发送至对应的IOT设备,从而实现第二服务器对应的IOT设备接收第一IOT设备发布的事件。在系统中变更设备时,第一服务器只需要在区块链系统中写入变更设备信息的交易,则第二服务器可以通过订阅设备管理主题,获取变更设备的信息,并针对变更设备信息执行的相应动作。整个系统无需桥接器进行变更设备的绑定或者映射动作,且避免由于MQ和桥接服务分属不同的金融机构所存在的不一致问题,降低运维成本,适用于快速发展的IOT组网系统。In the above technical solution, a method for changing an IOT device suitable for an IOT device alliance system is provided. Specifically, changing a device in the system may be adding a device, deleting a device, updating a device, etc. in the system, and changing the device can be performed. It is defined as the first IOT device, and the first server is used to manage the first IOT device. The first server generates a first transaction request containing the information of the first IOT device, and sends it to the blockchain system, and the blockchain system receives the first transaction request, invokes the device management contract, and generates a first transaction that records the information of the first IOT device. log, and store the first transaction log in the blockchain system. The second server can obtain the first transaction log by subscribing to the device management topic, and determine whether to subscribe to the first IOT device topic according to the first transaction log. If the second server subscribes to the topic of the first IOT device, the second server can obtain the event published by the first IOT device. In the IOT device alliance system, after the second server obtains the event published by the first IOT device, the event can be It is sent to the corresponding IOT device, so that the IOT device corresponding to the second server receives the event published by the first IOT device. When changing the device in the system, the first server only needs to write the transaction of changing the device information in the blockchain system, then the second server can obtain the information of the changed device by subscribing to the device management topic, and execute the transaction for the changed device information. Action accordingly. The whole system does not require a bridge to change the binding or mapping of devices, and avoids inconsistencies due to the fact that MQ and bridge services belong to different financial institutions, reducing operation and maintenance costs, and is suitable for rapidly developing IOT networking systems.

基于同一发明构思,图7示例性的示出了本发明实施例提供的一种基于区块链的IOT设备变更的装置的结构,该装置可以执行基于区块链的IOT设备变更的方法的流程。Based on the same inventive concept, FIG. 7 exemplarily shows the structure of an apparatus for changing an IOT device based on a blockchain provided by an embodiment of the present invention, and the apparatus can execute the flow of a method for changing an IOT device based on the blockchain. .

该装置包括:The device includes:

处理单元701,用于生成包含第一IOT设备信息的第一交易请求;所述第一IOT设备信息为第一服务器下变更的IOT设备的设备信息;所述第一服务器为所述多个服务器中的任一个;A processing unit 701, configured to generate a first transaction request including first IOT device information; the first IOT device information is the device information of the IOT device changed under the first server; the first server is the multiple servers any one of;

收发单元702,用于将所述第一交易请求发送至所述区块链系统;所述第一交易请求用于指示所述区块链系统调用设备管理合约生成并存储第一交易日志;所述第一交易日志记录有设备管理主题及所述第一IOT设备信息;所述IOT设备联盟系统中的任一服务器均订阅有所述设备管理主题;所述第一交易日志用于第二服务器确定是否订阅所述第一IOT设备信息指示的第一IOT设备主题;所述第二服务器为所述IOT设备联盟系统中除所述第一服务器以外的任一服务器。A transceiver unit 702, configured to send the first transaction request to the blockchain system; the first transaction request is used to instruct the blockchain system to call a device management contract to generate and store a first transaction log; The first transaction log records the device management topic and the first IOT device information; any server in the IOT device alliance system is subscribed to the device management topic; the first transaction log is used for the second server Determine whether to subscribe to the first IOT device topic indicated by the first IOT device information; the second server is any server other than the first server in the IOT device alliance system.

可选的,所述处理单元701还用于:Optionally, the processing unit 701 is further configured to:

从所述区块链系统中获取第二交易日志;所述第二交易日志是所述区块链系统基于所述第二服务器发送的第二交易请求调用所述设备管理合约生成的;所述第二交易日志中记录有第二IOT设备信息和所述设备管理主题,所述第二IOT设备信息是所述第二服务器下新增的IOT设备的设备信息;Obtain a second transaction log from the blockchain system; the second transaction log is generated by the blockchain system calling the device management contract based on the second transaction request sent by the second server; the The second transaction log records the second IOT device information and the device management topic, and the second IOT device information is the device information of the newly added IOT device under the second server;

根据所述第二交易日志中的第二IOT设备信息,向所述区块链系统订阅所述第二IOT设备信息所指示的第二IOT设备主题。According to the second IOT device information in the second transaction log, the second IOT device topic indicated by the second IOT device information is subscribed to the blockchain system.

可选的,所述处理单元701还用于:Optionally, the processing unit 701 is further configured to:

在所述生成包含第一IOT设备信息的第一交易请求之前,根据所述第一IOT设备信息,生成所述第一IOT设备主题;Before generating the first transaction request including the first IOT device information, generating the first IOT device subject according to the first IOT device information;

根据所述第一IOT设备主题,生成并控制所述收发单元702向所述区块链系统发送第一部署请求;所述第一部署请求用于指示所述区块链系统部署所述第一IOT设备主题的主题合约;According to the first IOT device topic, generate and control the transceiver unit 702 to send a first deployment request to the blockchain system; the first deployment request is used to instruct the blockchain system to deploy the first deployment request The theme contract for the theme of the IOT device;

控制所述收发单元702接收所述区块链系统返回的第一部署结果,所述第一部署结果是所述区块链系统完成所述第一IOT设备主题的主题合约的部署后发送的;所述第一部署结果包括所述第一IOT设备主题的主题合约的合约地址。Controlling the transceiver unit 702 to receive the first deployment result returned by the blockchain system, where the first deployment result is sent after the blockchain system completes the deployment of the theme contract of the first IOT device theme; The first deployment result includes the contract address of the subject contract of the first IOT device subject.

可选的,所述处理单元701还用于:Optionally, the processing unit 701 is further configured to:

在所述生成第一部署请求之前,控制所述收发单元702向所述区块链系统发送第二部署请求;所述第二部署请求用于指示所述区块链系统部署系统合约;Before generating the first deployment request, control the transceiver unit 702 to send a second deployment request to the blockchain system; the second deployment request is used to instruct the blockchain system to deploy a system contract;

控制所述收发单元702接收所述区块链系统返回的第二部署结果;所述第二部署结果是所述区块链系统完成所述系统合约的部署后发送的;Control the transceiver unit 702 to receive the second deployment result returned by the blockchain system; the second deployment result is sent after the blockchain system completes the deployment of the system contract;

所述处理单元701还用于:The processing unit 701 is also used for:

在控制所述收发单元702接收所述区块链系统返回的第一部署结果之后,将所述第一IOT设备主题和所述第一IOT设备主题的主题合约的合约地址的对应关系更新至所述系统合约。After controlling the transceiver unit 702 to receive the first deployment result returned by the blockchain system, update the correspondence between the first IOT device topic and the contract address of the topic contract of the first IOT device topic to the the system contract.

基于同一发明构思,本发明实施例还提供了一种计算设备,包括:Based on the same inventive concept, an embodiment of the present invention also provides a computing device, including:

存储器,用于存储程序指令;memory for storing program instructions;

处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述基于区块链的IOT设备变更的方法。The processor is configured to call the program instructions stored in the memory, and execute the above method for changing the IOT device based on the blockchain according to the obtained program.

基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述基于区块链的IOT设备变更的方法。Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions, when the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned region-based A method for changing the IOT device of the blockchain.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although preferred embodiments of the present invention have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of the present invention.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of Internet of Things IOT equipment changing method based on block chain, which is characterized in that suitable for including multiple servers IOT equipment alliance system;Each server is for managing respective IOT equipment;The multiple server passes through block catenary system Carry out the information exchange of IOT equipment;
The described method includes:
First server generates the first transaction request comprising the first IOT facility information;The first IOT facility information is described The facility information of the IOT equipment changed under first server;The first server is any of the multiple server;
First transaction request is sent to the block catenary system by the first server;First transaction request is used for Indicate that the block catenary system calls equipment management contract to generate and store the first transaction log;First transaction log record There are equipment management theme and the first IOT facility information;Any server in the IOT equipment alliance system, which is subscribed to, to be had The equipment management theme;First transaction log determines whether to subscribe to the first IOT equipment letter for second server Cease the first IOT equipment theme of instruction;The second server is that the first server is removed in the IOT equipment alliance system Any server in addition.
2. the method as described in claim 1, which is characterized in that the method also includes:
The first server obtains the second transaction log from the block catenary system;Second transaction log is the area Block catenary system calls the equipment management contract to generate based on the second transaction request that the second server is sent;Described Record has the 2nd IOT facility information and the equipment management theme in two transaction logs, and the 2nd IOT facility information is described The facility information of the IOT equipment increased newly under second server;
The first server is ordered according to the 2nd IOT facility information in second transaction log, Xiang Suoshu block catenary system Read the 2nd IOT equipment theme indicated by the 2nd IOT facility information.
3. the method as described in claim 1, which is characterized in that it includes the first IOT facility information that the first server, which generates, The first transaction request before, further includes:
The first server generates the first IOT equipment theme according to the first IOT facility information;
The first server generates according to the first IOT equipment theme and sends the first deployment to the block catenary system Request;The first deployment request is used to indicate the theme contract that the block catenary system disposes the first IOT equipment theme;
The first server receives the first deployment that the block catenary system returns as a result, first deployment is the result is that described What block catenary system was completed to send after the deployment of the theme contract of the first IOT equipment theme;The first deployment result packet Include the contract address of the theme contract of the first IOT equipment theme.
4. method as claimed in claim 3, which is characterized in that before the first server generates the first deployment request, Further include:
The first server sends the second deployment request to the block catenary system;The second deployment request is used to indicate institute State block catenary system deployment system contract;
The first server receives the second deployment result that the block catenary system returns;Second deployment is the result is that described What block catenary system was completed to send after the deployment of the system contract;
After the first deployment result that the first server receives that the block catenary system returns, further includes:
The first server is by the contract of the first IOT equipment theme and the theme contract of the first IOT equipment theme The corresponding relationship of address is updated to the system contract.
5. a kind of device of the IOT equipment changing based on block chain characterized by comprising
Processing unit, for generating the first transaction request comprising the first IOT facility information;The first IOT facility information is The facility information of the IOT equipment changed under first server;The first server is any of the multiple server;
Transmit-Receive Unit, for first transaction request to be sent to the block catenary system;First transaction request is used for Indicate that the block catenary system calls equipment management contract to generate and store the first transaction log;First transaction log record There are equipment management theme and the first IOT facility information;Any server in the IOT equipment alliance system, which is subscribed to, to be had The equipment management theme;First transaction log determines whether to subscribe to the first IOT equipment letter for second server Cease the first IOT equipment theme of instruction;The second server is that the first server is removed in the IOT equipment alliance system Any server in addition.
6. device as claimed in claim 5, which is characterized in that the processing unit is also used to:
The second transaction log is obtained from the block catenary system;Second transaction log is that the block catenary system is based on institute The second transaction request for stating second server transmission calls the equipment management contract to generate;Remember in second transaction log Record has the 2nd IOT facility information and the equipment management theme, and the 2nd IOT facility information is new under the second server The facility information of the IOT equipment of increasing;
According to the 2nd IOT facility information in second transaction log, Xiang Suoshu block catenary system is subscribed to the 2nd IOT and is set 2nd IOT equipment theme indicated by standby information.
7. device as claimed in claim 5, which is characterized in that the processing unit is also used to:
It is described generate the first transaction request comprising the first IOT facility information before, according to the first IOT facility information, Generate the first IOT equipment theme;
According to the first IOT equipment theme, generates and control the Transmit-Receive Unit to block catenary system transmission first Administration's request;The first deployment request is used to indicate the theme conjunction that the block catenary system disposes the first IOT equipment theme About;
It controls the Transmit-Receive Unit and receives the first deployment of the block catenary system return as a result, described first disposes the result is that institute It states and sends after the deployment for the theme contract that block catenary system completes the first IOT equipment theme;The first deployment result The contract address of theme contract including the first IOT equipment theme.
8. device as claimed in claim 7, which is characterized in that the processing unit is also used to:
Before the first deployment of generation request, controls the Transmit-Receive Unit and asked to the second deployment of block catenary system transmission It asks;The second deployment request is used to indicate the block catenary system deployment system contract;
It controls the Transmit-Receive Unit and receives the second deployment result that the block catenary system returns;Second deployment is the result is that institute State what block catenary system was completed to send after the deployment of the system contract;
The processing unit is also used to:
After controlling the Transmit-Receive Unit and receiving the first deployment result that the block catenary system returns, by the first IOT The corresponding relationship of the contract address of the theme contract of equipment theme and the first IOT equipment theme is updated to the system and closes About.
9. a kind of calculating equipment characterized by comprising
Memory, for storing program instruction;
Processor requires 1 to 4 according to the program execution benefit of acquisition for calling the program instruction stored in the memory Described in any item methods.
10. a kind of computer-readable non-volatile memory medium, which is characterized in that including computer-readable instruction, work as computer When reading and executing the computer-readable instruction, so that computer executes such as the described in any item methods of Claims 1-4.
CN201910292923.1A 2019-04-12 2019-04-12 A method and device for changing IOT equipment based on block chain Active CN110062041B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910292923.1A CN110062041B (en) 2019-04-12 2019-04-12 A method and device for changing IOT equipment based on block chain
PCT/CN2020/079360 WO2020207194A1 (en) 2019-04-12 2020-03-13 Blockchain-based iot device changing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910292923.1A CN110062041B (en) 2019-04-12 2019-04-12 A method and device for changing IOT equipment based on block chain

Publications (2)

Publication Number Publication Date
CN110062041A true CN110062041A (en) 2019-07-26
CN110062041B CN110062041B (en) 2023-04-07

Family

ID=67318884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910292923.1A Active CN110062041B (en) 2019-04-12 2019-04-12 A method and device for changing IOT equipment based on block chain

Country Status (2)

Country Link
CN (1) CN110062041B (en)
WO (1) WO2020207194A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020207194A1 (en) * 2019-04-12 2020-10-15 深圳前海微众银行股份有限公司 Blockchain-based iot device changing method and apparatus
CN112543184A (en) * 2020-11-19 2021-03-23 杭州甘道智能科技有限公司 Block chain-based equipment authentication activation method
CN112669157A (en) * 2020-12-30 2021-04-16 深圳前海微众银行股份有限公司 Transaction method, device and system based on block chain and readable storage medium
CN114153153A (en) * 2021-12-13 2022-03-08 珠海格力电器股份有限公司 Device control method, system, apparatus, electronic device, and storage medium
CN115834663A (en) * 2022-11-29 2023-03-21 中国建设银行股份有限公司 Message processing method, device, equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679472A (en) * 2022-03-01 2022-06-28 达闼机器人股份有限公司 Communication system, method, apparatus, storage medium, and electronic device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106100981A (en) * 2016-08-22 2016-11-09 布比(北京)网络技术有限公司 Social network data exchange method and device
CN107911421A (en) * 2017-10-30 2018-04-13 上海点融信息科技有限责任公司 For configuring the method for internetwork communication, equipment and computer-readable storage medium in block chain
CN108134819A (en) * 2017-12-06 2018-06-08 北京连琪科技有限公司 Block chain operating status is collected and transfer approach, device and server
CN108347362A (en) * 2018-01-09 2018-07-31 海尔优家智能科技(北京)有限公司 A kind of method and bridging device and devices in system finding new equipment
CN108365993A (en) * 2018-03-09 2018-08-03 深圳前海微众银行股份有限公司 Block chain link point dynamic altering method, system and computer readable storage medium
CN108881165A (en) * 2017-05-16 2018-11-23 江峰 A multi-center authentication system with a block publishing mechanism
KR20180129027A (en) * 2017-05-24 2018-12-05 라온시큐어(주) Authentification methods and system based on programmable blockchain and one-id
CN108961047A (en) * 2017-05-25 2018-12-07 通用汽车环球科技运作有限责任公司 The method and system of data trade is carried out between vehicle and entity using block chain database
CN109462483A (en) * 2018-11-27 2019-03-12 平安科技(深圳)有限公司 Mail based on block chain deposits card method, apparatus, equipment and storage medium
US20190081789A1 (en) * 2017-09-13 2019-03-14 Vijay K. Madisetti Tokens or crypto currency using smart contracts and blockchains
CN109801152A (en) * 2019-01-24 2019-05-24 中国农业银行股份有限公司 Supplementary pension method for processing business and system based on block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180137457A1 (en) * 2016-11-16 2018-05-17 Sap Se Monitoring inventory based on iot device data
CN107104816A (en) * 2017-03-07 2017-08-29 阿里巴巴集团控股有限公司 A kind of information change monitoring method and device
US10547594B2 (en) * 2017-08-17 2020-01-28 Domanicom Corporation Systems and methods for implementing data communication with security tokens
CN110062041B (en) * 2019-04-12 2023-04-07 深圳前海微众银行股份有限公司 A method and device for changing IOT equipment based on block chain

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106100981A (en) * 2016-08-22 2016-11-09 布比(北京)网络技术有限公司 Social network data exchange method and device
CN108881165A (en) * 2017-05-16 2018-11-23 江峰 A multi-center authentication system with a block publishing mechanism
KR20180129027A (en) * 2017-05-24 2018-12-05 라온시큐어(주) Authentification methods and system based on programmable blockchain and one-id
CN108961047A (en) * 2017-05-25 2018-12-07 通用汽车环球科技运作有限责任公司 The method and system of data trade is carried out between vehicle and entity using block chain database
US20190081789A1 (en) * 2017-09-13 2019-03-14 Vijay K. Madisetti Tokens or crypto currency using smart contracts and blockchains
CN107911421A (en) * 2017-10-30 2018-04-13 上海点融信息科技有限责任公司 For configuring the method for internetwork communication, equipment and computer-readable storage medium in block chain
CN108134819A (en) * 2017-12-06 2018-06-08 北京连琪科技有限公司 Block chain operating status is collected and transfer approach, device and server
CN108347362A (en) * 2018-01-09 2018-07-31 海尔优家智能科技(北京)有限公司 A kind of method and bridging device and devices in system finding new equipment
CN108365993A (en) * 2018-03-09 2018-08-03 深圳前海微众银行股份有限公司 Block chain link point dynamic altering method, system and computer readable storage medium
CN109462483A (en) * 2018-11-27 2019-03-12 平安科技(深圳)有限公司 Mail based on block chain deposits card method, apparatus, equipment and storage medium
CN109801152A (en) * 2019-01-24 2019-05-24 中国农业银行股份有限公司 Supplementary pension method for processing business and system based on block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
梅兰妮·斯万: "《区块链 新经济蓝图及导读》", 31 May 2018, pages: 091 - 102 *
王成: ""基于区块链的保险行业信息系统架构及关键技术研究 "", 《中国优秀博士学位论文全文数据库》, 15 December 2018 (2018-12-15) *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020207194A1 (en) * 2019-04-12 2020-10-15 深圳前海微众银行股份有限公司 Blockchain-based iot device changing method and apparatus
CN112543184A (en) * 2020-11-19 2021-03-23 杭州甘道智能科技有限公司 Block chain-based equipment authentication activation method
CN112669157A (en) * 2020-12-30 2021-04-16 深圳前海微众银行股份有限公司 Transaction method, device and system based on block chain and readable storage medium
CN114153153A (en) * 2021-12-13 2022-03-08 珠海格力电器股份有限公司 Device control method, system, apparatus, electronic device, and storage medium
CN114153153B (en) * 2021-12-13 2024-05-03 珠海格力电器股份有限公司 Device control method, system, device, electronic device and storage medium
CN115834663A (en) * 2022-11-29 2023-03-21 中国建设银行股份有限公司 Message processing method, device, equipment and medium

Also Published As

Publication number Publication date
CN110062041B (en) 2023-04-07
WO2020207194A1 (en) 2020-10-15

Similar Documents

Publication Publication Date Title
US10552448B2 (en) Systems and methods for event driven object management and distribution among multiple client applications
CN110062041A (en) A kind of method and device of the IOT equipment changing based on block chain
US10560544B2 (en) Data caching in a collaborative file sharing system
US7912949B2 (en) Systems and methods for recording changes to a data store and propagating changes to a client application
CN113630310B (en) A distributed high-availability gateway system
US11416294B1 (en) Task processing for management of data center resources
AU2017251862A1 (en) Marketplace for timely event data distribution
US20050246547A1 (en) Computer grid access management system
WO2021047227A1 (en) Cross-region service sharing method, apparatus and management device, and storage medium
CA2843284A1 (en) Computer system, computer-implemented method and computer program product for sequencing incoming messages for processing at an application
CN114866416A (en) Multi-cluster unified management system and deployment method
CN110413918A (en) Data transmission method for uplink, device, equipment and storage medium
AU2019203092A1 (en) System and method for deploying a distributed component-based application
EP1872256B1 (en) System and method of waste management
JP2009157786A (en) Message transmission control method, message transmission control device, and message transmission control program
US12153551B2 (en) Intelligent cloud portal integration
CN115102854B (en) Remote procedure call route management control method, system and equipment for micro-service
CN117240825A (en) An address database construction method, device, equipment and medium applied to CDN
CN117114613A (en) A process engine, method, equipment and program product for business process control
CN115934292A (en) Calling method, device and equipment of microservice application
CN114598700A (en) Communication method and communication system
WO2014036715A1 (en) System and method for controlling real-time resource supply process based on delivery point
CN114546674A (en) Method, device, electronic equipment and medium for processing service
CN115730934A (en) Blockchain-based data processing method, device, equipment and storage medium
JP2018181012A (en) Business collaboration system and business collaboration method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant