CN107231262B - Message routing method based on MQTT multi-layer cascade - Google Patents

Message routing method based on MQTT multi-layer cascade Download PDF

Info

Publication number
CN107231262B
CN107231262B CN201710495388.0A CN201710495388A CN107231262B CN 107231262 B CN107231262 B CN 107231262B CN 201710495388 A CN201710495388 A CN 201710495388A CN 107231262 B CN107231262 B CN 107231262B
Authority
CN
China
Prior art keywords
gateway
message
mqtt
uid
routing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710495388.0A
Other languages
Chinese (zh)
Other versions
CN107231262A (en
Inventor
刘发贵
彭妙霞
冯炜君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN201710495388.0A priority Critical patent/CN107231262B/en
Publication of CN107231262A publication Critical patent/CN107231262A/en
Application granted granted Critical
Publication of CN107231262B publication Critical patent/CN107231262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/44Star or tree networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2816Controlling appliance services of a home automation network by calling their functionalities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a message routing method based on MQTT multilayer cascade. The method comprises the steps of multi-gateway networking based on MQTT; carrying out routing downlink on the basis of MQTT multi-gateway networking, and routing a message sent by an MQTT control end to the household appliance; and performing routing uplink on the basis of MQTT multi-gateway networking, and routing the feedback message of the household appliance to an MQTT control end. The invention improves the centralized star network topology of the MQTT protocol, supports the multilayer cascade gateway topology, supports the connection networking and message routing of multiple gateways, solves the problems of connection, communication and management of the multiple gateways of the current intelligent home, and supports safe and quick intranet control and small-range management of household appliances divided into different areas according to custom rules in a family.

Description

Message routing method based on MQTT multi-layer cascade
Technical Field
The invention relates to the technical field of intelligent home communication, in particular to a message routing method based on MQTT multi-layer cascade.
Background
The intelligent home gateway can communicate the home appliance equipment with an external network through a unified interface after being connected with the home appliance equipment in a wired mode or a wireless mode, and plays a core role in the intelligent home. However, the existing intelligent home scheme has many defects, only one gateway is deployed in a common home, a hardware interface provided by a single gateway is limited, and the range of a wireless communication area is limited. Although the adoption of the multi-gateway structure can make up for the defects of insufficient physical distance and hardware resources, the connection and management among a plurality of gateways is a difficult problem and is less adopted.
Currently, a plurality of transmission protocols exist in the internet of things, wherein MQTT (Message Queuing Telemetry Transport) is developed by IBM company, and a protocol based on Message push, reliability, robustness and open source, which operates on TCP/IP, has obvious advantages in the aspects of universality, expandability, compatibility, energy consumption, flow and the like. However, the current network communication based on the MQTT protocol has the following two problems: because the centralized star network topology is adopted for MQTT communication, in the traditional MQTT remote control, a plurality of intelligent home gateways in a family can be connected and communicated with the MQTT Broker of an intelligent home service platform through the Internet, so that for one family, a plurality of gateways exist a plurality of communication interfaces to the outside, the platform is inconvenient to manage a plurality of gateways in the same family, and the plurality of gateways in a plurality of families are inconvenient to manage. Another problem is that when multiple gateways exist in a home, a user needs to access different gateways to control home devices in different areas.
Aiming at the defects of the current intelligent home scheme and the characteristics of MQTT protocol communication, the invention provides an MQTT multilayer cascade-based message routing method, which improves the centralized star network topology of the MQTT protocol, supports the multilayer cascade gateway topology, and realizes multilayer cascade networking and message routing among multiple gateways by using the multi-gateway intelligent home scheme.
Disclosure of Invention
The invention aims to provide an MQTT multi-layer cascade-based message routing method, which improves the centralized star network topology of an MQTT protocol, supports multi-layer cascade gateway topology, supports multi-gateway connection networking and message routing, solves the problems of connection, communication and management of the multi-gateway of the current intelligent home, and supports safe and rapid intranet control and small-range management of household appliances divided into different areas according to custom rules in a family.
The purpose of the invention is realized by at least one of the following technical solutions.
A message routing method based on MQTT multilayer cascade comprises a multi-gateway networking based on MQTT, a route downlink and a route uplink;
the MQTT-based multi-gateway networking adds a new gateway to an original network, adds new household appliances to the new gateway, and connects the new gateway with other gateways to form an MQTT-based multi-layer cascade network topology structure;
the routing downlink refers to that a message sent by an MQTT control terminal is routed to the household appliance equipment, and the routing downlink refers to that a lower-level routing rule of a gateway is searched in a multi-layer cascade network based on the MQTT and the message is forwarded to the lower-level gateway;
the routing uplink refers to that the feedback message of the household appliance is routed to the MQTT control end, wherein the feedback message of the household appliance is routed to all the MQTT control ends and the feedback message of the household appliance is routed to one of the MQTT control ends.
Further, the method comprises the following steps:
step one, multi-gateway networking based on MQTT.
And step two, carrying out routing downlink on the basis of MQTT multi-gateway networking, and routing the message sent by the MQTT control terminal to the household appliance.
And step three, performing routing uplink on the basis of MQTT multi-gateway networking, and routing the feedback message of the household appliance to an MQTT control end.
In the first step, the multi-gateway networking based on the MQTT comprises the following steps:
(1) when the gateway is started, whether the local database has a Unique Identifier (UID) of the gateway itself is firstly inquired. If not, a UID is generated according to a Snowfly algorithm, the UID is used for identifying a gateway, the gateway automatically subscribes to a theme "/UID/#" (MQTT theme format, and slashes (/) are used for separating each layer in a theme tree and provide a theme space of a hierarchical structure.
(2) And then inquiring a local database, and configuring the IP address of the upper-level routing node of the node by the user through the web page.
(3) And then the UID gateway is connected with the UID0 of the previous level gateway. The method comprises the steps of obtaining a routing rule of a superior gateway, wherein the routing rule is '. multidata./UID 0/#' (the ellipsis '. multidata.' indicates that the superior gateway may have a gateway higher than the self-hierarchy, the routing rule is '. multidata./UID 0/#' indicates that the superior gateway can be routed to all subjects below the subject hierarchy '. multidata./UID 0/'), updating the routing rule of the superior gateway in a local routing table to be '. multidata./UID 0/#', and updating the current self routing rule to be '. multidata./UID 0/UID/#'.
(4) And after the upper-level gateway receives the UID gateway connection, adding a '. multidot./UID/#' in the lower-level gateway routing rule of the upper-level gateway.
(5) The UID gateway starts a device discovery program, the SID (System Identification code) of the searched home appliance with matched information and the UID of the gateway are used as the global unique Identification (USID) of the home appliance in the format of the UID/SID, and meanwhile, the gateway records the SID and a routing rule in a device list of the gateway.
(6) And the UID gateway reports the USID to the upper level gateway, and the upper level gateway records the UID/SID and the routing rule in the own equipment list.
(7) And recursively executing the previous operation by each level of gateway until the USID is reported to the intelligent home service platform.
Preferably, in the step (5), the gateway records "SID" and the routing rule in its own device list as follows:
since the home devices which search the SID by the current gateway are directly connected to the gateway, the routing rule fills in the UID of the gateway itself, and the suffix fills in which hardware interface of the gateway device the device is connected to, for example, the serial port UART1, the device list records "SID" and the routing rule "UID/UART 0".
Preferably, in the step (6), the UID gateway reports the USID to the upper level gateway, and the upper level gateway records "UID/SID" and the routing rule in its own device list as follows:
the UID gateway searches the routing rule of the upper gateway in the routing table to be "./UID 0/", and the routing rule is used as the prefix of the issued subject. For example, the gateway issues a notification message with a topic of "./UID 0/DEVINFO _ NOTIFY", the content being the USID; the upper gateway identified as UID0 automatically subscribes to messages with subject prefix "./UID 0/#" by default, and can receive all self-related messages with subject prefix "./UID 0/". The superior gateway identified as UID0 adds record 'SID' in its original equipment list after receiving USID, and the routing rule is subordinate gateway 'UID'.
In the second step, the routing downlink is carried out on the basis of MQTT multi-gateway networking, and the routing of the message sent by the MQTT control end to the household appliance comprises the following small steps:
(1) and in the multilayer cascade gateway structure formed by the first step, when any one gateway receives the message from the MQTT control end, the controlled object in the message is extracted first.
(2) Then query the local device list.
(3) If the controlled object does not exist in the local equipment list, reporting to the upper-level gateway, and finally reporting to the service platform, and discarding the message by the service platform.
(4) If the controlled object exists in the local equipment list, the routing rule is inquired, the message is directly sent to a lower-level gateway in the routing rule, and if the lower-level gateway is self, the message is sent to the household appliance through a corresponding transparent transmission module.
Preferably, in the step (1) (2), the UID0 gateway receives the MQTT CONTROL message with the topic of "./UID 0/CONTROL/SID", extracts the controlled object SID, then queries the local device list for the presence of SID, and forwards the message to the subordinate gateway with the routing rule of subordinate gateway "UID" and the modification topic of UID0 as UID.
In the third step, the routing uplink is carried out on the basis of the MQTT multi-gateway networking, and the routing of the feedback message of the household appliance to the MQTT control end comprises two conditions, wherein one condition is that the feedback message of the household appliance is routed to all the MQTT control ends, and the other condition is that the feedback message of the household appliance is routed to a specific MQTT control end.
The routing of the feedback message of the household appliance to all MQTT control terminals comprises the following small steps:
(1) and in the multilayer cascade gateway structure formed by the first step, when any gateway receives the message from the household appliance, inquiring a local mobile control terminal list to obtain all MQTT control terminals directly connected to the gateway.
(2) And then forwarding the message to each directly connected MQTT control end.
(3) And reporting the message to the upper level gateway and sending the message to the lower level gateway. The superior gateway receives the uplink message and sends the uplink message to the superior and other subordinate gateways except the gateway reporting the message; and the subordinate gateways only issue the uplink messages to subordinate gateways when receiving the uplink messages, and each gateway forwards the messages to all directly connected MQTT control terminals, so that the information synchronization of all the MQTT control terminals in the intelligent home system is ensured. It should be noted that when the lower gateway receives the uplink message from the upper gateway, the lower gateway no longer needs to report the uplink message to the upper gateway, otherwise, a broadcast storm is formed.
The routing of the feedback message of the household appliance to a specific MQTT control end comprises the following small steps:
(1) in the multi-layer cascade gateway structure formed by the first step, when any gateway receives the message from the household appliance, a local mobile control terminal list is inquired, whether a target MQTT control terminal is included is judged, if yes, the target MQTT control terminal is sent to the target MQTT control terminal and stopped, and if not, the target MQTT control terminal is sent to a superior gateway.
(2) And (3) the superior gateway receives the message and repeats the step (1) until stopping or sending the message to the service platform.
Compared with the prior art, the invention has the beneficial effects that:
1) the centralized star network topology of the MQTT protocol is improved, and a multi-layer cascade gateway topology is supported. The MQTT Broker of the improved intelligent home service platform does not need to manage a plurality of gateways from the same family at the same time, each family can only have one primary gateway directly connected to the service platform, the equivalent family only provides one external interface, and the rest gateways are connected below the primary gateway; and when a plurality of gateways exist in the home, the user can control the household appliances in different areas through different gateways without identifying a specific gateway to control the appliances.
2) The method supports the connection networking and the message routing of multiple gateways and realizes the method for realizing the networking of the multiple gateways through MQTT. The method can support safe and quick intranet control and small-range management of dividing the household appliances into different areas according to the user-defined rule in a home, and expand the range of a wireless communication area. For example, the interior of a home is divided into different small areas according to physical distance or hardware communication interfaces, for example, a room one is divided into a first area, and a room two is divided into a second area, so that a user can conveniently perform different control and management on the different areas.
Drawings
Fig. 1 is a multi-layer cascaded gateway topology diagram based on MQTT implemented in an embodiment.
Fig. 2 is a schematic diagram of a multi-gateway networking process in the embodiment.
Fig. 3 is a flow chart of a routing downlink in an implementation process.
Fig. 4 is a flowchart of the route uplink to all MQTT control terminals in the specific implementation process.
Detailed Description
The embodiments of the present invention will be further described with reference to the drawings and specific examples.
The MQTT multilayer cascade-based message routing method mainly comprises four steps as follows:
step 1: multi-gateway networking based on MQTT: a new gateway is added and the home device connects to the new gateway. The specific networking process is shown in fig. 2, and finally the multi-layer cascaded gateway topology diagram of fig. 1 is formed.
a) When the gateway is started, whether the UID of the gateway exists in the local database is firstly inquired. And if the key exists, generating a UID according to a snowfall algorithm, wherein the UID is used for identifying the gateway, and the gateway automatically subscribes a theme "/UID/#".
For example, a new gateway is started, the new gateway cannot inquire the UID, the UID is generated according to a Snowfly algorithm, and the gateway automatically subscribes a theme "/UID/#".
b) And the user configures the IP address of the upper-level routing node of the node through the web page.
c) And the UID gateway is connected with the upper-level gateway. If the superior gateway is identified as UID0 and is directly connected to the intelligent home service platform, the routing rule "/UID 0/#" of the superior gateway is obtained, the routing rule of the superior gateway in the local routing list is updated to be "/UID 0/#", and the current routing rule per se is "/UID 0/UID/#".
d) After the upper level gateway receives UID gateway connection, a "/UID/#" is added in the lower level gateway routing rule of the upper level gateway.
e) The UID gateway starts a device discovery program, the SID of the searched home appliance with matched information and the UID of the home appliance are used as the global unique identification of the home appliance in the format of UID/SID, and meanwhile, the gateway records the SID and the routing rule in the device list of the gateway.
f) The UID gateway reports the USID to a superior gateway UID0, and the superior gateway records UID/SID and routing rule/UID in the device list of the superior gateway.
g) And each level of gateway recursively executes the previous operation until the USID is reported to the intelligent home service platform.
Here, the upper gateway UID0 reports the USID to the smart home service platform because of being directly connected to the service platform.
Step 2: the specific flow of the user control device and the data routing downlink is shown in fig. 3.
a) The user uses the MQTT control terminal to connect with any gateway, such as the gateway identified as UID 0.
b) The user sends a CONTROL message to CONTROL a certain device, such as a device with the CONTROL mark of "/CONTROL/SID" as SID.
c) UID0 gateway uses last '/' suffix to extract controlled object in message as SID
d) UID0 gateway looks up local device list, presence SID, routing rule "/UID"
e) The UID0 gateway issues the received CONTROL message with the title of "/UID/CONTROL/SID"
f) The next level gateway UID subscribes the theme "/UID/#", then receives the CONTROL message with the theme "/UID/CONTROL/SID", also extracts the controlled object SID of the message, searches the local device list for the existence of "/UID/SID", matches the suffix to know the existence of SID, the routing rule is "/UID/UART 0", then forwards the message to the local serial UART0
g) The SID appliance receives control messages from the serial UART 0.
And step 3: the device information is fed back to all users, and the data route is uplink, and the specific flow is shown in fig. 4.
a) When any gateway receives the message from the household appliance, the local mobile control terminal list is inquired, all MQTT control terminals directly connected to the gateway are obtained, and then the message is forwarded to each directly connected MQTT control terminal.
For example, the state of the SID device is changed to generate a device state message, the device state message is sent to the UID gateway through the UART0, the UID gateway firstly queries the local mobile control list to obtain an MQTT control end list, and the state message is sent to all MQTT control ends directly connected to the UID gateway one by one.
b) The superior gateway receives the uplink message and sends the uplink message to the superior and other subordinate gateways except the gateway reporting the message; and the subordinate gateways only issue the uplink messages to subordinate gateways when receiving the uplink messages, and each gateway forwards the messages to all directly connected MQTT control terminals, so that the information synchronization of all the MQTT control terminals in the intelligent home system is ensured.
For example, the UID gateway sends the state information to the superior gateway UID0, the superior gateway UID0 inquires the superior routing rule after receiving the state information, and sends the state information to the intelligent home service platform because no superior exists, or sends the state information to the superior gateway; and then the gateway UID0 inquires other subordinate gateways except the reported gateway UID, if not, the lower gateway is stopped, otherwise, the lower gateway is sent to.
Meanwhile, the UID0 gateway queries a local mobile control terminal list and forwards the message to each directly connected MQTT control terminal.
And 4, step 4: the equipment information is fed back to a specific user, and the routing data is uplink
a) When any gateway receives the message from the household appliance, the local mobile control terminal list is inquired, whether a target MQTT control terminal is included is judged, if yes, the target MQTT control terminal is sent to the target MQTT control terminal and stopped, and if not, the target MQTT control terminal is sent to a superior gateway.
For example, if the device state of the SID changes, a device state message is generated, and only the MQTT control terminal identified by UUID (Universally Unique Identifier) is notified, the state message contains the UUID, and is sent to the UID gateway through the serial UART 0. And after receiving the message, the UID gateway extracts a target MQTT control end UUID, inquires whether a local mobile control end list has the UUID, and if so, sends the UUID to a stop, otherwise, inquires a superior gateway routing rule and sends the superior gateway UID 0.
b) And the upper-level gateway receives the message, and repeatedly executes the previous step until the message is sent to a target MQTT control end or a service platform.
The superior gateway UID0 receives the message and analyzes the target MQTT control end firstly, then inquires the local mobile control list to judge whether the MQTT control end exists or not, if the MQTT control end exists, the MQTT control end is sent to the MQTT control end and stops, if the MQTT control end does not exist, the superior gateway is informed, and the UID0 does not have the superior gateway, so the MQTT control end is sent to the service platform and stops.
The above steps are preferred embodiments of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention shall be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. A message routing method based on MQTT multilayer cascade comprises a multi-gateway networking based on MQTT, a route downlink and a route uplink; the method is characterized in that:
adding a new gateway into an original network, adding new household appliances on the new gateway, and connecting the new gateway with other gateways to form an MQTT-based multi-layer cascaded network topology structure;
the routing downlink refers to that a message sent by an MQTT control end is routed to the household appliance equipment, and the routing downlink refers to that the next-level routing rule of the gateway is searched in a multi-layer cascade network based on the MQTT and the message is forwarded to the next-level gateway;
the routing uplink refers to that the feedback message of the household appliance is routed to the MQTT control end, wherein the feedback message of the household appliance is routed to all the MQTT control ends and the feedback message of the household appliance is routed to one of the MQTT control ends;
the MQTT-based multi-gateway networking method comprises the following steps:
(1) when the gateway is started, whether the UID of the local database exists or not is firstly inquired; if not, generating UID according to Snowflake algorithm, wherein UID is used for identifying gateway, and the gateway automatically subscribes theme "/UID/#";
(2) then, inquiring a local database, and configuring the IP address of the upper-level gateway of the gateway by the user through the web page;
(3) then the UID gateway is connected with the UID0 of the upper level gateway; the method comprises the steps of obtaining a routing rule of a previous-level gateway, namely,/UID 0/# ", updating the routing rule of the previous-level gateway in a local routing table to be". multidot./UID 0/# ", and updating the current routing rule of the current gateway to be". multidot./UID 0/UID/# ";
(4) after the upper-level gateway receives UID gateway connection, adding a piece of routing rule of the lower-level gateway per se;
(5) the UID gateway starts a device discovery program, the SID of the home appliance device which is searched and matched with the information and the UID of the home appliance device are used as the global unique identification USID of the home appliance device in the format of UID/SID, and meanwhile, the gateway records the SID and a routing rule in a device list of the gateway;
(6) the UID gateway reports the USID to a previous-level gateway, and the previous-level gateway records UID/SID and routing rules in a self equipment list;
(7) and recursively executing the previous operation by each level of gateway until the USID is reported to the intelligent home service platform.
2. The message routing method based on MQTT multilayer concatenation according to claim 1, characterized in that in step (5), the gateway records "SID" and routing rule in its own device list as follows:
because the household appliances which search the SID by the current gateway are directly connected to the gateway, the UID of the gateway is filled in by the routing rule, and the suffix is added to the hardware interface of the gateway equipment connected to the equipment, so that the SID is recorded in the equipment list, and the UID/UART0 is the routing rule.
3. The message routing method based on MQTT multilayer concatenation according to claim 1, characterized in that in step (6), the UID gateway reports the USID to the upper level gateway, and the upper level gateway records "UID/SID" and the routing rule in its own device list as follows:
the UID gateway searches the routing rule of the upper level gateway in the routing table to be "./UID 0/", the routing rule is used as the prefix of the issuing subject and comprises the gateway issuing notification message, the subject is "./UID 0/DEVINFO _ NOTIFY", and the content is USID; the upper level gateway identified as UID0 automatically subscribes to the message with the subject of "../UID 0/#" by default, and can receive all the messages related to the upper level gateway with the subject of "../UID 0/"; and after receiving the USID, the upper-level gateway identified as UID0 adds a record 'SID' in the original equipment list of the upper-level gateway, and the routing rule is the lower-level gateway 'UID'.
4. The MQTT multilayer concatenation-based message routing method according to claim 1, wherein the MQTT-based routing downlink step comprises:
(1) in the formed multilayer cascade network topology structure, when any gateway receives a message from an MQTT control end, a controlled object in the message is extracted firstly;
(2) then inquiring a local equipment list;
(3) if the controlled object does not exist in the local equipment list, reporting to the upper-level gateway, and finally reporting to the service platform, and discarding the message by the service platform;
(4) if the controlled object exists in the local equipment list, the routing rule is inquired, the message is directly sent to the next-level gateway in the routing rule, and if the next level is self, the message is sent to the household appliance through the corresponding transparent transmission module.
5. The MQTT multi-layer cascading-based message routing method as claimed in claim 1, wherein the UID0 gateway receives the MQTT control message with topic of ". multidot./UID 0/COTROL/SID", extracts the controlled object SID, then inquires the local device list for the existence of SID, the routing rule is the next level gateway "UID", modifies the topic UID0 to UID, and forwards the message to the next level gateway.
6. The MQTT multilayer cascade-based message routing method according to claim 1, wherein the MQTT-based route is uplink, and the feedback messages of the home appliance devices are routed to all MQTT control terminals, and the specific steps include:
(1) in the formed multilayer cascade network topology structure, when any gateway receives a message from the household appliance, a local mobile control terminal list is inquired, and all MQTT control terminals directly connected to the gateway are obtained;
(2) then, the message is forwarded to each directly connected MQTT control end;
(3) reporting the message to the upper-level gateway and sending the message to the lower-level gateway; the upper level gateway receives the uplink message and sends the uplink message to the upper level of the upper level gateway, and also sends the uplink message to other lower level gateways except the gateway reporting the message; and when receiving the uplink message, the next-level gateways are only issued to the next level, and each gateway forwards the message to all directly-connected MQTT control terminals, so that the information synchronization of all the MQTT control terminals in the intelligent home system is ensured.
7. The MQTT multilayer cascade-based message routing method according to claim 1, wherein the MQTT-based routing is performed upstream, and a feedback message of the home appliance device is routed to a specific MQTT control terminal, and the specific steps include:
(1) in the formed multilayer cascade network topology structure, when any gateway receives a message from the household appliance, inquiring a local mobile control terminal list, judging whether a target MQTT control terminal is included, if so, sending the target MQTT control terminal to the target MQTT control terminal and stopping, and if not, sending the target MQTT control terminal to a previous-level gateway;
(2) and (3) the upper-level gateway receives the message and repeats the step (1) until stopping or sending the message to the service platform.
CN201710495388.0A 2017-06-26 2017-06-26 Message routing method based on MQTT multi-layer cascade Active CN107231262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710495388.0A CN107231262B (en) 2017-06-26 2017-06-26 Message routing method based on MQTT multi-layer cascade

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710495388.0A CN107231262B (en) 2017-06-26 2017-06-26 Message routing method based on MQTT multi-layer cascade

