CN107302478A - The long-range control method and system of a kind of smart home - Google Patents
The long-range control method and system of a kind of smart home Download PDFInfo
- Publication number
- CN107302478A CN107302478A CN201610236485.3A CN201610236485A CN107302478A CN 107302478 A CN107302478 A CN 107302478A CN 201610236485 A CN201610236485 A CN 201610236485A CN 107302478 A CN107302478 A CN 107302478A
- Authority
- CN
- China
- Prior art keywords
- smart home
- remote control
- mqtt
- equipment
- control equipment
- 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
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/2816—Controlling appliance services of a home automation network by calling their functionalities
- H04L12/2818—Controlling appliance services of a home automation network by calling their functionalities from a device located outside both the home and the home network
Abstract
The present invention provides the long-range control method and system of a kind of smart home, and its method includes:Each smart home hardware device and remote control equipment are accessed into internet by wifi module;Communicated between each smart home hardware device and remote control equipment by MQTT modes.System includes each smart home hardware device, remote control equipment, wifi module and MQTT servers, wherein, each smart home hardware device and remote control equipment access internet by wifi module, each smart home hardware device and remote control equipment are connected with MQTT servers respectively, to make to be communicated by MQTT modes between each smart home hardware device and remote control equipment.Each equipment is accessed internet by the present invention by wifi module, so that each equipment can carry out remote control, and each equipment is connected into MQTT servers so that the packet transmitted between each equipment is small, and call duration time is shorter.
Description
Technical field
The present invention relates to technical field of intelligent home control, more particularly to a kind of remote control of smart home
Method and system.
Background technology
With the development of technology of Internet of things, internet of things equipment is in explosive increase, and various equipment are directly networked
It is a kind of trend, but is due to the fourth edition (Internet Protocol, abbreviation IPV4) of Internet protocol
The limitation of technology and the complexity of network environment so that the communication of various equipment must adapt to poor net
Network environment, includes the real-time control of the real-time Transmission and equipment of data.
And the communication mode that intelligent home control system is used on the market at present is varied, if any line traffic control
Mode processed, or using the side of bluetooth, zigbee or wifi composition LANs to equipment progress controlled in wireless
Formula, it is well known that, wired control mode is easily by certain limitation, and above-mentioned wireless controlled
Its control range of mode processed is also by certain limitation, so that remote control can not be carried out.
The content of the invention
It is an object of the invention to provide a kind of long-range control method of smart home and system, to solve
The problem of intelligent home control system can not carry out remote control in the prior art.
The first aspect of the invention is to provide a kind of tele-control system of smart home, including each intelligence
Energy household hardware device, remote control equipment, wifi module and MQTT servers, wherein, each intelligence
Energy household hardware device and remote control equipment access internet by wifi module, and each smart home is hard
Part equipment and remote control equipment are connected with MQTT servers respectively, so that each smart home hardware is set
It is standby to be communicated between remote control equipment by MQTT modes.
Further, in addition to MySQL modules and RestAPI modules, wherein, MySQL modules
Be connected with MQTT servers, RestAPI modules respectively with MySQL modules and remote control equipment
Connection, MySQL modules are used to store the facility information that user basic information and user are possessed,
RestAPI modules are used to be communicated with remote control equipment.
Further, the MQTT primary modules and MQTT that MQTT servers include being sequentially connected are used
Family authentication module.
Further, wifi module uses ESP8266.
Further, remote control equipment includes mobile phone, tablet personal computer or computer.
Another aspect of the present invention is to provide a kind of long-range control method of smart home, including:
Each smart home hardware device and remote control equipment are accessed into internet by wifi module;
Communicated between each smart home hardware device and remote control equipment by MQTT modes.
Beneficial effect using the invention described above technical scheme is:Each equipment is accessed by wifi module mutual
Networking, so that each equipment can carry out remote control, and is connected to MQTT services by each equipment
Device so that the packet transmitted between each equipment is small, and call duration time is shorter.
Brief description of the drawings
Fig. 1 is the structural representation of the tele-control system of smart home of the present invention;
Fig. 2 is the long-range control method flow chart of smart home of the present invention;
Fig. 3 is the flow chart of control method of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with this hair
Accompanying drawing in bright embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described,
Obviously, described embodiment is a part of embodiment of the invention, rather than whole embodiments.
The invention discloses a kind of tele-control system of smart home, as shown in figure 1, including each intelligence
Can household hardware device (including hardware device 10A, 10B ..., 10N), remote control equipment
(including remote control equipment 11A, 11B ..., 11N), wifi module 12 and message queue
(Message Queuing Telemetry Transport, abbreviation MQTT) server 13 is transmitted in remote measurement,
Wherein, each smart home hardware device (including hardware device 10A, 10B ..., 10N) it is and remote
Program control control equipment (including remote control equipment 11A, 11B ..., 11N) pass through wifi module
12 access internets, each smart home hardware device and remote control equipment are serviced with MQTT respectively
Device 13 is connected, so as to can pass through MQTT between each smart home hardware device and remote control equipment
Mode is communicated.
In embodiments of the present invention, MQTT servers 13 include the MQTT primary modules being sequentially connected
131 and MQTT user authentication modules 132.In addition, the tele-control system of the smart home may be used also
With including Relational DBMS MySQL modules 14 and RestAPI modules 15, wherein,
MySQL modules 14 are connected with MQTT servers 13, RestAPI modules 15 respectively with MySQL
Module 14 and remote control equipment connection.In the present embodiment, MySQL modules 14 specifically for
Storage user basic information and the facility information that is possessed of user, RestAPI modules 15 be then used for it is remote
Program control control equipment is communicated.
Specifically, each hardware device is directly accessed internet, each hardware device by the present invention using wifi
Be connected to data relay server, each hardware device and remote control equipment respectively with MQTT servers
Connection so that all hardware devices just directly can carry out remote control by remote control equipment.
In the present embodiment, the communication between each hardware device and remote control equipment is solved using MQTT
The problem of various network environments, because MQTT communication data packets are smaller, transmit an instruction consumption
Time is shorter, and specifically for various complicated Environment Designs, it supports network address translation
(Network Address Translation, abbreviation NAT) network, so that packet can be more
More accurately arrive at soon, realize the function of controlling in real time.
In the present embodiment, remote control equipment can be mobile phone, tablet personal computer or computer, in this reality
Apply in example and illustrated by taking mobile phone as an example.When each hardware device and remote control equipment are serviced with MQTT
After device connection, authentication can be carried out according to predefined username and password in equipment, wherein,
Username and password dispatch from the factory it is preset in a device;Authentication is after further according to predefined
Parameter carries out topic subscription, the topic parameter of subscription be by by device chip sequence number add some with
Machine number after md5 encryption by what is generated, and this sequence number can be generated as Quick Response Code with convenient use;
Then control instruction is sent by mobile phone terminal, server end forwards the instruction to be set to the hardware for subscribing to topic
It is standby, and then realize remote real_time control.
In the above-described embodiments, wifi module can specifically use ESP8266 as core component, and
Router is connected using SmartConfig technologies, mobile phone terminal obtains mobile phone and now connects wifi's automatically
Connection button is clicked on after SSID, user's input wifi passwords, mobile phone will be sent to each channel
Include the broadcast packet of router SSID and password, wifi module is decoded after receiving broadcast packet
Router SSID and password are connected to router.For example, can be inputted by mobile phone A pp
Router password, and this password is passed into equipment by SmartConfig agreements, equipment will be route
Device information writes Flash, and then realizes the hardware device access interconnection without man-machine interface simply
Net.
Each hardware device is controlled using MQTT agreements, packet is smaller, possesses service quality
(Quality of Service, abbreviation QoS) grading control, so as to flexibly control communication quality,
When QoS be 0 when server push primary information, when QoS be 1 when client at least
A message is received, client just receives a message when QoS is 2, so as to ensure letter
Arrival rate is ceased, MQTT communications are subscription/publication mechanism, and some topic releases news to server,
All equipment (including mobile phone A pp and each hardware device) for subscribing to this topic can receive letter
Breath.In the present embodiment, possessed using MySQL modules storage user basic information and user
Facility information, server end is using HyperText Preprocessor (Hypertext Preprocessor, abbreviation
Php) read-write MySQL modules manage user basic information and its own facility information, and lead to
RestAPI is crossed to communicate with cell-phone customer terminal.Mobile phone terminal then passes through server authentication and reading service
Device end RestAPI facility informations generate corresponding list of devices, and send control instruction and server
Communication, to realize the control to hardware device.
In the present embodiment, server receives control instruction by MQTT agreements and pushes these first
Instruct and control in real time is realized in equipment, server end pushes control instruction and realizes equipment to mobile phone App
State synchronized is shown.Then, server end carries out user authentication by php+MySQL databases,
User authentication can just send and receive instruction after.And mobile phone terminal, then need to support
SmartConfig agreements, so as to very simple configuration route-map to equipment, connect equipment
Enter internet.Mobile phone is communicated by member's mechanism with server end, resolution server
List of devices data of return etc. are held, so as to send control letter to server by MQTT agreements
Breath.
Each equipment is accessed internet by the present invention by wifi module, so that each equipment can be carried out
Remote control, and each equipment is connected to MQTT servers so that the data transmitted between each equipment
Bag is small, and call duration time is shorter.
The invention also discloses a kind of long-range control method of smart home, as shown in Fig. 2 this method
It may include steps of:
Step S201, each smart home hardware device and remote control equipment are connect by wifi module
Enter internet;
Step S202, MQTT side is passed through between each smart home hardware device and remote control equipment
Formula is communicated.
Foundation and above-described embodiment of specific access interconnection network method and communication mode in the present embodiment
Described is similar, and here is omitted.
Below by way of specific embodiment furtherly of the invention control method, as shown in figure 3, bag
Include following steps:
Step S301, upper electricity is carried out to each equipment;
Step S302, judges whether to read wifi information;If can be with, step S303 be performed,
Otherwise step S304 is performed;
In the present embodiment, it can read and deposit into itself Flash first when an equipment starts
The router wifi information of storage, including SSID and router password are to be networked, when read from
When the wifi information that is stored with body Flash, then step S303 is performed;When reading itself Flash
In without any wifi information is stored when, then perform step S304.
Step S303, connects wifi;
It can be connected according to prompting input after wifi password, input wifi passwords, click on determination and press
Button, mobile phone can be to all channels broadcast router wifi information, and equipment receives decoding after packet
Go out corresponding data, and store to itself Flash, used when so as to start next time, and be connected to
Router.
Step S304, opens SmartConfig patterns;
In this step, SmartConfig patterns can be opened, and wait mobile phone to be its configuration route
Device information.
Step S305, judge wifi whether successful connection;If successful connection, step S306 is performed,
Otherwise step S307 is performed;
Step S306, at equal intervals the time send heartbeat packet to judge whether wifi disconnects;If wifi does not have
There is disconnection then to perform step S308, otherwise perform step S309;
Step S307, judges whether to exceed connection number of times;Execution step is returned if being not above
S303, otherwise performs step S304;
Step S308, connects MQTT servers;
Step S309, judges whether MQTT connections disconnect, and step S308 is performed if then returning,
Otherwise step S312 is performed;
Step S310, into subscription topic;
Step S311, carries out authentication;
Step S312, is confirmed whether to receive instruction;If then performing step S313, otherwise return and hold
Row step S306.
Step S313, takes action.
In the present embodiment, when equipment gets wifi information, corresponding wifi is connected to, once
WiFi, which disconnects, may turn on reconnect, it is ensured that equipment not suspension.Equipment is led to after being connected to wifi
Cross MQTT agreements and be connected to server with server handshaking, a heartbeat packet is sent at regular intervals
Ensure that MQTT connections are not turned off, be unobstructed, the equipment connection clothes for ensureing the push of MQTT information
Cell-phone customer terminal, which is waited for, after business device success sends control instruction.When MQTT disconnects, also can
Connect immediately, if do not reconnected within a period of time, server can subscribe to what this said to all
The equipment or App of topic issue the information that this equipment goes offline, and MQTT when Wifi disconnects
Also it can disconnect therewith.
After the completion of networking, mobile phone can inquire about logged-in user all devices under one's name to MySQL first
List is simultaneously shown, is to be sent out by MQTT agreements when using mobile phone A pp controls
Instruction is sent to arrive server;Server is received after MQTT information will be by entrained in information
Topic is pushed in the equipment of all this topics of subscription;Equipment is received after server push information
The relevant action corresponding to instruction, such as the toning and opening and closing of RGB light etc. will be taken, other
The mobile phone A pp for subscribing to this topic receives the state of this synchronous secondary control of meeting after information, accomplishes state
Real-time display.
The present invention sends heartbeat packet using timing and is connected with server, rather than using long connection and service
Device is connected, so as to mitigate server stress, is greatly increased server concurrent connection number amount, is reduced into
This.
One of ordinary skill in the art will appreciate that:Realize all or part of step of above-mentioned each method embodiment
Suddenly it can be completed by the related hardware of programmed instruction.Foregoing program can be stored in a computer can
Read in storage medium.The program upon execution, performs the step of including above-mentioned each method embodiment;And
Foregoing storage medium includes:ROM, RAM, magnetic disc or CD etc. are various can be with store program codes
Medium.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than right
It is limited;Although the present invention is described in detail with reference to foregoing embodiments, this area it is common
Technical staff should be understood:It can still modify to the technical scheme described in foregoing embodiments,
Or equivalent substitution is carried out to which part or all technical characteristic;And these modifications or replacement, and
The essence of appropriate technical solution is not set to depart from the scope of various embodiments of the present invention technical scheme.
Claims (6)
1. a kind of tele-control system of smart home, it is characterised in that set including each smart home hardware
Standby, remote control equipment, wifi module and MQTT servers, wherein, each smart home hardware
Equipment and remote control equipment access internet by wifi module, each smart home hardware device and
Remote control equipment is connected with the MQTT servers respectively, so that each smart home hardware device
Communicated between remote control equipment by MQTT modes.
2. the tele-control system of smart home according to claim 1, it is characterised in that also wrap
MySQL modules and RestAPI modules are included, the MySQL modules connect with the MQTT servers
Connect, the RestAPI modules are connected with the MySQL modules and remote control equipment respectively, described
MySQL modules are used to store the facility information that user basic information and user are possessed, the RestAPI
Module is used to be communicated with the remote control equipment.
3. the tele-control system of smart home according to claim 2, it is characterised in that described
MQTT servers include the MQTT primary modules and MQTT user authentication modules being sequentially connected.
4. the tele-control system of the smart home according to any one of claims 1 to 3, its feature
It is, the wifi module uses ESP8266.
5. the tele-control system of the smart home according to any one of claims 1 to 3, its feature
It is, the remote control equipment includes mobile phone, tablet personal computer or computer.
6. a kind of long-range control method of smart home, it is characterised in that including:
Each smart home hardware device and remote control equipment are accessed into internet by wifi module;
Communicated between each smart home hardware device and remote control equipment by MQTT modes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610236485.3A CN107302478A (en) | 2016-04-14 | 2016-04-14 | The long-range control method and system of a kind of smart home |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610236485.3A CN107302478A (en) | 2016-04-14 | 2016-04-14 | The long-range control method and system of a kind of smart home |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107302478A true CN107302478A (en) | 2017-10-27 |
Family
ID=60137994
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610236485.3A Pending CN107302478A (en) | 2016-04-14 | 2016-04-14 | The long-range control method and system of a kind of smart home |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107302478A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108270855A (en) * | 2018-01-15 | 2018-07-10 | 司中明 | A kind of method of platform of internet of things access device |
CN110233874A (en) * | 2019-05-08 | 2019-09-13 | 百度在线网络技术(北京)有限公司 | Information transferring method and device for internet of things equipment |
CN110266801A (en) * | 2019-06-24 | 2019-09-20 | 宁波中车时代电气设备有限公司 | A kind of gate monitoring system and method based on subscription Issuance model |
CN110602674A (en) * | 2019-08-22 | 2019-12-20 | 深圳市云顶信息技术有限公司 | Control method, device and equipment of electric toothbrush and readable medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103079176A (en) * | 2012-12-31 | 2013-05-01 | Tcl集团股份有限公司 | Method and system for remotely controlling electronic equipment, mobile terminal and electronic equipment |
CN104333595A (en) * | 2014-11-11 | 2015-02-04 | 深圳小蛋科技有限公司 | Method and system for transmitting information |
CN104539712A (en) * | 2014-12-31 | 2015-04-22 | 广东德豪润达电气股份有限公司 | Intelligent household appliance data transmission method |
CN104639625A (en) * | 2015-01-27 | 2015-05-20 | 华南理工大学 | Data concentrator acquisition control method based on MQTT (Message Queuing Telemetry Transport), data concentrator acquisition control device based on MQTT and data concentrator acquisition control system based on MQTT |
CN104954456A (en) * | 2015-06-08 | 2015-09-30 | 陈广宁 | Mobile Internet of Things management and control system |
CN204740485U (en) * | 2015-01-23 | 2015-11-04 | 游江 | Wifi connection control module of intelligence house |
-
2016
- 2016-04-14 CN CN201610236485.3A patent/CN107302478A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103079176A (en) * | 2012-12-31 | 2013-05-01 | Tcl集团股份有限公司 | Method and system for remotely controlling electronic equipment, mobile terminal and electronic equipment |
CN104333595A (en) * | 2014-11-11 | 2015-02-04 | 深圳小蛋科技有限公司 | Method and system for transmitting information |
CN104539712A (en) * | 2014-12-31 | 2015-04-22 | 广东德豪润达电气股份有限公司 | Intelligent household appliance data transmission method |
CN204740485U (en) * | 2015-01-23 | 2015-11-04 | 游江 | Wifi connection control module of intelligence house |
CN104639625A (en) * | 2015-01-27 | 2015-05-20 | 华南理工大学 | Data concentrator acquisition control method based on MQTT (Message Queuing Telemetry Transport), data concentrator acquisition control device based on MQTT and data concentrator acquisition control system based on MQTT |
CN104954456A (en) * | 2015-06-08 | 2015-09-30 | 陈广宁 | Mobile Internet of Things management and control system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108270855A (en) * | 2018-01-15 | 2018-07-10 | 司中明 | A kind of method of platform of internet of things access device |
CN108270855B (en) * | 2018-01-15 | 2021-06-29 | 司中明 | Method for accessing Internet of things platform to equipment |
CN110233874A (en) * | 2019-05-08 | 2019-09-13 | 百度在线网络技术(北京)有限公司 | Information transferring method and device for internet of things equipment |
CN110233874B (en) * | 2019-05-08 | 2022-02-18 | 百度在线网络技术(北京)有限公司 | Information transmission method and device for Internet of things equipment |
CN110266801A (en) * | 2019-06-24 | 2019-09-20 | 宁波中车时代电气设备有限公司 | A kind of gate monitoring system and method based on subscription Issuance model |
CN110602674A (en) * | 2019-08-22 | 2019-12-20 | 深圳市云顶信息技术有限公司 | Control method, device and equipment of electric toothbrush and readable medium |
CN110602674B (en) * | 2019-08-22 | 2022-09-30 | 深圳市云顶信息技术有限公司 | Method, device and equipment for controlling electric toothbrush and readable medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102893572B (en) | For online communication session registered client computing equipment | |
EP3169086A1 (en) | Connection method for multimedia playing device, master device, control terminal, and system | |
CN110268729A (en) | To Internet of Things (IOT) equipment supply equipment and/or Line sharing ability | |
US20090282130A1 (en) | Resource sharing via close-proximity wireless communication | |
CN108769009A (en) | Data communications method, smart machine and intelligent gateway | |
CN104995900B (en) | Link layer information is specified in URL | |
CN103957580B (en) | A kind of WIFI quickly networkings matching method and module for Intelligent hardware | |
CN107302478A (en) | The long-range control method and system of a kind of smart home | |
CN104135443B (en) | Router control method and device | |
CN107211029A (en) | Discovery and connection to service controller | |
CN104702608A (en) | WiFi sharing system | |
WO2019134595A1 (en) | Configuration system, client device, embedded device configuration method, and storage medium | |
CN108781473A (en) | A kind of method and apparatus of the shared file between different terminals | |
CN104410982B (en) | Terminal polymerization and reconstructing method in a kind of Wireless Heterogeneous Networks | |
JP2015211474A (en) | Method for opening communication path using relay server active connection for mobile terminal | |
CN103597884B (en) | Method and apparatus for the electrical management to UICC | |
US20160173820A1 (en) | Video Communication Method and Device | |
CN103209462A (en) | Mobile communication method, mobile communication server and mobile communication system | |
CN107509176A (en) | Method for building up and device, the computer-readable storage medium of a kind of group | |
CN105978606B (en) | Bluetooth equipment remote communication method, bluetooth equipment and client | |
CN108737231A (en) | A kind of distribution method, apparatus, computer equipment and the storage medium of smart machine | |
CN105246129B (en) | The network-building method and device of a kind of intelligent terminal | |
CN113132997B (en) | Communication method, device and system of intelligent household equipment | |
CN107181926A (en) | A kind of communication means, device and server | |
CN103229494B (en) | Service server device, service provision method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171027 |
|
RJ01 | Rejection of invention patent application after publication |