WO2026001058A1 - 通信方法、装置、系统及存储介质 - Google Patents
通信方法、装置、系统及存储介质Info
- Publication number
- WO2026001058A1 WO2026001058A1 PCT/CN2025/080062 CN2025080062W WO2026001058A1 WO 2026001058 A1 WO2026001058 A1 WO 2026001058A1 CN 2025080062 W CN2025080062 W CN 2025080062W WO 2026001058 A1 WO2026001058 A1 WO 2026001058A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- protocol
- gateway
- message
- iot device
- data
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/021—Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W80/00—Wireless network protocols or protocol adaptations to wireless operation
- H04W80/02—Data link layer protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
Definitions
- This application relates to the field of communications, and in particular to a communication method, apparatus, system and storage medium.
- a home network is an indoor local area network that provides network communication services to a family.
- a home typically includes multiple Internet of Things (IoT) devices.
- IoT Internet of Things
- a home often includes smart home devices such as smart lights, smart speakers, air conditioners, and refrigerators.
- IoT devices in the home can communicate with the main gateway in the home network using Bluetooth or StarNet protocols.
- IoT devices can send service data to the main gateway based on Bluetooth or StarNet, and the main gateway can process this service data.
- the main gateway can send this service data to a user's mobile phone, allowing the user to control the IoT devices through the main gateway on their phone.
- Bluetooth or StarSignal protocols have limited connection distances, and signal quality drops significantly after being blocked by indoor walls, making it impossible for many indoor IoT devices to communicate with the main gateway, thus reducing the coverage of the indoor local area network.
- This application provides a communication method, apparatus, system, and storage medium to extend the coverage of indoor local area networks.
- the technical solution is as follows:
- this application provides a communication method applied to an indoor local area network (LAN) including a first slave gateway.
- the LAN also includes an Internet of Things (IoT) device and a master gateway.
- the communication protocol used between the first slave gateway and the IoT device is a first protocol
- the communication protocol used between the first slave gateway and the master gateway is a second protocol.
- the first protocol is either Bluetooth or StarSignal
- the second protocol is a protocol other than Bluetooth or StarSignal.
- first service data sent by the IoT device is received; the first service data is data defined by the first protocol.
- a first message is generated; the first message is a message defined by the second protocol, and the payload of the first message includes the first service data.
- the first message is then sent to the master gateway.
- the first protocol is the communication protocol between the first slave gateway and the IoT device
- the second protocol is the communication protocol between the first slave gateway and the master gateway.
- the first slave gateway After receiving the first service data sent by the IoT device, the first slave gateway generates a first message defined by the second protocol.
- the payload of the first message includes the first service data, allowing the first slave gateway to send the first message to the master gateway. This enables the first service data sent by the IoT device to traverse the first slave gateway and be transmitted to the master gateway, allowing the IoT device to communicate with the master gateway. This expands the coverage of the indoor LAN, including the Bluetooth or StarFlash access range between the first slave gateway and the IoT device.
- the master gateway receives a second message sent by the first slave gateway.
- This second message is defined by a second protocol, and its payload includes second service data that the master gateway needs to send.
- This second service data is data specific to the IoT device and is defined by a first protocol.
- the second message is parsed to obtain the second service data.
- This second service data is then processed.
- the master gateway can send the second service data defined by the first protocol to the first slave gateway. Since the second service data is data specific to the IoT device, the master gateway can control and manage the IoT device.
- the second protocol is Internet Protocol (IP) or User Datagram Protocol (UDP).
- IP Internet Protocol
- UDP User Datagram Protocol
- the destination port number of the first message is the port number of the target port on the master gateway.
- the target port is used to receive messages containing data defined by the first protocol. This ensures that the first slave gateway can send the first message to the target port of the master gateway, so that the master gateway can detect that the first message contains data defined by the first protocol through the target port, and then perform parsing and other processing on the first message.
- the second protocol is the Ethernet protocol
- the destination Media Access Control (MAC) address of the first message is the MAC address of the master gateway.
- information about the IoT devices is sent to the main gateway.
- This information includes one or more of the following: IoT device authentication information, IoT device connection parameters, or status information between the first slave gateway and the IoT device.
- the indoor LAN is either a home network or a business LAN.
- this application provides a communication method applied to a main gateway in an indoor local area network (LAN).
- the LAN also includes an Internet of Things (IoT) device and a first slave gateway.
- the communication protocol between the first slave gateway and the IoT device is a first protocol
- the communication protocol between the first slave gateway and the main gateway is a second protocol.
- the first protocol is either Bluetooth or StarSignal
- the second protocol is a protocol other than Bluetooth or StarSignal.
- a first message sent by the first slave gateway is received.
- the payload of the first message includes first service data received by the first slave gateway from the IoT device.
- the first service data is data defined by the first protocol
- the first message is a message defined by the second protocol.
- the first service data is obtained by parsing the first message.
- the first service data is then processed.
- the first protocol is the communication protocol between the first slave gateway and the IoT device
- the second protocol is the communication protocol between the first slave gateway and the master gateway. Since the first message is a message defined by the second protocol, the master gateway can receive the first message from the first slave gateway. This first message is generated by the first slave gateway after receiving the first service data sent by the IoT device. The payload of the first message includes the first service data, thus allowing the first service data sent by the IoT device to traverse the first slave gateway and be transmitted to the master gateway. This enables the IoT device to communicate with the master gateway, thereby expanding the coverage of the indoor LAN, including the Bluetooth or StarFlash access range between the first slave gateway and the IoT device.
- a second message is sent to the first slave gateway.
- This second message is defined by a second protocol, and its payload includes second service data that the master gateway needs to send.
- This second service data is data specific to the IoT device and is defined by the first protocol.
- the master gateway can send the second service data defined by the first protocol to the first slave gateway. Since this second service data is data specific to the IoT device, the master gateway can control and manage the IoT device.
- the second business data includes one or more of the following: response data generated by the main gateway after processing the first business data, or commands for IoT devices received by the main gateway from terminal devices or servers.
- the second protocol is Internet Protocol (IP) or User Datagram Protocol (UDP).
- IP Internet Protocol
- UDP User Datagram Protocol
- the destination port number of the first message is the port number of the target port on the master gateway.
- the target port is used to receive messages containing data defined by the first protocol.
- the first message sent by the first slave gateway is received through the target port.
- the first service data is obtained by parsing the first message. Because the master gateway receives the first message sent by the first slave gateway through the target port and only parses the first message when it is determined based on the target port that the first message includes data defined by the first protocol, it avoids wasting computing resources by parsing messages that do not include data defined by the first protocol.
- the second protocol is the Ethernet protocol
- the destination Media Access Control (MAC) address of the first message is the MAC address of the master gateway.
- the first service data is obtained by parsing the first message. Since the master gateway determines that the first message is destined for itself when it determines that the destination MAC address of the first message is the MAC address of the master gateway, it only parses the first message, avoiding the waste of computing resources by parsing messages that do not include data defined by the first protocol.
- the first business data is converted into target data defined by a third protocol.
- This third protocol is used by smart services to manage IoT devices.
- the target data is then sent to the target device, which includes the smart service and can be a terminal device or a server. Since the third protocol is used by the smart service, converting the first business data into target data ensures that the smart service can recognize and use the target data.
- the system receives information about IoT devices sent by a first slave gateway.
- This information includes one or more of the following: IoT device authentication information, IoT device connection parameters, or status information between the first slave gateway and the IoT device.
- the master gateway centrally manages the information of IoT devices in the indoor LAN, making it easier for other slave gateways to obtain IoT device information from the master gateway. Since the master gateway centrally maintains the information of IoT devices in the indoor LAN, slave gateways do not need to maintain the same information, avoiding the storage of duplicate data and saving valuable resources.
- the indoor LAN also includes a second slave gateway, which receives a query request sent by the second slave gateway when it discovers an IoT device.
- the query request requests information about the IoT device.
- a query response including the IoT device information, is sent to the second slave gateway, instructing it to perform one or more of the following operations based on the IoT device information: establish a connection with the IoT device, or configure the state between the second slave gateway and the IoT device.
- the second slave gateway configures the state between itself and the IoT device based on the IoT device information, continuing the state between the first slave gateway and the IoT device, ensuring state continuity.
- the indoor LAN is either a home network or a business LAN.
- this application provides a communication apparatus for performing the method in the first aspect or any possible implementation thereof.
- the apparatus includes units for performing the method in the first aspect or any possible implementation thereof.
- this application provides a communication apparatus for performing the method in the second aspect or any possible implementation thereof.
- the apparatus includes units for performing the method in the second aspect or any possible implementation thereof.
- this application provides a communication device, the communication device comprising: at least one processor, the at least one processor executing the method in the first aspect or any possible implementation of the first aspect.
- this application provides a communication device comprising: at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions to cause the communication device to perform the method of the second aspect or any possible implementation thereof.
- this application provides a communication system, the system comprising the communication device described in the third aspect and the communication device described in the fourth aspect, or the communication equipment described in the fifth aspect and the communication equipment described in the sixth aspect.
- this application provides a computer program product comprising a computer program stored in a computer-readable storage medium, wherein the computer program is loaded by a processor to implement the methods in the first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect described above.
- this application provides a computer-readable storage medium for storing a computer program, which is loaded by a processor to execute the methods described in the first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
- this application provides a chip including a memory and a processor.
- the memory is used to store computer instructions
- the processor is used to call and execute the computer instructions from the memory to perform the methods in the first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect described above.
- Figure 1 is a schematic diagram of an indoor local area network provided in an embodiment of this application.
- Figure 2 is a schematic diagram of a network architecture provided in an embodiment of this application.
- FIG. 3 is a flowchart of a communication method provided in an embodiment of this application.
- Figure 4 is a schematic diagram of a message structure provided in an embodiment of this application.
- FIG. 5 is a schematic diagram of another message structure provided in an embodiment of this application.
- FIG. 6 is a schematic diagram of another message structure provided in an embodiment of this application.
- FIG. 7 is a flowchart of another communication method provided in an embodiment of this application.
- Figure 8 is a schematic diagram of a communication device structure provided in an embodiment of this application.
- Figure 9 is a schematic diagram of another communication device structure provided in an embodiment of this application.
- Figure 10 is a schematic diagram of a communication device structure provided in an embodiment of this application.
- Figure 11 is a schematic diagram of another communication device structure provided in an embodiment of this application.
- Figure 12 is a schematic diagram of a communication system structure provided in an embodiment of this application.
- the first protocol is the communication protocol between the IoT device and the gateway, such as the Bluetooth protocol or the StarFlash protocol.
- the second protocol is the communication protocol between the secondary gateway and the primary gateway.
- the second protocol is the Internet Protocol (IP), the User Datagram Protocol (UDP), or the Ethernet protocol.
- IP Internet Protocol
- UDP User Datagram Protocol
- Ethernet protocol Ethernet protocol
- the target port is the port on the main gateway used to receive packets containing data defined by the first protocol.
- this application embodiment provides an indoor local area network 100, which includes a main gateway 101, at least one slave gateway 102, and at least one IoT device 103.
- the master gateway 101 can communicate with each of the at least one slave gateway 102.
- the slave gateway 102 can communicate with at least one first IoT device.
- the main gateway 101 can also communicate with at least one second IoT device.
- the aforementioned at least one IoT device 103 includes at least one first IoT device communicating with the slave gateway 102, and at least one second IoT device communicating with the master gateway 101.
- the communication protocol used between gateway 102 and at least one first IoT device is a first protocol, which can be Bluetooth or StarScan.
- the service data transmitted between gateway 102 and the first IoT device is the data defined by the first protocol.
- the first protocol is the Bluetooth protocol
- the data defined by the first protocol is Bluetooth data. Therefore, the service data transmitted between the gateway 102 and the first IoT device is Bluetooth data.
- the first protocol is the StarShine protocol
- the data defined by the first protocol is StarShine data. Therefore, the service data transmitted between gateway 102 and the first IoT device is StarShine data.
- the communication protocol used between the main gateway 101 and at least one second IoT device is also the first protocol.
- the service data transmitted between the main gateway 101 and the second IoT device is the data defined by the first protocol.
- the service data transmitted between the main gateway 101 and the second IoT device can be Bluetooth data or Star Flash data.
- the communication protocol used between the main gateway 101 and at least one slave gateway 102 is the second protocol, which is a protocol other than Bluetooth and StarScan.
- the messages transmitted between the main gateway 101 and the slave gateway 102 are messages defined by the second protocol.
- the second protocol can be IP, UDP, or Ethernet protocol, etc.
- the messages defined by the second protocol are IP messages. Therefore, the messages transmitted between the main gateway 101 and the secondary gateway 102 are IP messages.
- the messages defined by the second protocol are UDP messages. Therefore, the messages transmitted between the main gateway 101 and the slave gateway 102 are UDP messages.
- the second protocol is the Ethernet protocol
- the messages defined by the second protocol are Ethernet messages
- the messages transmitted between the main gateway 101 and the slave gateway 102 are Ethernet messages.
- the first protocol is a short-range communication protocol.
- the first protocol may also be a low-power short-range communication protocol. Therefore, for IoT devices 103 that are far away from the main gateway 101, the main gateway 101 may not be able to detect the IoT device 103, and thus the main gateway 101 cannot establish a connection with the IoT device 103 or communicate with it.
- the slave gateway 102 discovers the at least one first IoT device.
- the at least one first IoT device can establish a connection with the slave gateway 102 but cannot establish a connection with the master gateway 101. Therefore, the at least one first IoT device communicates with the slave gateway 102.
- the main gateway 101 since the at least one second IoT device may be close to the main gateway 101, the main gateway 101 discovers the at least one second IoT device, and the at least one second IoT device can establish a connection with the main gateway 101, so the at least one second IoT device communicates with the main gateway 101.
- the communication between the main gateway 101 and the slave gateway 102 uses a second protocol
- the communication between the slave gateway 102 and at least one first IoT device uses a first protocol
- enabling the service data of the IoT device 103 to traverse the slave gateway 102 allows more IoT devices 103 to communicate with the main gateway 101 and allows more IoT devices 103 to access the indoor LAN.
- the main gateway 101 and the slave gateway 102 can be connected by optical fiber.
- the main gateway 101 and the slave gateway 102 can be the master device and the slave device in a fiber to the room (FTTR) scenario, respectively.
- they can be connected by cables other than optical fiber, such as coaxial cables or twisted pairs.
- they can be connected by wireless local area networks (WLANs) or cellular communication networks. Therefore, the main gateway 101 and the slave gateway 102 are not limited by distance or obstructed by obstacles such as walls.
- WLANs wireless local area networks
- the indoor local area network 100 may be a home network or an enterprise local area network, etc.
- the gateway 102 may be a wireless access point (AP) or an edge optical network terminal (Edge ONT), etc.
- this application embodiment also provides a network architecture 200, in which the main gateway 101 in the indoor local area network 100 can communicate with the target device 104.
- the target device 104 includes intelligent services for managing at least one IoT device 103, and the target device 104 can manage and/or control at least one IoT device 103 by running the intelligent services.
- the smart business can be an application for managing and/or controlling at least one IoT device 103.
- the target device 104 can be located in an indoor local area network and connected to the main gateway 101.
- target device 104 is a terminal device, such as a mobile phone or computer.
- the terminal device is located within the coverage area of indoor LAN 100 and is connected to main gateway 101.
- the terminal device communicates with at least one IoT device 103 through main gateway 101, thereby managing and/or controlling at least one IoT device 103 by running smart services.
- the target device 104 may not be located in the indoor local area network.
- the target device 104 may be located in the Internet, and the target device 104 may be connected to the main gateway 101 in the indoor local area network 100 through the Internet.
- the target device 104 can be a terminal device or a server.
- the target device 104 can be a terminal device such as a mobile phone or a computer.
- the mobile phone can be connected to the main gateway 101 in the indoor local area network 100 through a cellular communication network. In this way, the mobile phone can remotely manage and/or control at least one IoT device 103 outside the coverage area of the indoor local area network 100.
- the target device 104 can be a server, which may be located in the cloud.
- the server can be connected to the main gateway 101 in the indoor LAN 100 via the Internet, so that the server can remotely manage and/or control at least one IoT device 103 outside the coverage area of the indoor LAN 100.
- this application embodiment provides a communication method 300, which can be applied to the indoor local area network 100 shown in Figure 1, or to the network architecture 200 shown in Figure 2.
- the communication method 300 includes the following process.
- Step 301 The first service data is received from the gateway by the first IoT device.
- the first service data is data defined by the first protocol.
- the first business data includes a first device identifier of the first IoT device.
- the first device identifier may include one or more of the following: the serial number of the first IoT device, the address of the first IoT device, or the device type of the first IoT device.
- the device type of the first IoT device is a smart light.
- the first protocol is the communication protocol used between the first slave gateway and the first IoT device.
- the first IoT device is a device near the first slave gateway, which can discover the first IoT device and establish a connection with it.
- the first IoT device may periodically or upon user triggering broadcast discovery messages to its surroundings.
- the first IoT device is located near the first slave gateway, which receives the discovery messages sent by the first IoT device, thereby discovering the first IoT device.
- the first slave gateway establishes a connection with the first IoT device, or the first slave gateway authenticates the first IoT device and establishes a connection with the first IoT device after successful authentication.
- the first service data received from the gateway may include a discovery message sent by the first IoT device.
- the discovery message includes a first device identifier of the first IoT device.
- both the first slave gateway and the first IoT device include pre-configured authentication information.
- the authentication operation between the first slave gateway and the first IoT device can be as follows: the first slave gateway sends an authentication request to the first IoT device based on the first device identifier of the first IoT device; the first IoT device receives the authentication request and sends authentication information to the first slave gateway; the first slave gateway receives the authentication information; if the received authentication information is the same as the authentication information included locally, then the authentication of the first IoT device is successful.
- the discovery message also includes at least one frequency band supported by the first IoT device.
- the operation of establishing a connection between the first slave gateway and the first IoT device can be as follows: the first slave gateway sends a connection establishment request to the first IoT device based on the first device identifier of the first IoT device.
- the connection establishment request includes the connection parameters of the first IoT device, which include a communication frequency band and/or an encryption/decryption key.
- the communication frequency band is selected by the first slave gateway from at least one frequency band.
- the first IoT device can send data to the first slave gateway based on the communication frequency band, and similarly, the first slave gateway can also send data to the first IoT device based on the communication frequency band, thus completing the establishment of a connection between the first slave gateway and the first IoT device.
- the data sent by the first IoT device is encrypted using an encryption key, and the first slave gateway can decrypt it using a decryption key after receiving the data.
- the data sent by the first slave gateway is encrypted using an encryption key, and the first IoT device can decrypt it using a decryption key after receiving the data.
- the first slave gateway includes a protocol stack of the first protocol.
- the first slave gateway inputs the connection parameters and/or the received authentication information into the protocol stack and sends and receives data with the first IoT device based on the protocol stack.
- the first slave gateway may also send connection authentication information of the first IoT device to the master gateway.
- the connection authentication information includes the connection parameters of the first IoT device and/or the authentication information of the first IoT device.
- the authentication information of the first IoT device may include one or more of the following: the certificate of the first IoT device, or the personal identification number (PIN) code of the first IoT device.
- the operation of the first slave gateway sending the connection authentication information of the first IoT device to the main gateway can be as follows:
- the first information is sent from the gateway to the main gateway.
- the first information includes the connection authentication information of the first IoT device and the first device identifier of the first IoT device.
- the first IoT device after a connection is established between the first slave gateway and the first IoT device, the first IoT device sends service data to the first slave gateway through the connection when performing a service.
- the first service data may include the service data sent by the first IoT device when performing a service.
- the first IoT device is a smart light, which can periodically or upon user triggering broadcast discovery messages.
- the first slave gateway receives the discovery message, authenticates with the smart light, and establishes a connection. At this time, the first slave gateway receives the first service data sent by the smart light, including the discovery message.
- the smart light may send one or more of the following service data to the first slave gateway: a confirmation request to confirm the current color and/or brightness of the smart light, or a reservation request to schedule the smart light's on and/or off timestamps.
- the first slave gateway receives the first service data sent by the smart light, including the aforementioned one or more service data.
- the confirmation request includes the current color and/or brightness of the smart light
- the reservation request includes the smart light's scheduled on and/or off timestamps.
- the first service data may be a message, that is, the first service data is data in a message structure.
- the first protocol is the Bluetooth protocol
- the first service data is Bluetooth data
- the structure of the first service data is a Bluetooth format message structure
- the first service data includes one or more of the following parts: preamble, access code/access address, protocol data unit (PDU) header, data, or checksum, etc.
- PDU protocol data unit
- the first slave gateway after a connection is established between the first slave gateway and the first IoT device, the first slave gateway also obtains the status information between the first slave gateway and the first IoT device and sends the status information to the master gateway.
- the status information includes one or more of the following: the connection status of the first IoT device, or the service operation status between the first IoT device and the first slave gateway.
- the connection status of the first IoT device may include an online or offline status
- the service operation status between the first IoT device and the first slave gateway may include the progress of the first IoT device sending service data and/or the progress of the first slave gateway receiving service data.
- the first operation of sending the status information from the secondary gateway to the primary gateway can be:
- the first gateway sends a second reporting information to the main gateway.
- the second reporting information includes the status information and the first device identifier of the first IoT device.
- Step 302 First, a first message is generated from the gateway.
- the first message is a message defined by the second protocol.
- the payload of the first message includes the first service data.
- the second protocol is the communication protocol used between the first slave gateway and the master gateway.
- the second protocol can be IP, UDP, or Ethernet protocol, etc.
- the first slave gateway can obtain a first message by encapsulating the first service data based on the second protocol.
- a message header is added to the payload portion including the first service data to obtain the first message.
- the header of the first message includes the device identifier of the first slave gateway.
- the header of the first message may also include content such as source address, source port number, destination address, and destination port number.
- the destination port number of the first message is the port number of the target port on the main gateway.
- the target port on the main gateway is used to receive messages that include data defined by the first protocol.
- the main gateway can use port 5050 as the target port for receiving messages that include data defined by the first protocol.
- the source port number of the first message is the port number of a port on the first slave gateway.
- the master gateway may broadcast notification information to each slave gateway included in the indoor local area network.
- the notification information includes the port number of the target port, and is used to notify each slave gateway that the target port is the port used by the master gateway to receive packets containing data defined by a first protocol.
- each slave gateway may record the port number of the target port so that it can be used as the destination port number of the encapsulated packet when encapsulating the service data of the IoT device.
- the port number of the target port is configured in each slave gateway at the factory. In this way, when encapsulating the service data of the IoT device, each slave gateway uses the port number of the target port configured at the factory as the destination port number of the encapsulated message.
- the payload portion of the first message further includes a header.
- the header may include one or more of the following: magic word, data version, data type, data size, or, cyclic redundancy check (CRC) code, etc.
- the magic word is used to identify that the first service data included in the payload portion of the first message is data defined by the first protocol.
- the data version is the version of the first service data included in the payload portion of the first message.
- the data type is the type of the first business data included in the payload portion of the first message.
- the data size is the size of the first business data included in the payload portion of the first message.
- the CRC code is used to verify the first service data included in the payload of the first message.
- the second protocol is IP
- the header of the first message includes a Transmission Control Protocol (TCP) header and an IP header.
- TCP Transmission Control Protocol
- IP header is added to the TCP message to obtain the first message.
- the first message is an IP message.
- the first slave gateway includes a network layer.
- the first slave gateway encapsulates the first service data based on IP to obtain the first packet. That is, within the network layer, the first slave gateway adds a TCP header to the payload containing the first service data to obtain a TCP packet. Then, an IP header is added to the TCP packet to obtain the first packet.
- the TCP header in the first message includes the device identifier of the first slave gateway.
- the IP header in the first message includes the source address, source port number, destination address, and destination port number.
- the destination port number is the port number of the target port on the master gateway.
- the second protocol is UDP
- the header of the first message includes a UDP header.
- a UDP header is added to the payload containing the first service data to obtain the first message.
- the first message is a UDP message.
- the first slave gateway includes a network layer.
- the first slave gateway encapsulates the first service data using UDP to obtain the first message. That is, the first slave gateway adds a UDP header to the payload containing the first service data at the network layer to obtain the first message.
- the first slave gateway carries a transport layer on top of its network layer. At the transport layer above the network layer, the first slave gateway adds a UDP header to the payload containing the first service data to obtain the first message.
- the UDP header in the first message includes the device identifier of the first slave gateway, source address, source port number, destination address, destination port number, etc.
- the first slave gateway when the second protocol is IP or UDP, the first slave gateway includes a first proxy module and the master gateway includes a second proxy module.
- the first proxy module can be a proxy process, proxy thread, or virtual instance running on the first slave gateway
- the second proxy module can be a proxy process, proxy thread, or virtual instance running on the master gateway.
- the virtual instance can be a container or a virtual machine.
- the first proxy module runs at the network layer of the first slave gateway
- the second proxy module runs at the proxy layer of the master gateway.
- the first proxy module of the first slave gateway receives the first service data sent by the first IoT device, encapsulates the first service data, and obtains the first message.
- the first proxy module of the first slave gateway adds a message header to the payload portion including the first service data to obtain the first message.
- the destination media access control (MAC) address of the first message is the MAC address of the main gateway.
- the header of the first message may also include the device identifier of the first slave gateway, the source MAC address, the source port number, the destination MAC address, the destination port number, and the type.
- the type is used to identify that the first message is a message that includes data defined by the first protocol.
- the destination port can be any port number on the master gateway. That is, in this case, the master gateway does not need a separate destination port for receiving messages that include data defined by the first protocol.
- the payload portion of the first message may also include a header, which may include one or more of the following information: magic word, data version, data type, data size, or CRC code, etc.
- the header of the first message is an Ethernet header.
- an Ethernet header is added to the payload containing the first service data to obtain the first message.
- the first message is an Ethernet message.
- the first slave gateway includes a data link layer, which includes a driver for a first protocol.
- the first slave gateway based on the Ethernet protocol, encapsulates the first service data to obtain the first message.
- the first slave gateway within the driver included in the data link layer, adds an Ethernet header to the payload portion containing the first service data to obtain the first message.
- Step 303 The first message is sent from the first gateway to the first gateway.
- the destination port number of the first message is the port number of the target port, so the first slave gateway sends the first message to the target port on the master gateway.
- the first proxy module of the first slave gateway sends a first message to the target port on the master gateway.
- the second protocol is IP
- the first slave gateway sends the first message to the target port on the master gateway through the TCP connection.
- the first slave gateway also periodically sends connection information to the target port on the master gateway in order to maintain the connection relationship between the first slave gateway and the target port on the master gateway through the connection information.
- Step 304 The main gateway receives the first message and obtains the first service data in the first message by parsing the first message.
- the main gateway When the second protocol is IP or UDP, the main gateway includes the target port. The main gateway listens to the target port in real time. When it detects that the first message is being sent to the target port, it receives the first message through the target port.
- the main gateway receives the first packet through the target port. Based on the target port, it can be determined that the first packet contains data defined by the first protocol, and the first service data can be obtained by parsing the first packet.
- the main gateway includes a network layer, in which the main gateway parses the first packet to obtain the first service data.
- the main gateway includes a second proxy module.
- the second proxy module listens to the target port in real time. When it detects a first message being sent to the target port, it receives the first message through the target port. Based on the target port, it can be determined that the first message includes data defined by the first protocol. The first message is then parsed to obtain the first service data.
- the first slave gateway may send a message that does not include data defined by the first protocol to a target port on the master gateway due to anomalies or other reasons.
- the master gateway determines that the message includes data defined by the first protocol based on the target port. However, the message does not actually include the data defined by the first protocol, so the determination result is incorrect.
- the master gateway cannot parse the data defined by the first protocol from the message, thus wasting the master gateway's computing resources.
- the payload header of the first message includes a magic word.
- the main gateway determines, based on the destination port, that the payload of the first message includes data defined by the first protocol, it reads the magic word from the payload. Based on the magic word, it determines whether the payload of the first message includes the data defined by the first protocol. If it is determined that the payload includes the data defined by the first protocol, the main gateway parses the payload to obtain the first service data. If it is determined that the payload does not include the data defined by the first protocol, the main gateway can either discard the first message, forward the first message, or perform other processing on the first message.
- the main gateway receives the first message, reads the destination MAC address from the message header, and determines whether the destination MAC address is the main gateway's MAC address. If the destination MAC address is the main gateway's MAC address, the first message is parsed to obtain the first service data. If the destination MAC address is not the main gateway's MAC address, the first message is discarded.
- the main gateway's MAC address indicates that the packet was intended for the main gateway. However, this packet may or may not include data defined by the first protocol.
- the main gateway receives a packet that does not include data defined by the first protocol and whose destination MAC address is the main gateway's MAC address, it will be unable to parse the data defined by the first protocol if it attempts to parse the packet, thus wasting the main gateway's computing resources.
- the header of the first message also includes a type. This type identifies whether the first message includes data defined by the first protocol. When the main gateway determines that the destination MAC address of the first message is the main gateway's MAC address, it reads this type from the header of the first message. Based on this type, it determines whether the first message includes data defined by the first protocol. If it is determined that the first message includes data defined by the first protocol, it parses the first message to obtain the first service data. If it is determined that the first message does not include data defined by the first protocol, it can either discard the first message, forward the first message, or perform other processing on the first message.
- the main gateway includes a data link layer, which includes a driver for the first protocol.
- the main gateway parses the first packet to obtain the first service data.
- the driver parses the header information of the payload portion of the first packet to obtain the magic word of the first packet. If, based on the magic word, it is determined that the payload portion of the first packet includes data defined by the first protocol, the payload portion of the first packet is further parsed to obtain the first service data.
- the header of the payload portion of the first message further includes information such as data version, data type, data size, and/or CRC code.
- the main gateway when parsing the payload portion of the first message, first parses to obtain the data version, data type, data size, and/or CRC code. Based on the data version, data type, data size, and/or CRC code, it continues to parse the payload portion of the first message to obtain the first service data. For example, the main gateway can extract the first service data from the payload portion of the first message based on the data size, and verify the extracted first service data based on the CRC code.
- the header of the first message also includes the device identifier of the first slave gateway.
- the master gateway parses the first message, it can also obtain the device identifier of the first slave gateway.
- the main gateway may also receive connection authentication information of the first IoT device sent by the first slave gateway, and the main gateway will also store the first device identifier of the first IoT device and the connection authentication information in the correspondence between the first device identifier and the connection authentication information.
- the main gateway receives first reporting information sent by the first slave gateway.
- the first reporting information includes the first device identifier and connection authentication information of the first IoT device.
- the first device identifier and connection authentication information of the first IoT device included in the first reporting information are stored in the correspondence between the first device identifier and the connection authentication information.
- the main gateway may also send the first reporting information to the slave gateways included in the indoor LAN, excluding the first slave gateway.
- the slave gateways included in the indoor LAN, excluding the first slave gateway include a second slave gateway.
- the second slave gateway receives the first reporting information and stores the first device identifier and connection authentication information of the first IoT device included in the first reporting information in the correspondence between the first device identifier and the connection authentication information.
- the master gateway may also receive status information between the first slave gateway and the first IoT device sent by the first slave gateway.
- the master gateway also stores the first device identifier of the first IoT device and the status information in the correspondence between the first device identifier and the status information.
- the main gateway receives second reporting information sent by the first slave gateway.
- the second reporting information includes the first device identifier of the first IoT device and the status information.
- the first device identifier of the first IoT device and the status information included in the second reporting information are stored in the correspondence between the first device identifier and the status information.
- the main gateway can also send second reporting information to the slave gateways included in the indoor LAN, excluding the first slave gateway.
- the slave gateways included in the indoor LAN, excluding the first slave gateway include the second slave gateway.
- the second slave gateway receives the second reporting information and stores the first device identifier of the first IoT device and the corresponding status information in the mapping relationship between the first device identifier and the status information.
- the main gateway does not forward the first and second reporting information to the slave gateways in the indoor LAN, the main gateway centrally stores the mapping between the first device identifier and connection authentication information, as well as the mapping between the first device identifier and status information. Each slave gateway in the indoor LAN does not need to store these two mappings, thus avoiding duplicate data storage and saving valuable resources.
- Step 305 The main gateway processes the first service data.
- the first service data may be a discovery message.
- the main gateway can process the first service data as follows:
- the main gateway obtains the first device identifier of the first IoT device from the discovery message. Based on the first device identifier and the device identifier of the first slave gateway, it obtains the second device identifier of the first IoT device.
- the second device identifier includes information such as the location and device type of the first IoT device.
- the device identifier of the first slave gateway, the first device identifier of the first IoT device, and the second device identifier are stored in the correspondence between the device identifier of the slave gateway and the first device identifier and the second device identifier of the IoT device.
- the second device identifier can be an alias for the first IoT device that is easy for users to understand.
- the first IoT device is a smart light located in the master bedroom
- the second device identifier of the first IoT device can be "master bedroom smart light”.
- the operation of the main gateway to obtain the second device identifier of the first IoT device can be as follows:
- the main gateway determines the location of the first IoT device based on the device identifier of the first slave gateway, and determines the device type of the first IoT device based on the first device identifier of the first IoT device, thereby obtaining the second device identifier of the first IoT device.
- the main gateway can determine the location of the first slave gateway based on the device identifier of the first slave gateway, and use that location as the location of the first IoT device.
- the first slave gateway is located in the master bedroom, and the first IoT device is a smart light bulb located in the master bedroom. Therefore, the first slave gateway can discover the first IoT device and establish a connection with it.
- the master gateway can determine the location of the first slave gateway as the master bedroom based on its device identifier, thus concluding that the first IoT device is located in the master bedroom.
- the first device identifier of the first IoT device includes the device type of the first IoT device, and the main gateway can read the device type of the first IoT device from the first device identifier.
- the first device identifier of the first IoT device includes the serial number and/or the address of the first IoT device, and the main gateway can query the device type of the first IoT device from the network based on the serial number and/or the address of the first IoT device.
- the second device identifier of the first IoT device is the smart light for the main bedroom.
- the main gateway may also send a notification message to the target device, the notification message including a second device identifier of the first IoT device.
- the target device receives the notification message and displays it to indicate that a first IoT device has connected to the indoor local area network.
- the target device is a mobile phone running a smart service for managing IoT devices.
- the phone can receive a notification message from the main gateway stating "A smart light in the master bedroom has been connected to the home network," and display the message to alert the user.
- the first service data is service data sent by the first IoT device when performing a service.
- the first service data may be a confirmation request or a reservation request
- the operation of the main gateway in processing the first service data may be: the main gateway may confirm the confirmation request or the reservation request.
- the main gateway may also generate response data, which may be an agreement command obtained by confirming the confirmation request or the reservation request.
- the first service data is a confirmation request for the current color and/or brightness of the smart light's illumination.
- the main gateway can agree that the smart light should emit light at that color and/or brightness, so confirming the confirmation request yields an agreement command.
- the first service data is a pre-set request for the smart light's on and/or off timestamps.
- the main gateway can agree that the smart light should turn on at the pre-set on timestamp and/or turn off at the pre-set off timestamp, so confirming the pre-set request yields an agreement command.
- the main gateway may need to send first service data to the target device.
- the main gateway's processing of the first service data can be as follows:
- the main gateway converts the first service data into target data defined by the third protocol, which is the protocol used by intelligent services, and sends the target data to the target device.
- the first service data may be data in binary format.
- the first service data may be Bluetooth data or satellite flash data, which is binary data that is not easy for users to understand and program.
- the target data defined by the third protocol may be data in Extensible Markup Language (XML) format or JavaScript Object Notation (JSON) format, which is data that is easy for users to understand and program.
- XML Extensible Markup Language
- JSON JavaScript Object Notation
- the target device After receiving the target data, the target device can process the target data.
- the first business data is a confirmation request to confirm the current color and/or brightness of the smart light.
- the main gateway converts the confirmation request into an XML or JSON format confirmation request (as the target data) and sends the XML or JSON format confirmation request to the target device.
- the target device receives the confirmation request in XML or JSON format, and then performs the following processing operations:
- the target device displays a confirmation request in XML or JSON format to the user.
- the user can agree to the smart light emitting light in that color and/or brightness, triggering a confirmation request to the target device, thus granting the device consent.
- the user can disagree with the smart light emitting light in that color and/or brightness, triggering a change command to the target device, which includes the user-selected color and/or brightness.
- the first business data is a reservation request for reserving the turn-on timestamp and/or turn-off timestamp of a smart light.
- the main gateway converts the reservation request into a reservation request in XML or JSON format (as the target data) and sends the XML or JSON reservation request to the target device.
- the target device receives a pre-defined request in XML or JSON format, and then performs the following processing operations:
- the target device displays a reservation request in XML or JSON format to the user.
- the user can agree to have the smart light turn on at a predetermined on time and/or turn off at a predetermined off time, triggering a confirmation of the reservation request to the target device, thus granting the target device an agreement command.
- the user can disagree with the smart light turning on at a predetermined on time and/or turning off at a predetermined off time, triggering a change command to the target device, which includes the user's changed on and/or off timestamps.
- the first slave gateway when the first slave gateway receives the first service data, it can also convert the first service data into target data defined by a third protocol and send the target data to the master gateway. After receiving the target data, the master gateway can process the target data. For example, the master gateway can send the target data to the target device.
- the main gateway may perform different operations on the first business data for different types of IoT devices. These operations are not limited to the examples listed above; there may be other processing operations as well, which will not be listed here.
- the main gateway may need to send second service data, which is data specific to the first IoT device and is defined by the first protocol.
- the second service data can be sent according to the following procedure.
- Step 306 The main gateway obtains the second service data and generates a second message.
- the second message is a message defined by the second protocol, and the payload of the second message includes the second service data.
- the second service data includes a first device identifier of the first IoT device and response data generated by the main gateway after processing the first service data.
- the response data includes the aforementioned consent command.
- the response data generated by the main gateway is data defined by the first protocol.
- the first business data includes the first device identifier of the first IoT device, and the second business data includes the first device identifier, which may be obtained by the main gateway from the first business data.
- the second business data includes a first device identifier of the first IoT device and commands received by the main gateway from the target device for the first IoT device.
- the command could be an agreement command or a change command sent to the target device.
- the target device may need to query the status of the first IoT device, and this command can be a query command.
- the command sent by the target device to the first IoT device may be data defined by a third protocol.
- the main gateway converts the command into a command defined by a first protocol.
- the commands included in the second business data are commands defined by the first protocol.
- the command sent by the target device to the main gateway includes a second device identifier of the first IoT device.
- the second service data includes the first device identifier, which the main gateway can obtain by performing the following steps:
- the main gateway reads the second device identifier of the first IoT device from the command, and based on the second device identifier, queries the first device identifier of the first IoT device from the correspondence between the device identifier of the slave gateway, the first device identifier and the second device identifier of the IoT device.
- the main gateway may also obtain the second service data in other ways, which will not be listed here.
- the primary gateway has more resources than the first slave gateway, which has fewer resources, it may be unable to process the service data from IoT devices. Since the primary gateway can centrally process the service data from all IoT devices in the indoor LAN, the first slave gateway, upon receiving the first service data, directly encapsulates the first service data at the network layer or data link layer to obtain the first message, and forwards the first message to the primary network. The primary gateway then processes the first service data, ensuring successful control and/or management of the IoT devices in the indoor LAN.
- step 302 For a detailed explanation of how the primary gateway generates the second message, please refer to step 302 for the detailed explanation of how the primary gateway generates the first message; it will not be explained in detail here.
- Step 307 The master gateway sends the second message to the first slave gateway.
- the master gateway can obtain the device identifier of the first slave gateway and send a second message to the first slave gateway based on the device identifier of the first slave gateway.
- the main gateway can query the device identifier of the first slave gateway from the correspondence between the device identifier of the slave gateway and the first and second device identifiers of the IoT device, based on the first device identifier of the first IoT device. Based on the device identifier of the first slave gateway, the main gateway sends a second message to the first slave gateway.
- the master gateway when the second protocol is a protocol such as IP or UDP, the master gateway sends a second message to the first slave gateway through the target port.
- the source port number of the second message is the port number of the target port
- the destination port number of the second message is the source port number of the first message. That is, the destination port number of the second message is the port number of a port on the first slave gateway.
- the second protocol is IP
- the master gateway sends the second message to the first slave gateway through the target port based on the TCP connection.
- the first slave gateway periodically sends connection information to the target port on the master gateway, maintaining the connection relationship between the first slave gateway and the target port on the master gateway through this connection information.
- the master gateway can then send a second message to the first slave gateway through the target port based on the received connection information.
- Step 308 First, receive the second message from the gateway, parse the second message to obtain the second service data, and process the second service data.
- step 304 for the detailed process of parsing the first message from the main gateway. It will not be explained in detail here.
- the second service data includes the aforementioned consent command
- the first slave gateway can confirm the consent command to process the second service data.
- a consent command can be sent to the first IoT device to allow the first IoT device to confirm the consent command, thereby enabling the processing of the second service data.
- the second service data includes the aforementioned change command
- the first device sends the change command from the gateway to the first IoT device to process the second service data.
- the first IoT device receives and executes a change command.
- the first IoT device is a smart light, which receives a change command.
- the change command includes a user-defined color and/or brightness, and the smart light emits light based on the user-defined color and/or brightness.
- the change command includes a user-defined on/off timestamp, and the smart light turns on at the user-defined on/off timestamp and turns off at the user-defined off timestamp.
- the first IoT device may also send a change response to the first slave gateway, the change response being the service data defined by the first protocol.
- the change response can be used as the first service data to return to the execution starting from step 301 above.
- the second business data includes the query command mentioned above.
- the first gateway sends the query command to the first IoT device to process the second business data.
- the first IoT device receives and executes a query command.
- the first IoT device is a smart light.
- the smart light receives the query command to check the status of the first IoT device. Based on the query command, the smart light obtains its own status and sends a query response to the first slave gateway.
- the query response includes the status of the smart light.
- the query response can be used as the first business data, and execution can be resumed starting from step 301 above.
- the first IoT device may be a mobile device.
- the first IoT device moves from the vicinity of the first slave gateway to the vicinity of the second slave gateway and can be discovered by the second slave gateway. Then, the second slave gateway and the master gateway further perform the following process.
- the second slave gateway can send a query request to the master gateway.
- the query request includes the first device identifier of the first IoT device.
- the query request is used to request information of the first IoT device.
- the main gateway receives a query request sent by the second slave gateway, obtains the information of the first IoT device based on the first device identifier included in the query request, and sends a query response to the second slave gateway, the query response including the information of the first IoT device.
- the information of the first IoT device includes one or more of the following: connection authentication information of the first IoT device or status information between the first slave gateway and the first IoT device.
- the operation of the main gateway to obtain information from the first IoT device may include:
- the main gateway obtains the connection authentication information of the first IoT device from the mapping between the first device identifier and connection authentication information, based on the first device identifier of the first IoT device. And/or,
- the main gateway obtains the status information between the first slave gateway and the first IoT device from the correspondence between the first device identifier and status information based on the first device identifier of the first IoT device.
- the second slave gateway receives the query response and performs one or more of the following operations based on the information of the first IoT device: establishes a connection with the first IoT device, or configures the state between the second slave gateway and the first IoT device.
- the second slave gateway if the second slave gateway stores the correspondence between the first device identifier and the connection authentication information, the second slave gateway obtains the authentication information of the first IoT device from the correspondence between the first device identifier and the connection authentication information based on the first device identifier of the first IoT device.
- the second slave gateway If the second slave gateway stores the correspondence between the first device identifier and the status information, then the second slave gateway obtains the status information between the first slave gateway and the first IoT device from the correspondence between the first device identifier and the status information based on the first device identifier of the first IoT device.
- the information of the first IoT device includes connection authentication information of the first IoT device
- the second slave gateway includes a protocol stack of the first protocol.
- the second slave gateway inputs the authentication information of the first IoT device into the protocol stack of the first protocol, and establishes a connection with the first IoT device through the protocol stack of the first protocol.
- the second slave gateway does not need to authenticate with the first IoT device, and thus the second slave gateway does not need to request the target device to pair the second slave gateway and the first IoT device, saving the user pairing operation and improving the efficiency of connection establishment.
- connection authentication information includes the connection parameters of the first IoT device.
- the operation of establishing a connection between the second slave gateway and the first IoT device can be as follows: the second slave gateway sends a connection establishment request to the first IoT device based on the first device identifier of the first IoT device.
- the connection establishment request includes the connection parameters of the first IoT device.
- the first IoT device sends and receives data with the second slave gateway based on the connection parameters, thus completing the establishment of the connection between the second slave gateway and the first IoT device.
- the second slave gateway sends and receives data with the first IoT device based on the protocol stack.
- the second slave gateway configures the first IoT device based on this connection status.
- the connection status of the first IoT device may include online or offline status, and the second slave gateway can configure the first IoT device to be online or offline.
- the second slave gateway configures the first IoT device's service execution progress based on the service operation status.
- the service operation status may include the progress of the first IoT device sending service data and/or the progress of the first slave gateway receiving service data.
- the second slave gateway configures the first IoT device to continue sending service data from the progress of sending service data; or, the second slave gateway configures the first IoT device to continue sending service data from the progress of receiving service data from the first slave gateway.
- the main gateway can communicate directly with the second IoT device based on the first protocol. That is, the main gateway can receive business data sent by the second IoT device based on the first protocol, and/or send business data to the second IoT device based on the first protocol.
- the first IoT device can connect to a first slave gateway located nearby. It can connect to the first slave gateway based on a first protocol and send first service data defined by the first protocol to the slave gateway.
- the first slave gateway communicates with the main gateway based on a second protocol.
- the first slave gateway receives the first service data, encapsulates it into a first message defined by the second protocol, with the payload of the first message including the first service data, and sends the first message to the main gateway.
- This enables the first service data to traverse the first slave gateway and be transmitted to the main gateway.
- the main gateway then parses the first message to obtain the first service data and processes it. This expands the coverage and access capabilities of the indoor local area network. Because the first IoT device can connect to the first slave gateway located nearby, it can use a low-power, short-range communication first protocol to communicate with the first slave gateway, thereby reducing the power consumption of the first IoT device.
- this application embodiment provides a communication device 800.
- the device 800 can be deployed on a slave gateway in the indoor local area network 100 shown in Figure 1, or on a slave gateway in the network architecture 200 shown in Figure 2, or on a first slave gateway in the method 300 shown in Figure 3.
- the device 800 is located in the indoor local area network, which also includes Internet of Things (IoT) devices and a main gateway.
- the communication protocol used between the device 800 and the IoT devices is a first protocol
- the communication protocol used between the device 800 and the main gateway is a second protocol.
- the first protocol is Bluetooth or StarSignal
- the second protocol is a protocol other than Bluetooth or StarSignal.
- the device 800 includes:
- the communication unit 801 is used to receive first service data sent by the IoT device, wherein the first service data is data defined by the first protocol.
- Processing unit 802 is used to generate a first message, which is a message defined by a second protocol, and the payload of the first message includes first service data.
- the communication unit 801 is also used to send the first message to the main gateway.
- the detailed implementation process of the processing unit 802 generating the first message can be found in step 302 of method 300 shown in Figure 3, and will not be described in detail here.
- step 303 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 801 sending the first message to the main gateway is described in step 303 of method 300 shown in Figure 3, and will not be described in detail here.
- the communication unit 801 is further configured to receive a second message sent by the main gateway.
- the second message is a message defined by a second protocol.
- the payload of the second message includes second service data that the main gateway needs to send.
- the second service data is data for IoT devices and is data defined by a first protocol.
- the processing unit 802 is also used to obtain the second service data by parsing the second message
- the processing unit 802 is also used to process the second business data.
- step 308 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 801 receiving the second message sent by the main gateway is described in step 308 of method 300 shown in Figure 3, and will not be described in detail here.
- the processing unit 802 obtains the second service data.
- the processing unit 802 obtains the second service data.
- the second protocol is Internet Protocol (IP) or User Datagram Protocol (UDP), and the destination port number of the first message is the port number of the target port on the master gateway.
- the target port is used to receive messages containing data defined by the first protocol.
- the second protocol is the Ethernet protocol
- the destination Media Access Control MAC address of the first message is the MAC address of the main gateway.
- the communication unit 801 is also used for:
- the device sends information about the IoT device to the main gateway.
- the information about the IoT device includes one or more of the following: authentication information of the IoT device, connection parameters of the IoT device, or status information between the device 800 and the IoT device.
- the indoor LAN can be a home network or a business LAN.
- the processing unit After the communication unit receives the first service data sent by the IoT device, the processing unit generates a first message defined by the second protocol.
- the payload of the first message includes the first service data, allowing the communication unit to send the first message to the main gateway. This enables the first service data sent by the IoT device to traverse the device 800 and be transmitted to the main gateway, thereby expanding the coverage of the indoor local area network to include the Bluetooth or StarFlash access range between the device 800 and the IoT device.
- this application embodiment provides a communication device 900.
- the device 900 can be deployed on the main gateway of the indoor local area network 100 shown in Figure 1, or on the main gateway of the network architecture 200 shown in Figure 2, or on the main gateway of the method 300 shown in Figure 3.
- the device 900 is located in the indoor local area network, which also includes Internet of Things (IoT) devices and a first slave gateway.
- the communication protocol used between the first slave gateway and the IoT devices is a first protocol
- the communication protocol used between the first slave gateway and the device 900 is a second protocol.
- the first protocol is Bluetooth or StarSignal
- the second protocol is a protocol other than Bluetooth or StarSignal.
- the device 900 includes:
- the communication unit 901 is used to receive a first message sent by a first slave gateway.
- the payload of the first message includes first service data received from the IoT device by the first slave gateway.
- the first service data is data defined by a first protocol
- the first message is a message defined by a second protocol.
- Processing unit 902 is used to obtain first service data by parsing the first message
- the processing unit 902 is also used to process the first business data.
- step 304 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 901 receiving the first message can be found in step 304 of method 300 shown in Figure 3, and will not be described in detail here.
- step 304 of method 300 in Figure 3 the detailed implementation process of the processing unit 902 obtaining the first service data by parsing the first message is shown in step 304 of method 300 in Figure 3, and will not be described in detail here.
- step 305 of method 300 shown in Figure 3 the detailed implementation process of the processing unit 902 processing the first business data can be found in step 305 of method 300 shown in Figure 3, and will not be described in detail here.
- the communication unit 901 is also used for:
- the second message is a message defined by the second protocol.
- the payload of the second message includes the second service data that the device 900 needs to send.
- the second service data is data for IoT devices and is data defined by the first protocol.
- the detailed implementation process of the communication unit 901 sending the second message can be found in step 307 of method 300 shown in Figure 3, and will not be described in detail here.
- the second service data includes one or more of the following: response data generated by the processing unit 902 after processing the first service data, or commands for IoT devices received by the communication unit 901 from the terminal device or server.
- the second protocol is Internet Protocol (IP) or User Datagram Protocol (UDP)
- IP Internet Protocol
- UDP User Datagram Protocol
- the destination port number of the first message is the port number of the target port on the device 900.
- the target port is used to receive messages that include data defined by the first protocol.
- Communication unit 901 is used to receive a first message sent from the gateway through the target port;
- the processing unit 902 is used to obtain the first service data by parsing the first message when it is determined from the target port that the first message includes data defined by the first protocol.
- step 304 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 901 receiving the first message sent from the gateway through the target port is described in step 304 of method 300 shown in Figure 3, and will not be described in detail here.
- the processing unit 902 determines that the first message includes data defined by the first protocol based on the target port
- the detailed implementation process of obtaining the first service data by parsing the first message is shown in step 304 of method 300 in Figure 3, and will not be described in detail here.
- the second protocol is the Ethernet protocol
- the destination Media Access Control (MAC) address of the first message is the MAC address of the device 900;
- the processing unit 902 is used to obtain the first service data by parsing the first message when it is determined that the destination MAC address of the first message is the MAC address of the device 900.
- the processing unit 902 determines that the destination MAC address of the first message is the MAC address of the device 900, it obtains the first service data by parsing the first message.
- the processing unit 902 determines that the destination MAC address of the first message is the MAC address of the device 900, it obtains the first service data by parsing the first message.
- the processing unit 902 determines that the destination MAC address of the first message is the MAC address of the device 900.
- the processing unit 902 is used to convert the first business data into target data defined by the third protocol, which is the protocol used by the intelligent business, and the intelligent business is the business used to manage IoT devices.
- step 305 of method 300 shown in Figure 3 the detailed implementation process of the processing unit 902 converting the first service data into the target data defined by the third protocol can be found in step 305 of method 300 shown in Figure 3, and will not be described in detail here.
- the system receives information from the first slave gateway about the IoT device.
- the IoT device information includes one or more of the following: authentication information of the IoT device, connection parameters of the IoT device, or status information between the first slave gateway and the IoT device.
- step 304 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 901 receiving the information of the first IoT device sent from the gateway is described in step 304 of method 300 shown in Figure 3, and will not be described in detail here.
- the indoor local area network also includes a second gateway, communication unit 901, which is further used for:
- the query request is used to request information about the IoT device.
- the query response includes information about the IoT device.
- the query response is used to instruct the second slave gateway to perform one or more of the following operations based on the information about the IoT device: establish a connection with the IoT device, or configure the state between the second slave gateway and the IoT device.
- step 308 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 901 receiving the query request sent by the second slave gateway when discovering the IoT device is described in step 308 of method 300 shown in Figure 3, and will not be described in detail here.
- step 308 of method 300 shown in Figure 3 the detailed implementation process of the communication unit 901 sending a query response to the second slave gateway is described in step 308 of method 300 shown in Figure 3, and will not be described in detail here.
- the communication unit can receive the first message from the first slave gateway.
- the first message is generated by the first slave gateway after receiving the first service data sent by the IoT device.
- the payload of the first message includes the first service data, thus allowing the first service data sent by the IoT device to traverse the first slave gateway and be transmitted to the communication unit, where it can be received. This expands the coverage of the indoor local area network by including the Bluetooth or StarFlash access range between the first slave gateway and the IoT device.
- the communication device 1000 includes at least one processor 1001, a bus system 1002, a memory 1003, and at least one transceiver 1004.
- the communication device 1000 is a hardware structure that can be used to implement the functional modules in the communication device 800 shown in FIG8.
- the processing unit 802 in the communication device 800 shown in FIG8 can be implemented by the processor 1001 calling the code in the memory 1003, and the communication unit 801 in the communication device 800 shown in FIG8 can be implemented by the transceiver 1004.
- the communication device 1000 can also be used to implement the gateway function in any of the above embodiments.
- the processor 1001 described above may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of programs according to the present application.
- CPU central processing unit
- ASIC application-specific integrated circuit
- the transceiver 1004 described above is used for communicating with other devices or communication networks.
- the communication device 1000 may include multiple processors, such as processor 1001 and processor 1007 in FIG. 10. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
- a processor may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
- the communication device 1000 may further include an output device 1005 and an input device 1006.
- the output device 1005 communicates with the processor 1001 and can display information in various ways.
- the output device 1005 may be a liquid crystal display (LCD).
- the input device 1006 communicates with the processor 1001 and can accept user input in various ways.
- the input device 1006 may be a touchscreen device or a sensing device.
- the communication device 1100 includes at least one processor 1101, a bus system 1102, a memory 1103, and at least one transceiver 1104.
- the communication device 1100 can also be used to implement the function of the main gateway in any of the above embodiments.
- the processor 1101 described above may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of programs in the present application.
- CPU central processing unit
- ASIC application-specific integrated circuit
- the bus system 1102 described above may include pathways for transmitting information between the components described above.
- the transceiver 1104 described above is used for communicating with other devices or communication networks.
- the aforementioned memory 1103 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
- the memory may exist independently and be connected to the processor via a bus.
- the memory may also be integrated with the processor.
- the communication device 1100 may further include an output device 1105 and an input device 1106.
- the output device 1105 communicates with the processor 1101 and can display information in various ways.
- the output device 1105 may be a liquid crystal display (LCD).
- the input device 1106 communicates with the processor 1101 and can accept user input in various ways.
- the input device 1106 may be a touchscreen device or a sensing device.
- this application embodiment also provides a communication system 1200, which includes a communication device 800 as shown in Figure 8 and a communication device 900 as shown in Figure 9, or the system 1200 includes a communication device 1000 as shown in Figure 10 and a communication device 1100 as shown in Figure 11.
- the communication device 800 shown in Figure 8 or the communication device 1000 shown in Figure 10 can be a first slave gateway 1201
- the communication device 900 shown in Figure 9 or the communication device 1100 shown in Figure 11 can be a master gateway 1202.
- the computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium.
- the computer program product When the computer program product is run on at least one computing device, it causes the at least one computing device to perform the methods provided in any of the above embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请公开了一种通信方法、装置、系统及存储介质,属于通信领域。所述方法应用于室内局域网包括的第一从网关,室内局域网还包括IoT设备和主网关,第一从网关与IoT设备之间采用的通信协议为第一协议,第一从网关与主网关之间采用的通信协议为第二协议,第一协议为蓝牙协议或星闪协议,第二协议是除蓝牙协议和星闪协议之外的协议。所述方法包括:接收IoT设备发送的第一业务数据,第一业务数据是第一协议定义的数据;生成第一报文,第一报文是第二协议定义的报文,第一报文的净荷部分包括第一业务数据;向主网关发送第一报文。本申请能够扩展室内局域网的覆盖范围。
Description
本申请要求于2024年6月26日提交的申请号为202410847383.X、发明名称为“通信方法、装置、系统及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信领域,特别涉及一种通信方法、装置、系统及存储介质。
家庭网络是一种室内局域网,家庭网络可以为家庭提供网络通信服务,家庭往往包括多个物联网(internet of thing,IoT)设备。例如家庭中往往包括智能家居等IoT设备,智能家居有智能电灯、智能音箱、空调和冰箱等。
家庭中的IoT设备可以采用蓝牙协议或星闪协议与家庭网络中的主网关进行通信。在通信时,IoT设备可以基于蓝牙协议或星闪协议向主网关发送业务数据,主网关可以对该业务数据进行处理。例如,主网关可以将该业务数据发送给用户的手机,用户在手机上,通过主网关控制IoT设备。
蓝牙协议或星闪协议的连接距离有限,且经过室内的墙体阻挡后信号质量大幅下降,使得室内的不少IoT设备无法与主网关通信,减小了室内局域网的覆盖范围。
本申请提供了一种通信方法、装置、系统及存储介质,以扩展室内局域网的覆盖范围。所述技术方案如下:
第一方面,本申请提供了一种通信方法,所述方法应用于室内局域网包括的第一从网关,室内局域网还包括物联网IoT设备和主网关,第一从网关与IoT设备之间采用的通信协议为第一协议,第一从网关与主网关之间采用的通信协议为第二协议,第一协议为蓝牙协议或星闪协议,第二协议是除蓝牙协议和星闪协议之外的协议。在所述方法中,接收IoT设备发送的第一业务数据,第一业务数据是第一协议定义的数据。生成第一报文,第一报文是第二协议定义的报文,第一报文的净荷部分包括第一业务数据。向主网关发送第一报文。
第一协议是第一从网关与IoT设备之间的通信协议,第二协议是第一从网关与主网关之间的通信协议。由于第一从网关在接收IoT设备发送的第一业务数据后,生成第二协议定义的第一报文,第一报文的净荷部分包括第一业务数据,这样第一从网关可以向主网关发送第一报文。如此使得IoT设备发送的第一业务数据可以穿越第一从网关并被传输到主网关,IoT设备可以与主网关通信,从而使室内局域网包括第一从网关与IoT设备之间的蓝牙接入范围或星闪接入范围,扩大了室内局域网的覆盖范围。
在一种可能的实现方式中,接收主网关发送的第二报文,第二报文是第二协议定义的报文,第二报文的净荷部分包括主网关需要发送的第二业务数据,第二业务数据是针对IoT设备的数据,第二业务数据是第一协议定义的数据。通过解析第二报文,得到第二业务数据。对第二业务数据进行处理。这样主网关可以将第一协议定义的第二业务数据发送给第一从网关,第二业务数据是针对IoT设备的数据,主网关可以实现对IoT设备的控制和管理。
在另一种可能的实现方式中,第二协议为网际互联协议IP或用户数据报协议UDP,第一报文的目的端口号为主网关上的目标端口的端口号,目标端口用于接收包括第一协议定义的数据的报文。这样保证第一从网关可以将第一报文发送到主网关的目标端口,以使主网关通过目标端口检测第一报文包括第一协议定义的数据,进而对第一报文进行解析等处理。
在另一种可能的实现方式中,第二协议为以太网协议,第一报文的目的媒体接入控制MAC地址为主网关的MAC地址。这样在第一从网关发送第一报文后,主网关通过第一报文中的目的MAC地址,得出第一报文是发送给自身的报文,进而对第一报文进行解析等处理。
在另一种可能的实现方式中,向主网关发送IoT设备的信息,IoT设备的信息包括如下一个或多个:IoT设备的认证信息,IoT设备的连接参数,或者,第一从网关与IoT设备之间的状态信息。这样在主网关上统一对室内局域网中的IoT设备的信息进行管理,便于其他从网关能够从主网关上得到IoT设备的信息。主网关统一维护室内局域网中的IoT设备的信息,从网关可以不用维护室内局域网中的IoT设备的信息,避免从网关保存重复的数据,节省从网关的宝贵资源。
在另一种可能的实现方式中,室内局域网为家庭网络或企业局域网。
第二方面,本申请提供了一种通信方法,所述方法应用于室内局域网包括的主网关,室内局域网还包括物联网IoT设备和第一从网关,第一从网关与IoT设备之间采用的通信协议为第一协议,第一从网关与主网关之间采用的通信协议为第二协议,第一协议为蓝牙协议或星闪协议,第二协议是除蓝牙协议和星闪协议之外的协议。在所述方法中,接收第一从网关发送的第一报文,第一报文的净荷部分包括第一从网关接收的来自IoT设备的第一业务数据,第一业务数据是第一协议定义的数据,第一报文是第二协议定义的报文。通过解析第一报文,得到第一业务数据。对第一业务数据进行处理。
第一协议是第一从网关与IoT设备之间的通信协议,第二协议是第一从网关与主网关之间的通信协议。由于第一报文是第二协议定义的报文,主网关可以接收来自第一从网关的第一报文。而第一报文是第一从网关在接收IoT设备发送的第一业务数据后生成的,第一报文的净荷部分包括第一业务数据,如此使得IoT设备发送的第一业务数据可以穿越第一从网关并被传输到主网关,IoT设备可以与主网关通信,从而使室内局域网包括第一从网关与IoT设备之间的蓝牙接入范围或星闪接入范围,扩大了室内局域网的覆盖范围。
在一种可能的实现方式中,向第一从网关发送第二报文,第二报文是第二协议定义的报文,第二报文的净荷部分包括主网关需要发送的第二业务数据,第二业务数据是针对IoT设备的数据,第二业务数据是第一协议定义的数据。这样主网关可以将第一协议定义的第二业务数据发送给第一从网关,第二业务数据是针对IoT设备的数据,主网关可以实现对IoT设备的控制和管理。
在另一种可能的实现方式中,第二业务数据包括如下一个或多个:主网关处理第一业务数据后产生的响应数据,或者,主网关接收的来自终端设备或服务器的针对IoT设备的命令。
在另一种可能的实现方式中,第二协议为网际互联协议IP或用户数据报协议UDP,第一报文的目的端口号为主网关上的目标端口的端口号,目标端口用于接收包括第一协议定义的数据的报文。通过目标端口接收第一从网关发送的第一报文。在基于目标端口确定第一报文包括第一协议定义的数据时,通过解析第一报文,得到第一业务数据。由于主网关通过目标端口接收第一从网关发送的第一报文,并在基于目标端口确定第一报文包括第一协议定义的数据时,才解析第一报文,避免解析不包括第一协议定义的数据的报文,而产生计算资源的浪费。
在另一种可能的实现方式中,第二协议为以太网协议,第一报文的目的媒体接入控制MAC地址为主网关的MAC地址。在确定第一报文的目的MAC地址为主网关的MAC地址时,通过解析第一报文,得到第一业务数据。由于主网关在确定第一报文的目的MAC地址为主网关的MAC地址时,得出第一报文是发送给自身的报文,才解析第一报文,避免解析不包括第一协议定义的数据的报文,而产生计算资源的浪费。
在另一种可能的实现方式中,将第一业务数据转换成第三协议定义的目标数据,第三协议是智能业务使用的协议,智能业务是用于管理IoT设备的业务。向目标设备发送目标数据,目标设备包括智能业务,目标设备为终端设备或服务器。由于第三协议是智能业务使用的协议,将第一业务数据转换成第三协议定义的目标数据,保证智能业务能够识别并使用目标数据。
在另一种可能的实现方式中,接收第一从网关发送的IoT设备的信息,IoT设备的信息包括如下一个或多个:IoT设备的认证信息,IoT设备的连接参数或者第一从网关与所述IoT设备之间的状态信息。这样主网关统一对室内局域网中的IoT设备的信息进行管理,便于其他从网关能够从主网关上得到IoT设备的信息。主网关统一维护室内局域网中的IoT设备的信息,从网关可以不用维护室内局域网中的IoT设备的信息,避免从网关保存重复的数据,节省从网关的宝贵资源。
在另一种可能的实现方式中,室内局域网还包括第二从网关,接收第二从网关在发现IoT设备时发送的查询请求,查询请求用于请求获取IoT设备的信息。向第二从网关发送查询响应,查询响应包括IoT设备的信息,查询响应用于指示第二从网关基于IoT设备的信息执行如下一个或多个操作:建立与IoT设备之间的连接,或者,配置第二从网关与IoT设备之间的状态。这样第二从网关在基于IoT设备的信息建立与IoT设备之间的连接时,不需要请求与IoT设备配对,提高建立连接效率。或者,第二从网关基于IoT设备的信息配置第二从网关与IoT设备之间的状态,延续了第一从网关与IoT设备之间的状态,保证状态的连续性。
在另一种可能的实现方式中,室内局域网为家庭网络或企业局域网。
第三方面,本申请提供了一种通信装置,用于执行第一方面或第一方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能的实现方式中的方法的单元。
第四方面,本申请提供了一种通信装置,用于执行第二方面或第二方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第二方面或第二方面的任意一种可能的实现方式中的方法的单元。
第五方面,本申请提供了一种通信设备,所述通信设备包括:至少一个处理器,所述至少一个处理器执行第一方面或第一方面的任意一种可能的实现方式中的方法。
第六方面,本申请提供了一种通信设备,所述通信设备包括:至少一个处理器和至少一个存储器,所述至少一个存储器中存储有计算机可读指令;所述至少一个处理器执行所述计算机可读指令,以使得所述通信设备执行第二方面或第二方面的任意一种可能的实现方式中的方法。
第七方面,本申请提供了一种通信系统,所述系统包括第三方面所述的通信装置和第四方面所述的通信装置,或者,第五方面所述的通信设备和第六方面所述的通信设备。
第八方面,本申请提供了一种计算机程序产品,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现上述第一方面、第二方面、第一方面任意可能的实现方式或第二方面任意可能的实现方式中的方法。
第九方面,本申请提供了一种计算机可读存储介质,用于存储计算机程序,所述计算机程序通过处理器进行加载来执行上述第一方面、第二方面、第一方面任意可能的实现方式或第二方面任意可能的实现方式中的方法。
第十方面,本申请提供了一种芯片,包括存储器和处理器,存储器用于存储计算机指令,处理器用于从存储器中调用并运行该计算机指令,以执行上述第一方面、第二方面、第一方面任意可能的实现方式或第二方面任意可能的实现方式中的方法。
图1是本申请实施例提供的一种室内局域网的结构示意图;
图2是本申请实施例提供的一种网络架构的结构示意图;
图3是本申请实施例提供的一种通信方法流程图;
图4是本申请实施例提供的一种报文结构示意图;
图5是本申请实施例提供的另一种报文结构示意图;
图6是本申请实施例提供的另一种报文结构示意图;
图7是本申请实施例提供的另一种通信方法流程图;
图8是本申请实施例提供的一种通信装置结构示意图;
图9是本申请实施例提供的另一种通信装置结构示意图;
图10是本申请实施例提供的一种通信设备结构示意图;
图11是本申请实施例提供的另一种通信设备结构示意图;
图12是本申请实施例提供的一种通信系统结构示意图。
为了便于理解本申请实施例,下面先对本申请实施例涉及的一些专业名词进行解释说明。
第一协议,为IoT设备与从网关之间的通信协议,例如第一协议为蓝牙协议或星闪协议。
第二协议,为从网关与主网关之间的通信协议,例如第二协议为网际互连协议(internet protocol,IP)、用户数据报协议(user datagram protocol,UDP)或以太网协议等。
目标端口,为主网关上的用于接收包括第一协议定义的数据的报文的端口。
参见图1,本申请实施例提供了一种室内局域网100,所述室内局域网100包括主网关101、至少一个从网关102和至少一个IoT设备103。
主网关101可以与至少一个从网关102中的每个从网关102通信。
针对每个从网关102,从网关102可以与至少一个第一IoT设备通信。
在一些实施例中,主网关101还可以与至少一个第二IoT设备通信。
上述至少一个IoT设备103包括与从网关102通信的至少一个第一IoT设备,以及与主网关101通信的至少一个第二IoT设备。
从网关102与至少一个第一IoT设备之间采用的通信协议为第一协议,第一协议可以为蓝牙协议或星闪协议。从网关102与第一IoT设备之间传输的业务数据是第一协议定义的数据。
例如,第一协议为蓝牙协议,第一协议定义的数据为蓝牙数据。所以从网关102与第一IoT设备之间传输的业务数据为蓝牙数据。
再例如,第一协议为星闪协议,第一协议定义的数据为星闪数据。所以从网关102与第一IoT设备之间传输的业务数据为星闪数据。
主网关101与至少一个第二IoT设备之间采用的通信协议也为第一协议。主网关101与第二IoT设备之间传输的业务数据是第一协议定义的数据。例如,主网关101与第二IoT设备之间传输的业务数据可以是蓝牙数据或星闪数据。
主网关101与至少一个从网关102之间采用的通信协议为第二协议,第二协议是除蓝牙协议和星闪协议之外的协议。也就是说,主网关101与从网关102之间传输的报文是第二协议定义的报文。
可选地,第二协议可以为IP、UDP或以太网协议等。
例如,第二协议为IP,第二协议定义的报文为IP报文。所以主网关101与从网关102之间传输的报文为IP报文。
再例如,第二协议为UDP,第二协议定义的报文为UDP报文。所以主网关101与从网关102之间传输的报文为UDP报文。
还例如,第二协议为以太网协议,第二协议定义的报文为以太网报文。所以主网关101与从网关102之间传输的报文为以太网报文。
第一协议为短距离通信协议。可选地,第一协议还可能是低功耗短距离通信协议。所以离主网关101的距离较远的IoT设备103,主网关101可能无法发现该IoT设备103,所以主网关101无法与该IoT设备103建立连接,无法与该IoT设备103通信。
可选地,针对上述至少一个第一IoT设备,由于至少一个第一IoT设备可能离从网关102的距离较近,可能离主网关101的距离较远,使得从网关102发现了至少一个第一IoT设备,至少一个第一IoT设备能够与从网关102之间建立连接,而不能与主网关101之间建立连接,所以至少一个第一IoT设备与从网关102通信。
针对上述至少一个第二IoT设备,由于至少一个第二IoT设备可能离主网关101的距离较近,使得主网关101发现了至少一个第二IoT设备,至少一个第二IoT设备能够与主网关101之间建立连接,所以至少一个第二IoT设备与主网关101通信。
由于主网关101与从网关102之间的通信采用的第二协议和从网关102与至少一个第一IoT设备之间的通信采用的第一协议不同,如果第一IoT设备发送的业务数据能够穿越从网关102并被传输到主网关101,则可以实现第一IoT设备与主网关101通信。因此,实现IoT设备103的业务数据穿越从网关102,可以让更多的IoT设备103与主网关101通信,可以让更多的IoT设备103接入到室内局域网,使得室内局域网包括了从网关102与至少一个第一IoT设备之间的蓝牙接入范围或星闪接入范围,这无疑扩大了室内局域网的覆盖范围以及室内局域网的接入能力。
所以如何让IoT设备103发送的业务数据能够穿越从网关102并被传输到主网关101是急需要解决的问题,在本申请中可以通过如下任一实施例来解决该问题,在此先不详细说明。
在一些实施例中,主网关101与从网关102之间可以采用光纤连接,例如,主网关101与从网关102可以分别是光纤到房间(fiber to the room,FTTR)场景下的主设备和从设备,或者,可以采用除光纤之外的线缆如同轴电缆或双绞线等连接,或者,可以采用无线局域网(wireless local area network,WLAN)连接,或者,可以采用蜂窝通信网络连接等,所以主网关101与从网关102之间可以不受距离的限制,以及不受如墙体等障碍物的阻挡。
在一些实施例中,室内局域网100可以是家庭网络或企业局域网等。从网关102可以为无线接入点(access point,AP)或边缘光网络设备(edge optical network terminal,Edge ONT)等。
在一些实施例中,参见图2,本申请实施例还提供了一种网络架构200,在所述网络架构200中,室内局域网100中的主网关101可以与目标设备104通信。目标设备104包括用于管理至少一个IoT设备103的智能业务,目标设备104可以通过运行智能业务,来管理和/或控制至少一个IoT设备103。
可选地,智能业务可以为用于管理和/或控制至少一个IoT设备103的应用。
可选地,目标设备104可以位于室内局域网中并接入到主网关101上。
例如,目标设备104为终端设备,譬如目标设备104可以为手机或电脑等终端设备,终端设备位于室内局域网100的覆盖范围内,并接入到主网关101上,与主网关101之间存在连接。这样终端设备通过主网关101与至少一个IoT设备103通信,从而可以通过运行智能业务来管理和/或控制至少一个IoT设备103。
可选地,目标设备104可以不位于室内局域网中,目标设备104可以位于互联网中,目标设备104可以通过互联网与室内局域网100中的主网关101之间存在连接。
例如,目标设备104为终端设备或服务器等。譬如目标设备104可以为手机或电脑等终端设备,假设目标设备104为手机,手机可以通过蜂窝通信网络,与室内局域网100中的主网关101之间存在连接,这样手机可以在室内局域网100的覆盖范围外对至少一个IoT设备103进行远距离管理和/或控制。
还譬如目标设备104可以为服务器,服务器可能位于云端,服务器可以通过互联网,与室内局域网100中的主网关101之间存在连接,这样服务器可以在室内局域网100的覆盖范围外对至少一个IoT设备103进行远距离管理和/或控制。
参见图3,本申请实施例提供了一种通信方法300,所述通信方法300可以应用于图1所示的室内局域网100,或者,应用于图2所示的网络架构200。所述通信方法300包括如下流程。
步骤301:第一从网关接收第一IoT设备发送的第一业务数据,第一业务数据是第一协议定义的数据。
在一些实施例中,第一业务数据包括第一IoT设备的第一设备标识。
可选地,第一设备标识可能包括如下一个或多个内容:第一IoT设备的序列号、第一IoT设备的地址、或者、第一IoT设备的设备类型等。
例如,第一IoT设备为智能电灯,则第一IoT设备的设备类型为智能电灯。
第一协议是第一从网关与第一IoT设备之间进行通信所采用的通信协议。第一IoT设备是第一从网关附近的设备,第一从网关能够发现第一IoT设备,并与第一IoT设备建立连接。
在一些实施例中,第一IoT设备可以周期性地或在用户触发下向其周围广播发现报文,第一IoT设备位于第一从网关的附近,第一从网关接收第一IoT设备发送的发现报文,从而发现第一IoT设备。然后,第一从网关与第一IoT设备建立连接,或者,第一从网关与第一IoT设备进行认证,在认证通过后与第一IoT设备建立连接。
在一些实施例中,第一从网关接收的第一业务数据可以包括第一IoT设备发送的发现报文。可选地,发现报文包括第一IoT设备的第一设备标识。
可选地,第一从网关和第一IoT设备均包括事先配置的认证信息。第一从网关与第一IoT设备进行认证的操作可以为:第一从网关基于第一IoT设备的第一设备标识向第一IoT设备发送认证请求,第一IoT设备接收认证请求,向第一从网关发送认证信息,第一从网关接收认证信息,如果接收的认证信息与本地包括的认证信息相同,则对第一IoT设备认证通过。
可选地,发现报文还包括第一IoT设备支持的至少一个频段,第一从网关与第一IoT设备建立连接的操作可以为:第一从网关基于第一IoT设备的第一设备标识向第一IoT设备发送连接建立请求,连接建立请求包括第一IoT设备的连接参数,连接参数包括通信频段和/或加解密密钥,通信频段是第一从网关从至少一个频段中选择的频段。第一IoT设备接收连接建立请求后,可以基于通信频段向第一从网关发送数据,同样第一从网关也可以基于通信频段向第一IoT设备发送数据,即完成建立第一从网关与第一IoT设备之间的连接。其中,第一IoT设备发送的数据是通过加密密钥加密的,第一从网关接收该数据后,可以使用解密密钥解密,同样第一从网关发送的数据是通过加密密钥加密的,第一IoT设备接收该数据后,可以使用解密密钥解密。
可选地,第一从网关包括第一协议的协议栈,第一从网关将该连接参数和/或接收的认证信息输入到协议栈中,基于协议栈与第一IoT设备进行收发数据。
在一些实施例中,第一从网关建立与第一IoT设备之间的连接后,还可以向主网关发送第一IoT设备的连接认证信息,连接认证信息包括第一IoT设备的连接参数和/或第一IoT设备的认证信息。
可选地,第一IoT设备的认证信息包括如下一个或多个:第一IoT设备的证书,或者,第一IoT设备的个人识别密码(personal identification number,PIN)码等。
可选地,第一从网关向主网关发送第一IoT设备的连接认证信息的操作可以为:
第一从网关向主网关发送第一上报信息,第一上报信息包括第一IoT设备的连接认证信息和第一IoT设备的第一设备标识。
在一些实施例中,在第一从网关与第一IoT设备之间存在连接后,第一IoT设备在执行业务时,通过该连接向第一从网关发送业务数据,第一业务数据可以包括第一IoT设备在执行业务时发送的业务数据。
例如,第一IoT设备为智能电灯,智能电灯可以周期性地或在用户触发下广播发现报文。第一从网关接收发现报文,与智能电灯经过认证后,建立与智能电灯之间的连接。此时第一从网关接收智能电灯发送的第一业务数据包括发现报文。
在第一从网关与智能电灯建立连接后,智能电灯可能会向第一从网关发送如下一个或多个业务数据:用于请求确认智能电灯当前发光的颜色和/或亮度的确认请求、或者、用于预定智能电灯的开启时间戳和/或关闭时间戳的预定请求等。此时第一从网关接收智能电灯发送的第一业务数据包括上述一个或多个业务数据。确认请求包括智能电灯当前发光的颜色和/或亮度,预定请求包括智能电灯预定的开启时间戳和/或关闭时间戳。
在一些实施例中,第一业务数据可能包括多个数据分片,第一IoT设备可能分多次向第一从网关发送该多个数据分片。第一从网关分多次接收该多个数据分片,将该多个数据分片组成第一业务数据。
在一些实施例中,第一业务数据可能是报文,即第一业务数据是报文结构的数据。例如,参见图4,假设第一协议为蓝牙协议,第一业务数据是蓝牙数据,第一业务数据的结构是蓝牙格式的报文结构,第一业务数据包括如下一个或多个部分:前导码、访问码/访问地址、协议数据单元(protocol data unit,PDU)头、数据、或者、校验码等。
在一些实施例中,在第一从网关与第一IoT设备之间存在连接后,第一从网关还获取第一从网关与第一IoT设备之间的状态信息,向主网关发送该状态信息。
可选地,该状态信息包括如下一个或多个,第一IoT设备的连接状态,或者、第一IoT设备与第一从网关之间的业务运行状态等。可选地,第一IoT设备的连接状态可以包括在线状态或离线状态等,第一IoT设备与第一从网关之间的业务运行状态可以包括第一IoT设备发送业务数据的进度和/或第一从网关接收业务数据的进度等。
可选地,第一从网关向主网关发送该状态信息的操作可以为:
第一从网关向主网关发送第二上报信息,第二上报信息包括该状态信息和第一IoT设备的第一设备标识。
步骤302:第一从网关生成第一报文,第一报文是第二协议定义的报文,第一报文的净荷部分包括第一业务数据。
第二协议是第一从网关与主网关之间进行通信所采用的通信协议。第二协议可以为IP、UDP或以太网协议等。
在步骤302中,第一从网关可以基于第二协议,通过对第一业务数据进行封装,得到第一报文。可选地,在封装的过程中,在包括第一业务数据作的净荷部分的基础上添加报文头,得到第一报文。
在一些实施例中,第一报文的报文头包括第一从网关的设备标识。
在一些实施例中,第二协议为IP或UDP等协议时,第一报文的报文头还可能包括源地址、源端口号、目的地址和目的端口号等内容。
第一报文的目的端口号是主网关上的目标端口的端口号,主网关上的目标端口用于接收包括第一协议定义的数据的报文。例如,主网关可以使用5050的端口作为用于接收包括第一协议定义的数据的报文的目标端口。
第一报文的源端口号是第一从网关上的一个端口的端口号。
在一些实施例中,主网关可以向室内局域网包括的各从网关广播通知信息,通知信息包括目标端口的端口号,通知信息用于向各从网关通知目标端口是主网关用于接收包括第一协议定义的数据的报文的端口。各从网关接收通知信息后,可以记录目标端口的端口号,以便在封装IoT设备的业务数据时,将目标端口的端口号作为封装生成的报文的目的端口号。或者,
在一些实施例中,目标端口的端口号在各从网关出厂时配置在各从网关中,这样各从网关在封装IoT设备的业务数据时,将出厂时配置的目标端口的端口号作为封装生成的报文的目的端口号。
在一些实施例中,第一报文的净荷部分还包括信息头。可选地,信息头可能包括如下一个或多个信息:魔术字、数据版本、数据类型、数据大小、或者、循环冗余校验(cyclic redundancy check,CRC)码等。
魔术字用于标识第一报文的净荷部分包括的第一业务数据是第一协议定义的数据。
数据版本是第一报文的净荷部分包括的第一业务数据的版本。
数据类型是第一报文的净荷部分包括的第一业务数据的类型。
数据大小是第一报文的净荷部分包括的第一业务数据的大小。
CRC码用于校验第一报文的净荷部分包括的第一业务数据。
参见图4,第二协议为IP,第一报文的报文头包括传输控制协议(transmission control protocol,TCP)报文头和IP报文头。第一从网关在对第一业务数据进行封装的过程中,在包括第一业务数据的净荷部分的基础上添加TCP报文头,得到TCP报文。然后,在TCP报文的基础上添加IP报文头,得到第一报文。第一报文是IP报文。
可选地,第一从网关包括网络层,第一从网关在网络层中,基于IP,通过对第一业务数据进行封装,得到第一报文。也就是说,第一从网关在网络层中,在包括第一业务数据的净荷部分的基础上添加TCP报文头,得到TCP报文。然后,在TCP报文的基础上添加IP报文头,得到第一报文。
参见图5,第一报文中的TCP报文头包括第一从网关的设备标识。第一报文中的IP报文头包括源地址、源端口号、目的地址和目的端口号等内容。目的端口号为主网关上的目标端口的端口号。
参见图6,第二协议为UDP,第一报文的报文头包括UDP报文头。第一从网关在对第一业务数据进行封装的过程中,在包括第一业务数据的净荷部分的基础上添加UDP报文头,得到第一报文。第一报文是UDP报文。
可选地,第一从网关包括网络层,第一从网关在网络层中,基于UDP,通过对第一业务数据进行封装,得到第一报文。也就是说,第一从网关在网络层中,在包括第一业务数据的净荷部分的基础上添加UDP报文头,得到第一报文。可选地,第一从网关的网络层上承载传输层,第一从网关在网络层上的传输层中,在包括第一业务数据的净荷部分的基础上添加UDP报文头,得到第一报文。
第一报文中的UDP报文头包括第一从网关的设备标识、源地址、源端口号、目的地址、目的端口号等。
在一些实施例中,参见图7,在第二协议为IP或UDP的情况下,第一从网关包括第一代理模块,主网关包括第二代理模块。
可选地,第一代理模块可以为第一从网关上运行的代理进程、代理线程或虚拟实例等,第二代理模块可以为主网关上运行的代理进程、代理线程或虚拟实例等,虚拟实例可以为容器或虚拟机等。第一代理模块运行在第一从网关的网络层,第二代理模块运行在主网关的代理层。
第一从网关的第一代理模块接收第一IoT设备发送的第一业务数据,对第一业务数据进行封装,得到第一报文。可选地,在封装的过程中,第一从网关的第一代理模块在包括第一业务数据的净荷部分的基础上添加报文头,得到第一报文。
在一些实施例中,第二协议为以太网协议时,第一报文的目的媒体接入控制(media access control,MAC)地址为主网关的MAC地址。
第一报文的报文头还可能包括第一从网关的设备标识、源MAC地址、源端口号、目的MAC地址、目的端口号和类型,该类型用于标识第一报文是包括第一协议定义的数据的报文。目标端口可以为主网关上的任一端口的端口号,也就是说,在此情况下,主网关上不需要单独的用于接收包括第一协议定义的数据的报文的目标端口。
可选地,第一报文的净荷部分还包括信息头,信息头可能包括如下一个或多个信息:魔术字、数据版本、数据类型、数据大小、或者、CRC码等。
第一报文的报文头为以太网报文头。第一从网关在对第一业务数据进行封装的过程中,在包括第一业务数据的净荷部分的基础上添加以太网报文头,得到第一报文。第一报文是以太网报文。
可选地,第一从网关包括数据链路层,数据链路层包括第一协议的驱动,第一从网关在数据链路层包括的驱动中,基于以太网协议,通过对第一业务数据进行封装,得到第一报文。也就是说,第一从网关在数据链路层包括的驱动中,在包括第一业务数据的净荷部分的基础上添加以太网报文头,得到第一报文。
步骤303:第一从网关向主网关发送第一报文。
在第二协议为IP或UDP等协议时,第一报文的目的端口号为目标端口的端口号,所以第一从网关向主网关上的目标端口发送第一报文。
可选地,参见图7,第一从网关的第一代理模块向主网关上的目标端口发送第一报文。
可选地,第二协议为IP的情况,第一从网关与主网关的目标端口之间有TCP连接,第一从网关通过TCP连接,向主网关上的目标端口发送第一报文。
可选地,第二协议为UDP的情况,第一从网关还周期性地向主网关上的目标端口发送连接信息,以通过该连接信息维护第一从网关与主网关上的目标端口之间的连接关系。
步骤304:主网关接收第一报文,通过解析第一报文,得到第一报文中的第一业务数据。
在第二协议为IP或UDP等协议时,主网关包括目标端口,主网关实时监听目标端口,监听到有发送给目标端口的第一报文时,通过目标端口接收第一报文。
由于目标端口是用于接收包括第一协议定义的数据的报文的端口,因此主网关通过目标端口接收第一报文,基于目标端口可以确定第一报文包括第一协议定义的数据,解析第一报文,得到第一业务数据。
可选的,主网关包括网络层,主网关在网络层中,解析第一报文,得到第一业务数据。
在一些实施例中,参见图7,主网关包括第二代理模块,第二代理模块实时监听目标端口,监听到有发送给目标端口的第一报文时,通过目标端口接收第一报文。基于目标端口可以确定第一报文包括第一协议定义的数据,解析第一报文,得到第一业务数据。
在一些实施例中,第一从网关可能因异常等原因,将不包括第一协议定义的数据的报文发送到主网关上的目标端口。主网关通过目标端口接收该报文后,基于目标端口确定该报文包括第一协议定义的数据,然而该报文实际上不包括第一协议定义的数据,所以确定的结果是错误的,主网关无法从该报文中解析出第一协议定义的数据,浪费主网关的计算资源。
为了在这种情况下,解决出错的问题,第一报文的净荷部分的信息头包括魔术字,主网关在基于目标端口确定第一报文的净荷部分包括第一协议定义的数据时,从第一报文的净荷部分中读取第一报文的魔术字。基于第一报文的魔术字确定第一报文的净荷部分是否包括第一协议定义的数据;如果确定出第一报文的净荷部分包括第一协议定义的数据时,解析第一报文的净荷部分,得到第一业务数据;如果确定出第一报文的净荷部分不包括第一协议定义的数据时,可以丢弃第一报文,或者,转发第一报文,或者,对第一报文进行其他处理。
在第二协议为以太网协议等时,主网关接收第一报文,从第一报文的报文头中读取第一报文的目的MAC地址,确定第一报文的目的MAC地址是否为主网关的MAC地址。如果第一报文的目的MAC地址为主网关的MAC地址时,解析第一报文,得到第一业务数据。如果第一报文的目的MAC地址不为主网关的MAC地址时,丢弃第一报文。
主网关接收的报文的目的MAC地址是主网关的MAC地址,表示该报文是发送给主网关的报文,但该报文可能包括第一协议定义的数据,也可能不包括第一协议定义的数据。在接收到不包括第一协议定义的数据且目的MAC地址为主网关的MAC地址的报文时,主网关如果对该报文进行解析,则解析不出来第一协议定义的数据,浪费主网关的计算资源。
为了在这种情况下,避免浪费主网关的计算资源,第一报文的报文头还包括类型,该类型用于标识第一报文是包括第一协议定义的数据的报文,主网关在确定出第一报文的目的MAC地址为主网关的MAC地址时,从第一报文的报文头中读取该类型。基于该类型确定第一报文是否包括第一协议定义的数据;如果确定出第一报文包括第一协议定义的数据时,解析第一报文,得到第一业务数据;如果确定出第一报文不包括第一协议定义的数据时,可以丢弃第一报文,或者,转发第一报文,或者,对第一报文进行其他处理。
可选地,主网关包括数据链路层,数据链路层包括第一协议的驱动,主网关在数据链路层包括的驱动中,解析第一报文,得到第一业务数据。在实现时,在驱动中,解析第一报文的净荷部分中的信息头得到第一报文的魔术字,在基于第一报文的魔术字确定第一报文的净荷部分包括第一协议定义的数据时,继续解析第一报文的净荷部分,得到第一业务数据。
在一些实施例中,第一报文的净荷部分的信息头还包括数据版本、数据类型、数据大小和/或CRC码等内容。在第二协议为IP、UDP或以太网协议等情况下,主网关在解析第一报文的净荷部分时,先解析得到数据版本、数据类型、数据大小和/或CRC码。基于数据版本、数据类型、数据大小和/或CRC码,继续解析第一报文的净荷部分,得到第一业务数据。例如,主网关可以基于数据大小,从第一报文的净荷部分中提取第一业务数据,基于CRC码,对提取的第一业务数据进行校验。
在一些实施例中,第一报文的报文头还包括第一从网关的设备标识,主网关在解析第一报文时,还可以得到第一从网关的设备标识。
在一些实施例中,主网关还可能接收第一从网关发送的第一IoT设备的连接认证信息,主网关还将第一IoT设备的第一设备标识与连接认证信息对应保存在第一设备标识与连接认证信息之间对应关系中。
可选地,在实现时,主网关接收第一从网关发送的第一上报信息,第一上报信息包括第一IoT设备的第一设备标识和连接认证信息,将第一上报信息包括的第一IoT设备的第一设备标识和连接认证信息对应保存在第一设备标识与连接认证信息之间对应关系中。
可选地,主网关还可以向室内局域网包括的除第一从网关之外的从网关发送第一上报信息。室内局域网包括的除第一从网关之外的从网关包括第二从网关,第二从网关接收第一上报信息,将第一上报信息包括的第一IoT设备的第一设备标识和连接认证信息对应保存在第一设备标识与连接认证信息之间对应关系中。
在一些实施例中,主网关还可能接收第一从网关发送的第一从网关与第一IoT设备之间的状态信息,主网关还将第一IoT设备的第一设备标识与该状态信息对应保存在第一设备标识与状态信息之间对应关系中。
可选地,在实现时,主网关接收第一从网关发送的第二上报信息,第二上报信息包括第一IoT设备的第一设备标识和该状态信息,将第二上报信息包括的第一IoT设备的第一设备标识和该状态信息对应保存在第一设备标识与状态信息之间对应关系中。
可选地,主网关还可以向室内局域网包括的除第一从网关之外的从网关发送第二上报信息。室内局域网包括的除第一从网关之外的从网关包括第二从网关,第二从网关接收第二上报信息,将第二上报信息包括的第一IoT设备的第一设备标识和该状态信息对应保存在第一设备标识与状态信息之间对应关系中。
如果主网关不向室内局域网中的从网关转发第一上报信息和第二上报信息,这样主网关集中保存第一设备标识与连接认证信息之间对应关系以及第一设备标识与状态信息之间对应关系。室内局域网中的各从网关可以不保存该两个对应关系,从而避免从网关保存重复的数据,节省从网关的宝贵资源。
步骤305:主网关对第一业务数据进行处理。
在一些实施例中,第一业务数据可能是发现报文。主网关对第一业务数据进行处理的操作可以为:
主网关从发现报文中获取第一IoT设备的第一设备标识,基于第一设备标识和第一从网关的设备标识,获取第一IoT设备的第二设备标识,第二设备标识包括第一IoT设备的位置和设备类型等信息,将第一从网关的设备标识、第一IoT设备的第一设备标识和第二设备标识对应保存在从网关的设备标识、IoT设备的第一设备标识和第二设备标识之间的对应关系中。
可选地,第二设备标识可以为便于用户理解的第一IoT设备的别名,例如,假设第一IoT设备是位于主卧室内的智能电灯,则第一IoT设备的第二设备标识可以为主卧智能电灯。主网关获取第一IoT设备的第二设备标识的操作可以为:
主网关基于第一从网关的设备标识,确定第一IoT设备的位置,基于第一IoT设备的第一设备标识,确定第一IoT设备的设备类型,从而得到第一IoT设备的第二设备标识。
针对于第一IoT设备的位置,主网关基于第一从网关的设备标识可以确定第一从网关的位置,将该位置作为第一IoT设备的位置。
例如,第一从网关位于主卧室内,而第一IoT设备是位于主卧室内的智能电灯,所以第一从网关能够发现第一IoT设备,并与第一IoT设备之间建立连接。主网关可以基于第一从网关的设备标识,确定第一从网关的位置为主卧室,所以得出第一IoT设备位于主卧室内,从而得到第一IoT设备的位置为主卧室。
针对第一IoT设备的设备类型,第一IoT设备的第一设备标识包括第一IoT设备的设备类型,主网关可以从第一设备标识中读取第一IoT设备的设备类型。或者,第一IoT设备的第一设备标识包括第一IoT设备的序列号和/或第一IoT设备的地址等,主网关可以基于第一IoT设备的序列号和/或第一IoT设备的地址,从网络中查询第一IoT设备的设备类型。
例如,假设主网关获取的第一IoT设备的设备类型为智能电灯,所以得到的第一IoT设备的第二设备标识为主卧智能电灯。
在一些实施例中,主网关还可以向目标设备发送提示信息,提示信息包括第一IoT设备的第二设备标识。目标设备接收提示信息,显示提示信息,以提示有第一IoT设备接入室内局域网。
例如,假设目标设备为手机,手机中运行有用于管理IoT设备的智能业务。手机可以接收主网关发送的提示信息,提示信息为“有主卧智能电灯接入家庭网络”,手机显示提示信息,以向用户进行提示。
在一些实施例中,第一业务数据是第一IoT设备在执行业务时发送的业务数据。例如,第一业务数据可能是确认请求或预定请求,主网关对第一业务数据进行处理的操作可以为:主网关可以对确认请求或预定请求进行确认。
可选地,主网关对确认请求或预定请求进行确认后,还可以产生响应数据,响应数据可以是对确认请求或预定请求进行确认得到的同意命令。
例如,假设第一IoT设备为智能电灯,第一业务数据是用于请求确认智能电灯当前发光的颜色和/或亮度的确认请求,主网关可以同意智能电灯以该颜色和/或亮度进行发光,所以对确认请求进行确认得到同意命令。或者,第一业务数据是用于预定智能电灯的开启时间戳和/或关闭时间戳的预定请求,主网关可以同意智能电灯在预定的开启时间戳开启,和/或,在预定的关闭时间戳关闭,所以对预定请求进行确认得到同意命令。
在一些实施例中,主网关可能需要向目标设备发送第一业务数据,主网关对第一业务数据进行处理的操作可以为:
主网关将第一业务数据转换成第三协议定义的目标数据,第三协议是智能业务使用的协议,向目标设备发送目标数据。
可选地,第一业务数据可能是二进制格式的数据。例如,第一业务数据为蓝牙数据或星闪数据,第一业务数据是不便于用户理解和编程的二进制数据。第三协议定义的目标数据可以为可扩展标记语言(extensible markup language,xml)格式的数据或JS对象简谱(javascript object notation,json)格式的数据等,是便于用户理解和编程的数据。
目标设备接收目标数据后,可以对目标数据进行处理。
例如,假设第一IoT设备为智能电灯,第一业务数据是用于请求确认智能电灯当前发光的颜色和/或亮度的确认请求,主网关将确认请求转换为成xml格式或json格式的确认请求(为目标数据),向目标设备发送xml格式或json格式的确认请求。
目标设备接收xml格式或json格式的确认请求,然后执行的处理操作可以为:
目标设备向用户显示xml格式或json格式的确认请求。用户可以同意智能电灯以该颜色和/或亮度进行发光,向目标设备触发对确认请求的确认,使目标设备得到同意命令。或者,用户可以不同意智能电灯以该颜色和/或亮度进行发光,向目标设备触发更改命令,更改命令包括用户更改的颜色和/或亮度。
再例如,第一业务数据是用于预定智能电灯的开启时间戳和/或关闭时间戳的预定请求,主网关将预定请求转换为成xml格式或json格式的预定请求(为目标数据),向目标设备发送xml格式或json格式的预定请求。
目标设备接收xml格式或json格式的预定请求,然后执行的处理操作可以为:
目标设备向用户显示xml格式或json格式的预定请求。用户可以同意智能电灯在预定的开启时间戳开启,和/或,在预定的关闭时间戳关闭,向目标设备触发对预定请求的确认,使目标设备得到同意命令。或者,用户可以不同意智能电灯在预定的开启时间戳开启,和/或,在预定的关闭时间戳关闭,向目标设备触发更改命令,更改命令包括用户更改的开启时间戳和/或关闭时间戳。
在一些实施例中,第一从网关在接收到第一业务数据时,也可以将第一业务数据转换成第三协议定义的目标数据,向主网关发送目标数据。主网关接收目标数据后,可以处理目标数据。例如主网关向目标设备发送目标数据。
上述仅仅是列举了主网关处理第一业务数据的几种实例,在实际场景中,不同设备类型的IoT设备,主网关可能有不同的处理第一业务数据的操作,处理的操作不仅仅有上述列举的几种实例,还可能有其他的处理操作,在此不再一一列举。
在一些实施例中,主网关可能有需要发送的第二业务数据,第二业务数据是针对第一IoT设备的数据,且第二业务数据是第一协议定义的数据。可以按如下流程来发送第二业务数据。
步骤306:主网关获取第二业务数据,生成第二报文,第二报文是第二协议定义的报文,第二报文的净荷部分包括第二业务数据。
在一些实施例中,第二业务数据包括第一IoT设备的第一设备标识和主网关处理第一业务数据后产生的响应数据。例如,响应数据包括上述同意命令。主网关产生的响应数据为第一协议定义的数据。
第一业务数据包括第一IoT设备的第一设备标识,第二业务数据包括的第一设备标识可以是主网关从第一业务数据中得到的。
在一些实施例中,第二业务数据包括第一IoT设备的第一设备标识和主网关接收的来自目标设备的针对第一IoT设备的命令。
例如,该命令可以为目标设备发送的上述同意命令或更改命令等。
再例如,目标设备可能需要查询第一IoT设备的状态,该命令可以为查询命令。
在一些实施例中,目标设备发送的针对第一IoT设备的命令可能是第三协议定义的数据,主网关接收该命令后,将该命令转换为第一协议定义的命令,第二业务数据包括的命令为第一协议定义的命令。
可选地,目标设备在向主网关发送的该命令包括第一IoT设备的第二设备标识。而第二业务数据包括的第一设备标识,主网关可以按如下操作获取第一设备标识:
主网关从该命令中读取第一IoT设备的第二设备标识,基于第二设备标识,从从网关的设备标识、IoT设备的第一设备标识和第二设备标识之间的对应关系中,查询出第一IoT设备的第一设备标识。
主网关除了上述列举的几种获取第二业务数据的方式外,还可能有其他的方式得到第二业务数据,在此不再一一列举。
由于主网关的资源多于第一从网关的资源,从网关的资源较少,可能无法处理IoT设备的业务数据。由于主网关可以集中对室内局域网中的各IoT设备的业务数据进行处理,所以第一从网关在接收第一业务数据后,直接在网络层或数据链路层封装第一业务数据得到第一报文,向主网转发第一报文,由主网关来处理第一业务数据,保证能够成功对室内局域网中的各IoT设备进行控制和/或管理等操作。
主网关生成第二报文的详细实现过程,可以参见步骤302中第一从网关生成第一报文的详细实现过程,在此不再详细说明。
步骤307:主网关向第一从网关发送第二报文。
在步骤307中,主网关可以获取第一从网关的设备标识,基于第一从网关的设备标识,向第一从网关发送第二报文。
在第二业务数据包括主网关处理第一业务数据后产生的响应数据的情况下,主网关可以基于第一IoT设备的第一设备标识,从从网关的设备标识、IoT设备的第一设备标识和第二设备标识之间的对应关系中,查询出第一从网关的设备标识。基于第一从网关的设备标识,向第一从网关发送第二报文。
在第二业务数据包括目标设备发送的命令的情况下,主网关在基于该命令包括的第二设备标识,从从网关的设备标识、IoT设备的第一设备标识和第二设备标识之间的对应关系中查询第一IoT设备的第一设备标识时,还查询出第一从网关的设备标识。基于第一从网关的设备标识,向第一从网关发送第二报文。
在一些实施例中,在第二协议为IP或UDP等协议时,主网关通过目标端口向第一从网关发送第二报文,第二报文的源端口号为目标端口的端口号,第二报文的目的端口号为第一报文的源端口号,即第二报文的目的端口号是第一从网关上的一个端口的端口号。
可选地,第二协议为IP的情况,第一从网关与主网关的目标端口之间有TCP连接,主网关基于TCP连接,通过目标端口向第一从网关发送第二报文。
可选地,第二协议为UDP的情况,第一从网关周期性地向主网关上的目标端口发送连接信息,通过该连接信息维护第一从网关与主网关上的目标端口之间的连接关系。主网关可以基于接收的连接信息,通过目标端口向第一从网关发送第二报文。
步骤308:第一从网关接收第二报文,通过解析第二报文,得到第二业务数据,对第二业务数据进行处理。
第一从网关解析第二报文的详细实现过程,可以参见步骤304中主网关解析第一报文的详细实现过程,在此不再详细说明。
在一些实施例中,第二业务数据包括上述同意命令,第一从网关可以确认同意命令,以实现处理第二业务数据。或者,向第一IoT设备发送同意命令,以让第一IoT设备确认同意命令,以实现处理第二业务数据。
在一些实施例中,第二业务数据包括上述更改命令,第一从网关向第一IoT设备发送更改命令,以实现处理第二业务数据。
第一IoT接收更改命令,执行更改命令。例如,第一IoT设备为智能电灯,智能电灯接收更改命令。更改命令包括用户更改的颜色和/或亮度,智能电灯基于用户更改的颜色和/或亮度发光。或者,更改命令包括用户更改的开启时间戳和/或关闭时间戳,智能电灯在用户更改的开启时间戳开启,在用户更改的关闭时间戳关闭。
可选地,第一IoT设备执行更改命令后,还可能向第一从网关发送更改响应,更改响应为第一协议定义的业务数据。可以将更改响应作为第一业务数据,返回从上述步骤301开始执行。
在一些实施例中,第二业务数据包括上述查询命令,第一从网关向第一IoT设备发送查询命令,以实现处理第二业务数据。
第一IoT设备接收查询命令,执行查询命令。例如,第一IoT设备为智能电灯,智能电灯接收查询命令。查询命令用于查询第一IoT设备的状态,智能电灯基于查询命令获取自身的状态,向第一从网关发送查询响应,查询响应包括智能电灯的状态。
可以将查询响应作为第一业务数据,返回从上述步骤301开始执行。
在一些实施例中,第一IoT设备可能是移动设备,第一IoT设备从第一从网关的附近移动到第二从网关的附近,能够被第二从网关发现,接下来第二从网关和主网关还执行如下流程。
(1):第二从网关可以向主网关发送查询请求,查询请求包括第一IoT设备的第一设备标识,查询请求用于请求获取第一IoT设备的信息。
(2):主网关接收第二从网关发送的查询请求,基于查询请求包括的第一设备标识,获取第一IoT设备的信息,向第二从网关发送查询响应,查询响应包括第一IoT设备的信息。
第一IoT设备的信息包括如下一个或多个:第一IoT设备的连接认证信息或者第一从网关与第一IoT设备之间的状态信息。
主网关获取第一IoT设备的信息的操作,可以包括:
主网关基于第一IoT设备的第一设备标识,从第一设备标识与连接认证信息之间的对应关系中获取第一IoT设备的连接认证信息。和/或,
主网关基于第一IoT设备的第一设备标识,从第一设备标识与状态信息之间的对应关系中获取第一从网关与第一IoT设备之间的状态信息。
(3):第二从网关接收查询响应,基于第一IoT设备的信息执行如下一个或多个操作:建立与第一IoT设备之间的连接,或者,配置第二从网关与第一IoT设备之间的状态。
在一些实施例中,如果第二从网关保存有第一设备标识与连接认证信息之间的对应关系,则第二从网关基于第一IoT设备的第一设备标识,从第一设备标识与连接认证信息之间的对应关系中获取第一IoT设备的认证信息。
如果第二从网关保存有第一设备标识与状态信息之间的对应关系,则第二从网关基于第一IoT设备的第一设备标识,从第一设备标识与状态信息之间的对应关系中获取第一从网关与第一IoT设备之间的状态信息。
在一些实施例中,第一IoT设备的信息包括第一IoT设备的连接认证信息,第二从网关包括第一协议的协议栈,第二从网关将第一IoT的认证信息输入到第一协议的协议栈,通过第一协议的协议栈,建立与第一IoT设备之间的连接。这样第二从网关不需要与第一IoT设备认证,如此第二从网关就不需要请求目标设备配对第二从网关和第一IoT设备,节省了用户配对操作,提高连接建立的效率。
可选地,连接认证信息包括第一IoT设备的连接参数,第二从网关与第一IoT设备建立连接的操作可以为:第二从网关基于第一IoT设备的第一设备标识向第一IoT设备发送连接建立请求,连接建立请求包括第一IoT设备的连接参数。第一IoT设备接收连接建立请求后,基于连接参数与第二从网关收发数据,即完成建立第二从网关与第一IoT设备之间的连接。然后第二从网关基于协议栈与第一IoT设备进行数据收发。
在一些实施例中,第一IoT设备的信息包括第一从网关与第一IoT设备之间的状态信息,该状态信息包括如下一个或多个,第一IoT设备的连接状态,或者、第一IoT设备与第一从网关之间的业务运行状态等。
第二从网关基于该连接状态配置第一IoT设备。例如第一IoT设备的连接状态可以包括在线状态或离线状态等,第二从网关可以配置第一IoT设备在线或离线。和/或,
第二从网关基于该业务运行状态配置第一IoT设备运行业务的进度。例如,业务运行状态可以包括第一IoT发送业务数据的进度和/或第一从网关接收业务数据的进度等,第二从网关配置第一IoT设备从该发送业务数据的进度起,继续发送业务数据;或者,第二从网关配置第一IoT设备从第一从网关接收业务数据的进度起,继续发送业务数据。
对于与主网关连接的第二IoT设备,主网关可以直接基于第一协议与第二IoT设备通信,也就是说,主网关可以基于第一协议接收第二IoT设备发送的业务数据,和/或,基于第一协议向第二IoT设备发送业务数据。
在本申请实施例中,对于离主网关的距离较远的第一IoT设备,第一IoT设备可以就近接入位于第一IoT设备附近的第一从网关,可以基于第一协议连接到第一从网关上,向第一从网关发送第一协议定义的第一业务数据。第一从网关基于第二协议与主网关通信,第一从网关接收第一业务数据,将第一业务数据封装成第二协议定义的第一报文,第一报文的净荷部分包括第一业务数据,向主网关发送第一报文。如此实现了第一业务数据穿越第一从网关并被传输到主网关,这样主网关通过解析第一报文,得到第一业务数据,对第一业务数据进行处理。从而扩大了室内局域网的覆盖范围和接入能力。由于第一IoT设备可以就近接入位于第一IoT设备附近的第一从网关,所以第一IoT设备可以采用低功耗短距离通信的第一协议与第一从网关通信,从而可以减小第一IoT设备的功耗。
参见图8,本申请实施例提供了一种通信装置800,所述装置800可以部署在图1所示室内局域网100中的从网关上,或图2所示网络架构200中的从网关上,或图3所示方法300的第一从网关上。所述装置800位于室内局域网中,室内局域网还包括物联网IoT设备和主网关,所述装置800与IoT设备之间采用的通信协议为第一协议,所述装置800与主网关之间采用的通信协议为第二协议,第一协议为蓝牙协议或星闪协议,第二协议是除蓝牙协议和星闪协议之外的协议。所述装置800包括:
通信单元801,用于接收IoT设备发送的第一业务数据,第一业务数据是第一协议定义的数据;
处理单元802,用于生成第一报文,第一报文是第二协议定义的报文,第一报文的净荷部分包括第一业务数据;
通信单元801,还用于向主网关发送第一报文。
可选地,通信单元801接收IoT设备发送的第一业务数据的详细实现过程参见图3所示方法300的步骤301中的相关内容,在此不再详细说明。
可选地,处理单元802生成第一报文的详细实现过程参见图3所示方法300的步骤302中的相关内容,在此不再详细说明。
可选地,通信单元801向主网关发送第一报文的详细实现过程参见图3所示方法300的步骤303中的相关内容,在此不再详细说明。
可选地,通信单元801,还用于接收主网关发送的第二报文,第二报文是第二协议定义的报文,第二报文的净荷部分包括主网关需要发送的第二业务数据,第二业务数据是针对IoT设备的数据,第二业务数据是第一协议定义的数据;
处理单元802,还用于通过解析第二报文,得到第二业务数据;
处理单元802,还用于对第二业务数据进行处理。
可选地,通信单元801接收主网关发送的第二报文的详细实现过程参见图3所示方法300的步骤308中的相关内容,在此不再详细说明。
可选地,处理单元802得到第二业务数据,对第二业务数据进行处理的详细实现过程参见图3所示方法300的步骤308中的相关内容,在此不再详细说明。
可选地,第二协议为网际互联协议IP或用户数据报协议UDP,第一报文的目的端口号为主网关上的目标端口的端口号,目标端口用于接收包括第一协议定义的数据的报文。
可选地,第二协议为以太网协议,第一报文的目的媒体接入控制MAC地址为主网关的MAC地址。
可选地,通信单元801,还用于:
向主网关发送IoT设备的信息,IoT设备的信息包括如下一个或多个:IoT设备的认证信息,IoT设备的连接参数,或者,所述装置800与IoT设备之间的状态信息。
可选地,通信单元801向主网关发送IoT设备的信息的详细实现过程参见图3所示方法300的步骤301中的相关内容,在此不再详细说明。
可选地,室内局域网为家庭网络或企业局域网。
在本申请实施例中,由于处理单元在通信单元接收IoT设备发送的第一业务数据后,生成第二协议定义的第一报文,第一报文的净荷部分包括第一业务数据,这样通信单元可以向主网关发送第一报文。如此使得IoT设备发送的第一业务数据可以穿越所述装置800并被传输到主网关,从而使室内局域网包括所述装置800与IoT设备之间的蓝牙接入范围或星闪接入范围,扩大了室内局域网的覆盖范围。
参见图9,本申请实施例提供了一种通信装置900,所述装置900可以部署在图1所示室内局域网100中的主网关上,或图2所示网络架构200中的主网关上,或图3所示方法300的主网关上。所述装置900位于室内局域网中,室内局域网还包括物联网IoT设备和第一从网关,第一从网关与IoT设备之间采用的通信协议为第一协议,第一从网关与所述装置900之间采用的通信协议为第二协议,第一协议为蓝牙协议或星闪协议,第二协议是除蓝牙协议和星闪协议之外的协议,所述装置900包括:
通信单元901,用于接收第一从网关发送的第一报文,第一报文的净荷部分包括第一从网关接收的来自IoT设备的第一业务数据,第一业务数据是第一协议定义的数据,第一报文是第二协议定义的报文;
处理单元902,用于通过解析第一报文,得到第一业务数据;
处理单元902,还用于对第一业务数据进行处理。
可选地,通信单元901接收第一报文的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,处理单元902通过解析第一报文,得到第一业务数据的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,处理单元902对第一业务数据进行处理的详细实现过程参见图3所示方法300的步骤305中的相关内容,在此不再详细说明。
可选地,通信单元901,还用于:
向第一从网关发送第二报文,第二报文是第二协议定义的报文,第二报文的净荷部分包括所述装置900需要发送的第二业务数据,第二业务数据是针对IoT设备的数据,第二业务数据是第一协议定义的数据。
可选地,通信单元901发送第二报文的详细实现过程参见图3所示方法300的步骤307中的相关内容,在此不再详细说明。
可选地,第二业务数据包括如下一个或多个:处理单元902处理第一业务数据后产生的响应数据,或者,通信单元901接收的来自终端设备或服务器的针对IoT设备的命令。
可选地,第二协议为网际互联协议IP或用户数据报协议UDP,第一报文的目的端口号为所述装置900上的目标端口的端口号,目标端口用于接收包括第一协议定义的数据的报文;
通信单元901,用于通过目标端口接收第一从网关发送的第一报文;
处理单元902,用于在基于目标端口确定第一报文包括第一协议定义的数据时,通过解析第一报文,得到第一业务数据。
可选地,通信单元901通过目标端口接收第一从网关发送的第一报文的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,处理单元902在基于目标端口确定第一报文包括第一协议定义的数据时,通过解析第一报文,得到第一业务数据的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,第二协议为以太网协议,第一报文的目的媒体接入控制MAC地址为所述装置900的MAC地址;
处理单元902,用于在确定第一报文的目的MAC地址为所述装置900的MAC地址时,通过解析第一报文,得到第一业务数据。
可选地,处理单元902在确定第一报文的目的MAC地址为所述装置900的MAC地址时,通过解析第一报文,得到第一业务数据的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,处理单元902,用于将第一业务数据转换成第三协议定义的目标数据,第三协议是智能业务使用的协议,智能业务是用于管理IoT设备的业务;
通信单元901,还用于向目标设备发送目标数据,目标设备包括智能业务,目标设备为终端设备或服务器。
可选地,处理单元902将第一业务数据转换成第三协议定义的目标数据的详细实现过程参见图3所示方法300的步骤305中的相关内容,在此不再详细说明。
可选地,通信单元901向目标设备发送目标数据的详细实现过程参见图3所示方法300的步骤305中的相关内容,在此不再详细说明。
可选地,通信单元901,还用于:
接收第一从网关发送的IoT设备的信息,IoT设备的信息包括如下一个或多个:IoT设备的认证信息,IoT设备的连接参数,或者第一从网关与所述IoT设备之间的状态信息。
可选地,通信单元901接收第一从网关发送的IoT设备的信息的详细实现过程参见图3所示方法300的步骤304中的相关内容,在此不再详细说明。
可选地,室内局域网还包括第二从网关,通信单元901,还用于:
接收第二从网关在发现IoT设备时发送的查询请求,查询请求用于请求获取IoT设备的信息;
向第二从网关发送查询响应,查询响应包括IoT设备的信息,查询响应用于指示第二从网关基于IoT设备的信息执行如下一个或多个操作:建立与IoT设备之间的连接,或者,配置第二从网关与IoT设备之间的状态。
可选地,通信单元901接收第二从网关在发现IoT设备时发送的查询请求的详细实现过程参见图3所示方法300的步骤308中的相关内容,在此不再详细说明。
可选地,通信单元901向第二从网关发送查询响应的详细实现过程参见图3所示方法300的步骤308中的相关内容,在此不再详细说明。
可选地,室内局域网为家庭网络或企业局域网。
在本申请实施例中,由于第一报文是第二协议定义的报文,通信单元可以接收来自第一从网关的第一报文。而第一报文是第一从网关在接收IoT设备发送的第一业务数据后生成的,第一报文的净荷部分包括第一业务数据,如此使得IoT设备发送的第一业务数据可以穿越第一从网关并被传输到通信单元,并可以被通信单元接收到。从而使室内局域网包括第一从网关与IoT设备之间的蓝牙接入范围或星闪接入范围,扩大了室内局域网的覆盖范围。
参见图10,本申请实施例提供的一种通信设备1000示意图。该通信设备1000包括至少一个处理器1001,总线系统1002,存储器1003以及至少一个收发器1004。
该通信设备1000是一种硬件结构的装置,可以用于实现图8所述的通信装置800中的功能模块。例如,本领域技术人员可以想到图8所示的通信装置800中的处理单元802可以通过该至少一个处理器1001调用存储器1003中的代码来实现,图8所示的通信装置800中的通信单元801可以通过该收发器1004来实现。
可选的,该通信设备1000还可用于实现上述任一实施例中从网关的功能。
可选的,上述处理器1001可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统1002可包括通路,在上述组件之间传送信息。
上述收发器1004,用于与其他设备或通信网络通信。
上述存储器1003可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器1003用于存储执行本申请方案的应用程序代码,并由处理器1001来控制执行。处理器1001用于执行存储器1003中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器1001可以包括一个或多个CPU,例如图10中的CPU0和CPU1。
在具体实现中,作为一种实施例,该通信设备1000可以包括多个处理器,例如图10中的处理器1001和处理器1007。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,该通信设备1000还可以包括输出设备1005和输入设备1006。输出设备1005和处理器1001通信,可以以多种方式来显示信息。例如,输出设备1005可以是液晶显示器(liquid crystal display,LCD)等。输入设备1006和处理器1001通信,可以以多种方式接受用户的输入。例如,输入设备1006可以是触摸屏设备或传感设备等。
参见图11,本申请实施例提供的一种通信设备1100示意图。该通信设备1100包括至少一个处理器1101,总线系统1102,存储器1103以及至少一个收发器1104。
该通信设备1100是一种硬件结构的装置,可以用于实现图9所述的通信装置900中的功能模块。例如,本领域技术人员可以想到图9所示的通信装置900中的处理单元902可以通过该至少一个处理器1101调用存储器1103中的代码来实现,图9所示的通信装置900中的通信单元901可以通过该收发器1104来实现。
可选的,该通信设备1100还可用于实现上述任一实施例中主网关的功能。
可选的,上述处理器1101可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统1102可包括通路,在上述组件之间传送信息。
上述收发器1104,用于与其他设备或通信网络通信。
上述存储器1103可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器1103用于存储执行本申请方案的应用程序代码,并由处理器1101来控制执行。处理器1101用于执行存储器1103中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器1101可以包括一个或多个CPU,例如图11中的CPU0和CPU1。
在具体实现中,作为一种实施例,该通信设备1100可以包括多个处理器,例如图11中的处理器1101和处理器1107。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,该通信设备1100还可以包括输出设备1105和输入设备1106。输出设备1105和处理器1101通信,可以以多种方式来显示信息。例如,输出设备1105可以是液晶显示器(liquid crystal display,LCD)等。输入设备1106和处理器1101通信,可以以多种方式接受用户的输入。例如,输入设备1106可以是触摸屏设备或传感设备等。
参见图12,本申请实施例还提供了一种通信系统1200,所述系统1200包括如图8所示的通信装置800和如图9所示的通信装置900,或者,所述系统1200包括如图10所示的通信设备1000和如图11所示的通信设备1100。可选地,参见图12,如图8所示的通信装置800或如图10所示的通信设备1000可以为第一从网关1201,如图9所示的通信装置900或如图11所示的通信设备1100可以为主网关1202。
本申请实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算设备上运行时,使得至少一个计算设备执行上述任意实施例提供的方法。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (35)
- 一种通信方法,其特征在于,所述方法应用于室内局域网包括的第一从网关,所述室内局域网还包括物联网IoT设备和主网关,所述第一从网关与所述IoT设备之间采用的通信协议为第一协议,所述第一从网关与所述主网关之间采用的通信协议为第二协议,所述第一协议为蓝牙协议或星闪协议,所述第二协议是除所述蓝牙协议和所述星闪协议之外的协议,所述方法包括:接收所述IoT设备发送的第一业务数据,所述第一业务数据是所述第一协议定义的数据;生成第一报文,所述第一报文是所述第二协议定义的报文,所述第一报文的净荷部分包括所述第一业务数据;向所述主网关发送所述第一报文。
- 如权利要求1所述的方法,其特征在于,所述方法还包括:接收所述主网关发送的第二报文,所述第二报文是所述第二协议定义的报文,所述第二报文的净荷部分包括所述主网关需要发送的第二业务数据,所述第二业务数据是针对所述IoT设备的数据,所述第二业务数据是第一协议定义的数据;通过解析所述第二报文,得到所述第二业务数据;对所述第二业务数据进行处理。
- 如权利要求1或2所述的方法,其特征在于,所述第二协议为网际互联协议IP或用户数据报协议UDP,所述第一报文的目的端口号为所述主网关上的目标端口的端口号,所述目标端口用于接收包括所述第一协议定义的数据的报文。
- 如权利要求1或2所述的方法,其特征在于,所述第二协议为以太网协议,所述第一报文的目的媒体接入控制MAC地址为所述主网关的MAC地址。
- 如权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:向所述主网关发送所述IoT设备的信息,所述IoT设备的信息包括如下一个或多个:所述IoT设备的认证信息,所述IoT设备的连接参数,或者,所述第一从网关与所述IoT设备之间的状态信息。
- 如权利要求1-5任一项所述的方法,其特征在于,所述室内局域网为家庭网络或企业局域网。
- 一种通信方法,其特征在于,所述方法应用于室内局域网包括的主网关,所述室内局域网还包括物联网IoT设备和第一从网关,所述第一从网关与所述IoT设备之间采用的通信协议为第一协议,所述第一从网关与所述主网关之间采用的通信协议为第二协议,所述第一协议为蓝牙协议或星闪协议,所述第二协议是除所述蓝牙协议和所述星闪协议之外的协议,所述方法包括:接收所述第一从网关发送的第一报文,所述第一报文的净荷部分包括所述第一从网关接收的来自所述IoT设备的第一业务数据,所述第一业务数据是所述第一协议定义的数据,所述第一报文是所述第二协议定义的报文;通过解析所述第一报文,得到所述第一业务数据;对所述第一业务数据进行处理。
- 如权利要求7所述的方法,其特征在于,所述方法还包括:向所述第一从网关发送第二报文,所述第二报文是所述第二协议定义的报文,所述第二报文的净荷部分包括所述主网关需要发送的第二业务数据,所述第二业务数据是针对所述IoT设备的数据,所述第二业务数据是所述第一协议定义的数据。
- 如权利要求8所述的方法,其特征在于,所述第二业务数据包括如下一个或多个:所述主网关处理所述第一业务数据后产生的响应数据,或者,所述主网关接收的来自终端设备或服务器的针对所述IoT设备的命令。
- 如权利要求7-9任一项所述的方法,其特征在于,所述第二协议为网际互联协议IP或用户数据报协议UDP,所述第一报文的目的端口号为所述主网关上的目标端口的端口号,所述目标端口用于接收包括所述第一协议定义的数据的报文;所述接收所述第一从网关发送的第一报文,包括:通过所述目标端口接收所述第一从网关发送的所述第一报文;所述通过解析所述第一报文,得到所述第一业务数据,包括:在基于所述目标端口确定所述第一报文包括所述第一协议定义的数据时,通过解析所述第一报文,得到所述第一业务数据。
- 如权利要求7-9任一项所述的方法,其特征在于,所述第二协议为以太网协议,所述第一报文的目的媒体接入控制MAC地址为所述主网关的MAC地址;所述通过解析所述第一报文,得到所述第一业务数据,包括:在确定所述第一报文的目的MAC地址为所述主网关的MAC地址时,通过解析所述第一报文,得到所述第一业务数据。
- 如权利要求7-11任一项所述的方法,其特征在于,所述对所述第一业务数据进行处理,包括:将所述第一业务数据转换成第三协议定义的目标数据,所述第三协议是智能业务使用的协议,所述智能业务是用于管理所述IoT设备的业务;向目标设备发送所述目标数据,所述目标设备包括所述智能业务,所述目标设备为终端设备或服务器。
- 如权利要求7-12任一项所述的方法,其特征在于,所述方法还包括:接收所述第一从网关发送的所述IoT设备的信息,所述IoT设备的信息包括如下一个或多个:所述IoT设备的认证信息,所述IoT设备的连接参数或者所述第一从网关与所述IoT设备之间的状态信息。
- 如权利要求13所述的方法,其特征在于,所述室内局域网还包括第二从网关,所述方法还包括:接收所述第二从网关在发现所述IoT设备时发送的查询请求,所述查询请求用于请求获取所述IoT设备的信息;向所述第二从网关发送查询响应,所述查询响应包括所述IoT设备的信息,所述查询响应用于指示所述第二从网关基于所述IoT设备的信息执行如下一个或多个操作:建立与所述IoT设备之间的连接,或者,配置所述第二从网关与所述IoT设备之间的状态。
- 如权利要求7-14任一项所述的方法,其特征在于,所述室内局域网为家庭网络或企业局域网。
- 一种通信装置,其特征在于,所述装置位于室内局域网中,所述室内局域网还包括物联网IoT设备和主网关,所述装置与所述IoT设备之间采用的通信协议为第一协议,所述装置与所述主网关之间采用的通信协议为第二协议,所述第一协议为蓝牙协议或星闪协议,所述第二协议是除所述蓝牙协议和所述星闪协议之外的协议,所述装置包括:通信单元,用于接收所述IoT设备发送的第一业务数据,所述第一业务数据是所述第一协议定义的数据;处理单元,用于生成第一报文,所述第一报文是所述第二协议定义的报文,所述第一报文的净荷部分包括所述第一业务数据;所述通信单元,还用于向所述主网关发送所述第一报文。
- 如权利要求16所述的装置,其特征在于,所述通信单元,还用于接收所述主网关发送的第二报文,所述第二报文是所述第二协议定义的报文,所述第二报文的净荷部分包括所述主网关需要发送的第二业务数据,所述第二业务数据是针对所述IoT设备的数据,所述第二业务数据是第一协议定义的数据;所述处理单元,还用于通过解析所述第二报文,得到所述第二业务数据;所述处理单元,还用于对所述第二业务数据进行处理。
- 如权利要求16或17所述的装置,其特征在于,所述第二协议为网际互联协议IP或用户数据报协议UDP,所述第一报文的目的端口号为所述主网关上的目标端口的端口号,所述目标端口用于接收包括所述第一协议定义的数据的报文。
- 如权利要求16或17所述的装置,其特征在于,所述第二协议为以太网协议,所述第一报文的目的媒体接入控制MAC地址为所述主网关的MAC地址。
- 如权利要求16-19任一项所述的装置,其特征在于,所述通信单元,还用于:向所述主网关发送所述IoT设备的信息,所述IoT设备的信息包括如下一个或多个:所述IoT设备的认证信息,所述IoT设备的连接参数,或者,所述装置与所述IoT设备之间的状态信息。
- 如权利要求16-20任一项所述的装置,其特征在于,所述室内局域网为家庭网络或企业局域网。
- 一种通信装置,其特征在于,所述装置位于室内局域网中,所述室内局域网还包括物联网IoT设备和第一从网关,所述第一从网关与所述IoT设备之间采用的通信协议为第一协议,所述第一从网关与所述装置之间采用的通信协议为第二协议,所述第一协议为蓝牙协议或星闪协议,所述第二协议是除所述蓝牙协议和所述星闪协议之外的协议,所述装置包括:通信单元,用于接收所述第一从网关发送的第一报文,所述第一报文的净荷部分包括所述第一从网关接收的来自所述IoT设备的第一业务数据,所述第一业务数据是所述第一协议定义的数据,所述第一报文是所述第二协议定义的报文;处理单元,用于通过解析所述第一报文,得到所述第一业务数据;所述处理单元,还用于对所述第一业务数据进行处理。
- 如权利要求22所述的装置,其特征在于,所述通信单元,还用于:向所述第一从网关发送第二报文,所述第二报文是所述第二协议定义的报文,所述第二报文的净荷部分包括所述装置需要发送的第二业务数据,所述第二业务数据是针对所述IoT设备的数据,所述第二业务数据是所述第一协议定义的数据。
- 如权利要求23所述的装置,其特征在于,所述第二业务数据包括如下一个或多个:所述处理单元处理所述第一业务数据后产生的响应数据,或者,所述通信单元接收的来自终端设备或服务器的针对所述IoT设备的命令。
- 如权利要求22-24任一项所述的装置,其特征在于,所述第二协议为网际互联协议IP或用户数据报协议UDP,所述第一报文的目的端口号为所述装置上的目标端口的端口号,所述目标端口用于接收包括所述第一协议定义的数据的报文;所述通信单元,用于通过所述目标端口接收所述第一从网关发送的所述第一报文;所述处理单元,用于在基于所述目标端口确定所述第一报文包括所述第一协议定义的数据时,通过解析所述第一报文,得到所述第一业务数据。
- 如权利要求22-24任一项所述的装置,其特征在于,所述第二协议为以太网协议,所述第一报文的目的媒体接入控制MAC地址为所述装置的MAC地址;所述处理单元,用于在确定所述第一报文的目的MAC地址为所述装置的MAC地址时,通过解析所述第一报文,得到所述第一业务数据。
- 如权利要求22-26任一项所述的装置,其特征在于,所述处理单元,用于将所述第一业务数据转换成第三协议定义的目标数据,所述第三协议是智能业务使用的协议,所述智能业务是用于管理所述IoT设备的业务;所述通信单元,还用于向目标设备发送所述目标数据,所述目标设备包括所述智能业务,所述目标设备为终端设备或服务器。
- 如权利要求22-27任一项所述的装置,其特征在于,所述通信单元,还用于:接收所述第一从网关发送的所述IoT设备的信息,所述IoT设备的信息包括如下一个或多个:所述IoT设备的认证信息,所述IoT设备的连接参数或者所述第一从网关与所述IoT设备之间的状态信息。
- 如权利要求28所述的装置,其特征在于,所述室内局域网还包括第二从网关,所述通信单元,还用于:接收所述第二从网关在发现所述IoT设备时发送的查询请求,所述查询请求用于请求获取所述IoT设备的信息;向所述第二从网关发送查询响应,所述查询响应包括所述IoT设备的信息,所述查询响应用于指示所述第二从网关基于所述IoT设备的信息执行如下一个或多个操作:建立与所述IoT设备之间的连接,或者,配置所述第二从网关与所述IoT设备之间的状态。
- 如权利要求22-29任一项所述的装置,其特征在于,所述室内局域网为家庭网络或企业局域网。
- 一种通信设备,其特征在于,所述通信设备包括:处理器,所述处理器执行如权利要求1至6任一项所述的方法。
- 一种通信设备,其特征在于,所述通信设备包括:处理器和存储器,所述存储器存储有一个或多个程序,所述一个或多个程序被配置成由所述处理器执行,所述一个或多个程序包含用于进行如权利要求7至15任一项所述的方法的指令。
- 一种通信系统,其特征在于,包括如权利要求16-21任一项所述的装置和如权利要求22-30任一项所述的装置,或者,如权利要求31所述的通信设备和如权利要求32所述的通信设备。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储计算机程序,所述计算机程序通过设备进行加载来执行如权利要求1至15任一项所述的方法的指令。
- 一种包含指令的计算机程序产品,其特征在于,所述指令被设备执行时,使得所述设备执行如权利要求1-15任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410847383.XA CN121218099A (zh) | 2024-06-26 | 2024-06-26 | 通信方法、装置、系统及存储介质 |
| CN202410847383.X | 2024-06-26 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2026001058A1 true WO2026001058A1 (zh) | 2026-01-02 |
Family
ID=98113022
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/080062 Pending WO2026001058A1 (zh) | 2024-06-26 | 2025-02-28 | 通信方法、装置、系统及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN121218099A (zh) |
| WO (1) | WO2026001058A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121711027A (zh) * | 2026-02-11 | 2026-03-20 | Ut斯达康通讯有限公司 | 一种双通道接入系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102957596A (zh) * | 2011-08-16 | 2013-03-06 | 海尔集团公司 | 子网关装置、系统及处理终端设备数据的方法 |
| CN104038414A (zh) * | 2013-08-21 | 2014-09-10 | 江南大学 | 一种多协议智能家庭网关装置及其系统 |
| US20200195758A1 (en) * | 2018-12-14 | 2020-06-18 | EMC IP Holding Company LLC | Dynamic certification for configuration changes to software defined radio implemented devices |
| WO2023030513A1 (zh) * | 2021-09-05 | 2023-03-09 | 汉熵通信有限公司 | 物联网系统 |
| CN116827723A (zh) * | 2023-07-28 | 2023-09-29 | 美智光电科技股份有限公司 | 网关系统、网关设备及物联网系统 |
-
2024
- 2024-06-26 CN CN202410847383.XA patent/CN121218099A/zh active Pending
-
2025
- 2025-02-28 WO PCT/CN2025/080062 patent/WO2026001058A1/zh active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102957596A (zh) * | 2011-08-16 | 2013-03-06 | 海尔集团公司 | 子网关装置、系统及处理终端设备数据的方法 |
| CN104038414A (zh) * | 2013-08-21 | 2014-09-10 | 江南大学 | 一种多协议智能家庭网关装置及其系统 |
| US20200195758A1 (en) * | 2018-12-14 | 2020-06-18 | EMC IP Holding Company LLC | Dynamic certification for configuration changes to software defined radio implemented devices |
| WO2023030513A1 (zh) * | 2021-09-05 | 2023-03-09 | 汉熵通信有限公司 | 物联网系统 |
| CN116827723A (zh) * | 2023-07-28 | 2023-09-29 | 美智光电科技股份有限公司 | 网关系统、网关设备及物联网系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN121218099A (zh) | 2025-12-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN116405461B (zh) | 一种数据处理方法、网元设备以及可读存储介质 | |
| US10462260B2 (en) | Context-aware and proximity-aware service layer connectivity management | |
| US11277313B2 (en) | Data transmission method and corresponding device | |
| CN112787685B (zh) | 用于支持无线通信的方法、装置及系统 | |
| KR101961049B1 (ko) | 타임 슬롯화 채널 홉핑 네트워크에서의 효율적인 중앙 집중식 자원 및 스케줄 관리 | |
| US8711817B2 (en) | Low cost mesh network capability | |
| JP7246379B2 (ja) | 通信ネットワークにおけるサービス層メッセージテンプレート | |
| WO2026001058A1 (zh) | 通信方法、装置、系统及存储介质 | |
| WO2023025180A1 (zh) | 管理节点的方法、节点和系统 | |
| JP2024537662A (ja) | チャネル構成方法、及び装置 | |
| JP2023510410A (ja) | マルチアクセス関連情報を伴うプロビジョニングトラフィック操向 | |
| CN112968965A (zh) | Nfv网络节点的元数据服务方法、服务器及存储介质 | |
| US8924520B2 (en) | Method, remote access server and system for configuring a quality of service parameter | |
| US10645184B2 (en) | Information transmission method, gateway, and controller | |
| US11622263B2 (en) | Wireless repeater device and configuration method for the same | |
| US20240381227A1 (en) | Information configuration method and apparatus, and related devices and storage medium | |
| CN111465081A (zh) | 管控指令接收、发送方法、装置、设备及存储介质 | |
| EP4727254A1 (en) | Communication method and communication apparatus | |
| CN113783971A (zh) | 地址管理方法、网络设备及存储介质 | |
| US20230231803A1 (en) | Session establishment method and network device | |
| US20250088939A1 (en) | Network Device and Communication System | |
| US20240056814A1 (en) | Supporting computer networking device connections to controllers using different connection protocols | |
| CN116743861B (zh) | 一种组播加入方法及相关设备 | |
| CN111107046B (zh) | 一种数据流的传输方法及装置 | |
| TW202515222A (zh) | 一種服務發現方法及裝置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 25824453 Country of ref document: EP Kind code of ref document: A1 |