Distributed home bus system, medium, method and home system applied thereto
By designing a distributed home bus system, using the message bus of ZeroMq protocol and the resource bus of Http protocol, the problem of lack of independent encryption and multi-protocol access in the existing technology is solved, and the functions of efficient data interaction and multi-device access are realized, and the security and scalability of the smart home system are improved.
Patent Information
- Application Number
- CN202210568798.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The existing home bus systems lack bus protocols with independent encryption to support communication, as well as bus protocols for accessing multi-protocol and multi-network IoT devices, resulting in insufficient security and scalability of smart home systems.
A distributed home bus system is designed, using the message bus of ZeroMq protocol and the resource bus of Http protocol. Through the collaborative work of internal host, external host and AP Agent, device registration, data interaction and multi-protocol access are realized.
It realizes efficient data interaction of the distributed home bus system. All devices are directly interconnected based on the same protocol, and have the functions of independent encryption to support communication and access to multi-protocol and multi-network devices, improving the security and scalability of the system.
Smart Images

Figure CN114721285B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of home bus systems, in particular to a distributed home bus system, a medium, a method and a home system applied thereto. Background Art
[0002] On November 27, 2005, at the Information Society Summit held in Tunisia, the International Telecommunication Union (ITU) released the "ITU Internet Report 2005: Internet of Things", formally proposing the concept of the Internet of Things. After more than ten years of development, the Internet of Things has been widely used in building automation, industrial automation and other fields.
[0003] In the field of smart buildings, smart homes use advanced computer technology, smart hardware (wifi, Zigbee, Bluetooth, NB-iot, etc.), Internet of Things technology, and communication technology to organically combine various subsystems of furniture life, and through coordinated management, make home life more comfortable, convenient, effective, and safe.
[0004] In smart homes, bus technology can realize the information interaction of home appliances. In the industrial field, there are CAN bus, RS485 bus, etc., which can realize the information transmission of industrial equipment. The bus system is divided into distributed bus and distributed bus. The data capacity of the distributed bus system is no longer limited to a certain central processing module, and its scalability is better, allowing users to expand at any position of the bus, which is more flexible and convenient.
[0005] With smart home, you can ask them to clean up on their way home from get off work, and even call the police when someone maliciously pries the door lock. This can fully improve the quality of life. However, the initial development of ordinary smart home also brought some problems: when the headquarters database is modified or even deleted, the data of your home will also change; if someone hacks into your gateway, the data inside can be modified at will. The ideal framework of the smart home system should be a truly distributed bus structure, where all devices in the system are based on the same protocol and can directly communicate with each other, thus solving the problems brought by the current smart home market.
[0006] However, the existing home bus system still has the following problems: lack of bus protocol with autonomous encryption support communication; lack of bus protocol with multi-protocol, multi-network IoT device access. Summary of the invention
[0007] In order to overcome the problems in the above-mentioned background technology that the existing home bus system lacks a bus protocol with autonomous encryption support communication and lacks a bus protocol with multi-protocol and multi-network Internet of Things device access, the present invention provides a distributed home bus system, medium, method and home system applied thereto.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] According to a first aspect of the present invention, a distributed home bus system is provided, comprising an internal host, an external host, an APAgent and a home bus, wherein the internal host, the external host and the AP Agent are connected in the same local area network and are connected to each other through home bus communication; the internal host is installed inside a home information box for home bus management; the external host is installed outside the home information box for bus human-computer interaction; the AP Agent is installed in each family room for accessing home Internet of Things devices.
[0010] In some possible implementations, the home bus includes a message bus and a resource bus, the message bus adopts the ZeroMq protocol, and the resource bus adopts the Http protocol.
[0011] In some possible implementations, the message bus includes a message bus device management protocol and a message bus communication protocol.
[0012] In some possible implementations, the “message bus device management” specifically includes the following steps:
[0013] Step S11: Internal host broadcast:
[0014] After the internal host comes online, it sends UDP broadcast regularly to send out the IP and port number of the message bus service;
[0015] Step S12: Device registration:
[0016] After receiving the broadcast message, the AP Agent or external host connects to the message bus and requests bus registration. After successful registration, it requests an ID from the internal host. After receiving the ID, the AP Agent or external host stores the ID and subscribes to ID messages.
[0017] In some possible implementations, the “message bus communication” specifically includes:
[0018] Communication between the internal host and the external host: The internal host and the external host transmit messages through the message bus, and use the database for data interaction. The external host sends a request data packet to the internal host, and the internal host responds to the request by checking the request type in the data packet;
[0019] Communication between the internal host and the AP Agent: The internal host and the external host transmit messages through the message bus. When the APAgent receives the bus WDBK message, it determines whether it is an IOT block write and whether it is non-block data. If it is determined to be both an IOT block write and non-block data, the data is written through the serial port.
[0020] In some possible implementations, the types of the message include: a public message, a block data change message, and a database programming message, and the content of the message includes a PUBC message, a WDBK message, and a DBUP message.
[0021] A second aspect of the present invention provides a distributed home bus device management method, which is applied to the above-mentioned distributed home bus system and specifically comprises the following steps:
[0022] Step S11: Internal host broadcast: After the internal host comes online, it sends UDP broadcast regularly to send out the IP and port number of the message bus service;
[0023] Step S12: Device registration: After receiving the broadcast message, the AP Agent or external host connects to the message bus to request bus registration, and after successful registration, requests an ID from the internal host; after receiving the ID, the AP Agent or external host stores the ID and subscribes to ID messages.
[0024] A third aspect of the present invention provides a distributed home bus communication method, which is applied to the above-mentioned distributed home bus system, and specifically includes:
[0025] Communication between the internal host and the external host: The internal host and the external host transmit messages through the message bus, and use the database for data interaction. The external host sends a request data packet to the internal host, and the internal host responds to the request by checking the request type in the data packet;
[0026] Communication between the internal host and the AP Agent: The internal host and the external host transmit messages through the message bus. When the APAgent receives the bus WDBK message, it determines whether it is an IOT block write and whether it is non-block data. If it is determined to be both an IOT block write and non-block data, the data is written through the serial port.
[0027] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the distributed home bus device management method described above is implemented.
[0028] A fifth aspect of the present invention provides a home system, including a smart home system, wherein the smart home system includes the above-mentioned distributed home bus system.
[0029] The beneficial effects of the present invention are:
[0030] 1. Various message-receiving agents in the distributed home bus system use the message bus to communicate with the internal host, and the internal host coordinates the work of various agents to achieve efficient data interaction of the distributed home bus.
[0031] 2. All devices in the system are based on the same protocol and can communicate directly with each other. The protocol has the function of autonomous encryption to support communication and access to multi-protocol and multi-network IoT devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention uses a message bus established by ZeroMQ to implement message transmission between an internal host, an external host, and an AP. With reference to the accompanying drawings, the disclosed content of the present invention is easier to understand.
[0033] Figure 1 is a schematic diagram of a distributed home bus system of the present invention;
[0034] Figure 2 It is the multi-agent collaboration model of the present invention;
[0035] Figure 3 This is a schematic diagram of bus message interaction in away mode. DETAILED DESCRIPTION
[0036] In order to more clearly understand the technical content of the present invention, the following examples are given for detailed explanation.
[0037] Embodiment 1:
[0038] See attached Figure 1 As shown, this implementation is a distributed home bus system, which consists of an internal host, an external host, an AP (Wireless Access Point), a universal display terminal, and a message bus. During the first communication, the internal host and the external host use the method of regularly sending UDP (User Datagram Protocol) broadcast packets to broadcast their own IP and port numbers for data interaction in the smart home system. The distributed home bus system designs each message receiving object as an Agent, and multiple Agents communicate through three modes of the message bus, namely request, subscription, and push-pull modes. The universal display terminal interacts with the internal host through the http (Hypertext Transfer Protocol) system in the form of H5 (fifth generation HTML) pages.
[0039] Embodiment 2:
[0040] See attached Figure 2As shown, this embodiment is a communication method for a distributed home bus system, which adopts multi-agent collaborative communication. After the agent receives the broadcast packet from the internal and external hosts, a corresponding ZeroMq bus connection is established. Various agents receiving messages in the distributed home bus system communicate with the internal host through the message bus, and the internal host coordinates the work of various agents to achieve efficient data interaction of the distributed home bus.
[0041] The principle of multi-agent collaboration in this patent is: the software unit based on the smart home distributed bus system platform is an agent, and the software units distributed in the edge layer of the platform adopt a multi-agent model for negotiation. In the model, a loose, low-coupled system structure is formed within the family, and service tasks are completed together through mutual collaboration. The evolutionary characteristics of multi-agents enable the loose system to gradually accumulate experience and continuously adjust their respective strategies, so as to efficiently complete family services. In the system, each agent transmits time to each other through the message bus, and the mechanism of collaborative work is also event-driven. These agents include AI recognition agents, home control agents, AI learning agents, etc. For example, AI recognition agents mainly refer to smart camera devices. It can identify the identity, characteristics and certain family events of people in the image through deep learning algorithms, and send the identified events to the system through the bus.
[0042] The device management method of the distributed home bus of this embodiment specifically includes the following steps:
[0043] Step S11: Internal host broadcast:
[0044] After the internal host comes online, it sends UDP broadcasts regularly, sends out its own IP and port number, and the length of the sent data frame is 8 bytes, as shown in Table 1:
[0045] Table 1 Host broadcast packet content
[0046]
[0047] Among them: version information is fixed at 10; encryption flag: 0-not encrypted, LAN not encrypted; 1-encryption, AES128; the encrypted content is the message body content; packet type information: -1 publishing host IP, -2 publishing external host IP; others-spare.
[0048] Step S12: External host broadcast:
[0049] After the external host comes online, it sends UDP broadcasts at regular intervals to send out its own IP and port. The length of the sent data frame is fixed at 8 bytes, as shown in Table 2:
[0050] Table 2 Contents of the external host's broadcast packet
[0051]
[0052] Among them: the version information is fixed at 10; encryption flag: 1 not encrypted, LAN not encrypted 1 encryption, AES128, the encrypted content is the message body content; package type information: -1 publishes the internal host IP, -2 publishes the external host IP.
[0053] The communication method of the distributed home bus of this embodiment specifically includes the following steps:
[0054] Step S2: Internal host communicates with external host:
[0055] The internal host and the external host transmit messages through the ZeroMQ message bus and use the database for data interaction. The external host sends a request data packet to the internal host, and the internal host responds to the request by checking the request type in the data packet;
[0056] Step S3: Internal host communicates with AP Agent:
[0057] The internal host and the external host transmit messages through the ZeroMQ message bus. After the AP Agent bus is established and the connection is successful, it requests the ID from the internal host. After receiving the ID, the AP Agent stores the ID and subscribes to the ID message. When the AP Agent receives the bus WDBK message, it determines whether it is an IOT (Internet of Things) block write and whether it is non-block data. If so, it writes data through the serial port.
[0058] Step S4: Interaction between the internal host and the universal display terminal:
[0059] The universal display terminal uses the http protocol to interact with the user and the internal host in the form of an H5 web page.
[0060] The message types of this embodiment include three categories: public messages, block data change messages, and database programming messages. The subscription and application of the messages are shown in Table 3:
[0061] Table 3 Message types
[0062]
[0063] The content of the message in this embodiment includes:
[0064] 1) PUBC message: The message packet format is shown in Table 4.
[0065] Table 4 PUBC message packet format
[0066]
[0067] 2) WDBK message: The message packet format is shown in Table 5.
[0068] Table 5 WDBK message packet format
[0069]
[0070] Each cluster block consists of 22 bytes, as shown in Table 6.
[0071] Table 6 Cluster block composition
[0072]
[0073] 3) DBUP message: The message is shown in Table 7.
[0074] Table 7 DBUP message packet format
[0075]
[0076] The request packet format of this embodiment adopts the ZeroMQ request response method. The request packet format is shown in Table 8.
[0077] Table 8 Request packet format
[0078]
[0079] The request reply data packet of this embodiment is as follows: the internal host receives the data packet sent by the AP Agent, parses it, and sends a response according to the request type. The request reply format is shown in Table 9.
[0080] Table 9 Request Response
[0081]
[0082] The external host request of this embodiment includes:
[0083] 1) Request to write block data: The external host requests the internal host to write a data block. The request format is shown in Table 10.
[0084] Table 10 Write data block format
[0085]
[0086] 2) Request to change the database: The external host requests the internal host to change the database. The request format is shown in Table 11.
[0087] Table 11 Change database format
[0088]
[0089] The AP / MQTT-BROKER request in this embodiment includes:
[0090] 1) Request ID: The AP Agent successfully connects to the bus and sends a request ID message to the host. The request ID format is as shown in Table 12:
[0091] Table 12 Request ID format
[0092]
[0093] 2) Request to write block data: The AP agent sends a message to the internal host requesting to write a data block. The format of the request to write a data block is shown in Table 13:
[0094] Table 13 Write data block format
[0095]
[0096] 3) Request to change APList / Device: AP Agent sends a request to the internal host to change the AP / device database. The format of the request to change the database is shown in Table 14:
[0097] Table 14 Request Change Format
[0098]
[0099] Embodiment three:
[0100] See attached Figure 3 As shown, this embodiment is a working description of the distributed home bus system when it is in the away mode: in the home mode, all lighting, HVAC equipment and electric curtains are turned off, and it automatically switches to the security state.
[0101] For a home system with a distributed home bus, if the surveillance camera detects that there is no one at home in away mode, the AI recognition agent recognizes that there is no one at home, and the AI learning agent infers that all lighting systems, HVAC equipment and electric curtains need to be turned off, and automatically switches to the security state. The AI recognition agent connects to the bus and requests the internal host to turn off the device ID message. The internal host queries the database for the corresponding device ID and sends a request to the AP to turn off the device ID number information. Users can remotely check whether there is a dangerous situation in the current home through the http protocol web page.
[0102] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned distributed home bus device management method or the steps of the above-mentioned distributed home bus communication method are implemented or the above-mentioned distributed home bus system is executed.
[0103] The above implementation modes are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with this technology to understand the content of the present invention and implement it, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A distributed home bus system, characterized in that: It includes an internal host, an external host, an AP Agent and a home bus, wherein the internal host, the external host and the AP Agent are connected in the same local area network and are connected to each other through the home bus communication; the internal host is installed inside the home information box for the management of the home bus; the external host is installed outside the home information box for the human-computer interaction of the home bus; the AP Agent is installed in each family room for accessing home Internet of Things devices; The home bus includes a message bus, and the message bus includes a message bus device management protocol and a message bus communication protocol; The message bus device management protocol specifically includes the following steps: Step S11: Internal host broadcast: After the internal host comes online, it sends UDP broadcast regularly to send out the IP and port number of the message bus service; Step S12: Device registration: After receiving the broadcast message, the AP Agent or external host connects to the message bus and requests bus registration. After successful registration, it requests an ID from the internal host. After receiving the ID, the AP Agent or external host stores the ID and subscribes to ID messages; The message bus communication protocol specifically includes: Communication between the internal host and the external host: The internal host and the external host transmit messages through the message bus, and use the database for data interaction. The external host sends a request data packet to the internal host, and the internal host responds to the request by checking the request type in the data packet; Communication between the internal host and the AP Agent: The internal host and the external host transmit messages through the message bus. When the APAgent receives the bus WDBK message, it determines whether it is an IOT block write and whether it is non-block data. If it is determined to be both an IOT block write and non-block data, the data is written through the serial port.
2. A distributed home bus system according to claim 1, characterized in that: The home bus includes a resource bus, the message bus adopts the ZeroMq protocol, and the resource bus adopts the Http protocol.
3. A distributed home bus system according to claim 2, characterized in that: The types of the messages include: public messages, block data change messages and database programming messages, and the contents of the messages include PUBC messages, WDBK messages and DBUP messages.
4. A distributed home bus device management method, characterized in that: The distributed home bus system according to any one of claims 2 to 3 specifically comprises the following steps: Step S11: Internal host broadcast: After the internal host comes online, it sends UDP broadcast regularly to send out the IP and port number of the message bus service; Step S12: Device registration: After receiving the broadcast message, the AP Agent or external host connects to the message bus to request bus registration, and after successful registration, requests an ID from the internal host; After receiving the ID, the AP Agent or external host stores the ID and subscribes to ID messages.
5. A distributed home bus communication method, characterized in that: The distributed home bus system applied to any one of claims 2-3 specifically comprises: Communication between the internal host and the external host: The internal host and the external host transmit messages through the message bus, and use the database for data interaction. The external host sends a request data packet to the internal host, and the internal host responds to the request by checking the request type in the data packet; Communication between the internal host and the AP Agent: The internal host and the external host transmit messages through the message bus. When the APAgent receives the bus WDBK message, it determines whether it is an IOT block write and whether it is non-block data. If it is determined to be both an IOT block write and non-block data, the data is written through the serial port.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the distributed home bus device management method according to claim 4 or the distributed home bus communication method according to claim 5 is implemented.
7. A home system, characterized in that: It comprises a smart home system, and the smart home system comprises the distributed home bus system as described in any one of claims 1-3.
Citation Information
Patent Citations
Multilayered distributed router architecture
CN107078956A
Control method of home networking system, server and electronic equipment
CN113055411A