Information processing method, device, gateway device, control system and storage medium
By adopting blockchain technology and UDP discovery protocol in the smart home system and organizing the accounting linkage rule information of multiple gateway devices, the problems of low linkage efficiency of home devices and insufficient data privacy are solved, and efficient and secure smart home network control is achieved.
Patent Information
- Application Number
- CN202111257587.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-10-27
AI Technical Summary
The linkage efficiency between different home devices in existing smart home systems is low, the network structure deployment is complex, data privacy is insufficient, and network congestion and insufficient device linkage flexibility are prone to occur in large-scale networks.
Blockchain technology is used to organize multiple gateway devices in the smart home network. Each gateway device records the linkage rule information, and device discovery and binding are achieved through the UDP discovery protocol, which reduces physical storage devices, reduces the complexity of network structure deployment, improves linkage efficiency and protects data privacy.
It improves the linkage efficiency of home devices, reduces the complexity of network structure deployment and coordination costs, enhances data privacy and network robustness, avoids broadcast storms, and ensures the stable operation of large-scale networks.
Smart Images

Figure CN116032674B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to an information processing method, apparatus, gateway device, smart home control system, and storage medium. Background Art
[0002] The smart home system uses the house as a platform and uses integrated wiring technology, network communication technology, security technology, automatic control technology, audio and video technology, etc. to integrate home appliances related to home life, and coordinates and controls these home appliances by building an efficient computer information management system, thereby improving the comfort, safety and convenience of people's home life.
[0003] A key feature of smart home systems that attracts users is the interconnectedness of home devices connected to the network. For example, unlocking a smart door lock triggers home mode, which automatically executes actions such as turning on the living room lights, activating the air conditioner and automatically setting it to a comfortable temperature, and turning on the speakers to play user-selected background music.
[0004] However, how to achieve efficient linkage between different home devices in a smart home system is still a problem that needs to be solved urgently. Summary of the Invention
[0005] To solve related technical problems, the embodiments of the present application provide an information processing method, apparatus, gateway device, smart home control system and storage medium.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] An embodiment of the present application provides an information processing method, applied to a first gateway device, including:
[0008] Receiving a first instruction sent by a terminal, where the first gateway device is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0009] determining a type of the first instruction;
[0010] When the type of the first instruction is a linkage rule creation instruction, submitting the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction;
[0011] When the type of the first instruction is a device control instruction, the first instruction is sent to the electronic device in the smart home network to execute the first instruction.
[0012] In the above solution, the first instruction sent by the receiving terminal includes:
[0013] receiving the first instruction directly sent by the terminal;
[0014] or,
[0015] Receive the first instruction sent by the terminal through the smart home cloud platform.
[0016] In the above solution, the method further includes:
[0017] Access and register to the smart home cloud platform.
[0018] In the above solution, the method further includes:
[0019] Accessing the blockchain network after startup;
[0020] Determine whether block data synchronization is required and obtain the judgment result;
[0021] The block data is synchronized or not synchronized according to the judgment result.
[0022] In the above solution, the method further includes:
[0023] The blockchain network is discovered based on the User Datagram Protocol (UDP).
[0024] In the above solution, the method further includes:
[0025] After the first electronic device in the smart home network is connected to the first gateway device, a device binding relationship is established between the first gateway device and the first electronic device;
[0026] Submitting the device binding relationship to the blockchain network to form device topology information;
[0027] The first instruction is sent to electronic devices in the smart home network according to the device topology information.
[0028] In the above solution, the method further includes:
[0029] receiving a device event reported by a second electronic device in a smart home network connected to the first gateway device;
[0030] Searching for a linkage rule corresponding to the device event in the linkage rules;
[0031] At least one linkage device instruction included in the linkage rule is sent to a corresponding electronic device in the smart home network to execute the corresponding linkage device instruction.
[0032] In the above solution, the method further includes:
[0033] Submitting the execution record of the linkage rule to the blockchain network.
[0034] In the above solution, a gateway device having a device binding relationship with the electronic device corresponding to the linkage device instruction is determined based on the device topology information;
[0035] When the determined gateway device is not the first gateway device, a linkage device instruction is sent to the corresponding electronic device via a second gateway device that has established a device binding relationship with the corresponding electronic device.
[0036] The embodiment of the present application further provides an information processing apparatus, which is provided on a first gateway device and includes:
[0037] a receiving unit, configured to receive a first instruction sent by a terminal, wherein the first gateway device is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0038] a determining unit, configured to determine a type of the first instruction;
[0039] An execution unit is configured to, when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to an electronic device in the smart home network to execute the first instruction.
[0040] The embodiment of the present application further provides a gateway device, comprising: a processor and a communication interface; wherein,
[0041] The communication interface is configured to receive a first instruction sent by a terminal, wherein the gateway device is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0042] The processor is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network through the communication interface to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network through the communication interface to execute the first instruction.
[0043] The embodiment of the present application further provides a gateway device, characterized in that it includes: a processor and a memory for storing a computer program that can be run on the processor,
[0044] The processor is configured to execute the steps of any of the above methods when running the computer program.
[0045] The present application also provides a smart home control system, including:
[0046] Smart home cloud platform;
[0047] Multiple gateway devices, wherein the multiple gateway devices constitute a blockchain network in the smart home network;
[0048] a terminal, configured to send a first instruction to a first gateway device among the plurality of gateway devices directly or through the smart home cloud platform,
[0049] The first gateway device is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network to execute the first instruction.
[0050] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the steps of any of the above methods are implemented.
[0051] The information processing method, apparatus, gateway device, smart home control system and storage medium provided by the embodiments of the present application include: a first gateway device receiving a first instruction sent by a terminal, the first gateway device being one of multiple gateway devices in a smart home network, the multiple gateway devices forming a blockchain network; determining the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submitting the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; when the type of the first instruction is a device control instruction, sending the first instruction to the electronic device in the smart home network to execute the first instruction. The technical solution provided by the embodiments of the present application combines blockchain technology with the control of smart homes, utilizing the decentralized nature of blockchain technology. The linkage rule information will be recorded by each gateway device. Therefore, after a gateway device receives a user instruction, it does not need to query other gateway devices for the relevant information required to execute the instruction. In this way, there is no need to physically deploy additional equipment specifically for storing linkage rule information. In this way, the complexity of network structure deployment and the coordination cost between gateway devices are reduced, the linkage efficiency of home devices is improved, and the privacy of data is protected.
[0052] In addition, the gateway device uses UDP to discover the blockchain network and access the blockchain network, and the smart home electronic devices use UDP to discover the gateway device and bind to a specific gateway device. Since UDP supports a one-to-many interaction mode, that is, a message sent by the sender can be received by multiple receivers, which facilitates the purpose of discovering gateway devices and electronic devices in the smart home network; since the gateway device discovers the blockchain network based on UDP, and the electronic devices in the smart home network discover the network devices based on UDP, it can ensure that all gateway devices and smart home electronic devices are in the same local area network (that is, the smart home network); at the same time, the message structure based on UDP is simple, so the signaling overhead is relatively small.
[0053] In addition, device topology information and linkage rule information will be recorded by each gateway device in the blockchain network, so that multiple gateway devices can jointly undertake various events in the entire smart home control system, thereby improving the processing efficiency of various events in the smart home control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a schematic diagram of the structure of a smart home control system according to an embodiment of the present application;
[0055] Figure 2 The content of the chain data stored in the gateway device in the blockchain network of the embodiment of the present application;
[0056] Figure 3 This is a schematic diagram of the process of the gateway device going online in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of the process of bringing a primary electronic device online according to an embodiment of the present application;
[0058] Figure 5 A schematic diagram of the process of bringing a secondary electronic device online according to an embodiment of the present application;
[0059] Figure 6 A schematic diagram of a flow chart of processing a received terminal control instruction by the smart home control system according to an embodiment of the present application;
[0060] Figure 7 A schematic diagram of a process for processing device events by a smart home control system according to an embodiment of the present application;
[0061] Figure 8 A schematic diagram of a process flow for handling a gateway device failure according to an embodiment of the present application;
[0062] Figure 9 A flowchart of an information processing method according to an embodiment of the present application;
[0063] Figure 10 This is a schematic diagram of the structure of an information processing device according to an embodiment of the present application;
[0064] Figure 11 This is a schematic diagram of the gateway device structure of an embodiment of the present application. DETAILED DESCRIPTION
[0065] The present application will be described in further detail below with reference to the accompanying drawings and embodiments.
[0066] In related technologies, the linkage control of multiple electronic devices in a smart home network is mainly achieved through the following two technical solutions:
[0067] The first solution is a cloud platform control solution. In this solution, electronic devices connected to the smart home network are registered with the cloud platform, and linkage rules are established on the cloud platform. This allows for centralized scheduling of smart home devices through the cloud platform. However, because cloud platform scheduling is remote and highly dependent on the cloud platform, this solution suffers from issues such as response delay and reliability.
[0068] The second solution is to transfer the linkage processing capability to the home gateway. In the solution using the home gateway, the linkage processing capability is transferred to the home router or other networking gateway (for example, Zigbee gateway, RS485 gateway, etc.). However, with the popularization of the concept of smart home, the number and types of devices connected to the smart home network are constantly increasing. Or in large-sized households or villa-type households with large home networks, a single gateway can no longer meet the computing tasks of device linkage, and there is a risk of the entire network collapsing due to a single gateway failure. Therefore, at least two physical gateways need to be set up, but there is currently no relevant technology to support two physical gateways in the same home network to take effect simultaneously and collaboratively share the pressure of the entire home network.
[0069] Among them, in order to solve the above problems, the relevant technology proposes a solution. Specifically, multiple control nodes and backup nodes are arranged in the home network, all device events will be broadcast to the home network, and multiple control nodes will compete for the control of the device event. The control node that obtains the control right of the device event queries the backup node for linkage rule information, and sends control instructions to the home devices involved in the linkage rule information according to the linkage rule information returned by the backup node, so as to realize the control of the home devices in the home network.
[0070] However, the above solution still has the following technical problems:
[0071] First, the control node and backup node are physically separated, which increases unnecessary coordination costs for querying linkage rule information, complicating network structure deployment and increasing network traffic.
[0072] Secondly, in scenarios where the scale of smart home networks is large, the control node that obtains control rights for device events and the home devices involved in the queried linkage rule information may be in different LAN segments (connected to different routers). Therefore, it is impossible to establish a constraint relationship between the two, resulting in data intercommunication.
[0073] Thirdly, there is no detailed explanation on how to configure linkage rules in a home network, resulting in low flexibility for users to control linkage between multiple electronic devices;
[0074] Finally, all device events need to be notified to all control nodes in the form of broadcasts. When the smart home network is large, multiple home devices send broadcast messages at the same time. A large number of broadcast messages will flood the network, occupying a large amount of network bandwidth, causing network congestion and data packets cannot be transmitted normally, resulting in phenomena such as broadcast storms.
[0075] Based on this, in various embodiments of the present application, blockchain technology is used to organize multiple gateway devices in a smart home network, and each gateway device can receive terminal control instructions to realize linkage rule creation or device control functions. The linkage rule information will be recorded by each gateway device, so after a gateway device receives a terminal control instruction, it is not necessary to query other gateway devices for the relevant information required to execute the terminal control instruction. In this way, there is no need to physically deploy additional devices specifically for storing device linkage rule information. In this way, the complexity of network structure deployment and the coordination cost between gateway devices can be reduced, the linkage efficiency of home devices is improved, and the privacy of data is protected.
[0076] The embodiment of the present application provides a smart home control system, such as Figure 1 Said smart home control system comprises:
[0077] Smart home cloud platform 105;
[0078] Multiple gateway devices 103, wherein the multiple gateway devices 103 constitute a blockchain network in the smart home network (i.e., a home private domain blockchain network);
[0079] The terminal 104 is configured to send a first instruction to a first gateway device among the plurality of gateway devices directly or through the smart home cloud platform.
[0080] The first gateway device is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network to execute the first instruction.
[0081] The smart home network can be understood as a local area network formed within the home, which can allow access to the electronic devices, multiple gateway devices 103 and terminals 104.
[0082] The multiple gateway devices 103 in the home private domain blockchain network can be registered and connected to the smart home cloud platform 105 through a public network (such as the Internet), and the terminal 104 can also be connected to the smart home cloud platform 105, so that the multiple gateway devices 103 and the electronic devices bound to the multiple gateway devices 103 can be remotely controlled through the smart home cloud platform 105.
[0083] The gateway device 103 is a special type of smart home device that allows electronic devices within the smart home network to access, and can register and access the smart home cloud platform 105 so that the terminal 104 can access the gateway device 103 through the smart home cloud platform 105. In actual application, the gateway device 103 may include a home router, a networking device, or an ordinary smart device that supports the Internet Protocol (IP), that is, it only needs to meet certain computing and storage capabilities and be able to be relatively stable and continuously online. Therefore, in the embodiment of the present application, the hardware and functional requirements for the gateway device are relatively low, and the form of the gateway device is expanded to facilitate the construction of a large-scale smart home network.
[0084] In a smart home network, the gateway device 103 has both blockchain node and gateway node functions. To address the blockchain node function of the gateway device 103, multiple gateway devices 103 together constitute a private home blockchain network. Each gateway device 103, based on smart contracts, can authenticate and record the registration information, device linkage rules, and terminal control command execution information of other gateway devices and electronic devices in the smart home network. To address the gateway node function of the gateway device 103, it can discover and register electronic devices in the smart home network and collaborate with other gateway devices to achieve linkage of electronic devices across the entire smart home network.
[0085] In actual application, the blocks on each gateway device 103 can store data in a chain to facilitate searching. Figure 2 As shown, the gateway device 103 includes three blocks, namely blocks 201 , 202 and 203 , wherein block 201 records device topology information, block 202 records linkage rule information, and block 203 records linkage rule execution record information.
[0086] Blocks 201, 202, and 203 all contain a block header (which can be expressed as Head in English) and a block body (which can be expressed as Body in English). The block headers of blocks 201, 202, and 203 all contain a creation timestamp, a hash value of the previous data block, and a hash of the current block. The hash of the previous data block is used to point to the previous block of the current block, the hash of the current block is used to mark the current block, and the creation timestamp is used to mark the creation time of the current block.
[0087] The block body of block 201 includes multiple data packets, such as data packet 1, data packet 2, and so on. Each data packet includes information such as an electronic device identifier, an electronic device address, and a gateway address associated with the electronic device. In other words, each data packet may include topology information for a single electronic device. If the electronic device cannot directly access the smart home network via the Internet Protocol (IP), the data packet may also include a networking device address for assisting in connecting the electronic device to the smart home network.
[0088] The block body of block 202 includes multiple data packets, for example, data packet 1, data packet 2, and so on. Each data packet includes a linkage rule identifier, a triggering device identifier, a triggering device event, a linkage condition (optional), a linkage device identifier, a linkage device instruction, and so on. That is, each data packet includes linkage rule information related to an electronic device event. Among them, the linkage rule identifier is used to indicate the identifier of the linkage rule shown in the corresponding data packet, the triggering device identifier is used to indicate the identifier of the electronic device that triggers this linkage rule, the triggering device event is used to indicate the device event that triggers this linkage rule, the linkage condition may include the triggering device event and other additional conditions that trigger this linkage rule (such as time range, weather conditions, user type, etc.), the linkage device identifier is used to indicate the identifier of the electronic device (linked device) triggered by the electronic device event, and the linkage device instruction is used to indicate the instruction in this linkage rule for instructing the linkage device action.
[0089] The block body of block 203 includes multiple data packets, such as Data Packet 1, Data Packet 2, and so on. Each data packet is used to record the execution information of the linkage rule. The linkage rule identifier is used to indicate the linkage rule identifier, the linkage execution status is used to indicate the execution status of the corresponding linkage rule (e.g., execution result, execution failure reason, etc.), and the linkage execution time is used to indicate the execution time of the corresponding linkage rule.
[0090] As can be seen from the above description, each gateway device 103 records the topology information of the electronic devices in the smart home network, the linkage rule information of the smart home network, and the execution record information of the linkage rules, etc. That is, this information is recorded by each gateway device 103. In this way, after the gateway device 103 receives the terminal control instruction sent by the terminal 104 or the device event sent by the electronic device, the gateway device 103 can execute the terminal control instruction or respond to the device event according to the device topology information and linkage rule information stored in itself, without having to query the corresponding linkage rules from other gateway devices or other devices used to store device topology information and linkage rules. Therefore, the complexity of the smart home network structure deployment and the coordination cost between gateway devices can be reduced, thereby improving the processing efficiency of user instructions or device events; in addition, since each gateway device 103 stores the complete linkage rules, device topology information and other information of the smart home network, when a single gateway device 103 fails, it will not affect the normal operation of the entire smart home network, thereby improving the robustness and security of the network structure.
[0091] In addition, in actual application, the chain data stored in the gateway device 103 in the home private domain blockchain network disclosed in the embodiment of the present application may only include smart contracts and related block data related to device registration, linkage rule creation and linkage rule execution records. In this way, it can not only ensure the processing efficiency and data privacy of the home private domain blockchain data, but also meet the functional requirements of the gateway device 103 in the smart home network.
[0092] The terminal 104 can be operated by the user to enable the user to control the smart home network. It is usually implemented as a device such as a user's mobile phone or computer. The terminal 104 can issue terminal control commands to the gateway device 103 in the smart home network and receive and display feedback information regarding the results of the command execution and / or information proactively reported by the gateway device 103 (for example, the gateway device 103 reports a security alarm event to the terminal 104). When the terminal 104 is in the smart home network, the terminal 104 can discover multiple gateway devices 103 through the network discovery protocol and connect to one of the multiple gateway devices 103 discovered. In one embodiment, the terminal 104 can discover the gateway device 103 in the smart home network by sending a UDP broadcast message, that is, the terminal 104 can discover the gateway device 103 based on UDP. When the terminal 104 is not in the smart home network, the terminal 104 needs to access the smart home network remotely. In this case, the terminal 104 can access the smart home cloud platform 105 through the public network and send control commands to one of the multiple gateway devices 103 through the smart home cloud platform 105. The gateway device is a gateway device selected by the user from the plurality of gateway devices 103 through the terminal 104 .
[0093] Here, the terminal 104 is allowed to access the home private domain blockchain network through both remote and network discovery protocols, making the user's control over electronic devices in the smart home network more flexible. In addition, accessing the home private domain blockchain network through the network discovery protocol can avoid user data in the smart home network from entering the public network and the delay caused by entering the public network, thereby ensuring the security and processing efficiency of the smart home control system.
[0094] When a first gateway device among the multiple gateway devices 103 receives a terminal control instruction (ie, the first instruction) from the terminal 104 , the first gateway device determines the type of the first instruction and performs different operations according to the type of the first instruction.
[0095] Specifically, when the first instruction is a linkage rule creation instruction, the first gateway device 103 uploads the first instruction to the home private blockchain network. After receiving the first instruction, all gateway devices 103 in the home private blockchain network create a smart contract based on the linkage rules to identify the legitimacy of the linkage rule information corresponding to the first instruction. After all gateway devices 103 confirm that the linkage rule information corresponding to the first instruction is legitimate, each gateway device 103 completes data accounting and updates the linkage rule data. In this way, users can flexibly set linkage rules in the smart home network through terminal control instructions, and the updating, creation, and storage of linkage rules are all implemented in the home private blockchain network, thus ensuring data security.
[0096] Among them, in actual application, when each gateway device 103 confirms the legitimacy of the linkage rule information corresponding to the first instruction, it can be achieved by judging whether all electronic device identifiers in the linkage rule information corresponding to the first instruction are stored locally. Specifically, when it is determined that all electronic device identifiers in the linkage rule information corresponding to the first instruction are stored locally, it is determined that the created linkage rule information is legal; correspondingly, when it is determined that only some electronic device identifiers in the linkage rule information corresponding to the first instruction are stored locally or it is determined that all electronic device identifiers in the linkage rule information corresponding to the first instruction are not stored locally, it is determined that the created linkage rule information is illegal.
[0097] When the first gateway device determines that the type of the first instruction is a device control instruction, the first gateway device can query the device topology information stored locally in the first gateway device, and find the electronic device corresponding to the first instruction based on the device topology information, and send the first instruction to the corresponding electronic device.
[0098] Here, when there is a device binding relationship between the electronic device and the first gateway device, the first gateway device sends the first instruction directly to the electronic device; if the electronic device is bound to other gateway devices, that is, there is no device binding relationship between the electronic device and the first gateway device, then the first gateway device forwards the first instruction to the corresponding gateway device, and the corresponding gateway device sends the first instruction to the electronic device.
[0099] In one embodiment, referring to Figure 1 , electronic devices may include a primary electronic device 100 and a secondary electronic device 101. The primary electronic device 100 can access the smart home network via IP and can access a gateway device 103 in the home private blockchain network via a network discovery protocol (such as UDP). In actual application, the primary electronic device 100 may include sockets, air conditioners, cameras, etc. The secondary electronic device 101 cannot directly access the smart home network via IP and must instead access the smart home network through a networking device 102 that supports a protocol supported by the secondary electronic device 101 (e.g., Zigbee, Bluetooth, or RS485). Furthermore, the secondary electronic device 101 typically cannot dynamically select a networking device 102 and requires user assistance in establishing a binding relationship between the secondary electronic device 101 and the networking device 102. In actual application, the secondary electronic device 101 may include a switch, a weight scale, a smoke sensor, etc. The networking device 102 is a special type of smart home device that can support the access of the secondary electronic device 101 and act as a proxy for the secondary electronic device 101 to access the gateway device 103. At the same time, the networking device 102 can also serve as a primary electronic device 100 or a gateway device 103 .
[0100] The following describes the access (also understood as going online) process of the gateway device 103, the primary electronic device 100, and the secondary electronic device 101 in the above-mentioned smart home control system.
[0101] First, the gateway device online process is described.
[0102] Reference Figure 3 Taking the first gateway device as an example, the online process of the gateway device 103 includes the following steps:
[0103] Step 301: The first gateway device is started;
[0104] Step 302: After startup, the first gateway device determines whether it is the first time to use the device. If it is the first time to use the device, step 303 is executed; otherwise, step 304 is executed.
[0105] Specifically, after the first gateway device is started, the first gateway device is in an initialization state and does not store network configuration information related to the smart home network, so it cannot connect to the smart home network. At this time, the first gateway device determines that it is being used for the first time.
[0106] Step 303: When using the first gateway device for the first time, the user configures the network for the first gateway device, for example, connects to the upper-level router, and completes the binding between the terminal 104 and the first gateway device by scanning a code or other means to determine the ownership relationship of the first gateway device, and then continues to step 304;
[0107] Step 304: The first gateway device connects to the home private blockchain network, and then executes step 305;
[0108] Here, the first gateway device can discover other gateway devices in the home private domain blockchain network through a network discovery protocol. Specifically, the first gateway device discovers other gateway devices in the home private domain blockchain network through UDP messages.
[0109] Among them, since UDP supports one-to-many interaction, the UDP message sent by the first gateway device can be received by multiple gateway devices in the home private domain blockchain network; in addition, the operation of discovering other gateway devices based on UDP is only performed within the local area network, so it can be guaranteed that all gateway devices connected to the home private domain blockchain network and the device topology information, linkage rule information, etc. stored in all gateway devices are all within the smart home network, which can ensure the security and privacy of the home private domain blockchain network; the first gateway device only sends UDP messages when it is online, and the message structure of the UDP message is simple (less overhead), so the number of UDP messages sent is small and less network resources are occupied, which can avoid network congestion.
[0110] Step 305: After the first gateway device connects to the home private blockchain network, it checks the latest block data in the home private blockchain network. If the latest block data is higher than the block height of the block data stored by the first gateway device itself, the first gateway device synchronizes the current complete block data of the home private blockchain network. Otherwise, data synchronization is not required, and step 306 is executed.
[0111] Here, it can be seen from steps 304 and 305 that in the smart home control system disclosed in the embodiment of the present application, the gateway device discovers and accesses the home private domain blockchain network through UDP messages, and then checks the data height in the home private domain blockchain network and synchronizes or does not synchronize the block data. In this way, by utilizing the decentralized characteristics between the nodes in the blockchain, each gateway device connected to the home private domain blockchain network has no master-slave and functional distinction, and the cost of hardware, software implementation and deployment is low.
[0112] Step 306: The first gateway device is connected to the smart home cloud platform 105 and completes registration on the smart home cloud platform 105 so as to receive access from the terminal 104 through the interface service provided by the smart home cloud platform 105. Then, step 307 is executed:
[0113] Step 307: The first gateway device starts its own device discovery and heartbeat and other related functions to discover and synchronize events in the smart home network in real time, receive terminal control instructions from the terminal 104, etc.
[0114] After step 307 is completed, the first gateway device completes the online process.
[0115] Next, the online process of the primary electronic device 100 is described.
[0116] Reference Figure 4 Taking the first level electronic device in at least one level electronic device 100 as an example, the online process of the level electronic device 100 includes the following steps:
[0117] Step 401: The first-level electronic device is started;
[0118] Step 402: After startup, the first-level electronic device determines whether it is the first time to use the device. If it is the first time to use the device, step 403 is executed; otherwise, step 404 is executed.
[0119] Specifically, after the first-level electronic device is started, it is in an initialization state and does not store network configuration information related to the smart home network, so it cannot connect to the smart home network. At this time, the first-level electronic device determines that it is being used for the first time.
[0120] Step 403: When using the first-level electronic device for the first time, the user configures a network for the first-level electronic device, for example, by connecting the first-level electronic device to a wired network or a wireless network, and binds the terminal 104 to the first-level electronic device by scanning a code or other means to determine the ownership relationship of the first-level electronic device, and then executes step 404;
[0121] Step 404: The first-level electronic device sends a broadcast message to search for a gateway device to access a gateway device (e.g., the first gateway device), and then executes step 405;
[0122] Here, the first-level electronic device can discover the gateway device in the home private blockchain network through the network discovery protocol. Specifically, the first-level electronic device discovers the gateway device through UDP broadcast message.
[0123] Among them, since UDP supports one-to-many interaction, the UDP messages sent by the first-level electronic device can be received by multiple gateway devices in the home private domain blockchain network; secondly, the first-level electronic device only sends UDP broadcast messages for discovering gateway devices during the online stage, and the message structure of the UDP message is simple (less overhead), so the first-level electronic device sends fewer UDP messages and occupies less network resources, which can avoid network congestion; thirdly, the operation of discovering gateway devices based on UDP messages is only performed within the local area network, so that all first-level electronic devices in the same smart home network are in the same smart home network after going online, which can ensure data security and privacy.
[0124] Step 405: After the first-level electronic device discovers multiple gateway devices in the home private blockchain network through the network discovery protocol, the first-level electronic device receives response messages sent by one or more gateway devices, and then executes step 406;
[0125] Here, after the broadcast message in a specific format (i.e., UDP broadcast message) sent by the first-level electronic device is listened to by one or more gateway devices, the one or more gateway devices that listened to the broadcast message send a response message to the first-level electronic device, and the first-level electronic device can receive the response message from one or more gateway devices.
[0126] Step 406: In response to the response messages received from one or more gateway devices, the first-level electronic device selects a response message from the received multiple response messages and sends a confirmation message to the gateway device that sent the selected response message (e.g., the first gateway device), indicating that a device binding relationship of the first-level electronic device has been established with the first gateway device during this online session. Then, step 407 is executed.
[0127] Here, in actual application, when the first-level electronic device receives response messages from multiple gateway devices, the first-level electronic device may select the response message received most recently from the multiple received response messages.
[0128] Step 407: After receiving the confirmation message, the first gateway device confirms the device binding relationship between the first gateway device and the first-level electronic device, and submits the device binding relationship of the first-level electronic device to the home private blockchain network, and then executes step 408;
[0129] Step 408: After receiving the device binding relationship of the first-level electronic device submitted by the first gateway device, the other gateway devices in the home private blockchain network verify the legitimacy of the device binding relationship of the first-level electronic device according to the device registration smart contract in the home private blockchain network. After confirming that the device binding relationship of the first-level electronic device is legitimate, all gateway devices record the device binding relationship of the first-level electronic device to update the device topology information stored in each gateway device. In this way, the registration of the first-level electronic device in the home private blockchain network is completed, and then step 409 is executed.
[0130] Here, in actual application, when each gateway device confirms the legitimacy of the device binding relationship of the first-level electronic device, it can be achieved by accessing the smart home cloud platform 105 and having the smart home cloud platform 105 verify whether the device identification and device version number information of the first-level electronic device exist and are legal. Specifically, each gateway device transmits the device identification and device version number information of the first-level electronic device to the smart home cloud platform 105, and the smart home cloud platform 105 confirms whether the device identification and device version number information of the first-level electronic device exist and are legal based on the device information stored locally or queried through the network (such as the Internet). Then, the smart home cloud platform 105 returns the confirmation result to the gateway device, and the gateway device determines the legitimacy of the device binding relationship of the first-level electronic device based on the return result of the smart home cloud platform 105. For example, if the device identification and device version number of the first-level electronic device exist and are legal, the gateway device determines that the device binding relationship of the first-level electronic device is legal. Otherwise, the gateway device determines that the device binding relationship of the first-level electronic device is illegal.
[0131] Step 409: The first gateway device submits the device binding relationship between the first gateway device and the first-level electronic device to the smart home cloud platform 105. The smart home cloud platform 105 records the device binding relationship of the first-level electronic device, thereby completing the registration of the first-level electronic device on the smart home cloud platform 105. Then, step 410 is executed.
[0132] Step 410: The first-level electronic device turns on heartbeat and other related functions to maintain regular heartbeats with the first gateway device to maintain network connectivity.
[0133] After step 410 is completed, the first-level electronic device completes the online process.
[0134] Next, the online process of the secondary electronic device 101 is described.
[0135] Reference Figure 5 Taking the first secondary electronic device in the at least one secondary electronic device 101 as an example, the online process of the secondary electronic device 101 includes the following steps:
[0136] Step 501: the first and second electronic devices are started;
[0137] Step 502: After startup, the first or second electronic device determines whether it is being used for the first time. If so, the process proceeds to step 503; otherwise, the process proceeds to step 507.
[0138] Specifically, after the first and second level electronic devices are started, they are in an initialization state and do not store any network configuration information related to any networking device. Therefore, they cannot connect to the networking device through the communication protocol supported by the first and second level electronic devices. At this time, the first and second level electronic devices determine that they are being used for the first time.
[0139] Step 503: When used for the first time, the user configures a network for the first secondary electronic device. For example, the user connects the first secondary electronic device to a networking device (e.g., the first networking device) according to a communication protocol supported by the first secondary electronic device (e.g., Zigbee protocol, Bluetooth protocol, RS485 interface, etc.), thereby establishing a device binding relationship between the first secondary electronic device and the secondary electronic device of the first networking device. After binding the first secondary electronic device to the first networking device, the user binds the first secondary electronic device to the terminal 104 by scanning a code or other means to confirm the ownership relationship of the first secondary electronic device, and then executes step 504.
[0140] Step 504: The first networking device determines whether it is a gateway device. If it is a gateway device, the process proceeds to step 506; otherwise, the process proceeds to step 505.
[0141] Specifically, if the first networking device locally stores information for executing a gateway node function, the first networking device determines that it is a gateway device; otherwise, it determines that it is not a gateway device.
[0142] Step 505: If the first networking device is not a gateway device, the first networking device reports the device binding relationship of the secondary electronic device to the corresponding gateway device to which the first networking device is bound, and then executes step 506;
[0143] Step 506: The corresponding gateway device submits the device binding relationship between the first secondary electronic device and the secondary electronic device of the first networking device to the home private blockchain network;
[0144] Here, all gateway devices in the home private blockchain network verify the legitimacy of the device binding relationship of the secondary electronic device according to the device registration smart contract in the home private blockchain network; after confirming that the device binding relationship of the secondary electronic device is legal, all gateway devices record the device binding relationship of the first secondary electronic device to update the device topology information stored in each gateway device, complete the registration of the first secondary electronic device in the home private blockchain network, and then execute step 507;
[0145] Specifically, when each gateway device verifies the legitimacy of the device binding relationship of the first-level electronic device, it can be achieved by accessing the smart home cloud platform 105 and having the smart home cloud platform 105 verify whether the device identification and device version number information of the first-level electronic device exist and are legal. Specifically, each gateway device transmits the device identification and device version number information of the first-level electronic device to the smart home cloud platform 105, and the smart home cloud platform 105 confirms whether the device identification and device version number information of the first-level electronic device exist and are legal based on its own storage or information queried through the network (such as the Internet). Then, the smart home cloud platform 105 returns the confirmation result to the gateway device, and the gateway device determines the legitimacy of the device binding relationship of the first-level electronic device based on the return result of the smart home cloud platform 105. For example, if the device identification and device version number of the first-level electronic device exist and are legal, the gateway device determines that the device binding relationship of the first-level electronic device is legal. Otherwise, the gateway device determines that the device binding relationship of the first-level electronic device is illegal.
[0146] Step 507: The corresponding gateway device sends the device binding relationship of the first secondary electronic device and the device identification of the first networking device to the smart home cloud platform 105, and then executes step 508;
[0147] Step 508: The first or second electronic device turns on heartbeat and other related functions to maintain regular heartbeat with the first networking device to maintain network connectivity.
[0148] After step 508 is completed, the first and second electronic devices complete the online process.
[0149] In the smart home control system of the embodiment of the present application, the online process of the gateway device 103, the first-level electronic device 100 and the second-level electronic device 101 all need to be authenticated by all gateway devices in the home private blockchain network, thereby effectively reducing the risk of access by unfamiliar devices and ensuring the security of the smart home network.
[0150] Refer to the following Figure 6 The following describes the execution process of the control instructions issued by the smart home control system to the terminal 104 provided in the embodiment of the present application.
[0151] Step 601: Terminal 104 starts;
[0152] Step 602: The terminal 104 determines its own network environment. If the terminal 104 is in a smart home network, step 603 is executed. If the terminal 104 is not in a smart home network, step 605 is executed.
[0153] Specifically, the terminal 104 determines whether it is in the smart home network based on whether it can access the smart home network.
[0154] Step 603: The terminal 104 determines that it is in the smart home network. The terminal 104 discovers multiple gateway devices in the home private domain blockchain network through a broadcast message. For example, the terminal 104 discovers multiple gateway devices in the home private domain blockchain network by sending a UDP broadcast message, and then executes step 604;
[0155] Step 604: The terminal 104 queries a gateway device (a gateway device selected by the user through the terminal 104, such as the first gateway device) among the multiple gateway devices discovered for a device list and device topology information of electronic devices (including the primary electronic device 100, the secondary electronic device 101, and the networking device 102) in the smart home network, and then executes step 607;
[0156] Step 605: The terminal 104 determines that it is not in the smart home network, and then accesses the smart home cloud platform 105, and then executes step 606;
[0157] Step 606: The terminal accesses a gateway device in the home private blockchain network (a gateway device selected by the user through the terminal 104, such as the first gateway device) through the interface service provided by the smart home cloud platform 105, and queries the first gateway device for a list of electronic devices in the home private blockchain network (including the primary electronic device 100, the secondary electronic device 101, and the networking device 102) and device topology information in the smart home network, and then executes step 607;
[0158] Step 607: The terminal 104 sends an instruction to the first gateway device selected in step 604 or step 606. The first gateway device determines the type of the instruction. If the instruction is a rule creation instruction, step 608 is executed. If the instruction is a device control instruction, step 611 is executed.
[0159] Step 608: After the first gateway device determines that the type of the instruction is a rule creation instruction, the first gateway device submits the instruction to the family private domain blockchain network, and then executes step 609;
[0160] Step 609: After receiving the instruction, all gateway devices in the home private blockchain network create a smart contract based on the linkage rules to identify the legitimacy of the linkage rule information corresponding to the instruction; when all gateway devices in the home private blockchain network confirm that the corresponding linkage rule information is legitimate, each gateway device completes data accounting and updates the linkage rule data, and then executes step 610;
[0161] Among them, in actual application, when each gateway device confirms the legitimacy of the linkage rule information corresponding to the instruction, it can be achieved by judging whether all electronic device identifiers in the linkage rule information corresponding to the instruction are stored locally. Specifically, when it is determined that all electronic device identifiers in the linkage rule information corresponding to the instruction are stored locally, the corresponding linkage rule information is determined to be legal; correspondingly, when it is determined that only some electronic device identifiers in the linkage rule information corresponding to the instruction are stored locally or it is determined that all electronic device identifiers in the linkage rule information corresponding to the instruction are not stored locally, the created linkage rule information is determined to be illegal.
[0162] Step 610: After each gateway device completes data accounting, the first gateway device returns the linkage rule creation result of the linkage rule created according to the instruction to the terminal 104, and then executes step 614;
[0163] Step 611: After the first gateway device determines that the type of the instruction is a device instruction, the first gateway device determines the electronic device (e.g., an audio device) corresponding to the instruction based on the locally stored device topology information, and sends the instruction to the corresponding electronic device, and then executes step 612;
[0164] Specifically, the first gateway device queries the locally stored device topology information to confirm the device address of the gateway device to which the electronic device corresponding to the instruction is bound: if the device address of the bound gateway device is the same as the device address of the first gateway device, the first gateway device determines that the corresponding electronic device is bound to the first gateway device, and the first gateway device directly sends the instruction to the corresponding electronic device; if the device address of the bound gateway device is different from the device address of the first gateway device, the first gateway device determines that the corresponding electronic device has no device bound to the first gateway device, and the first gateway device forwards the instruction to the corresponding electronic device through the bound gateway device;
[0165] Step 612: After receiving the instruction, the corresponding electronic device executes the instruction (for example, turns on the speaker), and then executes step 613;
[0166] Step 613: The corresponding electronic device returns the execution result of the instruction to the first gateway device according to the instruction delivery path, and the first gateway device returns the execution result of the instruction to the terminal 104, and then executes step 614;
[0167] Step 614: After receiving the execution result of the instruction returned by the first gateway device, the terminal 104 can display the execution result of the instruction to the user in a visual manner to complete the current processing flow.
[0168] Refer to the following Figure 7 , taking the second electronic device as an example, the execution process of the linkage rules triggered by the smart home control system of the embodiment of the present application is described.
[0169] Step 701: A device event occurs on the second electronic device, such as a "door lock unlocked" event or a "security alarm" event. The second electronic device may be a primary electronic device or a secondary electronic device, and then step 702 is executed.
[0170] Step 702: The second electronic device reports the device event to the gateway device (eg, the first gateway device) to which the second electronic device is bound when it goes online, and then executes step 703;
[0171] Here, if the second electronic device is a secondary electronic device, the second electronic device reports the device event to the networking device to which the second electronic device is bound, and the networking device reports the device event to the gateway device to which the networking device is bound.
[0172] Step 703: After receiving the device event reported by the second electronic device, the gateway device queries the linkage rule information stored locally (for example, query Figure 2 The linkage rule corresponding to the device event in the linkage rule information stored in block 202 is queried and step 704 is executed;
[0173] Here, the gateway device queries the linkage rule information stored locally to confirm whether there is a device identification that also includes the second electronic device (refer to Figure 2 The trigger device identifier in block 202) and the device event (refer to Figure 2 The first gateway device searches for a linkage rule data packet related to the triggering device event in block 202, that is, queries whether there is a linkage rule related to both the second electronic device and the device event. For example, if the device event is the "entry door lock opened" event, the first gateway device searches for a linkage rule related to both "entry door lock" and "door lock opened" in block 202.
[0174] If a corresponding linkage rule exists, the gateway device reads the linkage device instruction in the corresponding linkage rule and executes step 704. For example, when the device event is "entry door lock unlocked", the related linkage rule contains a linkage device instruction "turn on living room light".
[0175] Step 704: After reading the linkage device instruction in the corresponding linkage rule, the gateway device queries the linkage device information involved in the linkage device instruction (such as the linkage device identifier in block 202), and then executes step 705;
[0176] Step 705: After the gateway device obtains the device information of the linkage device, the gateway device queries the locally stored device topology information to determine whether the linkage device is bound to the gateway device. If the linkage device is bound to the gateway device, step 707 is executed; otherwise, step 706 is executed.
[0177] Specifically, when the gateway device determines whether the linkage device is bound to the gateway device, the gateway device queries the locally stored device topology information to confirm the device address of the gateway device to which the linkage device is bound: if the device address of the gateway device to which the linkage device is bound matches the device address of the gateway device, the gateway device determines that the linkage device is bound to the gateway device; if the device address of the gateway device to which the linkage device is bound does not match the device address of the gateway device, the gateway device determines that the linkage device is not bound to the gateway device.
[0178] Step 706: If the linkage device is not bound to the gateway device, the gateway device forwards the linkage device instruction to the corresponding gateway device to which the linkage device is bound, and then executes step 707;
[0179] Step 707: The gateway device or the corresponding gateway device to which the linkage device is bound sends the linkage device instruction to the linkage device. The linkage device executes the linkage device instruction (e.g., turns on the living room light), and then executes step 708.
[0180] Step 708: After the linkage device completes the execution of the linkage device instruction, the linkage device returns the execution result of the linkage device instruction to the gateway device according to the delivery path of the linkage device instruction, and the gateway device submits the execution result of the linkage device instruction to the home private domain blockchain network. Each gateway device in the home private domain blockchain network authenticates the execution record of the linkage device instruction according to the linkage rule execution record smart contract and updates its own linkage rule execution record data (for example, update Figure 2 (The linkage rule execution record information in block 203).
[0181] From the above, it can be seen that in the application scenario of the smart home control system of the embodiment of the present application executing the linkage rules triggered by terminal control instructions and device events, based on the decentralized characteristics of the blockchain, the multiple gateway devices in the home private domain blockchain network have no master-slave and functional distinction, and each gateway device stores complete device topology information and linkage rule information, which reduces the coordination cost between gateway devices, improves the response speed and processing efficiency for various terminal control instructions and device events, and is more suitable for larger-scale smart home networks; in addition, each gateway device in the home private domain blockchain network hosts a part of electronic devices (first-level electronic devices 100 or second-level electronic devices 101), so that the load is balanced between the gateway devices.
[0182] Refer to the following Figure 8 Taking the first gateway device as an example, the linkage rule execution process when a gateway device fails in the smart home control system of the embodiment of the present application is described. The process includes the following steps:
[0183] Step 801: The first gateway device fails, resulting in the inability to provide external services, and then step 802 is executed;
[0184] Step 802: The third electronic device (e.g., a primary electronic device or a secondary electronic device) bound to the first gateway device and the smart home cloud platform 105 both detect an abnormal state of the first gateway device through heartbeat detection. The smart home cloud platform 105 sends the abnormal state of the first gateway device to the terminal 104 to remind the user to repair the problem. At the same time, when the third electronic device is a primary electronic device or a secondary electronic device, different recovery mechanisms are used for getting the third electronic device back online. Specifically, if the third electronic device is a primary electronic device, step 803 is executed; if the third electronic device is a secondary electronic device, step 804 is executed.
[0185] Step 803: When the third electronic device is a first-level electronic device, the third electronic device can automatically send a UDP message for discovering the gateway device to rediscover other gateway devices in the home private domain blockchain network. For specific steps, please refer to this manual in conjunction with Figure 4 Detailed description of step 404, then execute step 805;
[0186] Step 804: When the third electronic device is a secondary electronic device, a binding relationship is established between the third electronic device and the new networking device with the cooperation of the user. For example, the user connects the third electronic device to the new networking device according to the communication protocol supported by the third electronic device, and re-binds the third electronic device to the networking device. Then, step 805 is executed.
[0187] Step 805: By executing the above steps 803 and 804, the third electronic device rediscovers other gateway devices in the home private blockchain network except the first gateway device or binds to other gateway devices by binding to a new networking device, completing the re-online of the third electronic device.
[0188] Specifically, if the third electronic device is a primary electronic device, the steps for binding the third electronic device to other gateway devices can refer to the instructions in conjunction with Figure 4 If the third electronic device is a secondary electronic device, the steps of binding the third electronic device to other gateway devices can refer to this manual in conjunction with Figure 5 Detailed description of steps 504 to 508.
[0189] From the above, it can be seen that based on the network discovery protocol (such as UDP) between the gateway device and the electronic devices (such as the first-level electronic device 100 and the second-level electronic device 101), and the data sharing and timely synchronization mechanism between the gateway devices in the home private domain blockchain network, when any gateway device fails, the electronic devices bound to the failed gateway device can be automatically rebound to other gateway devices, quickly restoring the normal operation of the smart home network without the need for a large amount of manual intervention. Therefore, the smart home control system provided in the embodiment of the present application has a strong disaster recovery capability.
[0190] It can be seen from the above-mentioned processes of gateway online, electronic device online, user command processing, device event processing and gateway failure processing that in the smart home control system provided by the embodiment of the present application, multiple gateway devices constitute a distributed gateway structure. Based on the decentralized characteristics of the blockchain, there is no master-slave distinction between the gateway devices. Each gateway device stores complete device topology information, linkage rule information and linkage rule execution record information, etc., and can complete tasks such as electronic device access, terminal control instructions or linkage rules triggered by device events, and communication with the smart home cloud platform in parallel, which is more suitable for building a fully expanded large-scale smart home network.
[0191] Based on the above system, the embodiment of the present application further provides an information processing method, which is applied to the first gateway device among the multiple gateway devices of the above smart home control system, such as Figure 9 As shown, the method includes:
[0192] Step 901: Receive a first instruction sent by a terminal, where the first gateway device is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0193] Step 902: Determine the type of the first instruction;
[0194] Step 903: When the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction;
[0195] Step 904: When the type of the first instruction is a device control instruction, the first instruction is sent to the electronic device in the smart home network to execute the first instruction.
[0196] In one embodiment, the first gateway device receives a first instruction sent by a terminal, including:
[0197] receiving the first instruction directly sent by the terminal;
[0198] or,
[0199] Receive the first instruction sent by the terminal through the smart home cloud platform.
[0200] Among them, if the terminal is located in the home network, the terminal can discover multiple gateway devices in the home private domain blockchain network through broadcast messages. For example, the user terminal discovers multiple gateway devices in the home private domain blockchain network through UDP, and accesses one of the multiple gateway devices discovered (for example, the first gateway device), queries the first gateway device for information such as the device topology and linkage rules in the smart home network, and sends the first instruction to the first gateway device; if the terminal is not in the smart home network, the terminal can query the device topology relationship and linkage rules in the smart home network through the smart home cloud platform, and send the first instruction to the first gateway device through the smart home cloud platform.
[0201] In one embodiment, before the first gateway device receives the first instruction sent by the terminal through the smart home cloud platform, the method may further include the following steps:
[0202] The first gateway device is connected to and registered with the smart home cloud platform.
[0203] In one embodiment, the method may further include the following steps:
[0204] Accessing the blockchain network after startup;
[0205] Determine whether block data synchronization is required and obtain the judgment result;
[0206] The block data is synchronized or not synchronized according to the judgment result.
[0207] Among them, after the first gateway device is started, it discovers other gateway devices in the home private domain blockchain network and connects to the blockchain network; then checks and compares the latest block data in the home private domain blockchain network. If the block height of the latest block data is higher than the block height of the block data stored by the first gateway device itself, the current complete block data of the home private domain blockchain network is synchronized; otherwise, there is no need to perform data synchronization.
[0208] In one embodiment, the method may further include:
[0209] The first gateway device discovers the blockchain network based on UDP.
[0210] In one embodiment, the method may further include:
[0211] After the first electronic device in the smart home network is connected to the first gateway device, a device binding relationship is established between the first gateway device and the first electronic device;
[0212] Submitting the device binding relationship to the blockchain network to form device topology information;
[0213] The first instruction is sent to electronic devices in the smart home network according to the device topology information.
[0214] In one embodiment, the method may further include:
[0215] Submitting a device binding relationship between the first gateway device and the first electronic device to the smart home cloud platform.
[0216] In one embodiment, the method may further include:
[0217] receiving a device event reported by a second electronic device in a smart home network connected to the first gateway device;
[0218] Searching the linkage rules to see if there is a linkage rule corresponding to the device event;
[0219] At least one device control instruction included in the linkage rule is sent to a corresponding electronic device in the smart home network to execute the corresponding device control instruction.
[0220] In one embodiment, the method may further include:
[0221] Submitting an execution record of the at least one linkage rule to the blockchain network.
[0222] In one embodiment, the method may further include:
[0223] Determining, based on the device topology information, that the first gateway device has a device binding relationship with the electronic device corresponding to the device control instruction;
[0224] When the determined gateway device is not the first gateway device, a device control instruction is sent to the corresponding electronic device through a second gateway device that has established a device binding relationship with the corresponding electronic device.
[0225] Based on the method provided in the embodiment of the present application, the embodiment of the present application further provides an information processing device 1000, which is set on a first gateway device, such as Figure 10 As shown, the information processing device 1000 includes:
[0226] A receiving unit 1001 is configured to receive a first instruction sent by a terminal, wherein the first gateway device is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0227] A determining unit 1002 is configured to determine a type of the first instruction;
[0228] The execution unit 1003 is used to submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction when the type of the first instruction is a linkage rule creation instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network to execute the first instruction.
[0229] In one embodiment, the receiving unit 1001 is specifically configured to:
[0230] receiving the first instruction directly sent by the terminal;
[0231] or,
[0232] Receive the first instruction sent by the terminal through the smart home cloud platform.
[0233] In one embodiment, the information processing device 1000 may further include an access unit configured to:
[0234] Access and register to the smart home cloud platform.
[0235] In one embodiment, the access unit is further configured to:
[0236] Accessing the blockchain network after startup;
[0237] Determine whether block data synchronization is required and obtain the judgment result;
[0238] The block data is synchronized or not synchronized according to the judgment result.
[0239] In one embodiment, the access unit is further configured to:
[0240] Discover the blockchain network based on UDP.
[0241] In one embodiment, the information processing device 1000 may further include:
[0242] Device binding unit, used to:
[0243] After the first electronic device in the smart home network is connected to the first gateway device, a device binding relationship is established between the first gateway device and the first electronic device;
[0244] Submit the device binding relationship to the blockchain network to form device topology information,
[0245] The execution unit 1003 is configured to send the first instruction to the electronic devices in the smart home network according to the device topology information.
[0246] In one embodiment, the execution unit 1003 is further configured to:
[0247] receiving a device event reported by a second electronic device in a smart home network connected to the first gateway device;
[0248] Searching the linkage rules to see whether there is at least one linkage rule corresponding to the device event;
[0249] The device control instruction included in the at least one linkage rule is sent to a corresponding electronic device in the smart home network to execute the corresponding device control instruction.
[0250] In one embodiment, the execution unit 1003 is further configured to:
[0251] Submitting an execution record of the at least one linkage rule to the blockchain network.
[0252] In one embodiment, the execution unit 1003 is further configured to:
[0253] Determine, based on the device topology information, a gateway device having a device binding relationship with the electronic device corresponding to the device control instruction;
[0254] When the determined gateway device is not the gateway device, a device control instruction is sent to the corresponding electronic device through a second gateway device that has established a device binding relationship with the corresponding electronic device.
[0255] In actual application, the receiving unit 1001 can be implemented by a communication interface in the information processing device; the determination unit 1002 can be implemented by a processor in the information processing device; the execution unit 1003, the access unit 1004 and the device binding unit 1005 can be implemented by the processor in the information processing device combined with the communication interface.
[0256] It should be noted that the information processing device provided in the above embodiments is illustrated only by the division of the above-mentioned program modules when performing information processing. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the above-described processing. In addition, the information processing device provided in the above embodiments and the information processing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and is not repeated here.
[0257] Based on the hardware implementation of the above program modules, and in order to implement the information processing method of the embodiment of the present application, the embodiment of the present application also provides a gateway device 1100 (for example, a first gateway device), such as Figure 11 As shown, the gateway device 1100 includes: a communication interface 1101 and a first processor 1102; wherein,
[0258] The communication interface 1101 is configured to receive a first instruction sent by the terminal 104 , wherein the gateway device 1100 is one of multiple gateway devices in a smart home network, and the multiple gateway devices constitute a blockchain network;
[0259] The processor 1102 is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network through the communication interface 1101 to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network through the communication interface 1101 to execute the first instruction.
[0260] In one embodiment, the communication interface 1101 is specifically configured to:
[0261] receiving the first instruction directly sent by the terminal;
[0262] or,
[0263] Receive the first instruction sent by the terminal through the smart home cloud platform.
[0264] In one embodiment, the processor 1102 is further configured to:
[0265] Access and register to the smart home cloud platform through the communication interface 1101.
[0266] In one embodiment, the processor 1102 is further configured to:
[0267] After startup, access the blockchain network through the communication interface 1101;
[0268] Determine whether block data synchronization is required and obtain the judgment result;
[0269] The block data is synchronized or not synchronized according to the judgment result.
[0270] In one embodiment, the processor 1102 is further configured to:
[0271] Discover the blockchain network based on UDP.
[0272] In one embodiment, the processor 1102 is further configured to:
[0273] After the first electronic device in the smart home network is connected to the first gateway device 1100, a device binding relationship between the first gateway device 1100 and the first electronic device is established;
[0274] Submitting the device binding relationship to the blockchain network through the communication interface 1101 to form device topology information;
[0275] The first instruction is sent to the electronic devices in the smart home network through the communication interface 1101 according to the device topology information.
[0276] In one embodiment, the processor 1102 is further configured to:
[0277] Receiving, through the communication interface 1101, a device event reported by a second electronic device in the smart home network connected to the first gateway device 1100;
[0278] Searching the linkage rules to see whether there is at least one linkage rule corresponding to the device event;
[0279] The device control instruction included in the at least one linkage rule is sent to the corresponding electronic device in the smart home network through the communication interface 1101 to execute the corresponding device control instruction.
[0280] In one embodiment, the processor 1102 is further configured to:
[0281] Submitting the execution record of the at least one linkage rule to the blockchain network through the communication interface 1101.
[0282] In one embodiment, the processor 1102 is further configured to:
[0283] Determine, based on the device topology information, a gateway device having a device binding relationship with the electronic device corresponding to the device control instruction;
[0284] When the determined gateway device is not the gateway device 1100 , a device control instruction is sent to the corresponding electronic device via a second gateway device that has established a device binding relationship with the corresponding electronic device.
[0285] The gateway device 1100 in the embodiment of the present application further includes a first storage device 1103 for storing various types of data to support the operation of the gateway device 1100. Examples of such data include any computer program for operating on the gateway device 1100.
[0286] The methods disclosed in the above embodiments of the present application can be applied to the first processor 1102 or implemented by the first processor 1102. The first processor 1102 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the first processor 1102 or by instructions in the form of software. The above first processor 1102 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 1102 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium located in the first memory 1103. The first processor 1102 reads the information in the first memory 1103 and completes the steps of the above method in combination with its hardware.
[0287] In an exemplary embodiment, the gateway device 1100 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.
[0288] It is understood that the memory 1103 of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0289] In an exemplary embodiment, the present application also provides a storage medium, namely, a computer storage medium, specifically, a computer-readable storage medium, such as the memory 1103 of the gateway device. The computer program described above can be executed by the processor 1102 of the gateway device 1100 to complete the steps of the aforementioned information processing method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0290] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0291] In addition, the technical solutions described in the embodiments of the present application can be arbitrarily combined without conflict.
[0292] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.
Claims
1. An information processing method, characterized in that: Applied to a first gateway device, including: Receiving a first instruction sent by a terminal, where the first gateway device is one of multiple gateway devices in a smart home network, where the multiple gateway devices constitute a blockchain network; each gateway device is configured to implement a blockchain node function and a gateway node function; determining a type of the first instruction; When the type of the first instruction is a linkage rule creation instruction, submitting the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; When the type of the first instruction is a device control instruction, the first instruction is sent to the electronic device in the smart home network to execute the first instruction.
2. The method according to claim 1, characterized in that The receiving terminal sends a first instruction, including: receiving the first instruction directly sent by the terminal; or, Receive the first instruction sent by the terminal through the smart home cloud platform.
3. The method according to claim 2, characterized in that The method further comprises: Access and register to the smart home cloud platform.
4. The method according to claim 1, wherein The method further comprises: Accessing the blockchain network after startup; Determine whether block data synchronization is required and obtain the judgment result; The block data is synchronized or not synchronized according to the judgment result.
5. The method according to claim 4, characterized in that The method further comprises: The blockchain network is discovered based on the User Datagram Protocol (UDP).
6. The method according to claim 1, characterized in that The method further comprises: After the first electronic device in the smart home network is connected to the first gateway device, a device binding relationship is established between the first gateway device and the first electronic device; Submitting the device binding relationship to the blockchain network to form device topology information; The first instruction is sent to electronic devices in the smart home network according to the device topology information.
7. The method according to claim 1, characterized in that The method further comprises: receiving a device event reported by a second electronic device in a smart home network connected to the first gateway device; Searching for a linkage rule corresponding to the device event in the linkage rules; At least one linkage device instruction included in the linkage rule is sent to a corresponding electronic device in the smart home network to execute the corresponding linkage device instruction.
8. The method according to claim 7, characterized in that The method further comprises: Submitting the execution record of the linkage rule to the blockchain network.
9. The method according to any one of claims 1 to 8, characterized in that Determine, based on the device topology information, a gateway device having a device binding relationship with the electronic device corresponding to the linkage device instruction; When the determined gateway device is not the first gateway device, a linkage device instruction is sent to the corresponding electronic device via a second gateway device that has established a device binding relationship with the corresponding electronic device.
10. An information processing device, characterized in that: Set on the first gateway device, including: A receiving unit, configured to receive a first instruction sent by a terminal, wherein the first gateway device is one of multiple gateway devices in a smart home network, wherein the multiple gateway devices constitute a blockchain network; each gateway device is configured to implement a blockchain node function and a gateway node function; a determining unit, configured to determine a type of the first instruction; An execution unit is configured to, when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to an electronic device in the smart home network to execute the first instruction.
11. A gateway device, characterized in that: include: Processor and communication interface; wherein, The communication interface is configured to receive a first instruction sent by a terminal, wherein the gateway device is one of multiple gateway devices in a smart home network, wherein the multiple gateway devices constitute a blockchain network; each gateway device is configured to implement a blockchain node function and a gateway node function; The processor is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network through the communication interface to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network through the communication interface to execute the first instruction.
12. A gateway device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method according to any one of claims 1 to 9.
13. A smart home control system comprising: Smart home cloud platform; Multiple gateway devices, wherein the multiple gateway devices constitute a blockchain network in the smart home network; Each gateway device is used to implement blockchain node functions and gateway node functions; a terminal, configured to send a first instruction to a first gateway device among the plurality of gateway devices directly or through the smart home cloud platform, The first gateway device is used to determine the type of the first instruction; when the type of the first instruction is a linkage rule creation instruction, submit the first instruction to the blockchain network to create a linkage rule corresponding to the first instruction; and when the type of the first instruction is a device control instruction, send the first instruction to the electronic device in the smart home network to execute the first instruction.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Equipment linkage method, block chain network and storage medium
CN109447645A
Equipment linkage control method and device and storage medium
CN112511393A