This application claims the priority benefit of Taiwan application serial no. 106129191, filed on Aug. 28, 2017. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
The disclosure relates to a message delivery method and more particularly, to a message pushing system, a client equipment and a message pushing method thereof.
Along with rapid development of technologies, a variety of electronic devices, such as sensors, conventional home appliances, illumination devices, switch devices and so on, gradually and widely apply communication functions, such that the devices can transmit or receive messages and can be controlled by other devices or collect information through other devices.
Although hardware specifications of part of the electronic devices cannot achieve high network bandwidths, complex communication protocols or high hardware requirements of the communication functions, theses electronic devices can achieve message delivery with lower network bandwidths and hardware resources through a publishing/subscribing (PubSub) mechanism. Additionally, in order to make it easier for users to interact through other devices, some service providers launch internet of things (IoT)-based cloud platforms to provide a variety of network services.
However, referring to
Accordingly, the disclosure provides a message pushing system, a client equipment and a message pushing method thereof, by which a server which also resides in a local area network may be added, thereby solving the issue that the client equipment fails to connect to the Internet for services.
A message pushing system of the disclosure includes a first server, a second server and a first client equipment. The first server resides in a first network. The second server resides in a second network, and the second network is different from the first network. The first client equipment resides in the first network, registers with the first server and the second server, and transmits and receives messages via at least one of the first server and the second server based on a publishing/subscribing mechanism.
In an embodiment of the disclosure, the first client equipment subscribes to both the first server and the second server and publishes to both the first server and the second server.
In an embodiment of the disclosure, the message pushing system further includes a second client equipment. The second client equipment determines whether to subscribe to either the first server or the second server.
In an embodiment of the disclosure, the second client equipment subscribes to a topic published by the first client equipment from one of the first server and the second server.
In an embodiment of the disclosure, the first client equipment subscribes to a topic published by the second client equipment from both the first server and the second server.
In an embodiment of the disclosure, the first client equipment performs an operation of the first server.
A message pushing method of the disclosure includes the following steps: providing a server residing in first network; transmitting a registration message via a first network and a second network, wherein the second network is different from the first network; transmitting and receiving messages via at least one of the first server and the second server based on a publishing/subscribing mechanism.
In an embodiment of the disclosure, the step of transmitting and receiving the messages via at least one of the first server and the second server based on the publishing/subscribing mechanism includes subscribing through both the first network and the second network; and publishing through both the first network and the second network.
Additionally, a client equipment of the disclosure resides in a first network and includes a communication circuit and a processor. The communication circuit is configured to transmit and receive messages. The processor is coupled to the communication circuit, and configured to transmit a registration message through the communication circuit via the first network and a second network, and transmit and receive the message via one of the first network and the second network based on a publishing/subscribing mechanism, wherein the second network is different from the first network.
In an embodiment of the disclosure, the processor subscribes through the communication circuit via both the first network and the second network and publishes via both the first network and the second network.
In an embodiment of the disclosure, the publishing/subscribing mechanism complies with a message queue telemetry transport (MQTT) protocol.
Based on the above, the client equipment, after registering with the servers residing in different networks, can subscribe to the topics of the two servers or publish the messages thereto. When another client equipment subscribes to or publishes the same topic, the second server residing in the second network, no matter whether being disconnected, still can successfully publish the message or receive the subscribed message via the first network.
In order to make the aforementioned and other features and advantages of the disclosure more comprehensible, several embodiments accompanied with figures are described in detail below.
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the disclosure and, together with the description, serve to explain the principles of the disclosure.
The controlled device 210 may be an electronic device, such as a smart bulb, an intelligent remote control switch, an intelligent door lock and an intelligent sensor, which supports a Z-Wave, Bluetooth, Wi-Fi, ZigBee communication technique or other wireless communication techniques for transmitting or receiving messages.
It should be mentioned that in other embodiments, the client equipment 300 may also be an electronic device, for example, a smart bulb, an intelligent remote control switch, an intelligent door lock, an intelligent sensor, which complies with the MQTT protocol.
The local server 400 may be employed as a broker supporting the MQTT protocol to receive a subscribe request for a specific topic from the client equipment 300 or 600 and/or transmit a published message to a subscriber (e.g., the client equipment 300 or 600), which is referred to as a publishing/subscribing (PubSub) mechanism. In the present embodiment, the client equipment 300 and the local server 400 are combined into one (i.e., both are located in the same device), such that the client equipment 300 may perform operations of the client equipment 300 and the local server 400 respectively through two software modules which are separated from each other and capable of communicating with each other. Additionally, the client equipment 300 and the local server 400 both reside in a local area network (LAN) 250 (or referred to as a local network).
In other embodiments, the client equipment 300 and the local server 400 may also be two independent devices and communicate with each other in a wireless/wired manner.
The network access equipment 230 at least has an LAN interface card, processor, circuit or chipset (for example, an interface supporting the Wi-Fi, Bluetooth or Ethernet communication technique) and a WAN interface card, processor, circuit or chipset (which is, for example, a copper cable supporting digital subscriber line (DSL), an optical fiber supporting passive optical network (PON), or other communication techniques), such that the client equipment 300 residing in the LAN 250 may connect to a wide area network (WAN) 270 (or referred to as an external network) or the Internet.
The remote server 500 is a cloud broker complying with the MQTT protocol and may provide interne of things (IoT) cloud solutions, such as Amazon web service (AWS), Google cloud IoT service or Microsoft Azure IoT service. In the same or similar manner, the remote server 500 may receive a subscribe request for a specific topic from the client equipment 300 or 600 and/or transmit a published message to a subscriber (e.g., the client equipment 300 or 600). Additionally, the remote server 500 resides in the WAN 270 (or referred to as the external network).
The client equipment 600 may be a mobile device, for example, a smart phone, a tablet computer or a notebook computer, and may connect to the local server 400 or the remote server 500. The client equipment 600 may be further loaded with applications compliable with the service provided by the remote server 500 for a user to control the controlled device 210 or obtained related information.
It should be mentioned that in other embodiments, the local server 400 and the remote server 500 may also support other brokers based on the PubSub mechanism, such as a simple notification service (SNS), an extensible messaging and presence protocol (XMPP), while the client equipment 300 or 600 supports the same or a compliable communication protocol. Additionally, the local server 400 and the remote server 500, as long as residing in two different networks, are applicable to the present embodiment.
In the present embodiment, the client equipment 600 connects to the local server 400 via the network access equipment 230. However, in other embodiments, the client equipment 600 may also directly communicate with the local server 400 using the Wi-Fi, Bluetooth, Ethernet technique without the network access equipment 230 only if the client equipment 300 is capable of directly connecting to the WAN 270 or the Internet (for example, through the 4G communication or a network cable).
In order to facilitate understanding of the operation process of the present embodiment, several embodiments will be provided below for describing a message pushing method of the disclosure. The method of the present embodiment is applicable to each element of the message pushing system 1 illustrated in
If a message related to the topic A is about to be published, the client equipment 300 publishes the message to both the local server 400 and the remote server 500 via the LAN 250 and the WAN 270 (step S450). The remote server 500 transmits the message to all subscribers of the topic A, such that the client equipment 600 receives the message related to the topic A (step S460). On the other hand, if a message related to the topic B is about to be published, the client equipment 600 may publish the message to the remote server 500 (step S470), and the remote server 500 transmits the message to all subscribers of the topic B, such that the client equipment 300 receives the message related to the topic B (step S480).
It is assumed that the client equipment 600 subscribes to a topic (which is assumed as the topic A in this case) that the client equipment 300 schedules to publish, and the client equipment 300 subscribes to a topic (which is assumed as the topic B in this case) that the client equipment client equipment 600 schedules to be publish. If a message related to the topic A is about to be published, the client equipment 300 publishes the message to both the local server 400 and the remote server 500 via the LAN 250 and the WAN 270 (step S540). The local server 400 transmits the message to all subscribers of the topic A, such that the client equipment 600 receives the message related to the topic A (step S550). On the other hand, if a message related to the topic B is to be published, the client equipment 600 publishes the message to the local server 400 (step S470), the local server 400 transmits the message to all subscribers of the topic B, such that the client equipment 300 receives the message related to the topic B (step S570).
In this way, no matter whether the client equipment 600 resides in the LAN 250 or the WAN 270, the client equipment 600, as long as being capable of connecting to one of the local server 400 and the remote server 500, may successfully transmit the published message to the subscribers or successfully receive the subscribed messages, thereby solving the issue of failure in publishing and receiving the messages which is encountered when a disconnection scenario occurs to the existing internet.
In order to facilitate understanding of actual application scenarios of the present embodiment, three examples will be provided below for describing different application scenarios.
In light of the foregoing, a local server is newly added in the network where a first client equipment resides in the present embodiment, such that the first client equipment can register with the local server and the remote server and publish messages thereto or receives messages therefrom. No matter whether a second client equipment resides in the same network as the first client equipment or in a network different from that of the first client equipment, the second client equipment, as long as being capable of connecting to the server (e.g., the local server or the remote server) in any one of the networks, can successfully receive the message published by the first client equipment or successfully transmit the published message to the first client equipment. In this way, the user can set the first client equipment and the local server in the same network of the controlled device, such that the user, no matter whether being in the environment where the first client equipment resides or in other environments, can control the controlled device and/or collect information therefrom through the second client equipment.
Although the disclosure has been described with reference to the above embodiments, it will be apparent to one of the ordinary skill in the art that modifications to the described embodiment may be made without departing from the spirit of the disclosure. Accordingly, the scope of the disclosure will be defined by the attached claims not by the above detailed descriptions.
Number | Date | Country | Kind |
---|---|---|---|
106129191 | Aug 2017 | TW | national |