CN111741464B - Device connection method, master control device, controlled device, control system and medium - Google Patents

Device connection method, master control device, controlled device, control system and medium Download PDF

Info

Publication number
CN111741464B
CN111741464B CN202010707579.0A CN202010707579A CN111741464B CN 111741464 B CN111741464 B CN 111741464B CN 202010707579 A CN202010707579 A CN 202010707579A CN 111741464 B CN111741464 B CN 111741464B
Authority
CN
China
Prior art keywords
information
equipment
controlled
key
server
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.)
Active
Application number
CN202010707579.0A
Other languages
Chinese (zh)
Other versions
CN111741464A (en
Inventor
樊二锋
杨涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202010707579.0A priority Critical patent/CN111741464B/en
Publication of CN111741464A publication Critical patent/CN111741464A/en
Application granted granted Critical
Publication of CN111741464B publication Critical patent/CN111741464B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast

Abstract

The invention discloses a device connection method, which comprises the following steps: the main control device multicasts the device search information in the local area network; when address information returned by the controlled equipment through the equipment searching information is received, handshaking is carried out with the controlled equipment corresponding to the address information; and after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information. The invention also discloses a master control device, a controlled device, a control system and a readable storage medium, which improve the connection efficiency of the devices.

Description

Device connection method, master control device, controlled device, control system and medium
Technical Field
The present invention relates to the field of intelligent control, and in particular, to a device connection method, a master device, a controlled device, a control system, and a readable storage medium.
Background
In the existing device connection method, before the master control device is connected with the controlled device, the device needs to be configured or the bluetooth function of the device needs to be turned on, or the master control device and the controlled device need to be directly connected through a device connection line. Therefore, the existing equipment connection process is complicated, and the equipment connection efficiency is low.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a device connection method, a master control device, a controlled device, a control system and a readable storage medium, and aims to improve the device connection efficiency.
In order to achieve the above object, the present invention provides an apparatus connection method, which is applied to a master control apparatus, and the apparatus connection method includes the following steps:
the main control device multicasts the device search information in the local area network;
when address information returned by the controlled equipment through the equipment searching information is received, handshaking is carried out with the controlled equipment corresponding to the address information;
and after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information.
Optionally, the step of performing handshake by the controlled device corresponding to the address information includes:
sending a connection request to the controlled equipment corresponding to the address information;
when receiving connection response information sent by the controlled equipment, verifying the key information of the controlled equipment carried by the connection response information;
when the key information of the controlled equipment is successfully verified, a communication key is obtained according to the key information and is stored, so that the main control equipment and the controlled equipment carry out encryption communication through the communication key;
and sending information of successful handshake to the controlled equipment.
Optionally, before the step of multicasting the information by the device in the local area network, the main control device further includes:
after the main control equipment is accessed to the local area network, a login request is sent to a server, so that the server obtains a preset key set according to the login request, login response information is generated according to the preset key set, and the login response information is sent to the main control equipment;
after receiving the login response information, acquiring the preset key set carried by the login response information;
when receiving the device connection response sent by the controlled device, the step of verifying the key information carried by the device connection response includes:
acquiring key information carried by the equipment connection response;
and comparing preset key information in the preset key set with the key information, wherein when the preset key set has the preset key information matched with the key information, the key information is judged to be successfully verified.
Optionally, after the step of establishing a communication connection between the controlled devices corresponding to the address information after the handshake is successful, the method further includes:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a local area network control instruction according to the control information;
and encrypting the local area network control instruction, and sending the encrypted local area network control instruction to the controlled device.
Optionally, after the step of establishing a communication connection between the controlled devices corresponding to the address information after the handshake is successful, the method further includes:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a remote control instruction according to the control information;
sending the remote control instruction to a server so as to enable the server to send the remote control instruction to the controlled equipment;
and receiving the equipment control result sent by the server and outputting the equipment control result.
In addition, in order to achieve the above object, the present invention further provides an apparatus connection method, applied to a controlled apparatus, the apparatus connection method including the following steps:
when equipment search information sent by master control equipment is received, address information is obtained, and the address information is returned to the master control equipment corresponding to the equipment search information;
when receiving a connection request sent by the main control equipment, performing handshake with the main control equipment;
and after the handshake is successful, establishing communication connection with the main control equipment.
Optionally, when receiving the connection request sent by the master control device, the handshaking with the master control device includes:
when a connection request sent by the master control equipment is received, verifying key information of the master control equipment carried by the connection request;
when the key information of the main control equipment is successfully verified, a communication key is obtained according to a preset key corresponding to the key information of the main control equipment, and the communication key is stored, so that the controlled equipment and the main control equipment carry out encrypted communication through the communication key;
selecting key information of the controlled equipment in a preset key set;
generating an equipment connection response according to the key information of the controlled equipment, and sending the equipment connection response to the main control equipment;
and sending information of successful handshake to the master control equipment.
Optionally, before the step of acquiring address information and returning the address information to the main control device corresponding to the device search information when the device search information sent by the main control device is received, the method further includes:
generating a registration request according to the device information of the controlled device, and sending the registration request to a server, so that the server generates a registration response according to the registration request and sends the registration response to the controlled device;
receiving a registration response sent by the server;
when the registration response is successful, generating a key acquisition request, and sending the key acquisition request to the server, so that the server acquires the preset key set according to the key acquisition request and returns the preset key set to the controlled device;
and receiving and storing the preset key set sent by the server.
Optionally, after the step of establishing a previous communication connection with the master control device corresponding to the device search information after the handshake is successful, the method further includes:
when a local area network control command sent by the master control equipment is received, decrypting the local area network control request command;
and executing the operation corresponding to the decrypted local area network control instruction.
Optionally, after the step of returning the address information to the master control device corresponding to the device search information, the method further includes:
when a remote control instruction sent by a server is received, executing an operation corresponding to the remote control instruction;
and acquiring an execution result of the remote system instruction, and sending the execution result to the server so that the server generates an equipment control result according to the execution result.
In addition, to achieve the above object, the present invention further provides a main control device, including: a memory, a processor and a device connection program stored on the memory and executable on the processor, the device connection program when executed by the processor implementing the steps of the device connection method as described above.
In addition, to achieve the above object, the present invention further provides a controlled device, including: a memory, a processor and a device connection program stored on the memory and executable on the processor, the device connection program when executed by the processor implementing the steps of the device connection method as described above.
In addition, to achieve the above object, the present invention also provides a control system, including: the master device, the controlled device and the server are provided.
Further, to achieve the above object, the present invention also proposes a readable storage medium having stored thereon a device connection program which, when executed by a processor, implements the steps of the device connection method as described above.
In the existing device connection method, before the master control device is connected with the controlled device, the device needs to be configured or the bluetooth function of the device needs to be turned on, or the master control device and the controlled device need to be directly connected through a device connection line. Therefore, the existing equipment connection process is complicated, and the equipment connection efficiency is low.
According to the device connection method, the main control device, the controlled device, the control system and the readable storage medium provided by the embodiment of the invention, when the main control device and the controlled device are in the same local area network, the main control device and the controlled device perform handshaking, and communication connection with the controlled device is established when the handshaking is successful, so that connection between the main control device and the controlled device can be realized without additional configuration or device connection lines, and the device connection efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware architecture of a master device according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a hardware architecture of a controlled device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a system architecture of a control system according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a first embodiment of a method for connecting devices according to the present invention;
FIG. 5 is a flow chart illustrating a third embodiment of the apparatus connection method according to the present invention;
FIG. 6 is a flow chart illustrating a fourth embodiment of the apparatus connection method according to the present invention;
FIG. 7 is a schematic flow chart of a fifth embodiment of the connection method of the apparatus of the present invention;
FIG. 8 is a flowchart illustrating a sixth embodiment of the apparatus connection method of the present invention;
fig. 9 is a flowchart illustrating a seventh embodiment of the apparatus connection method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the existing device connection method, before the master control device is connected with the controlled device, the device needs to be configured or the bluetooth function of the device needs to be turned on, or the master control device and the controlled device need to be directly connected through a device connection line. Therefore, the existing equipment connection process is complicated, and the equipment connection efficiency is low.
In order to solve the foregoing drawbacks, an embodiment of the present invention provides an apparatus connection method, a master control apparatus, a controlled apparatus, a control system, and a readable storage medium, where the apparatus connection method is applied to the master control apparatus, and mainly includes the following steps:
the main control device multicasts the device search information in the local area network;
when address information returned by the controlled equipment through the equipment searching information is received, handshaking is carried out with the controlled equipment corresponding to the address information;
and after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information.
In addition, the embodiment of the invention also provides an equipment connection method, which is applied to controlled equipment and mainly comprises the following steps:
when equipment search information sent by master control equipment is received, address information is obtained, and the address information is returned to the master control equipment corresponding to the equipment search information;
when receiving a connection request sent by the main control equipment, performing handshake with the main control equipment;
and after the handshake is successful, establishing communication connection with the main control equipment.
When the master control device and the controlled device are in the same local area network, the master control device and the controlled device perform handshaking, and establish communication connection with the controlled device when the handshaking is successful, so that the connection between the master control device and the controlled device can be realized without additional configuration or device connecting lines, and the device connection efficiency is improved.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware architecture of a master device according to an embodiment of the present invention.
The main control device of the embodiment of the invention can be terminal devices such as a smart phone.
As shown in fig. 1, the master device may include: a first processor 1001, e.g. a CPU, a first user interface 1003, a first network interface 1004, a first memory 1005, a first communication bus 1002. Wherein a first communication bus 1002 is used to enable connectivity communication between these components. The first user interface 1003 may comprise a Display screen (Display), an input unit such as a keyboard, etc., and the optional first user interface 1003 may also comprise a standard wired interface, a wireless interface. The first network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The first memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The first memory 1005 may alternatively be a storage device separate from the first processor 1001.
Those skilled in the art will appreciate that the hardware architecture of the master device shown in fig. 1 does not constitute a limitation of the master device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the first memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device connection program.
In the main control device shown in fig. 1, the first network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the first processor 1001 may be configured to call a device connection program stored in the first memory 1005 and perform the following operations:
the main control device multicasts the device search information in the local area network;
when address information returned by the controlled equipment through the equipment searching information is received, handshaking is carried out with the controlled equipment corresponding to the address information;
and after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information. Further, the first processor 1001 may be configured to call a device connection program stored in the first memory 1005, and further perform the following operations:
sending a connection request to the controlled equipment corresponding to the address information;
when receiving connection response information sent by the controlled equipment, verifying the key information of the controlled equipment carried by the connection response information;
when the key information of the controlled equipment is successfully verified, a communication key is obtained according to the key information and is stored, so that the main control equipment and the controlled equipment carry out encryption communication through the communication key;
and sending information of successful handshake to the controlled equipment.
Further, the first processor 1001 may be configured to call a device connection program stored in the first memory 1005, and further perform the following operations:
after the main control equipment is accessed to the local area network, a login request is sent to a server, so that the server obtains a preset key set according to the login request, login response information is generated according to the preset key set, and the login response information is sent to the main control equipment;
after receiving the login response information, acquiring the preset key set carried by the login response information;
acquiring key information carried by the equipment connection response;
and comparing preset key information in the preset key set with the key information, wherein when the preset key set has the preset key information matched with the key information, the key information is judged to be successfully verified.
Further, the first processor 1001 may be configured to call a device connection program stored in the first memory 1005, and further perform the following operations:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a local area network control instruction according to the control information;
and encrypting the local area network control instruction, and sending the encrypted local area network control instruction to the controlled device.
Further, the first processor 1001 may be configured to call a device connection program stored in the first memory 1005, and further perform the following operations:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a remote control instruction according to the control information;
sending the remote control instruction to a server so as to enable the server to send the remote control instruction to the controlled equipment;
and receiving the equipment control result sent by the server and outputting the equipment control result.
As shown in fig. 2, fig. 2 is a schematic diagram of a hardware architecture of a controlled device according to an embodiment of the present invention.
The controlled device of the embodiment of the invention can be terminal devices such as a tablet personal computer.
As shown in fig. 2, the controlled device may include: a second processor 2001, e.g., a CPU, a second user interface 2003, a second network interface 2004, a second memory 2005, a second communication bus 2002. Wherein a second communication bus 2002 is used to enable connectivity communication between these components. The second user interface 2003 may include a Display screen (Display), an input unit such as a keyboard, etc., and the optional second user interface 2003 may also include a standard wired interface, a wireless interface. The second network interface 2004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The second memory 2005 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The second memory 2005 may alternatively be a storage device separate from the aforementioned processor 2001.
Those skilled in the art will appreciate that the hardware architecture of the controlled device shown in fig. 2 does not constitute a limitation of the controlled device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 2, the second memory 2005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device connection program.
In the controlled device shown in fig. 2, the second network interface 2004 is mainly used for connecting to a backend server and performing data communication with the backend server; the second processor 2001 may be configured to call the device connection program stored in the second memory 2005 and perform the following operations:
when equipment search information sent by master control equipment is received, address information is obtained, and the address information is returned to the master control equipment corresponding to the equipment search information;
when receiving a connection request sent by the main control equipment, performing handshake with the main control equipment;
and after the handshake is successful, establishing communication connection with the main control equipment.
Further, the second processor 2001 may be configured to invoke the device connection program stored in the second memory 2005, and also perform the following operations:
when a connection request sent by the master control equipment is received, verifying key information of the master control equipment carried by the connection request;
when the key information of the main control equipment is successfully verified, a communication key is obtained according to a preset key corresponding to the key information of the main control equipment, and the communication key is stored, so that the controlled equipment and the main control equipment carry out encrypted communication through the communication key;
selecting key information of the controlled equipment in a preset key set;
generating an equipment connection response according to the key information of the controlled equipment, and sending the equipment connection response to the main control equipment;
and sending information of successful handshake to the master control equipment.
Further, the second processor 2001 may be configured to invoke the device connection program stored in the second memory 2005, and also perform the following operations:
generating a registration request according to the device information of the controlled device, and sending the registration request to a server, so that the server generates a registration response according to the registration request and sends the registration response to the controlled device;
receiving a registration response sent by the server;
when the registration response is successful, generating a key acquisition request, and sending the key acquisition request to the server, so that the server acquires the preset key set according to the key acquisition request and returns the preset key set to the controlled device;
and receiving and storing the preset key set sent by the server.
Further, the second processor 2001 may be configured to invoke the device connection program stored in the second memory 2005, and also perform the following operations:
when a local area network control command sent by the master control equipment is received, decrypting the local area network control request command;
and executing the operation corresponding to the decrypted local area network control instruction.
Further, the second processor 2001 may be configured to invoke the device connection program stored in the second memory 2005, and also perform the following operations:
when a remote control instruction sent by a server is received, executing an operation corresponding to the remote control instruction;
and acquiring an execution result of the remote system instruction, and sending the execution result to the server so that the server generates an equipment control result according to the execution result.
As shown in fig. 3, fig. 3 is a schematic system structure diagram of a control system according to an embodiment of the present invention.
The control system includes a server 10, a master device 20, and at least one controlled device 30.
After accessing the local area network, the controlled device 30 may generate a registration request and send the registration request to the server 10. The server 10 receives the registration request sent by the controlled device 30, generates a registration response according to the registration request, and sends the registration response to the controlled device 30. The controlled device 30 receives the registration response sent by the server 10, generates a key obtaining request when the registration response is successful, and sends the key obtaining request to the server 10. The server 10 receives the key obtaining request sent by the controlled device 30, obtains a preset key set according to the key obtaining request, and sends the preset key set to the controlled device 30. The controlled device 30 receives and stores the preset key set sent by the server.
After accessing the local area network, the main control device 20 may generate a login request and send the login request to the server 10. The server 10 receives a login request sent by the main control device 20, and when the login request is successfully verified, acquires a preset key set according to the login request, generates login response information according to the preset key set, and sends the login response information to the main control device 20. The main control device 20 receives the login response information sent by the server 10, obtains the preset key set carried by the login response information, and stores the preset key set.
The master device 20 multicasts the device search instruction within the local area network. Controlled device 30 receives the device search instruction, obtains address information of controlled device 30, and sends the address information to main control device 20. The master device 20 receives the address information sent by the controlled device 30 and performs handshake with the controlled device 30. The controlled device 30 performs handshake with the master device 20 when receiving the handshake request transmitted by the master device 20. When the handshake is successful, the master control device 20 establishes a communication connection with the controlled device 30; the controlled device 30 establishes a communication connection with the master device 20.
When receiving a control instruction triggered by a user, the main control device 20 obtains control information corresponding to the control instruction, generates a local area network control instruction according to the control information, encrypts the local area network control instruction, and sends the encrypted local area network control instruction to the controlled device 30. The controlled device 30 receives the lan control instruction sent by the main control device 20, decrypts the lan control instruction, and executes an operation corresponding to the decrypted lan control instruction.
When receiving a control instruction triggered by a user, the main control device 20 obtains control information corresponding to the control instruction, generates a remote control instruction according to the control information, and sends the remote control instruction to the server 10. The server 10 receives the remote control instruction sent by the master device 20 and sends the remote control instruction to the controlled device 20. The controlled device 20 receives the remote control instruction sent by the server 10, executes an operation corresponding to the remote control instruction, then obtains an execution result of the remote control instruction, and sends the execution result to the server 10. The server 10 receives the execution result sent by the controlled device 30, generates a device control result according to the execution result, and sends the device control result to the main control device 20. The main control device 20 receives the device control result sent by the server 10 and outputs the device control result.
Referring to fig. 4, fig. 4 is a first embodiment of a device connection method of the present invention, where the device connection method is applied to a master device, and includes the following steps:
step S010, the main control device multicasts the device search information in the local area network;
step S020, when address information returned by the controlled equipment through the equipment searching information is received, handshaking is carried out with the controlled equipment corresponding to the address information;
and S030, after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information.
In this embodiment, the device search information is a data packet used by the master device to discover a controlled device, and the device search information may carry a data packet type, a multicast address, and a device type; the address information may be an IP address and a port number carried in device response information sent by the controlled device.
After the main control device accesses the local area network, the first processor receives a device control request input by a user, generates device search information according to a device type carried by the device control request, or acquires a preset device type corresponding to the device control request from the memory, generates the device search information according to the preset device type, and then multicasts the device search information in the local area network. When receiving the device response information sent by the controlled device, the first processor acquires the address information carried by the device response information.
Optionally, after the master device accesses the local area network, the first processor may also directly receive a device online notification multicast by the controlled device in the local area network, and then obtain address information carried in the device online notification.
And the first processor performs handshake with the controlled equipment corresponding to the acquired address information, and establishes communication connection with the controlled equipment after the handshake is successful.
Specifically, the step S020 further includes the steps of:
step S021, sending a connection request to the controlled equipment corresponding to the address information;
step S022, when receiving connection response information sent by the controlled device, verifying key information of the controlled device carried by the connection response information;
step S023, when the key information of the controlled device is successfully verified, obtaining and storing a communication key according to the key information, so that the master control device performs encrypted communication with the controlled device through the communication key;
and S024, sending information of successful handshake to the controlled equipment.
The connection request of the main control device may include an encryption method, key information, and a 32-byte random number, where the first 4 bytes of the 32-byte random number are a timestamp, and the last 28 bytes are a system-generated random number; the connection response information of the controlled device may include key information; the key information may be a key identification and a key length.
The first processor selects a preset key of the master control device in the preset key set, generates a connection request of the master control device according to the acquired address information and the selected preset key of the master control device, then sends the connection request of the master control device to the controlled device corresponding to the address information, acquires key information carried in the connection response information when receiving the connection response information sent by the controlled device, acquires the preset key corresponding to a key identifier in the key information in the preset key set, then acquires the length of the preset key, and judges that the key information verification of the controlled device is successful when the length of the preset key is consistent with the key length in the key information. And generating a communication key according to a preset key corresponding to the connection response information, the preset key of the master control device, the random number carried in the connection request and a preset key algorithm, and storing the communication key as the communication key between the master control device and the controlled device, so that the master control device can perform encrypted communication with the controlled device through the communication key after the master control device is connected with the controlled device. Specifically, the master control device may further notify the key change of the controlled device after the key information is successfully verified; meanwhile, the first processor can also send the information of successful handshake of the master control device to the controlled device.
In the technical scheme disclosed in this embodiment, when the master control device and the controlled device are in the same local area network, the master control device performs handshaking with the controlled device, and establishes communication connection with the controlled device when the handshaking is successful, so that connection between the master control device and the controlled device can be achieved without additional configuration or device connection lines, and the device connection efficiency is improved.
Optionally, based on the first embodiment, in a second embodiment of the device connection method of the present invention, before the step S010, the method further includes the following steps:
step S040, after the main control device accesses the local area network, sending a login request to a server, so that the server obtains a preset key set according to the login request, generates login response information according to the preset key set, and sends the login response information to the main control device;
step S050, after the login response information is received, acquiring the preset key set carried by the login response information;
the step S022 further includes the steps of:
step S0221, obtaining key information carried by the equipment connection response;
step S0222, comparing preset key information in the preset key set with the key information, wherein when preset key information matched with the key information exists in the preset key set, it is determined that the key information is successfully verified.
In this embodiment, the preset key set may be a (pre-shared key, PSK key set).
After the main control device accesses the local area network, the first processor may receive login information input by a user, generate a login request of the main control device according to the login information, and then send the login request to a server in the local area network to which the main control device belongs. The method comprises the steps that when a server receives a login request sent by a main control device, login information carried in the login request is obtained, after the login information is successfully verified, a preset key set corresponding to the login information is obtained, login response information is generated according to the preset key set, and the login response information is sent to the main control device. The first processor receives login response information sent by the server, then obtains a preset key set carried in the login response information, and then stores the preset key set into the memory.
Therefore, the first processor may perform the verification step when verifying the key information in the device connection response, which is not described herein again.
In the technical scheme disclosed in this embodiment, the login request is sent to obtain the corresponding preset key set, so that when the master control device and the controlled device perform handshake, the preset key can be selected from the preset key set, and then a communication key for communication between the master control device and the controlled device is generated, thereby improving the security of communication between the master control device and the controlled device.
Alternatively, based on the first embodiment, as shown in fig. 5, fig. 5 is a third embodiment of the device connection method of the present invention, and after the step S030, the method further includes the following steps:
step S060, when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
step S070, generating a local area network control instruction according to the control information;
and S080, encrypting the local area network control instruction, and sending the encrypted local area network control instruction to the controlled device.
In this embodiment, when receiving a control instruction triggered by a user, the first processor acquires control information corresponding to the control instruction in the memory, or acquires control information carried in the control instruction, and then generates a local area network control instruction according to the acquired control information. And acquiring a communication key corresponding to the controlled equipment controlled by the local area network control instruction, encrypting the local area network control instruction according to the communication key, and then sending the encrypted local area network control instruction to the corresponding controlled equipment so as to enable the controlled equipment to execute the operation corresponding to the control instruction.
In the technical scheme disclosed in this embodiment, after the main control device is connected to the controlled device, the lan control instruction is generated to control the controlled device, and the lan control instruction is encrypted, thereby improving the reliability of the control process.
Alternatively, based on the first embodiment, as shown in fig. 6, fig. 6 is a fourth embodiment of the device connection method of the present invention, and after the step S030, the method further includes the following steps:
s090, when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
step S100, generating a remote control instruction according to the control information;
step S110, sending the remote control instruction to a server so that the server sends the remote control instruction to the controlled equipment;
and step S120, receiving the equipment control result sent by the server and outputting the equipment control result.
In this embodiment, when receiving a control instruction triggered by a user, the first processor acquires control information corresponding to the control instruction in the memory, or acquires control information carried in the control instruction, generates a remote control instruction according to the acquired control information, and sends the remote control instruction to the server.
When the server receives a remote control instruction sent by the main control device, the controlled device corresponding to the remote control instruction is determined, and the remote control instruction is sent to the corresponding controlled device, so that the controlled device executes the operation corresponding to the remote control instruction, and sends an execution result to the server. And when receiving the execution result sent by the controlled equipment, the server generates an equipment control result according to the received execution result and then sends the equipment control result to the main control equipment.
Specifically, the control instruction triggered by the user may be a control instruction for controlling multiple controlled devices simultaneously, and the remote control instruction sent by the first processor may include address information of each controlled device, so that when the server receives the remote control instruction sent by the master control device, the server may multicast the remote control instruction, so that when each controlled device receives the remote control instruction, the server compares the local address information and the address information in the remote control instruction, and when address information consistent with the local address information exists in the remote control instruction, executes the remote control instruction; the server can also send the remote control instruction to each controlled device corresponding to the address information carried by the remote control instruction.
And when receiving the equipment control result sent by the server, the first processor outputs the equipment control result.
In the technical scheme disclosed in this embodiment, the remote control instruction is generated, sent to the server, and forwarded by the server, so that the effect of controlling the controlled devices in batches is achieved, and the control efficiency is improved.
Referring to fig. 7, fig. 7 is a fifth embodiment of the device connection method of the present invention, which is applied to a controlled device, and includes the following steps:
step S010, when receiving equipment searching information sent by a main control device, obtaining address information and returning the address information to the main control device corresponding to the equipment searching information;
step S020, when receiving a connection request sent by the main control equipment, performing handshake with the main control equipment;
and S030, after the handshake is successful, establishing communication connection with the main control equipment.
In this embodiment, the second processor receives device search information sent by the master control device, and when the device type in the device search information is consistent with the device type of the local machine (controlled device), acquires address information of the local machine, and returns the address information of the local machine to the master control device corresponding to the device search information.
Optionally, after the controlled device accesses the local area network, the second processor may further directly obtain the device type and the address information of the local device, generate a device online notification according to the obtained device type and address information, and then multicast the device online notification in the local area network.
And the second processor performs handshake with the main control equipment when receiving the connection request sent by the main control equipment, and establishes communication connection with the main control equipment after the handshake is successful.
Specifically, the step S020 further includes the steps of:
step S021, when receiving the connection request sent by the main control device, verifying the key information of the main control device carried by the connection request;
step S022, when the key information of the master control device is successfully verified, obtaining a communication key according to a preset key corresponding to the key information of the master control device, and storing the communication key, so that the controlled device performs encrypted communication with the master control device through the communication key;
step S023, selecting key information of the controlled equipment in a preset key set;
s024, generating an equipment connection response according to the key information of the controlled equipment, and sending the equipment connection response to the main control equipment;
and step S025, sending information of successful handshake to the main control equipment.
The second processor acquires key information carried in the connection request of the master control device when receiving the connection request sent by the master control device, acquires a preset key corresponding to a key identifier in the key information in a preset key set, then acquires the length of the preset key, and judges that the key information of the master control device is successfully verified when the length of the preset key is consistent with the key length in the key information. The second processor selects a preset key of the controlled device from the preset key set. And generating a communication key according to the preset key corresponding to the connection request, the random number carried in the connection request, the preset key of the controlled device and a preset key algorithm, and storing the communication key as the communication key between the master control device and the controlled device, so that the controlled device can perform encrypted communication with the master control device through the communication key after the master control device is connected with the controlled device. The second processor can also generate connection response information according to the key information of the selected preset key of the controlled device, and send the connection response information to the main control device.
Specifically, after the key information is successfully verified, the controlled device may also notify the master control device of the key change; meanwhile, the second processor can also send the information of successful handshake of the controlled device to the master control device.
In the technical scheme disclosed in this embodiment, when the master control device and the controlled device are in the same local area network, the master control device performs handshaking with the controlled device, and establishes communication connection with the controlled device when the handshaking is successful, so that connection between the master control device and the controlled device can be achieved without additional configuration or device connection lines, and the device connection efficiency is improved.
Optionally, based on the fifth embodiment, as shown in fig. 8, in a sixth embodiment of the apparatus connection method of the present invention, before the step S010, the method further includes:
step S040, generating a registration request according to the device information of the controlled device, and sending the registration request to a server, so that the server generates a registration response according to the registration request, and sends the registration response to the controlled device;
step S050, receiving a registration response sent by the server;
step S060, when the registration response is successful in registration, generating a key obtaining request, and sending the key obtaining request to the server, so that the server obtains the preset key set according to the key obtaining request, and returns the preset key set to the controlled device;
and step S070, receiving and storing the preset key set sent by the server.
In this embodiment, after the controlled device is accessed to the local area network, the second processor may further obtain device information of the controlled device, generate a registration request according to the obtained device information, and then send the registration request to the server. And when receiving the registration request sent by the controlled equipment, the server verifies the equipment information carried in the registration request, then generates a registration response according to the verification result, and sends the registration response to the controlled equipment.
And the second processor receives the registration response sent by the server, generates a key acquisition request when the registration response is successful, and sends the key acquisition request to the server. And when receiving a key acquisition request sent by the controlled equipment, the server acquires a preset key set and sends the acquired preset key set to the controlled equipment.
And after receiving the preset key set sent by the server, the second processor stores the preset key set in the memory.
In the technical scheme disclosed in this embodiment, by obtaining the corresponding preset key set, when the master control device and the controlled device perform handshake, the preset key can be selected from the preset key set, and then a communication key for communication between the master control device and the controlled device is generated, thereby improving the security of communication between the master control device and the controlled device.
Alternatively, based on the fifth embodiment, as shown in fig. 9, in a seventh embodiment of the device connection method according to the present invention, after the step S030, the method further includes:
step S080, when receiving a local area network control command sent by the main control equipment, decrypting the local area network control request command;
and S090, executing the operation corresponding to the decrypted local area network control instruction.
In this embodiment, when receiving the lan control instruction sent by the main control device, the second processor obtains a communication key for communicating with the main control device, decrypts the lan control instruction according to the communication, and then executes an operation corresponding to the decrypted lan control instruction.
Optionally, after the step S030, the method further includes:
step S100, when a remote control instruction sent by a server is received, executing an operation corresponding to the remote control instruction;
step S110, obtaining an execution result of the remote system instruction, and sending the execution result to the server, so that the server generates an equipment control result according to the execution result.
In the present embodiment, it is preferred that,
and when receiving the remote control instruction sent by the server, the second processor executes the operation corresponding to the remote control instruction, acquires the execution result of the remote control instruction and sends the execution result to the server.
Specifically, the second processor may further receive a remote control instruction multicast by the server, then acquire address information carried in the remote control instruction, execute an operation corresponding to the remote control instruction when the address information consistent with the local address information exists in the remote control instruction, acquire an execution result of the remote control instruction, and send the execution result to the server.
And when receiving the execution result sent by the controlled equipment, the server generates an equipment control result according to the execution result of the controlled equipment and sends the equipment control result to the main control equipment.
In the technical solution disclosed in this embodiment, a process of controlling a controlled device by a main control device is implemented by receiving a local area network control instruction and/or a remote control instruction and executing an operation corresponding to the local area network control instruction and/or the remote control instruction.
In addition, an embodiment of the present invention further provides a master control device, where the master control device includes a memory, a processor, and a device connection program that is stored in the memory and is executable on the processor, and when the device connection program is executed by the processor, the steps of the device connection method according to the above embodiments are implemented.
In addition, an embodiment of the present invention further provides a controlled device, where the controlled device includes a memory, a processor, and a device connection program that is stored in the memory and is executable on the processor, and the device connection program, when executed by the processor, implements the steps of the device connection method according to the above embodiments.
In addition, an embodiment of the present invention further provides a control system, where the control system includes: the master device, the controlled device and the server are provided.
Furthermore, an embodiment of the present invention further provides a readable storage medium, where a device connection program is stored, and the device connection program, when executed by a processor, implements the steps of the device connection method according to the above embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g. a smart phone, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (12)

1. A device connection method is applied to a main control device, and comprises the following steps:
the main control device multicasts the device search information in the local area network;
when address information returned by controlled equipment through the equipment search information is received, selecting a preset key of the main control equipment in a preset key set, and generating a connection request of the main control equipment according to the preset key of the main control equipment, wherein the preset key set of the main control equipment is issued by a server when the main control equipment logs in;
sending a connection request of the main control equipment to controlled equipment corresponding to the address information;
when receiving connection response information sent by the controlled equipment, verifying the key information of the controlled equipment carried by the connection response information;
when preset key information matched with the key information of the controlled equipment exists in the preset key set, judging that the key information of the controlled equipment is successfully verified;
when the key information of the controlled device is successfully verified, obtaining and storing a communication key according to the preset key of the main control device, the preset key of the controlled device, a preset key algorithm and the random number carried in the connection request, so that the main control device and the controlled device perform encrypted communication through the communication key;
sending information of successful handshake to the controlled device;
and after the handshake is successful, establishing communication connection between the controlled devices corresponding to the address information.
2. The device connection method of claim 1, wherein the master device, before the step of multicasting the device search information within the local area network, further comprises:
after the main control equipment is accessed to the local area network, a login request is sent to a server, so that the server obtains a preset key set according to the login request, login response information is generated according to the preset key set, and the login response information is sent to the main control equipment;
and after receiving the login response information, acquiring the preset key set carried by the login response information.
3. The device connection method according to claim 1, wherein after the step of establishing the communication connection between the controlled devices corresponding to the address information after the successful handshake, the method further comprises:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a local area network control instruction according to the control information;
and encrypting the local area network control instruction, and sending the encrypted local area network control instruction to the controlled device.
4. The device connection method according to claim 1, wherein after the step of establishing the communication connection between the controlled devices corresponding to the address information after the successful handshake, the method further comprises:
when a control instruction triggered by a user is received, acquiring control information corresponding to the control instruction;
generating a remote control instruction according to the control information;
sending the remote control instruction to a server so as to enable the server to send the remote control instruction to the controlled equipment;
and receiving the equipment control result sent by the server and outputting the equipment control result.
5. A device connection method is applied to a controlled device, and comprises the following steps:
when equipment search information sent by a master control device is received, address information of a controlled device is obtained, and the address information is returned to the master control device corresponding to the equipment search information;
when a connection request sent by the master control equipment is received, key information carried in the connection request is obtained;
acquiring a preset key corresponding to the key information of the master control device in a preset key set, and verifying the key information of the master control device according to the preset key, wherein the preset key set of the controlled device is issued by a server after the controlled device is registered;
when the key information of the master control device is successfully verified, selecting a preset key of the controlled device in a preset key set;
acquiring a communication key according to a preset key of the master control device, a preset key of the controlled device, a preset key algorithm and a random number carried in the connection request, and storing the communication key so that the controlled device performs encrypted communication with the master control device through the communication key;
generating an equipment connection response according to the preset secret key of the controlled equipment, and sending the equipment connection response to the main control equipment;
sending information of successful handshake to the master control equipment;
and after the handshake is successful, establishing communication connection with the main control equipment.
6. The device connection method according to claim 5, wherein before the step of obtaining address information of the controlled device and returning the address information to the master control device corresponding to the device search information when receiving the device search information sent by the master control device, the method further comprises:
generating a registration request according to the device information of the controlled device, and sending the registration request to a server, so that the server generates a registration response according to the registration request and sends the registration response to the controlled device;
receiving a registration response sent by the server;
when the registration response is successful, generating a key acquisition request, and sending the key acquisition request to the server, so that the server acquires the preset key set according to the key acquisition request and returns the preset key set to the controlled device;
and receiving and storing the preset key set sent by the server.
7. The device connection method according to claim 5, wherein after the step of establishing the previous communication connection with the master device corresponding to the device search information after the successful handshake, the method further comprises:
when a local area network control command sent by the master control equipment is received, decrypting the local area network control request command;
and executing the operation corresponding to the decrypted local area network control instruction.
8. The device connection method according to claim 5, wherein after the step of returning the address information to the master device corresponding to the device search information, the method further includes:
when a remote control instruction sent by a server is received, executing an operation corresponding to the remote control instruction;
and acquiring an execution result of the remote control instruction, and sending the execution result to the server so that the server generates an equipment control result according to the execution result.
9. A master device, the master device comprising: memory, a processor and a device connection program stored on the memory and executable on the processor, the device connection program when executed by the processor implementing the steps of the device connection method according to any one of claims 1 to 4.
10. A controlled device, characterized in that the controlled device comprises: memory, a processor and a device connection program stored on the memory and executable on the processor, the device connection program when executed by the processor implementing the steps of the device connection method according to any one of claims 5 to 8.
11. A control system, characterized in that the control system comprises: a server, a master device as claimed in claim 9 and at least one controlled device as claimed in claim 10.
12. A computer-readable storage medium, having stored thereon a device connection program which, when executed by a processor, implements the steps of the device connection method according to any one of claims 1 to 8.
CN202010707579.0A 2020-07-22 2020-07-22 Device connection method, master control device, controlled device, control system and medium Active CN111741464B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010707579.0A CN111741464B (en) 2020-07-22 2020-07-22 Device connection method, master control device, controlled device, control system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010707579.0A CN111741464B (en) 2020-07-22 2020-07-22 Device connection method, master control device, controlled device, control system and medium

Publications (2)

Publication Number Publication Date
CN111741464A CN111741464A (en) 2020-10-02
CN111741464B true CN111741464B (en) 2021-04-09

Family

ID=72656090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010707579.0A Active CN111741464B (en) 2020-07-22 2020-07-22 Device connection method, master control device, controlled device, control system and medium

Country Status (1)

Country Link
CN (1) CN111741464B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301721A (en) * 2021-06-28 2022-04-08 海信视像科技股份有限公司 Multi-device communication method and intelligent control device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101378582A (en) * 2007-08-29 2009-03-04 中国移动通信集团公司 User recognizing module, authentication center, authentication method and system
CN108833943A (en) * 2018-04-24 2018-11-16 苏州科达科技股份有限公司 The encrypted negotiation method, apparatus and conference terminal of code stream
CN110933672A (en) * 2019-11-29 2020-03-27 华为技术有限公司 Key negotiation method and electronic equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050111668A1 (en) * 2003-11-25 2005-05-26 Amit Raikar Dynamic source authentication and encryption cryptographic scheme for a group-based secure communication environment
CN103209188A (en) * 2013-04-16 2013-07-17 百度在线网络技术(北京)有限公司 Method, system and server for pushing data
CN103248562B (en) * 2013-04-27 2016-08-17 普联技术有限公司 A kind of method of device map, control terminal and controlled terminal
CN103647653B (en) * 2013-12-24 2016-08-24 深圳国微技术有限公司 A kind of authentication between devices and cryptographic key negotiation method
CN104883677B (en) * 2014-02-28 2018-09-18 阿里巴巴集团控股有限公司 A kind of communicated between near-field communication device connection method, device and system
CN105871670A (en) * 2016-05-20 2016-08-17 珠海格力电器股份有限公司 Method, device and system for controlling terminal equipment
CN109688583B (en) * 2018-12-03 2022-04-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Data encryption method in satellite-ground communication system
CN110266480B (en) * 2019-06-13 2022-05-20 腾讯科技(深圳)有限公司 Data transmission method, device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101378582A (en) * 2007-08-29 2009-03-04 中国移动通信集团公司 User recognizing module, authentication center, authentication method and system
CN108833943A (en) * 2018-04-24 2018-11-16 苏州科达科技股份有限公司 The encrypted negotiation method, apparatus and conference terminal of code stream
CN110933672A (en) * 2019-11-29 2020-03-27 华为技术有限公司 Key negotiation method and electronic equipment

Also Published As

Publication number Publication date
CN111741464A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
US10623954B2 (en) AP connection method, terminal, and server
US9843575B2 (en) Wireless network authentication method and wireless network authentication apparatus
CN106657152B (en) Authentication method, server and access control device
CN112351000B (en) Bidirectional identity verification method, system, equipment and storage medium
CN111327583B (en) Identity authentication method, intelligent equipment and authentication server
CN112559993B (en) Identity authentication method, device and system and electronic equipment
CN110545252B (en) Authentication and information protection method, terminal, control function entity and application server
CN107864475B (en) WiFi (Wireless Fidelity) shortcut authentication method based on Portal + dynamic password
US11489831B2 (en) Communication system and computer readable storage medium
US20160373924A9 (en) Method for providing application service
CN112672351A (en) Wireless local area network authentication method and device, electronic equipment and storage medium
CN104247485B (en) Network application function authorization in Generic Bootstrapping Architecture
WO2022111187A1 (en) Terminal authentication method and apparatus, computer device, and storage medium
CN109583154A (en) A kind of system and method based on Web middleware access intelligent code key
CN104579657A (en) Method and device for identity authentication
JP2014002716A (en) Information processing apparatus, network system, data sharing method, and computer program allowing data sharing
CN101616414A (en) Method, system and server that terminal is authenticated
CN107211265A (en) The safety interacting method and device of a kind of terminal room
CN111741464B (en) Device connection method, master control device, controlled device, control system and medium
CN115868189A (en) Method, vehicle, terminal and system for establishing vehicle safety communication
EP2849470B1 (en) Function sharing in wireless access hotspot device
KR102171377B1 (en) Method of login control
CN106714158B (en) WiFi access method and device
CN113132977A (en) Network distribution method, network distribution system and computer readable storage medium
KR100901279B1 (en) Wire/Wireless Network Access Authentication Method using Challenge Message based on CHAP and System thereof

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
GR01 Patent grant
GR01 Patent grant