CN110635979B - Method for interconnecting communication devices in local area network - Google Patents

Method for interconnecting communication devices in local area network Download PDF

Info

Publication number
CN110635979B
CN110635979B CN201910999578.5A CN201910999578A CN110635979B CN 110635979 B CN110635979 B CN 110635979B CN 201910999578 A CN201910999578 A CN 201910999578A CN 110635979 B CN110635979 B CN 110635979B
Authority
CN
China
Prior art keywords
communication
local area
area network
sub
message
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
CN201910999578.5A
Other languages
Chinese (zh)
Other versions
CN110635979A (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.)
Hangzhou Honyar Electrical Co Ltd
Hangzhou Hongyan Intelligent Technology Co Ltd
Original Assignee
Hangzhou Honyar Electrical Co Ltd
Hangzhou Hongyan Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Honyar Electrical Co Ltd, Hangzhou Hongyan Intelligent Technology Co Ltd filed Critical Hangzhou Honyar Electrical Co Ltd
Priority to CN201910999578.5A priority Critical patent/CN110635979B/en
Publication of CN110635979A publication Critical patent/CN110635979A/en
Application granted granted Critical
Publication of CN110635979B publication Critical patent/CN110635979B/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
    • 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/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure relates to a method for interconnecting communication devices in a local area network, wherein the local area network comprises: a first sub-local area network comprising a first communication device and one or more second communication devices, the method comprising: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then: opening a specific TCP port of the first communication device and closing a specific TCP port of the second communication device; and establishing communication between the first and second communication devices.

Description