Publications (2)

Publication Number Publication Date
CN107231262A CN107231262A (en) 2017-10-03
CN107231262B true CN107231262B (en) 2021-05-14

Family

ID=59935603

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710495388.0A Active CN107231262B (en) 2017-06-26 2017-06-26 Message routing method based on MQTT multi-layer cascade

Country Status (1)

Country Link
CN (1) CN107231262B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713084B (en) * 2016-12-01 2020-06-09 杭州鸿信智能工程有限公司 Multi-gateway system of Internet of things
CN110099078B (en) * 2018-01-29 2022-02-25 阿里巴巴集团控股有限公司 Method, device, equipment and storage medium for communication between equipment and message synchronization
CN110365790B (en) * 2019-07-23 2022-04-22 深圳市东微智能科技股份有限公司 Message transmission method and device, cascade networking equipment and readable storage medium
CN112532671A (en) * 2019-09-19 2021-03-19 阿里巴巴集团控股有限公司 Acquisition method, configuration method, edge computing cluster and device
CN110635979B (en) * 2019-10-21 2022-02-01 杭州鸿雁智能科技有限公司 Method for interconnecting communication devices in local area network
CN113271240B (en) * 2020-02-17 2022-11-01 深圳市艾特智能科技有限公司 Data transmission method, intelligent household system and readable storage medium
CN112751937A (en) * 2020-12-30 2021-05-04 广东好太太智能家居有限公司 Distributed edge intelligent Bluetooth Mesh gateway system and implementation method
CN113179225B (en) * 2021-04-26 2022-11-04 深圳市奇虎智能科技有限公司 Application identification and processing method and system of sub-route, storage medium and computer equipment
CN114500174B (en) * 2022-02-21 2024-05-14 杭州萤石软件有限公司 Interconnection and interworking system and data transmission method
CN115580534B (en) * 2022-11-24 2023-02-21 锱云(上海)物联网科技有限公司 Data acquisition and transmission method, system, equipment and gateway

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102064959A (en) * 2010-11-16 2011-05-18 西安电子科技大学 Three-network convergence oriented digital home network architecture
CN102098651A (en) * 2011-01-21 2011-06-15 北京邮电大学 Method for performing strategy identification and control by using user service identification (USID)
CN102624621A (en) * 2012-03-11 2012-08-01 上海宜云物联科技有限公司 Heterogeneous network adaptive data communication method and sensor network multi-protocol gateway
BG2065U1 (en) * 2014-05-16 2015-05-29 "Технически Иновации" Еоод Adaptive multilinear system for assisting of elderly and people with disabilities
CN104811375A (en) * 2015-05-08 2015-07-29 三星电子(中国)研发中心 Smart home gateway and networking method thereof
CN105915577A (en) * 2015-12-18 2016-08-31 美的集团股份有限公司 Internet of things control system, terminal, gateway, remote control terminal and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10257136B2 (en) * 2013-05-28 2019-04-09 Convida Wireless, Llc Data aggregation in the internet of things

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102064959A (en) * 2010-11-16 2011-05-18 西安电子科技大学 Three-network convergence oriented digital home network architecture
CN102098651A (en) * 2011-01-21 2011-06-15 北京邮电大学 Method for performing strategy identification and control by using user service identification (USID)
CN102624621A (en) * 2012-03-11 2012-08-01 上海宜云物联科技有限公司 Heterogeneous network adaptive data communication method and sensor network multi-protocol gateway
BG2065U1 (en) * 2014-05-16 2015-05-29 "Технически Иновации" Еоод Adaptive multilinear system for assisting of elderly and people with disabilities
CN104811375A (en) * 2015-05-08 2015-07-29 三星电子(中国)研发中心 Smart home gateway and networking method thereof
CN105915577A (en) * 2015-12-18 2016-08-31 美的集团股份有限公司 Internet of things control system, terminal, gateway, remote control terminal and method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Design of Cordova-based Message Push Module for Cross-platform Smart Home Application;Fagui Liu et al.,;《2015 Fifth International Conference on Instrumentation and Measurement, Computer, Communication and Control IMCCC》;20160215;正文第635-639页 *
基于MQTT协议的通用智能家居***设计与实现;顾亚文;《中国优秀硕士学位论文全文数据库》;20160315(第3期);正文第29-48页 *
基于MQTT的云推送平台的研究及应用;郑峰;《中国优秀硕士学位论文全文数据库》;20170415(第4期);正文第23-32页 *

