Internet of Things multiple gateway system
Technical field
The invention belongs to internet of things field, it is related to a kind of Internet of things system, more particularly to a kind of Internet of Things multiple gateway
System.
Background technology
The Internet of Things application mode for being touched at present is all only to support single gateway application mode, that is, single account is only
The equipment under a gateway can be controlled, if to control other gateways to need switch accounts.
In view of this, nowadays in the urgent need to designing a kind of new connected mode, to overcome what existing connected mode was present
Drawbacks described above.
The content of the invention
The technical problems to be solved by the invention are:A kind of Internet of Things multiple gateway system is provided, the same time control of user can be facilitated
Make or be to look at the home environment of two places.
In order to solve the above technical problems, the present invention is adopted the following technical scheme that:
A kind of Internet of Things multiple gateway system, the system includes:Service end and an at least client of service end connection;
Each gateway possesses a UUID, and server supports that multiple gateways are connected simultaneously;Forwarding server is with UUID as mesh
Mark ID, to gateway forwards message;
Client keeps multiple gateways connections, and, with UUID as reference, how many UUID are with regard to how many company for establishment of connection
Connect;These are connected with the connection of LAN, the connection for also having wide area network;LAN connection is that interior off the net, client is direct
Searching gateway will set up LAN connection, improve real-time, in this case be that client directly sends control to gateway
Instruction is without server;Wide area network connection is, outer off the net, and client directly passes through 4G or WIFI connection servers,
Control instruction is sent to gateway by server;
Gateway messages are pushed and pushed with UUID, so as under realizing multiple gateway pattern, user can simultaneously receive multiple gateways
PUSH message;The system realizes scene composition and equipment linkage operation under multiple gateways.
As a preferred embodiment of the present invention, if client and one of gateway be not under same LAN;Account
Number must and gateway there is no an absolute incidence relation, i.e., mobile phone is logged in and is independent of whether gateway is opened;High in the clouds saves and all nets
The binding table of pass;
Application process and flow include:
1st, client login account;
2nd, after server authentication passes through, generate session control SESSION and return to client;So client is just led to
Sessionid is crossed to communicate;
3rd, client passes through the sessionid for obtaining, request to all list of gateways under account;
4 then client to Intranet broadcast, judge whether the gateway of Intranet;
5th, if it find that Intranet gateway, then client sets up Intranet connection, then straight for gateway in list not in Intranet
Connect and set up service end connection, and the connected mode of service end is that shared one of multiple gateways connect to reach the mesh for economizing on resources
's;
6th, after connection is set up, the equipment of all gateways is collected and shows together by client;
7th, whenever a battery limits control is opened, then while order is sent, message can carry gateway ID, thus
Realize the control to multiple gateway.
As a preferred embodiment of the present invention, if client and all gateways are under same LAN;Account is necessary
There is no absolute incidence relation, i.e. mobile phone to log in gateway and be independent of whether gateway is opened;High in the clouds is saved and all gateways are tied up
Determine table;
Application process and flow include:
1st, client login account;
2nd, after server authentication passes through, generate SESSION and return to client;So mobile phone terminal just passes through
Sessionid communicates;
3rd, client passes through the sessionid for obtaining, request to all list of gateways under account;
4 then client to Intranet broadcast, judge whether the gateway of Intranet;
5th, if it find that Intranet gateway, then client sets up Intranet connection;
6th, after connection is set up, the equipment of all gateways is collected and shows together by client;
7th, when a battery limits control is opened, such as switch command is sent, then while order is sent, is disappeared
Breath can carry gateway ID;But message is intended for the account of the specific connection of Intranet;In this case, control message does not walk cloud completely
End.
As a preferred embodiment of the present invention, server S ERVER ends using MQTT clustered deploy(ment)s client, gateway with
And transmitted between server, use the so-called data medium of JSON forms.
As a preferred embodiment of the present invention, in communication process, by the UUID of gateway, server
SESSIONID realizes data transfer.
The beneficial effects of the present invention are:Internet of Things multiple gateway system proposed by the present invention, by many account multiple gateway moulds
Formula a, account can simultaneously control multiple associated gateways.So facilitate user while controlling or being to look at the family of two places
Environment.
Brief description of the drawings
Fig. 1 is the block schematic illustration of Internet of Things multiple gateway system of the present invention.
Fig. 2 is the trans-regional connection diagram of Internet of Things multiple gateway system of the present invention.
Fig. 3 is connection diagram of the Internet of Things multiple gateway system of the present invention with region.
Specific embodiment
The preferred embodiment that the invention will now be described in detail with reference to the accompanying drawings.
Embodiment one
Fig. 1 is referred to, present invention is disclosed a kind of Internet of Things multiple gateway system, the system includes:Service end and service
Hold an at least client of connection;
Each gateway possesses a UUID (Universally Unique Identifier, general unique identifier), clothes
Business device supports that multiple gateways are connected simultaneously;Forwarding server with UUID as Target id, to gateway forwards message;
Client keeps multiple gateways connections, and, with UUID as reference, how many UUID are with regard to how many company for establishment of connection
Connect;These are connected with the connection of LAN, the connection for also having wide area network;LAN connection is that interior off the net, client is direct
Searching gateway will set up LAN connection, improve real-time, in this case be that client directly sends control to gateway
Instruction is without server;Wide area network connection is, outer off the net, and client directly passes through 4G or WIFI connection servers,
Control instruction is sent to gateway by server;
Gateway messages are pushed and pushed with UUID, so as under realizing multiple gateway pattern, user can simultaneously receive multiple gateways
PUSH message;The system realizes scene composition and equipment linkage operation under multiple gateways.
Implementation:IOS first, ADNROID client, 2+ gateway (support outer net).Implementation has two kinds, 1 (1)
Trans-regional, such as one gateway is in, and a gateway is in unit.(2) same to region, i.e., under same router, mainly realize
The extension (single ZIGBEE network capacities are limited) of ZIGBEE networks;
It is trans-regional, as shown in Figure 2:
Application conditions:
1st, mobile phone and one of gateway be not under same LAN;
2nd, account must and gateway there is no an absolute incidence relation, i.e., mobile phone is logged in and is independent of whether gateway is opened;
3rd, high in the clouds save and all gateways binding table.
Application process and flow:
1st, mobile phone login account, such as cell-phone number or Email Accounts.
2nd, after server authentication passes through, generation SESSION (session control) simultaneously returns to client.So mobile phone terminal is just
Communicated by sessionid (session control ID, session control mark).
3rd, mobile phone terminal passes through the sessionid for obtaining, request to all list of gateways under account.(binding procedure presses factory
Family is different, is exactly in general to realize that an account is associated with multiple gateway)
4 then mobile phone to Intranet broadcast, judge whether the gateway of Intranet.
5th, if it find that Intranet gateway, then mobile phone terminal sets up Intranet connection, then straight for gateway in list not in Intranet
Connect and set up service end connection, and service end connected mode, can be that the shared connection of multiple gateways economizes on resources to reach
Purpose.
6th, after connection is set up, the equipment of all gateways is collected and shows together by APP ends.
7th, when a battery limits control is opened, such as switch command is sent, then while order is sent, is disappeared
Breath can carry gateway ID, can thus realize the control to multiple gateway.
Same region, as shown in Figure 3:
Application conditions:
1st, mobile phone and all gateways are under same LAN;
2nd, account must and gateway there is no an absolute incidence relation, i.e., mobile phone is logged in and is independent of whether gateway is opened;
3rd, high in the clouds save and all gateways binding table.
Application process and flow:
1st, mobile phone login account, such as cell-phone number or Email Accounts.
2nd, after server authentication passes through, generate SESSION and return to client.So mobile phone terminal just passes through
Sessionid communicates.
3rd, mobile phone terminal passes through the sessionid for obtaining, request to all list of gateways under account.(binding procedure presses factory
Family is different, is exactly in general to realize that an account is associated with multiple gateway)
4 then mobile phone to Intranet broadcast, judge whether the gateway of Intranet.
5th, if it find that Intranet gateway, then mobile phone terminal sets up Intranet connection.
6th, after connection is set up, the equipment of all gateways is collected and shows together by APP ends.
7th, when a battery limits control is opened, such as switch command is sent, then while order is sent, is disappeared
Breath can carry gateway ID.But message is intended for the account of the specific connection of Intranet.In this case, control message does not walk cloud completely
End.
It is exactly above the connected mode of multi-gateway model, in actual use, SERVER ends use MQTT (Message
Queuing Telemetry Transport, message queue remote measurement transmission) clustered deploy(ment), between mobile phone, gateway and server
Transmission, it is so-called using a kind of JSON (JavaScript Object Notation are data interchange formats of lightweight) form
Data medium.
In communication process, by the UUID of gateway, the SESSIONID of mobile phone terminal realizes data transfer.
Gateway UUID:It is the unique identification ID of gateway, can be sent out by it to gateway hair message.
SESSIONID:It is unique ID of mobile phone terminal, APP must carry SESSIONID when sending every time, then gateway is passed through
Treatment is crossed, APP can be returned message to according to this ID.Data interaction can thus be realized.
Embodiment two
1st, service end multiple gateway and multi-client message are forwarded
A, each gateway possess a UUID.
B, server support that multiple gateways are connected simultaneously.
C, forwarding server with UUID as Target id, to gateway forwards message.
2nd, APP clients multiple gateway/server connection
A, APP keep multiple gateways connections, and, with UUID as reference, how many UUID are with regard to how many company for establishment of connection
Connect.These are connected with the connection of LAN, the connection for also having wide area network.
B, LAN connection are, interior off the net, and APP can directly search gateway and will set up LAN connection, can
In this case it is that APP directly sends control instruction without server to gateway to improve real-time.
C, wide area network connection are, outer off the net, and APP directly passes through 4G or WIFI connection servers, by server
Control instruction is sent to gateway.
3rd, multiple gateway message is pushed
A, gateway messages are pushed and pushed with UUID, so as under realizing multiple gateway pattern, user can simultaneously receive multiple nets
The PUSH message of pass.
4th, multiple gateway scene and linkage
A, scene composition and the equipment linkage operation that can be realized under multiple gateways.
Multiple gateway of the present invention |
Common approach |
One account can simultaneously control multiple gateways |
One account can only control a gateway |
Multiple gateway scene and control linkage |
The equipment linkage under single gateway can only be realized |
|
|
The technology contrast table of table 1
In sum, Internet of Things multiple gateway system proposed by the present invention, by many account multiple gateway patterns, an account can
To control multiple associated gateways simultaneously.So facilitate user while controlling or being to look at the home environment of two places.
Here description of the invention and application are illustrative, are not wishing to limit the scope of the invention to above-described embodiment
In.The deformation and change of embodiments disclosed herein are possible, real for those skilled in the art
The replacement and equivalent various parts for applying example are known.It should be appreciated by the person skilled in the art that not departing from the present invention
Spirit or essential characteristics in the case of, the present invention can in other forms, structure, arrangement, ratio, and with other components,
Material and part are realized.In the case where scope and spirit of the present invention are not departed from, embodiments disclosed herein can be entered
Other deformations of row and change.