Method for interconnecting communication devices in local area network
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method for interconnecting communication devices in a local area network and a method for interconnecting gateway devices in a home network.
Background
With the development of the smart home industry, people pay more attention to the requirements of timeliness and safety, and expect to obtain services with faster response and higher safety and privacy, so that some processing needs to be completed in a local area network of a home network without being transmitted to an external entity (such as a cloud server) to realize edge computing or distributed computing. In some cases, when the home network cannot be connected to an external network, it is more important to be able to complete some processing in the local area network of the home network. However, since the gateway device in the local area network of the home network is usually an embedded system, the processing capability is limited, and the computing requirement is difficult to meet in a complex application environment, a plurality of gateway devices are required to work cooperatively. The interconnection among the gateway devices is the premise of cooperative work among all the gateway devices.
Disclosure of Invention
One of the objects of the present disclosure is to provide an interconnection method between communication devices within a local area network, and a method for interconnection between gateway devices within a home network.
According to a first aspect of the present disclosure, a method for interconnecting communication devices in a local area network is provided, where the local area network includes: a first sub-local area network comprising a first communication device and one or more second communication devices, the method comprising: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then: opening a specific TCP port of the first communication device and closing a specific TCP port of the second communication device; and establishing communication between the first and second communication devices.
According to a second aspect of the present disclosure, there is provided a method for interconnection between gateway devices in a home network, the gateway devices being capable of connecting the home devices, wherein the home network includes a first sub-local area network, the first sub-local area network includes a first gateway device and one or more second gateway devices, the method including: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then: opening a specific TCP port of the first gateway device and closing a specific TCP port of the second gateway device; and establishing communication between the first and second gateway devices.
According to a third aspect of the present disclosure, there is provided a method for interconnection between communication devices in a local area network, wherein the local area network includes: a first sub-local area network comprising a first communication device and one or more second communication devices; a first router; and a second sub-local area network including at least a third communication device determined to be a master communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router, the method comprising: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then: opening a specific TCP port of the first communication device, closing a specific TCP port of the second communication device, and establishing communication between the first and second communication devices; the first communication equipment monitors a TCP handshake request from the second sub-local area network, and the second communication equipment does not monitor the TCP handshake request from the second sub-local area network; and in response to receiving a first TCP handshake request from the third communication device, the first communication device sends a first TCP handshake response to the third communication device and establishes a first TCP connection with the third communication device.
According to a fourth aspect of the present disclosure, there is provided a method for interconnection between gateway devices in a home network, where the gateway devices are capable of connecting home devices, and the home network includes: a first sub-local area network comprising a first gateway device and one or more second gateway devices; a first router; and a second sub-local area network comprising at least a third gateway device determined to be a primary communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router, the method comprising: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then: opening a specific TCP port of the first gateway device, closing a specific TCP port of the second gateway device, and establishing communication between the first and second gateway devices; the first gateway device monitors a TCP handshake request from the second sub-local area network, and the second gateway device does not monitor the TCP handshake request from the second sub-local area network; and in response to receiving a first TCP handshake request from the third gateway device, the first communication device sends a first TCP handshake response to the third communication device and establishes a first TCP connection with the third communication device.
Other features of the present disclosure and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a block diagram schematically illustrating a system to which a method of interconnecting communication devices within a local area network according to an embodiment of the present disclosure is applied.
Fig. 2A is an interaction flow diagram schematically illustrating a portion of a method for interconnection between communication devices within a local area network, according to one embodiment of the present disclosure.
Fig. 2B is an interaction flow diagram schematically illustrating a portion of a method for interconnection between communication devices within a local area network, according to yet another embodiment of the present disclosure.
Fig. 3 is an interaction flow diagram schematically illustrating yet another part of a method for interconnection between communication devices within a local area network according to yet another embodiment of the present disclosure.
Fig. 4 is a block diagram schematically illustrating a local area network established by the method for interconnecting communication devices in the local area network according to the embodiment of the present disclosure.
Detailed Description
The present disclosure will now be described with reference to the accompanying drawings, which illustrate several embodiments of the disclosure. It should be understood, however, that the present disclosure may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, the embodiments described below are intended to provide a more complete disclosure of the present disclosure, and to fully convey the scope of the disclosure to those skilled in the art. It is also to be understood that the embodiments disclosed herein can be combined in various ways to provide further additional embodiments.
It should be understood that like reference numerals refer to like elements throughout the several views. In the drawings, the size of some of the features may be varied for clarity.
It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. All terms (including technical and scientific terms) used herein have the meaning commonly understood by one of ordinary skill in the art unless otherwise defined. Well-known functions or constructions may not be described in detail for brevity and/or clarity.
In this document, the term "coupled" is intended to encompass a physical, electrical, and/or communicative coupling of one feature to another, and may or may not have intervening features between the one feature and the other feature. When the connection is a communicative connection, even though reference is made to a and B being "directly connected," it is intended to merely emphasize that one or more features emphasized by the present disclosure are not present between the connection of a and B, but is not meant to limit the connection between a and B without passing through any element, as one skilled in the art will appreciate that a and B may be connected by a cable, router, gateway, channel, link, network, or the like. It should be noted that, in the drawings of the present disclosure, a direct connection or an indirect connection between a and B is represented by a straight line connecting a and B.
Herein, the term "a or B" includes "a and B" and "a or B" rather than exclusively including only "a" or only "B" unless otherwise specifically stated.
In this document, the term "exemplary" means "serving as an example, instance, or illustration," and not as a "model" that is to be reproduced exactly. Any implementation exemplarily described herein is not necessarily to be construed as preferred or advantageous over other implementations. Furthermore, the disclosure is not limited by any expressed or implied theory presented in the preceding technical field, background, brief summary or the detailed description.
In this document, the term "substantially" is intended to encompass any minor variations due to design or manufacturing imperfections, tolerances of the devices or components, environmental influences and/or other factors. The term "substantially" also allows for differences from a perfect or ideal situation due to parasitics, noise, and other practical considerations that may exist in a practical implementation.
In addition, "first," "second," and like terms may also be used herein for reference purposes only, and thus are not intended to be limiting. For example, the terms "first," "second," and other such numerical terms referring to structures or elements do not imply a sequence or order unless clearly indicated by the context.
It will be further understood that the terms "comprises/comprising," "includes" and/or "including," when used herein, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should be noted that herein, when multiple identical or similar elements are provided, they may be labeled in the figures using two-part reference numerals (e.g., gateway device 112-1). These elements may be referred to herein individually by their full reference number (e.g., gateway device 112-1), and may be referred to collectively by a first portion of their reference number (e.g., gateway device 112).
Fig. 1 is a block diagram schematically illustrating a system to which a method of interconnecting communication devices within a local area network according to an embodiment of the present disclosure is applied. Although the communication devices within the local area network are illustrated as gateway devices in the drawings of the present disclosure (i.e., illustrated as a subordinate concept of the communication devices), it will be understood by those skilled in the art that the communication devices involved in the method according to the embodiments of the present disclosure are not limited to gateway devices in a narrow sense, i.e., are not limited to internetwork connectors, protocol converters, etc., but include any electronic devices with communication functions that can be applied in the method according to the embodiments of the present disclosure. The system includes a local area network 100, and the local area network 100 may be a home network, a part of a home network, or another local area network. The local area network 100 may comprise one or more sub-local area networks, in the example shown in the figure, the local area network 100 comprises sub-local area networks 110, 120, 130, wherein the sub-local area network 110 communicates with the sub-local area network 120 via the router 111 and with the sub-local area network 130 via the routers 111 and 121, and the sub-local area network 120 communicates with the sub-local area network 130 via the router 121. It should be understood that lan 100 may also include other sub-lans, such as other sub-lans (not shown) that communicate with sub-lan 130 through router 131.
Each sub-local area network may include one or more gateway devices, each of which may communicate with one or more terminal devices. The terminal device may be a communication terminal within a local area network, such as a personal computer, a mobile phone, etc.; and the system can also be terminal equipment in a home network, such as lighting equipment, access control equipment, alarm equipment, heating equipment and the like. In the example shown in the figure, sub-local area network 110 includes gateway devices 112-1 and 112-2, and terminal devices 113-1 through 113-6. Wherein terminal devices 113-1 through 113-3 communicate with gateway device 112-1 and terminal devices 113-4 through 113-6 communicate with gateway device 112-2. Each gateway device 112 is connected to bus 141 so as to be able to communicate directly with router 111 or other entities (e.g., external entity 303) also connected to bus 141. Further, router 111 is also coupled to bus 142, and thus, router 111 may communicate directly with other entities (e.g., router 121, gateway device 122) also coupled to bus 142. Sub-lan 120 includes gateway devices 122-1 and 122-2, and terminal devices 123-1 through 123-6. Terminal devices 123-1 through 123-3 communicate with gateway device 122-1, and terminal devices 123-4 through 123-6 communicate with gateway device 122-2. Each gateway device 122 is connected to bus 142 so as to be able to communicate directly with routers 111, 121 or other entities also connected to bus 142. Further, router 121 is also coupled to bus 143, and thus router 121 may communicate directly with other entities (e.g., router 131, gateway device 132) also coupled to bus 143. The sub-lan 130 includes gateway devices 132-1 and 132-2, and terminal devices 133-1 through 133-6. Where terminal devices 133-1 through 133-3 communicate with gateway device 132-1 and terminal devices 133-4 through 133-6 communicate with gateway device 132-2. Each gateway device 132 is connected to bus 143 so as to be able to communicate directly with router 131 or other entities also connected to bus 143. Further, although not shown, the router 131 may also be connected to other buses or entities. It should be understood that if lan 100 does not include other sub-lans or other entities, lan 100 may not include router 131.
In the example shown in the figure, the local area network comprises three sub-local area networks, each of which comprises two gateway devices, each of which communicates with three terminal devices. It should be understood that the figures are merely illustrative and that a local area network may include more or fewer sub-local area networks, each of which may include more or fewer gateway devices, each of which may communicate with more or fewer terminal devices. In the example shown in the figure, each sub-lan has a bus-type topology. It should be understood that the figures are merely schematic and that each sub-area network may also have other types of topologies, such as star, tree, ring, mesh, etc. topologies.
The local area network 100 may also communicate with external entities. It should be understood that the external entity referred to herein refers to a communication entity located outside the local area network 100, and may include various devices/apparatuses and the like operated by users, operators, managers and the like of the local area network 100, such as a server, a cloud server, an operation/control terminal and the like. The local area network 100 may communicate with external entities in various ways so that the external entities may query the status of, control, configure, etc. the various entities within the local area network 100. In the example shown in the figure, the local area network 100 is connected to the internet 200 (e.g., the internet) through the router 101, while the external entity 301 is also connected to the internet 200, so that the local area network 100 can communicate with the external entity 301 through the internet 200 and the router 101. External entities may also be unconnected to the internet 200, for example, external entity 302 may communicate with local area network 100 by connecting to router 101. External entities may also be connected directly to lan 100, e.g., external entity 303 is connected to any bus in lan 100, e.g., bus 141, to communicate with lan 100.
According to the method for interconnecting communication devices in the local area network, even in the case that the connection L1 between the local area network 100 and the router 101 is disconnected and/or the connection L2 between the router 101 and the Internet 200 is disconnected, the gateway devices in the whole local area network 100 can communicate with each other. The method of interconnection between communication devices within a local area network according to the present disclosure is described below in several processes.
One and the same sonCommunication set-up between communication devices within a local area network
According to the method for interconnecting communication devices in a local area network, a sub-local area network comprises a plurality of gateway devices, one gateway device in the plurality of gateway devices is determined as a main communication unit (hereinafter referred to as a main unit) in the sub-local area network according to a predetermined rule, other gateway devices are determined as secondary communication units (hereinafter referred to as secondary units) in the sub-local area network, and each secondary unit can communicate with the main unit. If the sub-area network comprises only one gateway device, the gateway device is the master within the sub-area network. The master unit within the sub-area network is connected to the master unit of at least one other sub-area network by the method described below. Thus, any gateway device in the sub-lan can communicate with gateway devices in other sub-lans (the secondary unit communicates through the primary unit).
The predetermined rule may be a rule that is configured in advance by any external entity to each gateway device in the sub-lan, or may be a rule in a default configuration (for example, factory configuration) of the gateway device, or the like. The predetermined rule configured to each gateway device may include, for example, determining the gateway device with the smallest MAC address in the sub-lan as the primary unit and determining other gateway devices as the secondary units, or specifying which gateway device in the sub-lan is the primary unit and determining other gateway devices in the sub-lan as the secondary units by an external entity, and the like.
Taking sub-lan 110 as an example, each gateway device 112 located within sub-lan 110 is connected to bus 141, so that each gateway device 112 can communicate directly with each other. According to a predetermined rule, for example, the gateway device 112-1 in the sub-local area network 110 may be determined as a primary unit, and the gateway device 112-2 may be determined as a secondary unit. As shown in fig. 2A, the gateway device 112-1 as the master unit transmits a UDP multicast packet on a multicast channel within the sub-area network 110 to transmit device information (which may include, for example, an IP address and a port number) of the gateway device 112-1. The gateway device 112-2, as a secondary unit, listens to the multicast channel within the sub-local area network 110. If the gateway device 112-2 receives the UDP multicast packet sent by the gateway device 112-1, it sends a UDP unicast packet to the gateway device 112-1 according to the device information in the UDP multicast packet, so as to send the device information (which may include, for example, an IP address and a port number) of the gateway device 112-2 to the gateway device 112-1. Gateway device 112-1 establishes a UDP communication with gateway device 112-2 after receiving the UDP unicast message from gateway device 112-2. The establishment of the UDP communication and the subsequent transmission of the data packet through the established UDP communication both conform to the standard UDP protocol, which is not described herein again. In response to establishing a UDP communication, gateway device 112-1 and gateway device 112-2 store information for the UDP communication established, which may include the IP addresses and port numbers of the two parties to the communication.
In order to illustrate an operation of establishing communication within a sub-area network including a plurality of sub-units, a procedure of establishing communication in the sub-area network in a method of interconnecting communication devices within the local area network according to still another embodiment of the present disclosure will be described with reference to fig. 2B. The sub-lan 110 includes a gateway device 112-1 operating as a primary unit and gateway devices 112-2, 112-3 operating as secondary units. Although fig. 2B depicts an embodiment in which only two subunits are included in the sub-area network 110, it should be understood that more subunits may be included in the sub-area network 110, and each subunit may perform similar operations as the other subunits. The gateway device 112-1 as the master unit transmits a UDP multicast packet on a multicast channel within the sub-area network 110 to transmit device information (which may include, for example, an IP address and a port number) of the gateway device 112-1. Each gateway device 112-2, 112-3 as a sub-unit listens to the multicast channel within the sub-lan 110. The gateway devices 112-2, 112-3 each receive the UDP multicast packet sent by the gateway device 112-1 and each send a UDP unicast packet to the gateway device 112-1 to send respective device information (which may include, for example, respective IP addresses and port numbers) to the gateway device 112-1. Gateway device 112-1 establishes UDP communications with gateway devices 112-2, 112-3, respectively, after receiving UDP unicast messages from gateway devices 112-2, 112-3, respectively. In response to establishing the UDP communication, the two communicating parties respectively store information of the established UDP communication, which may include IP addresses and port numbers of the two communicating parties.
Through the above-described procedure, in the sub-area network, the gateway device as the master unit can discover all connectable gateway devices (sub-units) in the sub-area network and establish direct communication with each of the sub-units.
In addition, after a UDP communication is established, information of the UDP communication may be shared. The information of the shared UDP communication may include at least IP addresses of both communication parties, and may further include a port number. In some embodiments, gateway device 112-1, as the master unit, may multicast information of the established UDP communication within sub-local area network 110. The gateway device 112-2, as a secondary unit, upon receiving the multicast information, stores the information, e.g., in a memory of the gateway device 112-2, for later retrieval. Through this process, each gateway device within the sub-area network 110 knows information of UDP communication between all established gateway devices within the sub-area network 110. Furthermore, information of these UDP communications may be shared throughout the lan 100 by the sub-lan 110 master unit, so that each gateway device throughout the lan 100 is able to know information of the established UDP communication of any one gateway device throughout the lan 100. In some embodiments, gateway device 112-1, as a master unit, may broadcast information for UDP communications established within the sub-lan 110 throughout lan 100. Any gateway device in the entire lan 100 except the gateway device 112-1, upon receiving the information, stores the information. In this way, each gateway device in the entire lan 100 can know information of UDP communication established by any one gateway device in the entire lan 100. In some embodiments, both parties that have established UDP communication may share the information externally, that is, both the gateway device 112-1 as the primary unit and the gateway device 112-2 as the secondary unit may multicast in the sub-lan 110 or broadcast the information of the respective established UDP communication in the entire lan 100.
Although gateway device 112-1 is identified as the master within the sub-lan 110 and gateway device 112-2 is identified as the slave within the sub-lan 110 in the examples herein, it should be understood that where each gateway device may operate as both a master and a slave, any one gateway device within the sub-lan 110 may or may not be identified as a master and the other gateway devices are identified as slaves, e.g., gateway device 112-2 may be identified as a master within the sub-lan 110 and gateway device 112-1 is identified as a slave.
Communication maintenance between communication devices within the same sub-LAN
After communication is established between a gateway device operating as a secondary unit (also referred to herein as a secondary unit) and a gateway device operating as a primary unit (also referred to herein as a primary unit) within a sub-local area network, there may be some circumstances that result in a loss of communication. For example, the IP address of either party of the two communicating parties changes, either party goes offline due to power outage, crash, etc. Therefore, in order to maintain the communication after the communication is established, at least one of the two communicating parties periodically transmits heartbeat data to the other party, and the other party periodically listens to the heartbeat data to monitor the state of the communication. If the heartbeat data is not monitored within a predetermined period of time, both parties attempt to re-establish communication. If the attempt to reestablish the communication is successful, information of the reestablished communication is multicast in the sub-local area network or broadcast in the entire local area network. If the attempt to reestablish the communication fails, the communication loss is multicast in the sub-local area network or broadcast in the whole local area network, and the party which does not send the heartbeat data according to the period can also be reported to the external entity to be offline.
In some embodiments, heartbeat data is periodically transmitted by the secondary unit to the primary unit, which periodically listens for the heartbeat data. In some embodiments, heartbeat data is periodically transmitted by the primary unit to the secondary units, which periodically listen for the heartbeat data. In some embodiments, both the primary and secondary units periodically transmit heartbeat data, and both the primary and secondary units periodically listen for heartbeat data of the other.
The following is a detailed description of the master listening to the secondary units as an example. After establishing communication between the gateway device 112-1 as the primary unit and the gateway device 112-2 as the secondary unit within the sub-local area network 110, the gateway device 112-2 periodically transmits heartbeat data to the gateway device 112-1, and the gateway device 112-1 periodically listens for the heartbeat data. If the gateway device 112-1 does not monitor the heartbeat data of the gateway device 112-2 within the predetermined time period, the UDP multicast packet is sent again within the sub-lan 110.
If the connection is disconnected due to the IP change of the gateway device 112-2 and the heartbeat is not monitored, the gateway device 112-2 at this time may receive the UDP multicast packet from the gateway device 112-1 by monitoring the multicast channel in the sub-lan 110. After receiving the UDP multicast packet, the gateway device 112-2 may send a UDP unicast packet to the gateway device 112-1. After gateway device 112-1 receives the UDP unicast message from gateway device 112-2, UDP communication may be reestablished between gateway devices 112-1 and 112-2. After the UDP communication is reestablished, information of the reestablished UDP communication may be saved and shared. Saving the information of the re-established UDP communication may include gateway devices 112-1 and 112-2 updating the information of both parties that has been saved. Sharing information of the re-established UDP communication may be similar to the information sharing process in the above-described connection establishment process, including the master unit and/or the secondary unit multicasting within the sub-local area network and/or broadcasting information of the re-established UDP communication (i.e., updated information of the UDP communication) throughout the local area network, and thus will not be described again herein.
If the connection is disconnected due to the offline of the gateway device 112-2 and the heartbeat is not monitored, the gateway device 112-2 at this time does not monitor the multicast channel in the sub-lan 110 any more, and therefore the gateway device 112-1 does not receive the UDP unicast packet from the gateway device 112-2. After the gateway device 112-1 sends the UDP multicast packet again, if the UDP unicast packet from the gateway device 112-2 is not received (e.g., not received within a predetermined time period), the information of the UDP communication with the gateway device 112-2 that has been stored is deleted, and the UDP communication loss between the gateway devices 112-1 and 112-2 is multicast within the sub-lan and/or broadcast within the entire lan. In addition, gateway device 112-1 may also report to at least one external entity that gateway device 112-2 is offline. In this way, the server, the operation/control terminal, and the like, which are external entities, can know the online/offline status of each gateway device in the entire local area network 100 (e.g., the intelligent furniture network).
Connection establishment between communication devices between different sub-LANs
The gateway device operated as a master unit in each sub-lan is responsible for establishing a communication connection with other sub-lans, e.g. a master unit in one sub-lan is in communication connection with a master unit in another sub-lan, so that communication between the master units in the two sub-lans is possible. In some embodiments, the two sub-lans between the master unit that establish the connection may be adjacent sub-lans. Here, adjacent means that two sub-lans communicate with each other via only one router. Since in each sub-lan, all the gateway devices operating as slave units establish communication connections with the gateway device operating as master unit in the sub-lan, a sub-unit in one sub-lan can communicate with a master unit in another sub-lan via the master unit of the sub-lan, and a sub-unit in one sub-lan can communicate with a sub-unit in another sub-lan via the master unit of the sub-lan and the master unit in another sub-lan. Thus, intercommunication between all gateway devices can be achieved within the entire local area network.
In some embodiments, a master unit located in a lower sub-local area network in the entire local area network 100 may actively initiate a communication connection with a master unit located in an upper sub-local area network. For example, master gateway device 132-1 within sub-lan 130 may actively initiate establishment of a communication connection with master gateway device 122-1 within sub-lan 120, and/or master gateway device 122-1 within sub-lan 120 may actively initiate establishment of a communication connection with master gateway device 112-1 within sub-lan 110. In some embodiments, a master unit located in an upper sub-local area network of the entire local area network 100 may actively initiate a communication connection with a master unit located in a lower sub-local area network. For example, master unit gateway device 112-1 within sub-lan 110 may actively initiate establishment of a communication connection with master unit gateway device 122-1 within sub-lan 120, and/or master unit gateway device 122-1 within sub-lan 120 may actively initiate establishment of a communication connection with master unit gateway device 132-1 within sub-lan 130.
The following description will take the example where gateway device 122-1 in sub-lan 120 actively initiates the establishment of a communication connection with gateway device 112-1 in sub-lan 110. As shown in fig. 3, gateway device 122-1 in sub-lan 120 sends TCP handshake requests to specific TCP ports of all gateway devices 112-1, 112-2 in sub-lan 110, which is upper and adjacent to it. For example, gateway device 122-1 may compute a particular network segment based on its default gateway and WAN port subnet mask and then send a TCP handshake request to a particular TCP port of all gateway devices within the particular network segment. In one particular example, the WAN port IP address of the gateway device 122-1 is 192.168.31.154, the subnet mask is 255.255.255.0, and the default gateway is 192.168.31.1. The subnet mask is anded with the default gateway to obtain a network number 192.168.31.0, which is the network number on the LAN side of the previous router (i.e., router 111). Then, by performing TCP scan on all gateway devices in the network segment of the network number (i.e. sending TCP handshake request to specific TCP ports of all gateway devices in the network segment), a gateway device with which a TCP connection can be established can be found.
According to an embodiment of the present disclosure, in each sub-area network, the TCP communication module of the gateway device operating as the primary unit is configured in the on state, and the TCP communication module of the gateway device operating as the secondary unit is configured in the off state. For example, in the sub-area network 120, the TCP communication module of the gateway device 122-1 as the primary unit is configured in the open state, and the TCP communication module of the gateway device 122-2 as the secondary unit is configured in the closed state, so that only the gateway device 122-1 in the sub-area network 120 transmits a TCP handshake request to all gateway devices in the sub-area network (i.e., the sub-area network 110) on the upper layer thereof. On the other hand, in the sub-lan 110, the TCP communication module of the gateway device 112-1 as the primary unit is configured in an open state (e.g., a listening state), and the TCP communication module of the gateway device 112-2 as the secondary unit is configured in a closed state, so that only the gateway device 112-1 can receive TCP handshake requests from other sub-lans within the sub-lan 110.
Gateway device 112-1 may reply with a TCP handshake response to gateway device 122-1 upon receiving the TCP handshake request sent by gateway device 122-1 through its particular TCP port. While other gateway devices within sub-local area network 110 (i.e., gateway devices operating as subunits) do not receive the TCP handshake request and therefore do not reply with a TCP handshake response. Gateway device 122-1 establishes a TCP communication connection with gateway device 112-1 after receiving the TCP handshake response sent by gateway device 112-1. The process of establishing a communication connection may conform to a standard TCP protocol, for example, a TCP connection acknowledgement may be sent by the master unit gateway device 122-1 located in the lower sub-lan 120 to the master unit gateway device 112-1 located in the upper sub-lan 110, as shown in fig. 3, thereby establishing a TCP communication connection between the two gateway devices. In this way, the master gateway device 122-1 in the sub-lan 120 can discover all gateway devices in the sub-lan 110 on the upper layer, that is, the master gateway device 112-1 in the sub-lan 110, and establish a direct communication connection therewith.
Further, after the communication connection is established, information of the connection relationship of the communication connection may be saved and shared. Gateway devices 112-1 and 122-1 may store connection relationship information for the communication connections established therebetween on respective memories. Sharing the information of the connection relationship may include that the gateway devices 112-1 and 122-1 may multicast the connection relationship information within the respective sub-local area networks 110 and 120, and the gateway devices operating as sub-units within the respective sub-local area networks 110 and 120 store the multicast information in respective memories after receiving it. In addition, the gateway devices 112-1 and 122-1 may broadcast the connection relation information throughout the lan 100, and the gateway devices (including the primary and secondary units) in other sub-lans (e.g., the sub-lan 130) may store the multicast information in their respective memories after receiving it. In this way, each gateway device in the entire lan 100 can know the connection relationship of any one gateway device in the entire lan 100.
Although in the above description of the specification, the establishment of communication between gateway devices in the same sub-lan is described first, and then the establishment of communication connection between master gateway devices in different sub-lans is described, it should be understood by those skilled in the art that these two procedures are not dependent on each other, and are not limited in order. The communication connection between different sub-local area networks can be established first, then the communication in the same sub-local area network can be established, the communication in the same sub-local area network can be established first, then the communication connection between different sub-local area networks can be established, and the communication in the same sub-local area network and the communication connection between different sub-local area networks can be established at the same time.
Connection maintenance between communication devices between different sub-LANs
Similar to the above-described procedure of communication maintenance between gateway devices within the same sub-lan, the state of the communication connection between two master unit gateway devices establishing a TCP communication connection can be monitored by listening to heartbeat data. The master unit located in the lower sub-local area network may listen to the heartbeat data of the master unit located in the upper sub-local area network, or the master unit located in the upper sub-local area network may listen to the heartbeat data of the master unit located in the lower sub-local area network.
The following description will be made in detail by taking an example in which a master unit located in a lower-layer sub-lan listens for heartbeats of a master unit located in an upper-layer sub-lan. After establishing a connection between the gateway device 122-1 as the master unit in the sub-area network 120 and the gateway device 112-1 as the master unit in the sub-area network 110, the gateway device 112-1 periodically transmits heartbeat data to the gateway device 122-1, and the gateway device 122-1 periodically listens for the heartbeat data. If the gateway device 122-1 does not listen to the heartbeat data of the gateway device 112-1 within a predetermined time period, which may be, for example, an IP address of the gateway device 112-1 changes or goes offline, the gateway device 122-1 sends a TCP handshake request to specific TCP ports of all gateway devices in the sub-local area network 110 again.
If the connection is broken due to the IP change of gateway device 112-1 and the heartbeat is not monitored, gateway device 112-1 may again receive the TCP handshake request from gateway device 122-1 at this time. Upon receiving the TCP handshake request sent by gateway device 122-1, gateway device 112-1 may reply with a TCP handshake response to gateway device 122-1. Gateway device 122-1 reestablishes the communication connection with gateway device 112-1 after receiving the TCP handshake response that gateway device 112-1 sent again. After the communication connection is reestablished, information of the reestablished communication connection may be saved and shared. Storing information for the re-established communication connection may include gateway devices 122-1 and 112-1 updating the stored information for the connection (including at least the IP addresses of both parties to the connection). The sharing of information of the re-established communication connection may be similar to the information sharing procedure in the above-described connection establishment procedure, and a description thereof will not be repeated.
If the connection is disconnected due to the off-line of the gateway device 112-1 and the heartbeat is not monitored, the gateway device as the master unit is determined again in the sub-local area network 110 at this time. For example, the gateway device 112-2 is determined as the master within the sub-lan 110 according to a predetermined rule. At this time, the TCP communication module of the gateway device 112-2 as the master unit is configured in the open state, and therefore, after the gateway device 122-1 transmits the TCP handshake request again, the gateway device 112-2 receives the handshake request and replies a TCP handshake response. Gateway device 122-1 establishes a new TCP communication connection with gateway device 112-2 after receiving the TCP handshake response from gateway device 112-2. After the new communication connection (e.g., the connection between gateway devices 112-2 and 122-1) is established, the connection information between sub-local area networks 110 and 120 (e.g., the connection between gateway devices 112-1 and 122-1) that has been saved is deleted, and the information of the new communication connection is saved and shared. If the gateway device 112-1 is the only gateway device in the sub-lan 110, the new master unit can no longer be determined in the sub-lan 110 after it is offline. Thus, after gateway device 122-1 again sends the TCP handshake request, without receiving a TCP handshake response from any gateway device within sub-lan 110, the information for the communication connection (e.g., the connection between gateway devices 112-1 and 122-1) that has been stored is deleted and the communication connection loss is multicast within the sub-lan and/or broadcast throughout the lan. In addition, gateway device 122-1 may also report to at least one external entity that gateway device 112-1 is offline.
Through the process, the interconnection system among the gateway devices in the local area network can be autonomously formed and maintained by the gateway devices (i.e. without manual intervention). The local area network comprises a plurality of sub-local area networks, each sub-local area network comprises a main unit and one or more sub-units, and each sub-unit is communicated with the main unit of the sub-local area network in which the sub-local area network is positioned. The master units of every two adjacent sub-local area networks are connected with each other in a communication way. So that any one gateway device within the local area network can communicate with another gateway device within the local area network without connecting to an external network. Therefore, a plurality of gateway devices in the local area network can work cooperatively (such as distributed computing, triggering linkage and the like) without connecting with an external network, so that computing, linkage and the like can be completed inside the local area network, dependence on cloud services is reduced, flow to the external network can be saved, and/or response speed between the gateway devices can be improved.
Messaging between communication devices
When any one of the secondary unit gateway devices in any one of the secondary local area networks wants to send a message to any one of the other gateway devices, it is only necessary to send the message to the primary unit gateway device communicating with the secondary unit gateway device. When any one of the master gateway devices in any one of the sub-lans wants to send a message to the slave gateway device in the sub-lan, it only needs to send the message to the slave gateway device communicating with the master gateway device. When the master gateway device of any sub-lan wants to send a message to any gateway device in any sub-lan located in a lower layer, it only needs to send the message to the master gateway device in the sub-lan located in the lower layer and adjacent to the master gateway device (i.e. the sub-lan located in the lower layer). Similarly, when the master gateway device of any sub-lan wants to send a message to any gateway device in any sub-lan located in the upper layer, it only needs to send the message to the master gateway device in the sub-lan located in the upper layer and adjacent to the master gateway device (i.e. the sub-lan located in the upper layer). The messaging of each gateway device may be provided with an acknowledgement and retransmission mechanism. For example, after any gateway device sends a message, it needs to obtain the confirmation of the receiving party; and if the confirmation of the receiver is not received within the preset time period, the message is retransmitted.
When any sub-unit gateway device in any sub-local area network receives any message, judging the destination of the message (namely the target device, for example, the destination device can be judged by the destination IP address in the message), and if the destination is the sub-unit, processing the message; and if the destination is not the secondary unit, sending the message to a main unit gateway device connected with the secondary unit. When the main unit gateway equipment in any sub-local area network receives any message, judging the destination of the message, and if the destination is the main unit, processing the message; if the destination is not the master unit itself, the message is transmitted according to the destination of the message, and the transmission method is as described above.
In the example shown in fig. 4, the local area network includes sub-local area networks 10 to 30, the sub-local area network 10 including a gateway device 11 operating as a primary unit and gateway devices 12-1 to 12-3 operating as secondary units, each gateway device 12 communicating with the gateway device 11. The sub-lan 20 includes a gateway device 21 operating as a primary unit and gateway devices 22-1 to 22-3 operating as secondary units, each gateway device 22 communicating with the gateway device 21. The sub-lan 30 includes a gateway device 31 operating as a primary unit and gateway devices 32-1 to 32-3 operating as secondary units, each gateway device 32 communicating with the gateway device 31. The main unit gateway device 11 of the sub-lan 10 is connected to the main unit gateway device 21 of the sub-lan 20, and the main unit gateway device 21 of the sub-lan 20 is connected to the main unit gateway device 31 of the sub-lan 30.
The following describes the above data transmission and reception process with some specific examples.
When the secondary unit gateway device 12 in the sub-lan 10 wants to send a message to any other gateway device, it only needs to send the message to the primary unit gateway device 11 in the sub-lan 10.
When the master gateway device 11 in the sub-lan 10 wants to send a message to the gateway device 21 in the sub-lan 20 or any one of the gateway devices 22, it only needs to send the message to the master gateway device 21 in the sub-lan 20. When the master gateway device 11 in the sub-lan 10 wants to transmit a message to the gateway device 31 or any one of the gateway devices 32 in the non-adjacent sub-lan 30, it is sufficient to transmit the message to the master gateway device 21 in the adjacent sub-lan 20.
When the master gateway device 31 in the sub-lan 30 wants to send a message to the gateway device 21 in the sub-lan 20 or any one of the gateway devices 22, it only needs to send the message to the master gateway device 21 in the sub-lan 20. When the master gateway device 31 in the sub-lan 30 wants to transmit a message to the gateway device 11 or any one of the gateway devices 12 in the sub-lan 10 that is not adjacent to the master gateway device, the master gateway device may transmit the message to the master gateway device 21 in the sub-lan 20 adjacent to the master gateway device.
The subunit gateway device 22 in the sub-lan 20, after receiving a message, determines the destination of the message. If the destination is gateway device 22, the message is processed. If the destination is not the gateway device 22, the message is sent to the master gateway device 21 in the sub-lan 20.
The master gateway device 21 in the sub-lan 20 also determines the destination of a message after receiving the message. If the destination is the gateway device 21, the message is processed. If the destination is not gateway device 21 and the destination is a gateway device in a sub-lan of an upper layer of sub-lan 20 (e.g., sub-lan 10 or another sub-lan not shown above sub-lan 10), the message is sent to master unit gateway device 11 in sub-lan 10. If the destination is a gateway device in a sub-lan of a lower layer of the sub-lan 20 (e.g., the sub-lan 30 or other sub-lan not shown below the sub-lan 30), the message is sent to the main unit gateway device 31 in the sub-lan 30.
In addition, embodiments of the present disclosure may also include the following examples:
1. a method of interconnecting communication devices within a local area network, wherein
The local area network includes:
a first sub-local area network comprising a first communication device and one or more second communication devices,
the method comprises the following steps: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first communication device and closing a specific TCP port of the second communication device; and
communication between the first and second communication devices is established.
2. The method according to claim 1, characterized in that,
the local area network further comprises:
a first router; and
a second sub-local area network comprising at least a third communication device, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method further comprises the following steps:
after a specific TCP port of the first communication device is opened, the first communication device sends a first TCP handshake request to all communication devices included in the second sub-local area network; and
the first communication device receives a TCP handshake response from the second sub-LAN, and in response to receiving a first TCP handshake response from the third communication device, the first communication device establishes a first TCP connection with the third communication device.
3. The method of claim 2, wherein the local area network is configured to communicate with an external entity, wherein the first sub-local area network communicates with the external entity via the second sub-local area network, and wherein the second sub-local area network does not communicate with the external entity via the first sub-local area network.
4. The method of claim 2, wherein sending first TCP handshake requests to all communication devices included in the second sub-LAN comprises sending first TCP handshake requests to all communication devices of a particular network segment, wherein the particular network segment is calculated based on a default gateway and a WAN port subnet mask of the first communication device.
5. The method of claim 2, further comprising:
after the first TCP connection is established, the first communication device broadcasts information of the first TCP connection in the local area network, wherein the information of the TCP connection at least comprises IP addresses of both connection parties.
6. The method of claim 5, further comprising:
after the first TCP connection is established, the first communication device periodically monitors the heartbeat of the third communication device, and if the heartbeat is not monitored in a preset time period, the first communication device sends second TCP handshake requests to all communication devices included in the second sub-local area network;
if a second TCP handshake response from the third communication device is received, the first communication device establishes a second TCP connection with the third communication device, and broadcasts and updates the information of the first TCP connection into the information of the second TCP connection in the local area network; and
if a TCP handshake response from the third communication device is not received, the first communication device broadcasts the first TCP connection loss in the local area network.
7. The method of claim 6, wherein the local area network is configured to communicate with an external entity, the method further comprising:
if a TCP handshake response from the third communication device is not received, the first communication device also reports the third communication device to be offline to the external entity.
8. The method of claim 6, further comprising:
the second communication equipment receives and stores the TCP connection information broadcast by the first communication equipment; and
after receiving the broadcast of the TCP connection loss, the second communication device deletes the information of the TCP connection that has been stored.
9. The method of claim 2, further comprising the following operations performed by the first communications device:
when a first message is required to be sent to any communication device located in the second sub-local area network, sending the first message to the third communication device; and
when a second message is received, determining a destination of the second message,
if the destination is the first communication equipment, processing the second message;
if the destination is the second communication equipment, sending the second message to the second communication equipment; and
and if the destination is any communication equipment located in the second sub-local area network, sending the second message to the third communication equipment.
10. The method of claim 9, wherein the local area network further comprises a third sub-local area network and a second router, wherein the third sub-local area network is configured to communicate with the first sub-local area network via the first and second routers and to communicate with the second sub-local area network via the second router but not via the first router, wherein the method further comprises the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the third sub-local area network, sending the first message to the third communication device; and
and after receiving a second message, judging the destination of the second message, and if the destination is any communication equipment located in the third sub-local area network, sending the second message to the third communication equipment.
11. The method of claim 2, further comprising the following operations performed by the second communications device:
when a first message is required to be sent to any other communication equipment, the first message is sent to the first communication equipment; and
when a second message is received, determining a destination of the second message,
if the destination is the second communication equipment, processing the second message; and
and if the destination is not the second communication equipment, sending the second message to the first communication equipment.
12. The method of claim 1, wherein the predetermined rule comprises:
determining the communication device with the minimum MAC address in the first sub-local area network as the primary communication unit, and determining other communication devices as the secondary communication unit; or
The primary communication unit and the secondary communication unit are determined according to designation of an external entity connected to the local area network.
13. The method of claim 1, further comprising:
the first communication equipment sends a UDP multicast message in the first sub-local area network;
the second communication equipment monitors a UDP multicast channel in the first sub-local area network, and if the UDP multicast message is received, the second communication equipment sends a UDP unicast message to the first communication equipment; and
and after receiving the UDP unicast message from the second communication device, the first communication device establishes UDP communication with the second communication device, thereby establishing communication between the first communication device and the second communication device.
14. The method of claim 13, further comprising the following operations performed by the first communications device:
and after the UDP communication is established, storing and broadcasting information of the UDP communication in the local area network, wherein the information at least comprises IP addresses of both communication parties.
15. The method of claim 13, further comprising the following operations performed by the first communications device:
after the UDP communication is established, periodically monitoring the heartbeat of the second communication equipment, and if the heartbeat is not monitored in a preset time period, sending a UDP multicast message in the first sub-local area network again; and
after receiving the UDP unicast message from the second communication device, reestablishing the UDP communication with the second communication device.
16. The method of claim 15, further comprising the following operations performed by the first communications device:
after reestablishing the UDP communication, updating the stored information of the UDP communication and broadcasting the reestablished information of the UDP communication in the local area network.
17. The method of claim 15, further comprising the following operations performed by the first communications device:
after the UDP multicast packet is sent again, if a UDP unicast packet from the second communication device is not received, deleting the stored information of the UDP communication and broadcasting the UDP communication loss in the local area network.
18. The method of claim 15, wherein the local area network is configured to communicate with an external entity, the method further comprising the following by the first communication device:
after sending the UDP multicast message again, if the UDP unicast message from the second communication equipment is not received, reporting the offline of the second communication equipment to the external entity.
19. Method for interconnection between gateway devices in home network, wherein the gateway devices can be connected with home devices, wherein
The home network comprises a first sub-local area network comprising a first gateway device and one or more second gateway devices,
the method comprises the following steps: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first gateway device and closing a specific TCP port of the second gateway device; and
communication between the first and second gateway devices is established.
20. The method of claim 19, wherein the first and second portions of the sample are,
the home network further comprises:
a first router; and
a second sub-local area network comprising at least a third gateway device, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method further comprises the following steps: after opening a particular TCP port of the first gateway device,
the first gateway equipment sends a first TCP handshake request to all gateway equipment included in the second sub-local area network; and
and if the first gateway device receives a first TCP handshake response from the third gateway device, establishing a first TCP connection with the third gateway device.
21. A method of interconnecting communication devices within a local area network, wherein
The local area network includes:
a first sub-local area network comprising a first communication device and one or more second communication devices;
a first router; and
a second sub-local area network including at least a third communication device determined to be a master communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first communication device, closing a specific TCP port of the second communication device, and establishing communication between the first and second communication devices;
the first communication equipment monitors a TCP handshake request from the second sub-local area network, and the second communication equipment does not monitor the TCP handshake request from the second sub-local area network; and
in response to receiving a first TCP handshake request from the third communication device, the first communication device sends a first TCP handshake response to the third communication device and establishes a first TCP connection with the third communication device.
22. The method of claim 21, wherein the local area network is configured to communicate with an external entity, wherein the first sub-local area network does not communicate with the external entity via the second sub-local area network, and wherein the second sub-local area network communicates with the external entity via the first sub-local area network.
23. The method of claim 21, further comprising:
after the first TCP connection is established, the first communication device broadcasts information of the first TCP connection in the local area network, wherein the information of the TCP connection at least comprises IP addresses of both connection parties.
24. The method of claim 23, further comprising:
after establishing the first TCP connection, the first communication device periodically monitors the heartbeat of the third communication device, and if the heartbeat is not monitored within a preset time period, monitors a TCP handshake request from the third communication device,
if a second TCP handshake request from the third communication equipment is received within a preset time period, sending a second TCP handshake response to the third communication equipment, establishing a second TCP connection with the third communication equipment, and broadcasting and updating the information of the first TCP connection into the information of the second TCP connection in the local area network; and
broadcasting the first TCP connection loss within the local area network if a second TCP handshake request from the third communication device is not received within a predetermined time period.
25. The method of claim 24, wherein the local area network is configured to communicate with an external entity, the method further comprising:
the first communication device also reports the third communication device offline to the external entity if a second TCP handshake request from the third communication device is not received within a predetermined time period.
26. The method of claim 24, further comprising:
the second communication equipment receives and stores the TCP connection information broadcast by the first communication equipment; and
after receiving the broadcast of the TCP connection loss, the second communication device deletes the information of the TCP connection that has been stored.
27. The method of claim 21, further comprising the following operations performed by the first communications device:
when a first message is required to be sent to any communication device located in the second sub-local area network, sending the first message to the third communication device; and
when a second message is received, determining a destination of the second message,
if the destination is the first communication equipment, processing the second message;
if the destination is the second communication equipment, sending the second message to the second communication equipment; and
and if the destination is any communication equipment located in the second sub-local area network, sending the second message to the third communication equipment.
28. The method of 27, wherein the local area network further comprises a third sub-local area network and a second router, wherein the third sub-local area network is configured to communicate with the first sub-local area network via the first and second routers and to communicate with the second sub-local area network via the second router but not via the first router, wherein the method further comprises the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the third sub-local area network, sending the first message to the third communication device; and
and after receiving a second message, judging the destination of the second message, and if the destination is any communication equipment located in the third sub-local area network, sending the second message to the third communication equipment.
29. The method of claim 21, further comprising the following operations performed by the second communications device:
when a first message is required to be sent to any other communication equipment, the first message is sent to the first communication equipment; and
when a second message is received, determining a destination of the second message,
if the destination is the second communication equipment, processing the second message; and
and if the destination is not the second communication equipment, sending the second message to the first communication equipment.
30. The method of claim 21, wherein the predetermined rule comprises:
determining the communication device with the minimum MAC address in the first sub-local area network as the primary communication unit, and determining other communication devices as the secondary communication unit; or
The primary communication unit and the secondary communication unit are determined according to designation of an external entity connected to the local area network.
31. The method of claim 21, further comprising:
the first communication equipment sends a UDP multicast message in the first sub-local area network;
the second communication equipment monitors a UDP multicast channel in the first sub-local area network, and if the UDP multicast message is received, the second communication equipment sends a UDP unicast message to the first communication equipment; and
and after receiving the UDP unicast message from the second communication device, the first communication device establishes UDP communication with the second communication device, thereby establishing communication between the first communication device and the second communication device.
32. The method of claim 31, further comprising the following operations performed by the first communications device:
and after the UDP communication is established, storing and broadcasting information of the UDP communication in the local area network, wherein the information at least comprises IP addresses of both communication parties.
33. The method of claim 31, further comprising the following operations performed by the first communications device:
after the UDP communication is established, periodically monitoring the heartbeat of the second communication equipment, and if the heartbeat is not monitored in a preset time period, sending a UDP multicast message in the first sub-local area network again; and
after receiving the UDP unicast message from the second communication device, reestablishing the UDP communication with the second communication device.
34. The method of 33, further comprising the following operations performed by the first communications device:
after reestablishing the UDP communication, updating the stored information of the UDP communication and broadcasting the reestablished information of the UDP communication in the local area network.
35. The method of 33, further comprising the following operations performed by the first communications device:
after the UDP multicast packet is sent again, if a UDP unicast packet from the second communication device is not received, deleting the stored information of the UDP communication and broadcasting the UDP communication loss in the local area network.
36. The method of 33, wherein the local area network is configured to communicate with an external entity, the method further comprising the following by the first communication device:
after sending the UDP multicast message again, if the UDP unicast message from the second communication equipment is not received, reporting the offline of the second communication equipment to the external entity.
37. Method for interconnection between gateway devices in home network, wherein the gateway devices can be connected with home devices, wherein
The home network includes:
a first sub-local area network comprising a first gateway device and one or more second gateway devices;
a first router; and
a second sub-local area network comprising at least a third gateway device determined to be a master communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first gateway device, closing a specific TCP port of the second gateway device, and establishing communication between the first and second gateway devices;
the first gateway device monitors a TCP handshake request from the second sub-local area network, and the second gateway device does not monitor the TCP handshake request from the second sub-local area network; and
in response to receiving a first TCP handshake request from the third gateway device, the first gateway device sends a first TCP handshake response to the third gateway device and establishes a first TCP connection with the third gateway device.
Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the foregoing examples are for purposes of illustration only and are not intended to limit the scope of the present disclosure. The various embodiments disclosed herein may be combined in any combination without departing from the spirit and scope of the present disclosure. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the disclosure. The scope of the present disclosure is defined by the appended claims.