Also Published As

Publication number Publication date
CN107231262A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
CN107231262B (en) Message routing method based on MQTT multi-layer cascade
Villaverde et al. Service discovery protocols for constrained machine-to-machine communications
CN101577722B (en) Method for realizing MAC forced forwarding function and device
EP3175602A2 (en) Server for device location registration in an internet of things (iot)
CN104811375A (en) Smart home gateway and networking method thereof
CN101345655A (en) Method for discovering protocol and acquiring network connection information by utilization of link layer
EP2951953A1 (en) Method of managing zigbee network in the internet of things
US20130238779A1 (en) Data structure for managing sensor network using id of sensor node and method using the same
EP2579525B1 (en) System and method for managing device identifiers of ubiquitous network
WO2009111965A1 (en) Method, device and system of data synchronization
CN111034129A (en) Communication module with network interface and lighting bus system
CN105591798A (en) Method and device for transmitting OAM information in DCN
KR100429902B1 (en) Apparatus and method for controlling devices in private network from public network
WO2024146464A1 (en) Uniform configuration method for integration of industrial wireless network and time-sensitive network
CN101494561A (en) Network management method and system based on simple network management protocol
CN113285894B (en) Identity identification network mobility control method and system based on programmable switch
CN113381875B (en) Method for acquiring configuration data
CN103813372A (en) Wireless sensor network management method based on IPV6 (internet protocol version 6)
WO2017215383A1 (en) Network element configuration method and device, and network element management method and device
KR100868825B1 (en) Method for configuring network address translating table in mobile communication system and method for routing network address of base station
US20100153551A1 (en) Method of managing non-ip based sensor network using simple network management protocol
CN100499489C (en) management method of network constituted by resource restricted apparatus
CN104836678A (en) Message transmission method based on network selection and time arrangement, and node equipment
JP7107047B2 (en) Control system, search device and search program
CN106027641A (en) TCP (Transmission Control Protocol) connection multiplexing method based on SDN (Software Defined Network)

Legal Events

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