CN111781848A - Server connection method, device and system based on intelligent household equipment - Google Patents
Server connection method, device and system based on intelligent household equipment Download PDFInfo
- Publication number
- CN111781848A CN111781848A CN202010684256.4A CN202010684256A CN111781848A CN 111781848 A CN111781848 A CN 111781848A CN 202010684256 A CN202010684256 A CN 202010684256A CN 111781848 A CN111781848 A CN 111781848A
- Authority
- CN
- China
- Prior art keywords
- server
- gateway
- service request
- information
- 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
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000015654 memory Effects 0.000 claims description 22
- 241000465502 Tobacco latent virus Species 0.000 description 17
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000006855 networking Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004378 air conditioning Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000000060 site-specific infrared dichroism spectroscopy Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B15/00—Systems controlled by a computer
- G05B15/02—Systems controlled by a computer electric
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
- G05B19/4185—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
- G05B19/4185—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
- G05B19/41855—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication by local area network [LAN], network structure
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5053—Lease time; Renewal aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/26—Pc applications
- G05B2219/2642—Domotique, domestic, home control, automation, smart house
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Manufacturing & Machinery (AREA)
- Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Selective Calling Equipment (AREA)
Abstract
The invention discloses a server connection method, a device and a system based on intelligent household equipment, wherein a server is arranged in a gateway, and the method comprises the following steps: judging the connection state with the server; when detecting and determining that the current connection state is an offline state, sending a service request broadcast to a gateway; receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information; and connecting the server according to the reply message. According to the server connection method, device and system based on the intelligent home equipment, provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a server connection method, device and system based on intelligent household equipment.
Background
The smart home (home automation) is characterized in that a home is used as a platform, facilities related to home life are integrated by utilizing a comprehensive wiring technology, a network communication technology, a safety precaution technology, an automatic control technology and an audio and video technology, an efficient management system of home facilities and home schedule affairs is constructed, home safety, convenience, comfort and artistry are improved, and an environment-friendly and energy-saving living environment is realized. The intelligent home is embodied in an internet of things manner under the influence of the internet. The intelligent home is connected with various devices in the home through the Internet of things technology, and the control over the intelligent home devices is achieved.
Most of the existing smart homes adopt an AP network distribution mode to realize network connection. The specific distribution process is as follows: the method comprises the steps that an AP mode is started by equipment, a mobile phone is used in the STA mode, the mobile phone is connected with equipment AP to form a local area network (namely SSID sent by the mobile phone connection equipment), the mobile phone sends WIFI information needing to be connected and relevant information of a server in a gateway to the equipment needing to be distributed, and the equipment completes connection according to received WIFI information.
By adopting the AP distribution network, the WiFi information and the server information can be simultaneously informed to the equipment, however, some existing equipment cannot enter an AP mode or are gateways directly connected through network cables. Such equipment can easily join in the LAN of gateway, but can't pass through the cell-phone and join in marriage net APP and obtain server information. This results in the device being unable to connect the cloud server, and unable to realize the overall control of the cloud.
Disclosure of Invention
In view of this, embodiments of the present invention provide a server connection method, device and system based on smart home devices, so as to solve the technical problem that some existing smart home devices cannot connect to a server, and thus cannot realize overall control of a cloud.
The technical scheme provided by the invention is as follows:
the first aspect of the embodiments of the present invention provides a server connection method based on smart home devices, where the server is disposed in a gateway, and the server connection method includes: judging the connection state with the server; when detecting and determining that the current connection state is an offline state, sending a service request broadcast to a gateway; receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information; and connecting the server according to the reply information.
Further, connecting the server according to the reply message includes: acquiring server information according to the reply information; determining a domain name and a port of a server according to the server information; and connecting the server according to the domain name and the port.
Further, the server connection method based on the smart home device further includes: and after detecting and confirming that the connection with the server is successful, communicating with the cloud through the gateway.
Further, the service request broadcast and the reply message are transmitted according to a user datagram protocol; the service request broadcast and the reply information are encoded according to TLV format.
A second aspect of the embodiments of the present invention provides a server connection device based on smart home devices, where a server is disposed in a gateway, and the server connection device includes: the connection judging module is used for judging the connection state with the server; the broadcast sending module is used for sending a service request broadcast to the gateway when detecting and determining that the current connection state is an offline state; the information receiving module is used for receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information; and the connection module is used for connecting the server according to the reply information.
A third aspect of the embodiments of the present invention provides a server connection method based on smart home devices, where the server is disposed in a gateway, and the server connection method includes: receiving a service request broadcast sent by intelligent household equipment; and sending reply information to the intelligent household equipment according to the service request broadcast, wherein the reply information comprises server information.
A fourth aspect of the embodiments of the present invention provides a server connection device based on smart home devices, where the server is disposed in a gateway, and the server connection device includes: the broadcast receiving module is used for receiving a service request broadcast sent by the intelligent household equipment; and the reply module is used for sending reply information to the intelligent household equipment according to the service request broadcast, wherein the reply information comprises server information.
A fifth aspect of an embodiment of the present invention provides a server connection system based on an intelligent home device, including: the intelligent home equipment judges the connection state with the server, and sends a service request broadcast to the gateway when detecting and determining that the current connection state is an offline state; the gateway receives a service request broadcast sent by the intelligent home equipment, and sends reply information to the intelligent home equipment according to the service request broadcast, wherein the reply information comprises server information; and the intelligent home equipment receives reply information sent by the gateway according to the service request broadcast, and is connected with the server according to the reply information.
A sixth aspect of the present embodiment provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, where the computer instruction is configured to enable a computer to execute the method for connecting a server based on smart home devices according to any one of the first aspect and the first aspect of the present embodiment, or execute the method for connecting a server based on smart home devices according to the second aspect of the present embodiment.
A seventh aspect of the embodiments of the present invention provides an intelligent home terminal, including: the server connection method based on the smart home devices according to any one of the first aspect and the first aspect of the embodiments of the present invention is implemented by executing the computer instructions, or the server connection method based on the smart home devices according to the second aspect of the embodiments of the present invention is implemented by executing the computer instructions.
The technical scheme provided by the invention has the following effects:
according to the server connection method, device and system based on the intelligent home equipment, provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
The server connection method, the device and the system based on the intelligent home equipment provided by the embodiment of the invention can be used for the situation that the intelligent home equipment is only connected with the gateway and is not connected with the server; the method can also be used for the situation that the connection between the intelligent household equipment and the server in the gateway is interrupted when the gateway is restarted. In addition, the server connection system can also be used in other situations where a server in a gateway needs to be connected.
According to the server connection method, device and system based on the intelligent home equipment, the service request broadcast and the reply information are encoded in the TLV format, the message content is easy to analyze, the expansibility is strong, and the content variability is strong. Meanwhile, the server connection system informs the equipment of the server information without the networking stage of the intelligent equipment, so that the equipment which cannot establish connection communication with the mobile phone or the equipment which is connected with the gateway through a network cable has a way of acquiring the server information.
The server connection method, device and system based on the intelligent home equipment provided by the embodiment of the invention enrich the connection topology types of the intelligent home equipment and the gateway. This connection system can let equipment need not the direct connection gateway just can connect the server in the gateway, can design a section according to this connection system like this and do not take the gateway that gives off the wiFi function, as long as let gateway and intelligent equipment connect under the same router, the server in the gateway just can be connected through this kind of form to the intelligent equipment.
According to the server connection method, device and system based on the intelligent home equipment, provided by the embodiment of the invention, as the IP in the reply message sent by the gateway is obtained in real time, the IP received by the equipment each time the server information is obtained is the latest, and the server information in the reply message obtained by the intelligent home equipment can be real and accurate. And then can be sent to the device by this information if the gateway wants to replace another port, or opens a new port.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a block diagram of a server connection system based on smart home devices according to an embodiment of the present invention;
fig. 2 is a flowchart of a server connection method based on smart home devices according to an embodiment of the present invention;
fig. 3 is a block diagram of a server connection apparatus based on smart home devices according to an embodiment of the present invention;
fig. 4 is a block diagram of a server connection apparatus based on smart home devices according to another embodiment of the present invention;
fig. 5 is a block diagram of a server connection apparatus based on smart home devices according to another embodiment of the present invention;
fig. 6 is a block diagram of a server connection apparatus based on smart home devices according to another embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a computer-readable storage medium provided according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an intelligent home terminal provided according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present invention. The gateway 20 is developed based on a router, and has a routing function, and a server 30 is embedded therein. The smart home devices 10 may include audio/video devices, lighting systems, curtain control, air conditioning control, security systems, digital cinema systems, audio/video servers, movie cabinet systems, network appliances, and the like, and may also be other smart home devices.
As shown in fig. 1, the server connection system based on smart home devices provided in the embodiments of the present invention includes: the intelligent home device 10 and the gateway 20, the gateway 20 is provided with a server 30, wherein the intelligent home device 10 judges a connection state with the server 30, and sends a service request broadcast to the gateway 20 when detecting and determining that the current connection state is an offline state; the gateway 20 receives a service request broadcast sent by the smart home device 10, and sends reply information to the smart home device 10 according to the service request broadcast, wherein the reply information includes server information; the smart home device 10 receives the reply message broadcast by the gateway 20 according to the service request, and connects to the server 30 according to the reply message. The server may be an MQTT server.
According to the server connection system based on the intelligent home equipment provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
The server connection system based on the intelligent home equipment provided by the embodiment of the invention can be used for the situation that the intelligent home equipment is only connected with the gateway and is not connected with the server; the method can also be used for the situation that the connection between the intelligent household equipment and the server in the gateway is interrupted when the gateway is restarted. In addition, the server connection system can also be used in other situations where a server in a gateway needs to be connected.
In an embodiment, a heartbeat mechanism may be used to determine a connection state between the smart home device and the server. Specifically, when the smart home devices are in an online state, the smart home devices send fixed information to the gateway at preset time intervals; if the gateway does not receive the fixed information sent by the intelligent home equipment within 1.5 times of the preset time, the intelligent home equipment is considered to be in an off-line state, and at the moment, the gateway and the intelligent home equipment can know the fixed information. In order to reconnect the smart home device to the server in the gateway, the smart home device may send a service request broadcast to the gateway to obtain server information.
In an embodiment, before the smart home device initiates the service request broadcast, the connection state between the smart home device and the gateway is not limited as long as the device is in the local area network of the gateway. Specifically, after receiving the reply message, the smart home device may obtain the server information from the reply message, thereby confirming the domain name and the port of the server that needs to be connected.
Optionally, the service request broadcast and the reply message are transmitted according to a user datagram protocol; the service request broadcast and reply information is encoded according to TLV format. In addition, the encoding form of the broadcast and reply information for the service request can also be realized by a common character string. When a common character string is used, it is necessary to distinguish which contents in the reply message are domain names of the server and which contents are ports of the server, and to define in what form the contents are divided.
Specifically, TLVs are a variable format, meaning: type, length, Value. Wherein Type means that the field is information about a tag and an encoding format; length refers to the Length of the field that is a defined value; value means that the field indicates the actual Value. Type and Length are fixed in Length, typically 2 or 4 bytes; the Length of Value is specified by Length; also, Value of TLV may be a TLV structure, and because of this nested nature, may be used to wrap the implementation of the protocol. In addition, since the network byte sequence is uniformly used as a big end, some host byte sequences are big ends, and some host byte sequences are small ends, which are different according to different platforms. The service request broadcast and reply messages may be implemented in a small-end format.
In an embodiment, the content broadcast for the service request may include the following:
Type:0x01
value: device mac address
00 00 00 01 00 00 00 0C 34 43 45 31 37 33 30 32 46 42 38 36。
The content indicates that the type of service request broadcast is 01, the length is 12, and the content is 4CE17302FB 86. Specifically, the service request broadcast may be in this format and set according to specific content.
In an embodiment, the content for the reply message may include the following:
Type:0x02
nesting protocol:
type: 0x03, Value: server IP
Type: 0x04, Value: server port
Type: 0x05, Value: server protocol
00 00 00 02 00 00 00 2B00 00 00 03 00 00 00 0C 31 39 32 2E 31 36 382E 31 38 2E 31 00 00 00 04 00 00 00 04 36 38 38 35 00 00 00 05 00 00 00 03 7373 6C。
The content indicates that the overall type of the reply message is 02, the length is 43, the content is composed of three TLV structures, the meaning is that the domain name (IP) of the server is 192.168.18.1, the port is 6885, and the connection protocol is SSL. SSL means that a pre-issued certificate is required for a successful connection. Specifically, the reply information may be in this format and set according to the specific content.
According to the server connection system based on the intelligent home equipment, the service request broadcast and the reply information are encoded in the TLV format, the message content is easy to analyze, the expansibility is strong, and the content variability is strong. Meanwhile, the server connection system informs the equipment of the server information without the networking stage of the intelligent equipment, so that the equipment which cannot establish connection communication with the mobile phone or the equipment which is connected with the gateway through a network cable has a way of acquiring the server information.
The server connection system based on the intelligent home equipment provided by the embodiment of the invention enriches the connection topology types of the intelligent home equipment and the gateway. This connection system can let equipment need not the direct connection gateway just can connect the server in the gateway, can design a section according to this connection system like this and do not take the gateway that gives off the wiFi function, as long as let gateway and intelligent equipment connect under the same router, the server in the gateway just can be connected through this kind of form to the intelligent equipment.
According to the server connection system based on the intelligent home equipment provided by the embodiment of the invention, as the IP in the reply message sent by the gateway is obtained in real time, the IP received by the equipment each time the server information is obtained is the latest, and the server information in the reply message obtained by the intelligent home equipment can be real and accurate. And then can be sent to the device by this information if the gateway wants to replace another port, or opens a new port.
An embodiment of the present invention further provides a server connection method based on an intelligent home device, where the server is disposed in a gateway, and in an embodiment, the server connection method may be performed between the gateway and the intelligent home device, as shown in fig. 2, which is an interaction schematic diagram of the gateway and the intelligent home device, where steps S101 to S104 are steps executed by the intelligent home device, steps S201 to S202 are executed by the gateway,
step S101: and judging the connection state with the server. In particular, the server may be an MQTT server embedded in a gateway. Other types of servers are possible, as the present invention is not limited in this respect.
Step S102: and when the current connection state is detected and determined to be the offline state, sending a service request broadcast to the gateway.
In an embodiment, a heartbeat mechanism may be used to determine a connection state between the smart home device and the server. Specifically, when the smart home devices are in an online state, the smart home devices send fixed information to the gateway at preset time intervals; if the gateway does not receive the fixed information sent by the intelligent home equipment within 1.5 times of the preset time, the intelligent home equipment is considered to be in an off-line state, and at the moment, the gateway and the intelligent home equipment can know the fixed information. In order to reconnect the smart home device to the server in the gateway, the smart home device may send a service request broadcast to the gateway to obtain server information.
Optionally, before the smart home device initiates the service request broadcast, the connection state between the smart home device and the gateway is not limited as long as the device is in the local area network of the gateway.
Step S201: and receiving a service request broadcast sent by the intelligent household equipment. Optionally, the service request broadcast received by the gateway may be transmitted by the smart home device using a User Datagram Protocol (UDP). The specific encoding form can adopt TLV format.
Specifically, TLVs are a variable format, meaning: type, length, Value. Wherein Type means that the field is information about a tag and an encoding format; length refers to the Length of the field that is a defined value; value means that the field indicates the actual Value. Type and Length are fixed in Length, typically 2 or 4 bytes; the Length of Value is specified by Length; also, Value of TLV may be a TLV structure, and because of this nested nature, may be used to wrap the implementation of the protocol. In addition, since the network byte sequence is uniformly used as a big end, some host byte sequences are big ends, and some host byte sequences are small ends, which are different according to different platforms. The service request broadcast and reply messages may be implemented in a small-end format.
In an embodiment, the content broadcast for the service request may include the following:
Type:0x01
value: device mac address
00 00 00 01 00 00 00 0C 34 43 45 31 37 33 30 32 46 42 38 36。
The content indicates that the type of service request broadcast is 01, the length is 12, and the content is 4CE17302FB 86.
Specifically, the service request broadcast may be in this format and set according to specific content.
Step S202: and sending reply information to the intelligent household equipment according to the service request broadcast, wherein the reply information comprises server information.
Optionally, the specific encoding form of the reply message generated by the gateway according to the service request broadcast may adopt a TLV format. The reply information can be transmitted to the intelligent home equipment by adopting User Datagram Protocol (UDP) transmission.
In an embodiment, the content for the reply message may include the following:
Type:0x02
nesting protocol:
type: 0x03, Value: server IP
Type: 0x04, Value: server port
Type: 0x05, Value: server protocol
00 00 00 02 00 00 00 2B00 00 00 03 00 00 00 0C 31 39 32 2E 31 36 382E 31 38 2E 31 00 00 00 04 00 00 00 04 36 38 38 35 00 00 00 05 00 00 00 03 7373 6C。
The content indicates that the overall type of the reply message is 02, the length is 43, the content is composed of three TLV structures, the meaning is that the domain name (IP) of the server is 192.168.18.1, the port is 6885, and the connection protocol is SSL. SSL means that a pre-issued certificate is required for a successful connection. Specifically, the reply information may be in this format and set according to the specific content.
Step S103: and receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information. Specifically, after receiving the reply information, the gateway may obtain the domain name and the port of the server according to the reply information. Optionally, when the reply message is in the TLV format, the domain name and the port may be obtained according to the specific form of the TLV format. In addition, when the reply message is encoded by a common character string, it is necessary to determine which contents are the domain name of the server and which contents are the port of the server according to the predefined definition when analyzing the reply message.
Step S104: and connecting the server according to the reply message. Specifically, after the smart home device obtains the domain name and the port of the server, the server may be connected according to the domain name and the port.
According to the server connection method based on the intelligent home equipment, provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
The server connection method based on the intelligent home equipment provided by the embodiment of the invention can be used for the situation that the intelligent home equipment is only connected with the gateway and is not connected with the server; the method can also be used for the situation that the connection between the intelligent household equipment and the server in the gateway is interrupted when the gateway is restarted. In addition, the server connection method can also be used in other situations where a server in a gateway needs to be connected.
In an embodiment, the server connection method based on the smart home device further includes: and after detecting and confirming that the connection with the server is successful, communicating with the cloud through the gateway. Specifically, after the smart home device is successfully connected with the server in the gateway, the communication with the remote end can be realized through the server in the gateway. For example, the intelligent device is a television, and when the television is connected to the server, the information of the intelligent device needs to be actively reported, including the mac, model, and version information of the intelligent device. When the state of the device changes, for example, the volume of the television changes, a message needs to be sent to the gateway, and the gateway sends the message to the cloud. When receiving the command of the cloud control device, the gateway sends the message content to the device through the server, and after receiving the message content, the device feeds back the execution result to the gateway.
According to the server connection method based on the intelligent home equipment, the service request broadcast and the reply information are coded in the TLV format, the message content is easy to analyze, the expansibility is strong, and the content variability is strong. Meanwhile, the server connection method informs the equipment of the server information without the networking stage of the intelligent equipment, so that the equipment which cannot establish connection communication with the mobile phone or the equipment which is connected with the gateway through a network cable has a way of acquiring the server information.
The server connection method based on the intelligent home equipment provided by the embodiment of the invention enriches the connection topology types of the intelligent home equipment and the gateway. According to the connection method, the device can be connected with the server in the gateway without directly connecting the gateway, so that the gateway without the WiFi function can be designed according to the connection method, and the intelligent device can be connected with the server in the gateway in the form as long as the gateway and the intelligent device are connected with the same router.
According to the server connection method based on the intelligent home equipment, provided by the embodiment of the invention, as the IP in the reply message sent by the gateway is obtained in real time, the IP received by the equipment each time the server information is obtained is the latest, and the server information in the reply message obtained by the intelligent home equipment can be real and accurate. And then can be sent to the device by this information if the gateway wants to replace another port, or opens a new port.
An embodiment of the present invention further provides a server connection device based on an intelligent home device, where a server is disposed in a gateway, and as shown in fig. 3, the server connection device includes:
the connection judging module 1 is used for judging the connection state with the server; for details, refer to the related description of step S101 in the above method embodiment.
The broadcast sending module 2 is used for sending a service request broadcast to the gateway when detecting and determining that the current connection state is the offline state; for details, refer to the related description of step S102 in the above method embodiment.
The information receiving module 3 is used for receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information; for details, refer to the related description of step S103 in the above method embodiment.
And the connection module 4 is used for connecting the server according to the reply information. For details, refer to the related description of step S104 in the above method embodiment.
In one embodiment, as shown in fig. 4, the connection module 4 includes:
and a server information obtaining module 41, configured to obtain the server information according to the reply information.
And the connection information determining module 42 is configured to determine a domain name and a port of the server according to the server information.
And a connection sub-module 43 for connecting the server according to the domain name and the port.
In an embodiment, as shown in fig. 5, the server connection apparatus based on smart home devices further includes:
and the communication module 5 is used for detecting and confirming that the connection with the server is successful and then communicating with the cloud terminal through the gateway.
According to the server connection device based on the intelligent home equipment, provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
An embodiment of the present invention further provides a server connection device based on an intelligent home device, as shown in fig. 6, where a server is disposed in a gateway, and the server connection device includes:
the broadcast receiving module 21 is configured to receive a service request broadcast sent by the smart home device. For details, refer to the related description of step S201 in the above method embodiment.
And the reply module 22 is configured to send reply information to the smart home device according to the service request broadcast, where the reply information includes server information. For details, refer to the related description of step S202 in the above method embodiment.
According to the server connection device based on the intelligent home equipment, provided by the embodiment of the invention, the server information in the gateway can be obtained through the service request and the service reply between the intelligent home equipment and the gateway, so that the intelligent home equipment can be connected with the server through the server information, and finally the overall control of the cloud is realized. The technical problem that some existing intelligent household equipment cannot enter an AP mode or cannot be connected with a cloud server through a gateway directly connected through a network cable is solved.
For the functional description of the server connection device based on the smart home devices provided by the embodiments of the present invention, reference is made in detail to the description of the server connection method based on the smart home devices in the above embodiments.
An embodiment of the present invention further provides a storage medium, as shown in fig. 7, where a computer program 601 is stored on the storage medium, and when executed by a processor, the instructions implement the steps of the server connection method based on the smart home device in the foregoing embodiments. The storage medium is also stored with audio and video stream data, characteristic frame data, an interactive request signaling, encrypted data, preset data size and the like. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard disk (Hard disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
An embodiment of the present invention further provides an intelligent home terminal, as shown in fig. 8, the intelligent home terminal may include a processor 51 and a memory 52, where the processor 51 and the memory 52 may be connected by a bus or in another manner, and fig. 8 takes the example of connection by a bus.
The processor 51 may be a Central Processing Unit (CPU). The Processor 51 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 52, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the corresponding program instructions/modules in the embodiments of the present invention. The processor 51 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 52, that is, implements the server connection method based on the smart home device in the above method embodiment.
The memory 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 51, and the like. Further, the memory 52 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 52 may optionally include memory located remotely from the processor 51, and these remote memories may be connected to the processor 51 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 52, and when executed by the processor 51, perform the smart home device-based server connection method in the embodiment shown in fig. 1-2.
The specific details of the smart home terminal may be understood by referring to the corresponding related descriptions and effects in the embodiments shown in fig. 1 to fig. 2, which are not described herein again.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.
Claims (10)
1. A server connection method based on intelligent household equipment is characterized in that a server is arranged in a gateway, and the server connection method comprises the following steps:
judging the connection state with the server;
when detecting and determining that the current connection state is an offline state, sending a service request broadcast to a gateway;
receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information;
and connecting the server according to the reply information.
2. The server connection method based on the smart home device according to claim 1, wherein connecting the server according to the reply message comprises:
acquiring server information according to the reply information;
determining a domain name and a port of a server according to the server information;
and connecting the server according to the domain name and the port.
3. The server connection method based on the smart home device according to claim 1, further comprising: and after detecting and confirming that the connection with the server is successful, communicating with the cloud through the gateway.
4. The smart home device-based server connection method according to claim 1,
the service request broadcast and the reply message are transmitted according to a user datagram protocol;
the service request broadcast and the reply information are encoded according to TLV format.
5. The utility model provides a server connecting device based on intelligent household equipment which characterized in that, the server sets up in the gateway, server connecting device includes:
the connection judging module is used for judging the connection state with the server;
the broadcast sending module is used for sending a service request broadcast to the gateway when detecting and determining that the current connection state is an offline state;
the information receiving module is used for receiving reply information sent by the gateway according to the service request broadcast, wherein the reply information comprises server information;
and the connection module is used for connecting the server according to the reply information.
6. A server connection method based on intelligent household equipment is characterized in that a server is arranged in a gateway, and the server connection method comprises the following steps:
receiving a service request broadcast sent by intelligent household equipment;
and sending reply information to the intelligent household equipment according to the service request broadcast, wherein the reply information comprises server information.
7. The utility model provides a server connecting device based on intelligent household equipment which characterized in that, the server sets up in the gateway, server connecting device includes:
the broadcast receiving module is used for receiving a service request broadcast sent by the intelligent household equipment;
and the reply module is used for sending reply information to the intelligent household equipment according to the service request broadcast, wherein the reply information comprises server information.
8. The utility model provides a server connected system based on intelligent home equipment which characterized in that includes: the intelligent home equipment comprises intelligent home equipment and a gateway, wherein a server is arranged in the gateway,
the intelligent home equipment judges the connection state with the server, and sends a service request broadcast to the gateway when detecting and determining that the current connection state is an offline state;
the gateway receives a service request broadcast sent by the intelligent home equipment, and sends reply information to the intelligent home equipment according to the service request broadcast, wherein the reply information comprises server information;
and the intelligent home equipment receives reply information sent by the gateway according to the service request broadcast, and is connected with the server according to the reply information.
9. A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions for causing the computer to execute the smart home device-based server connection method according to any one of claims 1 to 4, or execute the smart home device-based server connection method according to claim 6.
10. The utility model provides an intelligent home terminal which characterized in that includes: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the smart home device-based server connection method according to any one of claims 1 to 4, or to perform the smart home device-based server connection method according to claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010684256.4A CN111781848A (en) | 2020-07-15 | 2020-07-15 | Server connection method, device and system based on intelligent household equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010684256.4A CN111781848A (en) | 2020-07-15 | 2020-07-15 | Server connection method, device and system based on intelligent household equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111781848A true CN111781848A (en) | 2020-10-16 |
Family
ID=72767823
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010684256.4A Pending CN111781848A (en) | 2020-07-15 | 2020-07-15 | Server connection method, device and system based on intelligent household equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111781848A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114567916A (en) * | 2022-03-01 | 2022-05-31 | 德沃康科技集团有限公司 | Production test method, device, equipment and medium based on WiFi furniture |
CN115580533A (en) * | 2021-06-30 | 2023-01-06 | 星络家居云物联科技有限公司 | Networking configuration method based on server, server and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160150463A1 (en) * | 2011-10-18 | 2016-05-26 | Texas Instruments Incorporated | Bootstrapping server for joining process in powerline communication (plc) networks |
CN106211270A (en) * | 2016-08-26 | 2016-12-07 | 四川九洲电器集团有限责任公司 | Gateway server and mobile terminal |
CN107171837A (en) * | 2017-05-11 | 2017-09-15 | 广东美的制冷设备有限公司 | Wireless network configuration method, device and system |
CN109039840A (en) * | 2018-08-06 | 2018-12-18 | 上海顺舟智能科技股份有限公司 | Zigbee network-building method and access point gateway |
CN109219943A (en) * | 2016-07-01 | 2019-01-15 | 英特尔公司 | The automatic configuration of Machine To Machine system |
CN110324215A (en) * | 2018-03-30 | 2019-10-11 | 云丁智能科技(北京)有限公司 | Intelligent door lock binding method, intelligent door lock, gateway, server and binding system |
-
2020
- 2020-07-15 CN CN202010684256.4A patent/CN111781848A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160150463A1 (en) * | 2011-10-18 | 2016-05-26 | Texas Instruments Incorporated | Bootstrapping server for joining process in powerline communication (plc) networks |
CN109219943A (en) * | 2016-07-01 | 2019-01-15 | 英特尔公司 | The automatic configuration of Machine To Machine system |
CN106211270A (en) * | 2016-08-26 | 2016-12-07 | 四川九洲电器集团有限责任公司 | Gateway server and mobile terminal |
CN107171837A (en) * | 2017-05-11 | 2017-09-15 | 广东美的制冷设备有限公司 | Wireless network configuration method, device and system |
CN110324215A (en) * | 2018-03-30 | 2019-10-11 | 云丁智能科技(北京)有限公司 | Intelligent door lock binding method, intelligent door lock, gateway, server and binding system |
CN109039840A (en) * | 2018-08-06 | 2018-12-18 | 上海顺舟智能科技股份有限公司 | Zigbee network-building method and access point gateway |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115580533A (en) * | 2021-06-30 | 2023-01-06 | 星络家居云物联科技有限公司 | Networking configuration method based on server, server and storage medium |
CN114567916A (en) * | 2022-03-01 | 2022-05-31 | 德沃康科技集团有限公司 | Production test method, device, equipment and medium based on WiFi furniture |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9973567B2 (en) | System and method for terminal management in a home network using a virtual client | |
WO2018077018A1 (en) | Networking method and device, network connection method and device, router, and smart home appliance | |
US10034057B2 (en) | Message processing method, device, gateway, STB and IPTV | |
WO2017097093A1 (en) | Implementation method for home internet of things, set top box, and internet-of-things server | |
CN107800791B (en) | Debugging method and device | |
CN102763373B (en) | The method and apparatus using the service of local network devices based on remote access | |
CN111741538B (en) | Communication link establishing method based on gateway, equipment control method and device | |
US10038664B2 (en) | Terminal status subscription method, apparatus, and system | |
CN107835257B (en) | Session management method and device | |
CN111638891B (en) | Equipment upgrading method and device, terminal equipment and storage medium | |
US10075354B2 (en) | Identification of servers by common wide area network addresses | |
CN108650142A (en) | The control method and device of multiple gateway equipment in intelligent domestic system | |
CN111781848A (en) | Server connection method, device and system based on intelligent household equipment | |
CN104584514B (en) | Apparatus and method for providing services in a communication network | |
WO2016078291A1 (en) | Method, apparatus and system for accessing file sharing server | |
US20140201376A1 (en) | Method and system for the handling of redundant long poll | |
CN108989157B (en) | Method and device for controlling intelligent equipment | |
WO2014015525A1 (en) | Method and device for querying for user online state | |
CN113938391A (en) | Network distribution method and system for gateway equipment and electronic equipment | |
CN105338398A (en) | Set top box management method, device and system | |
CN114125883A (en) | Network access method and device of intelligent device, electronic device and storage medium | |
CN117478449B (en) | Control method and device of third party equipment, electronic equipment and medium | |
TWI778771B (en) | Monitoring method, monitoring system and monitoring device of virtual machine operation | |
CN115412588B (en) | Method and device for remotely updating configuration file and electronic equipment | |
CN102571861B (en) | Remote access method, server and network system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201016 |