Claims (33)

1. A method of interconnecting communication devices within a local area network, wherein
The local area network includes:
a first sub-local area network comprising a first communication device and one or more second communication devices;
a first router; and
a second sub-local area network comprising at least a third communication device, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first communication device and closing a specific TCP port of the second communication device;
establishing communication between the first and second communication devices;
the first communication equipment sends a first TCP handshake request to all communication equipment included in the second sub-local area network;
the first communication device receives a TCP handshake response from the second sub-local area network, and in response to receiving a first TCP handshake response from the third communication device, the first communication device establishes a first TCP connection with the third communication device; and
the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the second sub-local area network, sending the first message to the third communication device; and
when a second message is received, determining a destination of the second message,
if the destination is the first communication equipment, processing the second message;
if the destination is the second communication equipment, sending the second message to the second communication equipment; and
and if the destination is any communication equipment located in the second sub-local area network, sending the second message to the third communication equipment.
2. The method of claim 1, wherein the local area network is configured to communicate with an external entity, wherein the first sub-local area network communicates with the external entity via the second sub-local area network, and wherein the second sub-local area network does not communicate with the external entity via the first sub-local area network.
3. The method of claim 1, wherein sending first TCP handshake requests to all communication devices included in the second sub-local area network comprises sending first TCP handshake requests to all communication devices of a particular network segment, wherein the particular network segment is calculated based on a default gateway and a WAN port subnet mask of the first communication device.
4. The method of claim 1, further comprising:
after the first TCP connection is established, the first communication device broadcasts information of the first TCP connection in the local area network, wherein the information of the TCP connection at least comprises IP addresses of both connection parties.
5. The method of claim 4, further comprising:
after the first TCP connection is established, the first communication device periodically monitors the heartbeat of the third communication device, and if the heartbeat is not monitored in a preset time period, the first communication device sends second TCP handshake requests to all communication devices included in the second sub-local area network;
if a second TCP handshake response from the third communication device is received, the first communication device establishes a second TCP connection with the third communication device, and broadcasts and updates the information of the first TCP connection into the information of the second TCP connection in the local area network; and
if a TCP handshake response from the third communication device is not received, the first communication device broadcasts the first TCP connection loss in the local area network.
6. The method of claim 5, wherein the local area network is configured to communicate with an external entity, the method further comprising:
if a TCP handshake response from the third communication device is not received, the first communication device also reports the third communication device to be offline to the external entity.
7. The method of claim 5, further comprising:
the second communication equipment receives and stores the TCP connection information broadcast by the first communication equipment; and
after receiving the broadcast of the TCP connection loss, the second communication device deletes the information of the TCP connection that has been stored.
8. The method of claim 1, wherein the local area network further comprises a third sub-local area network and a second router, wherein the third sub-local area network is configured to communicate with the first sub-local area network via the first and second routers and communicate with the second sub-local area network via the second router but not via the first router, wherein the method further comprises the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the third sub-local area network, sending the first message to the third communication device; and
and after receiving a second message, judging the destination of the second message, and if the destination is any communication equipment located in the third sub-local area network, sending the second message to the third communication equipment.
9. The method of claim 1, wherein the predetermined rule comprises:
determining the communication device with the minimum MAC address in the first sub-local area network as the primary communication unit, and determining other communication devices as the secondary communication unit; or
The primary communication unit and the secondary communication unit are determined according to designation of an external entity connected to the local area network.
10. The method of claim 1, further comprising:
the first communication equipment sends a UDP multicast message in the first sub-local area network;
the second communication equipment monitors a UDP multicast channel in the first sub-local area network, and if the UDP multicast message is received, the second communication equipment sends a UDP unicast message to the first communication equipment; and
and after receiving the UDP unicast message from the second communication device, the first communication device establishes UDP communication with the second communication device, thereby establishing communication between the first communication device and the second communication device.
11. The method of claim 10, further comprising the following operations performed by the first communication device:
and after the UDP communication is established, storing and broadcasting information of the UDP communication in the local area network, wherein the information at least comprises IP addresses of both communication parties.
12. The method of claim 10, further comprising the following operations performed by the first communication device:
after the UDP communication is established, periodically monitoring the heartbeat of the second communication equipment, and if the heartbeat is not monitored in a preset time period, sending a UDP multicast message in the first sub-local area network again; and
after receiving the UDP unicast message from the second communication device, reestablishing the UDP communication with the second communication device.
13. The method of claim 12, further comprising the following operations performed by the first communication device:
after reestablishing the UDP communication, updating the stored information of the UDP communication and broadcasting the reestablished information of the UDP communication in the local area network.
14. The method of claim 12, further comprising the following operations performed by the first communication device:
after the UDP multicast packet is sent again, if a UDP unicast packet from the second communication device is not received, deleting the stored information of the UDP communication and broadcasting the UDP communication loss in the local area network.
15. The method of claim 12, wherein the local area network is configured to communicate with an external entity, the method further comprising the following by the first communication device:
after sending the UDP multicast message again, if the UDP unicast message from the second communication equipment is not received, reporting the offline of the second communication equipment to the external entity.
16. A method of interconnecting communication devices within a local area network, wherein
The local area network includes:
a first sub-local area network comprising a first communication device and one or more second communication devices;
a first router; and
a second sub-local area network comprising at least a third communication device, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first communication device and closing a specific TCP port of the second communication device;
establishing communication between the first and second communication devices;
the first communication equipment sends a first TCP handshake request to all communication equipment included in the second sub-local area network;
the first communication device receives a TCP handshake response from the second sub-local area network, and in response to receiving a first TCP handshake response from the third communication device, the first communication device establishes a first TCP connection with the third communication device; and
the following operations performed by the second communication device:
in case it is desired to send a first message to any of the other communication devices,
sending the first message to the first communication device; and
when a second message is received, determining a destination of the second message,
if the destination is the second communication equipment, processing the second message; and
and if the destination is not the second communication equipment, sending the second message to the first communication equipment.
17. Method for interconnection between gateway devices in home network, wherein the gateway devices can be connected with home devices, wherein
The home network includes:
a first sub-local area network comprising a first gateway device and one or more second gateway devices;
a first router; and
a second sub-local area network comprising at least a third gateway device, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first gateway device and closing a specific TCP port of the second gateway device;
establishing communication between the first and second gateway devices;
the first gateway equipment sends a first TCP handshake request to all gateway equipment included in the second sub-local area network;
if the first gateway device receives a first TCP handshake response from the third gateway device, establishing a first TCP connection with the third gateway device; and
the following operations performed by the first gateway device:
when a first message is required to be sent to any gateway device located in the second sub-local area network, sending the first message to the third gateway device; and
when a second message is received, determining a destination of the second message,
if the destination is the first gateway equipment, processing the second message;
if the destination is the second gateway equipment, sending the second message to the second gateway equipment; and
and if the destination is any gateway equipment located in the second sub-local area network, sending the second message to the third gateway equipment.
18. A method of interconnecting communication devices within a local area network, wherein
The local area network includes:
a first sub-local area network comprising a first communication device and one or more second communication devices;
a first router; and
a second sub-local area network including at least a third communication device determined to be a master communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first communication device is determined as a primary communication unit in the first sub-local area network and the second communication device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first communication device, closing a specific TCP port of the second communication device, and establishing communication between the first and second communication devices;
the first communication equipment monitors a TCP handshake request from the second sub-local area network, and the second communication equipment does not monitor the TCP handshake request from the second sub-local area network;
in response to receiving a first TCP handshake request from the third communication device, the first communication device sends a first TCP handshake response to the third communication device and establishes a first TCP connection with the third communication device; and
the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the second sub-local area network, sending the first message to the third communication device; and
when a second message is received, determining a destination of the second message,
if the destination is the first communication equipment, processing the second message;
if the destination is the second communication equipment, sending the second message to the second communication equipment; and
and if the destination is any communication equipment located in the second sub-local area network, sending the second message to the third communication equipment.
19. The method of claim 18, wherein the local area network is configured to communicate with an external entity, wherein the first sub-local area network does not communicate with the external entity via the second sub-local area network, and wherein the second sub-local area network communicates with the external entity via the first sub-local area network.
20. The method of claim 18, further comprising:
after the first TCP connection is established, the first communication device broadcasts information of the first TCP connection in the local area network, wherein the information of the TCP connection at least comprises IP addresses of both connection parties.
21. The method of claim 20, further comprising:
after establishing the first TCP connection, the first communication device periodically monitors the heartbeat of the third communication device, and if the heartbeat is not monitored within a preset time period, monitors a TCP handshake request from the third communication device,
if a second TCP handshake request from the third communication equipment is received within a preset time period, sending a second TCP handshake response to the third communication equipment, establishing a second TCP connection with the third communication equipment, and broadcasting and updating the information of the first TCP connection into the information of the second TCP connection in the local area network; and
broadcasting the first TCP connection loss within the local area network if a second TCP handshake request from the third communication device is not received within a predetermined time period.
22. The method of claim 21, wherein the local area network is configured to communicate with an external entity, the method further comprising:
the first communication device also reports the third communication device offline to the external entity if a second TCP handshake request from the third communication device is not received within a predetermined time period.
23. The method of claim 21, further comprising:
the second communication equipment receives and stores the TCP connection information broadcast by the first communication equipment; and
after receiving the broadcast of the TCP connection loss, the second communication device deletes the information of the TCP connection that has been stored.
24. The method of claim 18, wherein the local area network further comprises a third sub-local area network and a second router, wherein the third sub-local area network is configured to communicate with the first sub-local area network via the first and second routers and communicate with the second sub-local area network via the second router but not via the first router, wherein the method further comprises the following operations performed by the first communication device:
when a first message is required to be sent to any communication device located in the third sub-local area network, sending the first message to the third communication device; and
and after receiving a second message, judging the destination of the second message, and if the destination is any communication equipment located in the third sub-local area network, sending the second message to the third communication equipment.
25. The method of claim 18, further comprising the following operations performed by the second communications device:
when a first message is required to be sent to any other communication equipment, the first message is sent to the first communication equipment; and
when a second message is received, determining a destination of the second message,
if the destination is the second communication equipment, processing the second message; and
and if the destination is not the second communication equipment, sending the second message to the first communication equipment.
26. The method of claim 18, wherein the predetermined rule comprises:
determining the communication device with the minimum MAC address in the first sub-local area network as the primary communication unit, and determining other communication devices as the secondary communication unit; or
The primary communication unit and the secondary communication unit are determined according to designation of an external entity connected to the local area network.
27. The method of claim 18, further comprising:
the first communication equipment sends a UDP multicast message in the first sub-local area network;
the second communication equipment monitors a UDP multicast channel in the first sub-local area network, and if the UDP multicast message is received, the second communication equipment sends a UDP unicast message to the first communication equipment; and
and after receiving the UDP unicast message from the second communication device, the first communication device establishes UDP communication with the second communication device, thereby establishing communication between the first communication device and the second communication device.
28. The method of claim 27, further comprising the following operations performed by the first communications device:
and after the UDP communication is established, storing and broadcasting information of the UDP communication in the local area network, wherein the information at least comprises IP addresses of both communication parties.
29. The method of claim 27, further comprising the following operations performed by the first communications device:
after the UDP communication is established, periodically monitoring the heartbeat of the second communication equipment, and if the heartbeat is not monitored in a preset time period, sending a UDP multicast message in the first sub-local area network again; and
after receiving the UDP unicast message from the second communication device, reestablishing the UDP communication with the second communication device.
30. The method of claim 29, further comprising the following operations performed by the first communications device:
after reestablishing the UDP communication, updating the stored information of the UDP communication and broadcasting the reestablished information of the UDP communication in the local area network.
31. The method of claim 29, further comprising the following operations performed by the first communications device:
after the UDP multicast packet is sent again, if a UDP unicast packet from the second communication device is not received, deleting the stored information of the UDP communication and broadcasting the UDP communication loss in the local area network.
32. The method of claim 29, wherein the local area network is configured to communicate with an external entity, the method further comprising the following by the first communication device:
after sending the UDP multicast message again, if the UDP unicast message from the second communication equipment is not received, reporting the offline of the second communication equipment to the external entity.
33. Method for interconnection between gateway devices in home network, wherein the gateway devices can be connected with home devices, wherein
The home network includes:
a first sub-local area network comprising a first gateway device and one or more second gateway devices;
a first router; and
a second sub-local area network comprising at least a third gateway device determined to be a master communication unit within the second sub-local area network, wherein the first and second sub-local area networks are configured to communicate with each other via the first router,
the method comprises the following steps: if the first gateway device is determined as a primary communication unit in the first sub-local area network and the second gateway device is determined as a secondary communication unit according to a predetermined rule, then:
opening a specific TCP port of the first gateway device, closing a specific TCP port of the second gateway device, and establishing communication between the first and second gateway devices;
the first gateway device monitors a TCP handshake request from the second sub-local area network, and the second gateway device does not monitor the TCP handshake request from the second sub-local area network;
in response to receiving a first TCP handshake request from the third gateway device, the first gateway device sends a first TCP handshake response to the third gateway device and establishes a first TCP connection with the third gateway device; and
the following operations performed by the first gateway device:
when a first message is required to be sent to any gateway device located in the second sub-local area network, sending the first message to the third gateway device; and
when a second message is received, determining a destination of the second message,
if the destination is the first gateway equipment, processing the second message;
if the destination is the second gateway equipment, sending the second message to the second gateway equipment; and
and if the destination is any gateway equipment located in the second sub-local area network, sending the second message to the third gateway equipment.
CN201910999578.5A 2019-10-21 2019-10-21 Method for interconnecting communication devices in local area network Active CN110635979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910999578.5A CN110635979B (en) 2019-10-21 2019-10-21 Method for interconnecting communication devices in local area network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910999578.5A CN110635979B (en) 2019-10-21 2019-10-21 Method for interconnecting communication devices in local area network

