A kind of ZigBee telepilot long-range control method
Technical field
The present invention relates to wireless communication technology field, especially for the control method of the remote controlled terminal device of a kind of ZigBee telepilot.
Background technology
Along with the development of Internet of Things industry, the remote control equipment demand for stability on market is more and more vigorous, and particularly little, the easy networking of power consumption, data transmission be stable, can the product of upstream device state.
ZigBee technology be one closely, low complex degree, low-power consumption, low rate, the bidirectional wireless communication technology of low cost, because it has above-mentioned technical characterstic, it is applied on wireless electronic product gradually, as: Smart Home, the fields such as intelligent medical, current ZigBee wireless electronic product in use, all by coordinating gateway device and high in the clouds processing enter to realize controlled in wireless, when using ZigBee telepilot control ZigBee device end, be broadly divided into following several implementation: (1) ZigBee telepilot sends instruction directly to the ZigBee terminal device in ZigBee-network, (2) ZigBee telepilot sends instruction to the gateway device in ZigBee-network, is transmitted to ZigBee terminal device by gateway device.Current ZigBee telepilot is all the control mode based on local ZigBee gateway device, namely ZigBee signal only transmits in local ZigBee-network, and the continuous increase of application places along with gateway device, there is different gateway devices in different places, the demand that ZigBee telepilot passes through gateway device will constantly promote.Be directed to ZigBee telepilot in prior art only can realize carrying out to the ZigBee terminal device of this locality the growth requirement that controlled in wireless does not reach ZigBee-network far away.Therefore how ZigBee telepilot is realized carrying out to ZigBee terminal device the important topic that remote wireless control becomes those skilled in the art's research.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of ZigBee telepilot long-range control method, to solve the problem that ZigBee telepilot in prior art cannot realize carrying out the ZigBee terminal device be not in same ZigBee-network Wireless remote control, and the problem of Wireless remote control must be carried out to ZigBee terminal device by equipment for surfing the net.
For achieving the above object, a kind of ZigBee telepilot long-range control method of the present invention, it is based on ZigBee-network system, and this system comprises: ZigBee telepilot, multiple gateway device, ZigBee terminal device and cloud server, and the method comprises:
Time initial, ZigBee telepilot is carried out networking with multiple gateway device respectively, and the ZigBee terminal device in the button on ZigBee telepilot and at least one gateway device network is carried out control bind;
1) ZigBee-network of ZigBee remote controller searches region, and automatically add in the ZigBee-network of region networking;
2) key command that sends of the ZigBee remote control external world, and the key command received is analyzed, whether what judge the corresponding control of key command is ZigBee terminal device in the network of place, if "Yes", enters step 3); If "No", enter step 5);
3) key command information is directly sent to the corresponding ZigBee terminal device controlled in network by ZigBee-network by ZigBee telepilot;
4) ZigBee terminal device is according to the corresponding instruction action of key command information and executing received, and terminates;
5) key command information is sent to the gateway device in the ZigBee-network of place by ZigBee telepilot, and key command information is transmitted to cloud server by Ethernet by gateway device;
6) cloud server carries out analyzing and processing to the key command information received, and obtains gateway device corresponding to key command information and ZigBee terminal device;
7) key command information is sent to corresponding gateway device by Ethernet, and be transmitted to ZigBee terminal device by gateway device and perform corresponding instruction action.
Preferably, when initial, after ZigBee telepilot carries out networking with multiple gateway device respectively, generation has added the list of network automatically in it, and stores and eachly add network of network identifier (PAN-ID) and netkey; Button on ZigBee telepilot is carrying out after control binds, storing the id information of each ZigBee terminal device, bunch information with the ZigBee terminal device in network, and the network identifier of ZigBee terminal device corresponding gateway equipment and netkey.
Preferably, specifically comprise in above-mentioned step 1: during the ZigBee-network of ZigBee remote controller searches region, if there is the ZigBee-network of multiple networking, then it selects the network of network signal optimum automatically to add.
Preferably, specifically comprise in above-mentioned step 2: the key command information that the analysis of ZigBee telepilot receives, from the data that it stores, transfer corresponding ZigBee-network information and ZigBee terminal device information, judge that whether the ZigBee-network of correspondence in key command information is the network at current place.
Preferably, specifically comprise in above-mentioned step 6: in cloud server analysis button command information with the network identifier of map network and netkey, and according to analysis result, key command information being sent to corresponding network, the ZigBee terminal device controlled in corresponding network performs corresponding instruction action.
Preferably, also comprise in above-mentioned step 7: ZigBee terminal device feeds back to cloud server according to the status information that action can be completed after the corresponding instruction action of key command information and executing received by the gateway device of place network, cloud server is analyzed, find corresponding ZigBee telepilot, and give corresponding ZigBee telepilot by status information feedback, ZigBee telepilot sends to be reminded to user.
Beneficial effect of the present invention:
How the present invention can realize the controlled in wireless of the ZigBee terminal device to by ZigBee telepilot, comprising: local control and Long-distance Control, solves ZigBee telepilot in prior art and only can carry out the problem of controlled in wireless to the ZigBee terminal device of this locality.Meanwhile, Long-distance Control must be carried out by equipment for surfing the net to ZigBee terminal device compared to prior art, the present invention can convenient, quickly Wireless remote control is carried out to ZigBee terminal device.
Accompanying drawing explanation
Fig. 1 illustrates the flow chart of steps of ZigBee telepilot long-range control method of the present invention.
Embodiment
For the ease of the understanding of those skilled in the art, below in conjunction with embodiment and accompanying drawing, the present invention is further illustrated, and the content that embodiment is mentioned not is limitation of the invention.
With reference to shown in Fig. 1, a kind of ZigBee telepilot long-range control method of the present invention, it is based on ZigBee-network system, and this system comprises: ZigBee telepilot, multiple gateway device, ZigBee terminal device and cloud server, and the method comprises:
Time initial, ZigBee telepilot is carried out networking with multiple gateway device respectively, and the ZigBee terminal device on ZigBee telepilot in selection key and at least one gateway device network carries out control binds; After ZigBee telepilot carries out networking with multiple gateway device respectively, generation has added the list of network automatically in it, and stores and eachly add network of network identifier (PAN-ID) and netkey; Button on ZigBee telepilot is carrying out after control binds, storing the id information of each ZigBee terminal device, bunch information with the ZigBee terminal device in network, and the network identifier of ZigBee terminal device corresponding gateway equipment and netkey;
The ZigBee-network of step 101:ZigBee remote controller searches region, and automatically add in the ZigBee-network of region networking according to the list adding network stored in it; During the ZigBee-network of ZigBee remote controller searches region, if there is the ZigBee-network of multiple networking, then it selects the network of network signal optimum automatically to add; In addition, the selection of ZigBee-network also can be carried out voluntarily according to the demand of user;
(this key command comprises destination address and control information to the key command that the extraneous user of step 102:ZigBee remote control sends, destination address refers to the id information of corresponding ZigBee terminal device, control information refers to bunch information of corresponding ZigBee terminal device), and the key command received is analyzed, whether what judge that key command correspondence controls is ZigBee terminal device in the network of place, if "Yes", enters step 103; If "No", enter step 105; Particularly, the key command information that the analysis of ZigBee telepilot receives, corresponding ZigBee-network information and ZigBee terminal device information is transferred from the data that it stores, comprise the id information of each ZigBee terminal device, bunch information, and the network identifier of ZigBee terminal device corresponding gateway equipment and netkey, judge that whether ZigBee-network corresponding in key command information is the network at current place;
Key command information is directly sent to the ZigBee terminal device in network by step 103:ZigBee telepilot by ZigBee-network;
Step 104:ZigBee terminal device, according to the corresponding instruction action of key command information and executing received, terminates;
Key command information is sent to the gateway device in the ZigBee-network of place by step 105:ZigBee telepilot, and key command information is transmitted to cloud server by Ethernet by gateway device; The key command packets of information of the above-mentioned gateway device issued in the ZigBee-network of place is containing the network identifier of the id information of ZigBee terminal device, bunch information and ZigBee terminal device corresponding gateway equipment and netkey information;
Step 106: cloud server carries out analyzing and processing to the key command information received, obtains gateway device corresponding to key command information and ZigBee terminal device;
In cloud server analysis button command information with the network identifier about map network and netkey, and according to analysis result, key command information being sent to corresponding network, the ZigBee terminal device controlled in corresponding network performs corresponding instruction action;
Step 107: key command information is sent to corresponding gateway device by Ethernet, and be transmitted to ZigBee terminal device by gateway device and perform corresponding instruction action;
ZigBee terminal device feeds back to cloud server according to the status information that action can be completed after the corresponding instruction action of key command information and executing received by the gateway device of place network, cloud server is analyzed, find corresponding ZigBee telepilot, and give corresponding ZigBee telepilot by status information feedback, ZigBee telepilot sends to be reminded to user.
In order to set forth ZigBee telepilot long-range control method of the present invention better, with reference to following instantiation, comprise: a ZigBee telepilot, a ZigBee gateway device, a 2nd ZigBee gateway device, a ZigBee intelligent switch and cloud server, wherein:
Time initial, ZigBee telepilot is carried out networking action with a ZigBee gateway device, the 2nd ZigBee gateway device by user respectively, and in ZigBee telepilot, generation has added the list of network automatically; ZigBee intelligent switch and a ZigBee gateway device are in same ZigBee-network; The button A of ZigBee telepilot is carried out bind with ZigBee intelligent switch, the unlatching of control ZigBee intelligent switch or closedown;
When ZigBee telepilot and a ZigBee gateway device are in consolidated network, button A on user's touch-control ZigBee telepilot, the ZigBee terminal device (being ZigBee intelligent switch in embodiment) that ZigBee telepilot analysis button A controls whether with consolidated network residing for a ZigBee gateway device, when obtaining after said two devices is in consolidated network, steering order information is directly sent to ZigBee intelligent switch by ZigBee-network by ZigBee telepilot, respond this instruction by ZigBee intelligent switch, and complete corresponding instruction action.
When ZigBee telepilot and the 2nd ZigBee gateway device are in consolidated network, button A on user's touch-control ZigBee telepilot, the ZigBee terminal device (being ZigBee intelligent switch in embodiment) that ZigBee telepilot analysis button A controls whether with consolidated network residing for the 2nd ZigBee gateway device, when obtaining after said two devices is not in consolidated network, ZigBee telepilot is by the id information of ZigBee intelligent switch and bunch information, network identifier and the netkey of the corresponding ZigBee gateway device of ZigBee intelligent switch send to the 2nd ZigBee gateway device, cloud server is forwarded to by it, cloud server carries out analyzing and processing to the data message received, obtain a ZigBee gateway device corresponding to data message and ZigBee intelligent switch, then steering order information is transmitted to ZigBee intelligent switch by a ZigBee gateway device, so, just the Wireless remote control of ZigBee telepilot to the ZigBee intelligent switch not in consolidated network is completed.
In the process of above-mentioned ZigBee telepilot control ZigBee intelligent switch, the action status information completed can be fed back to ZigBee telepilot by different modes by ZigBee intelligent switch, to inform the state outcome of user control terminal equipment, the mode of prompting includes but not limited to sound, pilot lamp and vibration etc.
Embody rule approach of the present invention is a lot, and the above is only the preferred embodiment of the present invention, should be understood that; for those skilled in the art; under the premise without departing from the principles of the invention, can also make some improvement, these improvement also should be considered as protection scope of the present invention.