Publications (2)

Publication Number Publication Date
CN110635979A CN110635979A (en) 2019-12-31
CN110635979B true CN110635979B (en) 2022-02-01

Family

ID=68976895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910999578.5A Active CN110635979B (en) 2019-10-21 2019-10-21 Method for interconnecting communication devices in local area network

Country Status (1)

Country Link
CN (1) CN110635979B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189567B (en) * 2021-12-15 2024-08-02 广州河东科技有限公司 Intelligent access control system management method and device and electronic equipment
CN114531722B (en) * 2022-03-01 2024-05-03 杭州老板电器股份有限公司 Networking method and device for equipment in local network and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291283A (en) * 2011-08-03 2011-12-21 中山大学深圳研究院 Digital home network system
CN107231262A (en) * 2017-06-26 2017-10-03 华南理工大学 A kind of message route method cascaded based on MQTT multilayers
CN109842537A (en) * 2017-11-29 2019-06-04 上海企想信息技术有限公司 Smart home system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006310928A (en) * 2005-04-26 2006-11-09 Yokogawa Electric Corp Gateway system
CN101478485B (en) * 2009-01-19 2012-04-04 成都市华为赛门铁克科技有限公司 Method for local area network access control and network gateway equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291283A (en) * 2011-08-03 2011-12-21 中山大学深圳研究院 Digital home network system
CN107231262A (en) * 2017-06-26 2017-10-03 华南理工大学 A kind of message route method cascaded based on MQTT multilayers
CN109842537A (en) * 2017-11-29 2019-06-04 上海企想信息技术有限公司 Smart home system

Also Published As

Publication number Publication date
CN110635979A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
CN110730116B (en) Operation method of communication equipment in local area network, communication equipment and gateway equipment
US7739384B2 (en) System and method for load balancing
US9019956B2 (en) Self-forming VoIP network
KR100948673B1 (en) Data network having a wirless local area network with a packet hopping wireless backbone
JP4897884B2 (en) ZIGBEE / IP gateway
US7606227B2 (en) Method, apparatus and system for distributing multicast data
EP1379038B1 (en) Method for implementing router interface backup with virtual router redundancy protocol
CN108323246B (en) Networking method, chip and wireless network system
EP2206320B1 (en) Method and apparatus for peer to peer link establishment over a network
US20020097732A1 (en) Virtual private network protocol
CN110635979B (en) Method for interconnecting communication devices in local area network
CN103095749A (en) Method and system used for achieving discovery of cross-network-segment equipment
KR20120045515A (en) Method for supporting network-based mobility in virtual network environment that can be direct communication based on virtual ip
CN110601940B (en) Method for interconnecting communication devices in local area network
EP3632081B1 (en) Session layer communications using an id-oriented network
EP3754933A1 (en) Fault diagnosis method and apparatus therefor
CN117061431A (en) Heterogeneous network emergency communication system terminal fusion method, heterogeneous network emergency communication system terminal fusion device, terminal and medium
JP2005033250A (en) Relaying apparatus and port forward setting method
US7116775B2 (en) Apparatus and method for managing BLF information in an inter-networking system
JP3682439B2 (en) Data communication system and method, server device, client device, and program
JPWO2007114035A1 (en) Connection support server and communication device
CN114466008B (en) Cloud edge communication system, cloud edge communication method, cloud edge communication device, electronic equipment and storage medium
CN116708381B (en) Cross-network data transmission method and device, storage medium and electronic equipment
CN113630276B (en) Main-standby switching control method and device and DVPN network system
CN115883286B (en) IGMP message processing method, device, VTEP device and storage medium

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