CN105812413B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN105812413B
CN105812413B CN201410842900.0A CN201410842900A CN105812413B CN 105812413 B CN105812413 B CN 105812413B CN 201410842900 A CN201410842900 A CN 201410842900A CN 105812413 B CN105812413 B CN 105812413B
Authority
CN
China
Prior art keywords
equipment
account
verification
login password
address information
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
CN201410842900.0A
Other languages
Chinese (zh)
Other versions
CN105812413A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410842900.0A priority Critical patent/CN105812413B/en
Publication of CN105812413A publication Critical patent/CN105812413A/en
Application granted granted Critical
Publication of CN105812413B publication Critical patent/CN105812413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a communication method and equipment, and belongs to the field of Internet of things. The method comprises the following steps: receiving a communication message sent by a first device through a first long connection, wherein the communication message carries communication content, a first device account, a verification bill and a second device account, and the first long connection is a network connection between the first device and a server; verifying the identity of the first equipment according to the first equipment account and the verification bill; and when the identity verification of the first equipment passes, based on the account number of the second equipment, sending the communication content to the second equipment through a second long connection, wherein the second long connection is a network connection between the second equipment and the server. The invention realizes the communication between the first equipment and the second equipment through the network, the network is remote control, the distance limitation is avoided, and the communication is more flexible.

Description

Communication method and device
Technical Field
The invention relates to the field of Internet of things, in particular to a communication method and equipment.
Background
With the rapid development of the internet of things, more and more intelligent devices are added into the internet of things. In order for the intelligent devices to work together to provide richer intelligent services to users, the intelligent devices are required to communicate with a control terminal to control the intelligent devices.
At present, the intelligent device and the control terminal are communicated through Bluetooth or radio frequency signals, the Bluetooth and the radio frequency signals are both process control, namely, the distance between the control terminal and the intelligent device is smaller than or equal to a distance threshold, and when the distance between the control terminal and the intelligent device exceeds the distance threshold, the control terminal and the intelligent device cannot be communicated, and further the intelligent device cannot be controlled.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a communication method and device. The technical scheme is as follows:
in one aspect, a communication method is provided, and the method includes:
receiving a communication message sent by a first device through a first long connection, wherein the communication message carries communication content, a first device account, a verification bill and a second device account, and the first long connection is a network connection between the first device and a server;
verifying the identity of the first equipment according to the first equipment account and the verification bill;
and when the identity verification of the first equipment passes, based on the account number of the second equipment, sending the communication content to the second equipment through a second long connection, wherein the second long connection is a network connection between the second equipment and the server.
In another aspect, a communication device is provided, the device comprising:
the system comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a communication message sent by a first device through a first long connection, the communication message carries communication content, a first device account, a verification bill and a second device account, and the first long connection is a network connection between the first device and a server;
the first verification module is used for verifying the identity of the first equipment according to the first equipment account and the verification bill;
and the first sending module is used for sending the communication content to the second equipment through a second long connection based on the account number of the second equipment when the identity verification of the first equipment passes, wherein the second long connection is a network connection between the second equipment and the server.
In the embodiment of the invention, a first long connection is established between the first device and the server, a second long connection is established between the second device and the server, and the first long connection and the second long connection are both network connections. The first device may send a communication message to the server over the first long connection, and when the server receives the communication message and verifies the identity of the first device, the server sends the communication content to the second device over the second long connection. Therefore, the first equipment and the second equipment can communicate through the network, the network is controlled remotely and is not limited by distance, and the communication is flexible.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a diagram of a communication system architecture according to an embodiment of the present invention;
fig. 2 is a flowchart of a communication method according to an embodiment of the present invention;
fig. 3 is a flow chart of another communication method provided by the embodiment of the invention;
fig. 4 is a schematic structural diagram of a communication device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a diagram of a communication system architecture according to an embodiment of the present invention. Referring to fig. 1, the communication system architecture includes a control terminal, a server, and an intelligent device. The control terminal is connected with the server through a network, and the intelligent device is connected with the server through the network. The control terminal is used for sending a control instruction to the intelligent equipment, and the control instruction is used for controlling the intelligent equipment. The intelligent device is used for receiving a control instruction sent by the control terminal and executing specified operation through the control instruction, and the intelligent device is also used for sending state information to the control terminal. The server is used for forwarding messages between the control terminal and the intelligent device and achieving communication between the intelligent device and the control terminal.
Fig. 2 is a flowchart of a communication method according to an embodiment of the present invention. Referring to fig. 2, the method includes:
step 201: and receiving a communication message sent by the first device through a first long connection, wherein the communication message carries communication content, a first device account number, a verification bill and a second device account number, and the first long connection is a network connection between the first device and the server.
Step 202: and verifying the identity of the first equipment according to the first equipment account and the verification bill.
Step 203: and when the identity authentication of the first equipment passes, based on the account number of the second equipment, sending the communication content to the second equipment through a second long connection, wherein the second long connection is a network connection between the second equipment and the server.
In the embodiment of the invention, a first long connection is established between the first device and the server, a second long connection is established between the second device and the server, and the first long connection and the second long connection are both network connections. The first device may send a communication message to the server over the first long connection, and when the server receives the communication message and verifies the identity of the first device, the server sends the communication content to the second device over the second long connection. Therefore, the first equipment and the second equipment can communicate through the network, the network is controlled remotely and is not limited by distance, and the communication is flexible.
Optionally, verifying the identity of the first device according to the first device account and the verification ticket includes:
acquiring a corresponding verification bill from the corresponding relation between the equipment account and the verification bill stored in the memory according to the first equipment account;
and if the verification bill is the same as the acquired verification bill, determining that the identity verification of the first equipment is passed, otherwise, determining that the identity verification of the first equipment is not passed.
Optionally, sending the communication content to the second device through a second long connection based on the second device account includes:
acquiring corresponding address information from the corresponding relation between the stored equipment account and the address information based on the second equipment account;
and transmitting the communication content to the second device through the second long connection based on the acquired address information.
Optionally, the method further comprises:
when a connection data packet sent by the second equipment through the second long connection is received, acquiring new address information of the second equipment from the connection data packet;
according to the second equipment account, acquiring old address information of the second equipment from the corresponding relation between the equipment account and the address information;
when the new address information is different from the old address information, the old address information is replaced with the new address information.
Optionally, before receiving the communication message sent by the first device through the first long connection, the method further includes:
receiving a login request sent by third equipment, wherein the login request carries a third equipment account and a login password, and the third equipment is any one of the first equipment and the second equipment;
acquiring a corresponding login password from the stored corresponding relation between the equipment account and the login password according to the third equipment account;
if the login password carried by the login request is the same as the obtained login password, generating a verification bill for the third equipment;
and sending the generated verification bill to the third equipment based on the third equipment account.
Optionally, after generating the verification ticket for the third device, the method further includes:
and storing the third equipment account and the generated verification bill in the corresponding relation between the equipment account and the verification bill.
Optionally, before receiving the communication message sent by the first device through the first long connection, the method further includes:
when the first device is a control terminal, receiving a binding request sent by the first device, wherein the binding request carries a first device account number, a verification bill and a second device account number;
verifying the identity of the first equipment according to the first equipment account and the verification bill;
and when the identity verification of the first equipment passes, storing the corresponding relation between the first equipment account and the second equipment account.
Optionally, after storing the correspondence between the first device account and the second device account, the method further includes:
receiving a password modification request sent by first equipment, wherein the password modification request carries a first equipment account, a verification bill, a second equipment account and a new login password;
verifying the identity of the first equipment according to the first equipment account and the verification bill;
when the identity authentication of the first device passes, replacing a corresponding login password in the corresponding relationship between the stored device account and the login password with a new login password according to the second device account;
and sending the new login password to the second equipment based on the second equipment account, so that the second equipment replaces the stored login password with the new login password.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present invention, which is not described in detail herein.
Fig. 3 is a flowchart of a communication method according to an embodiment of the present invention. The execution main body of the method is a first device, a second device and a server, the first device can be a control terminal, the second device can be an intelligent device, of course, the first device can also be an intelligent device, and the second device can be a control terminal. Referring to fig. 3, the method includes:
step 301: the server receives a login request sent by third equipment, wherein the login request carries a third equipment account and a login password, and the third equipment is any one of the first equipment and the second equipment.
In the embodiment of the present invention, the first device and the second device communicate with each other through the network, so that the first device and the second device need to log in the server before communicating with each other, and the first device and the second device can communicate with each other only after the first device and the second device successfully log in the server.
The third device account is used to identify a third device, and when the third device is a control terminal, the third device account may be a serial number, a mobile phone number, and the like of the third device, and when the third device is an intelligent device, the third device account may be a serial number of the third device, which is not specifically limited in this embodiment of the present invention.
Step 302: and the server acquires the corresponding login password from the stored corresponding relation between the equipment account and the login password according to the third equipment account.
Because the server stores the login password of the first device account and the second device and the login password of the second device account and the second device in advance, when the server receives a login request of the third device, the server can directly acquire the login password corresponding to the third device from the stored corresponding relationship between the device account and the login password.
For example, the third device account is 1324343, and the server obtains the corresponding login password sfd34565xd from the correspondence between the device account and the login password shown in table 1 below according to the third device account.
TABLE 1
Device account number Login password
1324343 sfd34565xd
13354324567 Sghd35tyds
…… ……
Step 303: and if the login password carried by the login request is the same as the acquired login password, generating a verification bill for the third equipment.
Specifically, the server compares the login password carried by the login request with the obtained login password, if the login password carried by the login request is the same as the obtained login password, it is determined that the third device successfully logs in, and the server generates an authentication bill for the third device; and if the login password carried by the login request is different from the acquired login password, determining that the third device fails to login, and at the moment, the server can send a login failure message to the third device. For example, if the login password sfd34565xd carried by the login request is determined to be the same as the acquired login password, it is determined that the third device has successfully logged in, and the server generates the authentication ticket 1133sd for the third device.
In the above steps 302 and 303, the server verifies the identity of the third device, that is, when the server verifies the identity of the third device, the third device logs in successfully, but in the embodiment of the present invention, in order to ensure the security of the communication between the first device and the second device, the server verifies the identity of the third device when a communication message sent by the third device needs to be received, but in the embodiment of the present invention, the server simply describes the login process of the third device through the steps 302 and 303, and in practical applications, the process of verifying the identity of the third device by the server is relatively complex. Therefore, in order to simplify the authentication process for the third device when the communication message sent by the third device is subsequently received, the server may generate an authentication ticket for the third device, where the authentication ticket may be randomly generated by the server, and the authentication ticket corresponding to each device is different.
In this embodiment of the present invention, the validation ticket may be a character string, which is not specifically limited in this embodiment of the present invention.
In addition, after the server generates the verification ticket for the third device, the server may further store the third device account and the generated verification ticket in the correspondence between the device account and the verification ticket, so as to verify the identity of the third device in the following. For example, the server may store the third device account number 1324343 and the generated verification ticket 1133sd in the correspondence between the device account number and the verification ticket as shown in table 2 below.
TABLE 2
Device account number Verification bill
1324343 1133sd
13354324567 1134sd
…… ……
Step 304: and sending the generated verification bill to the third equipment based on the third equipment account.
The steps 301 to 304 may not only log the first device and the second device in the server, but also prevent a malicious attacker from controlling the smart device or the control terminal through the generated verification ticket.
After the first device and the second device log in the server through the steps 301 to 304, in order to implement communication between the first device and the second device, the first device and the second device need to be bound, specifically: when the first device is a control terminal, the first device acquires a second device account and sends a binding request to the server, wherein the binding request carries the first device account, the verification bill and the second device account; when the server receives a binding request sent by first equipment, verifying the identity of the first equipment according to a first equipment account and the verification bill; and when the identity verification of the first equipment passes, storing the corresponding relation between the first equipment account and the second equipment account.
For example, when the first device and the second device are located in the same local area network, the first device may send an information acquisition request to the router, so that the router sends a broadcast packet to all devices accessing the router, where the broadcast packet is used to acquire an account of the device accessing the router.
According to the first device account and the verification ticket, the operation of verifying the identity of the first device may be: and according to the first equipment account, acquiring a corresponding verification bill from the corresponding relation between the stored equipment account and the verification bill, comparing the acquired verification bill with the verification bill carried by the binding request, if the acquired verification bill and the verification bill are the same, determining that the identity verification of the first equipment passes, and otherwise, determining that the identity verification of the first equipment does not pass.
In addition, when the second device is an intelligent device, the intelligent device generally does not have a man-machine interaction interface easy to operate, and usually only has one or two keys, and the intelligent device starts to work after being connected to a power supply. Therefore, when the intelligent device is used for the first time, the intelligent device needs to be bound with the control terminal through the method. Furthermore, in order to ensure the security of the smart device, the user needs to modify the initial login password of the smart device, which specifically includes: when the first device receives the password modification instruction, a password modification request is sent to the server, and the password modification request carries the first device account number, the verification bill, the second device account number and the new login password. When the server receives a password modification request sent by the first equipment, the identity of the first equipment is verified according to the first equipment account and the verification bill; when the identity authentication of the first device passes, replacing a corresponding login password in the corresponding relationship between the stored device account and the login password with a new login password according to the second device account; and based on the second equipment account, sending the new login password to the second equipment, so that the second equipment replaces the stored login password with the new login password.
Optionally, in order to further ensure communication security, when a user modifies an initial login password of the smart device, a password modification request sent by the first device to the server may also carry the initial login password of the second device, and when the server receives the password modification request sent by the first device, the server verifies the identity of the first device according to the first device account and the verification ticket; when the identity authentication of the first equipment passes, acquiring an initial login password of the second equipment from the stored corresponding relation between the equipment account and the login password according to the second equipment account, and replacing the acquired initial login password with a new login password if the acquired initial login password is the same as the initial login password carried in the password modification request; and based on the second equipment account, sending the new login password to the second equipment, so that the second equipment replaces the stored login password with the new login password.
It should be noted that, in the embodiment of the present invention, in order to ensure the security of communication between the first device and the second device, one intelligent device may only be bound by one control terminal, and when another control terminal wants to bind the intelligent device, the intelligent device needs to be unbound.
The operation of unbinding the intelligent device can be as follows: when the first device is a control terminal, the first device may send a unbinding request to the server, where the unbinding request carries a first device account, a verification ticket, and a second device account; when the server receives a unbinding request sent by first equipment, verifying the identity of the first equipment according to a first equipment account and the verification bill; and when the identity verification of the first equipment passes, deleting the corresponding relation between the first equipment account and the second equipment account.
When the first device and the second device log in the server and are bound, the first device and the second device can communicate with each other, as follows.
Step 305: the first device sends a communication message to the server through a first long connection, wherein the communication message carries communication content, a first device account number, a verification bill and a second device account number, and the first long connection is a network connection between the first device and the server.
Because the first device may be a control terminal or an intelligent device, when the first device is the control terminal, the communication content carried in the communication message is a control instruction, and when the first device is the intelligent device, the communication content carried in the communication message is state information of the intelligent device.
Step 306: and when the server receives the communication message sent by the first equipment, verifying the identity of the first equipment according to the first equipment account and the verification bill.
Specifically, according to a first device account, obtaining a corresponding verification bill from a corresponding relation between a device account and the verification bill stored in a memory; and if the verification bill carried in the communication message is the same as the acquired verification bill, determining that the identity verification of the first equipment passes, otherwise, determining that the identity verification of the first equipment does not pass.
Because the equipment account number and the verification bill are stored in the memory of the server, the server verifies the identity of the first equipment in a short time and at a high speed according to the verification bill, and the identity verification efficiency of the first equipment is improved.
Step 307: and when the identity authentication of the first equipment passes, the server sends the communication content to the second equipment through a second long connection based on a second equipment account, wherein the second long connection is a network connection between the second equipment and the server.
Specifically, the server acquires corresponding address information from the stored corresponding relationship between the device account and the address information based on the second device account; and transmitting the communication content to the second device through the second long connection based on the acquired address information.
In the embodiment of the present invention, the intelligent device is generally connected to a home router, the router corresponds to a local area network, the intelligent device connected to the router is assigned an intranet address information, the intranet address information does not have public network address information, the address information may be an IP (Internet Protocol ) address, a control terminal outside the local area network cannot directly communicate with the intelligent device, and the server generally has the public network address information. In addition, because the control terminal and the intelligent device are both located in the intranet of the local area network, and the control terminal is generally a mobile terminal, the network accessed by the control terminal is not fixed, and the server cannot find the intelligent device and the control terminal, in the embodiment of the present invention, the first long connection and the second long connection can be established, so that the server can issue the communication content to the intelligent device or the control terminal.
In the embodiment of the present invention, the long connection may be a TCP (Transmission Control Protocol) connection, and the TCP connection itself is a connection-oriented Protocol, so once the three-way handshake is completed, the connection state can be maintained all the time. The reality is that this is not ideal, and if a TCP connection does not send or receive data for a long time, the router will break the connection, so it is still necessary to send some data every first specified period of time to keep the connection alive. In addition, the long connection may also use a UDP (User Datagram Protocol) Protocol, where the UDP Protocol requires the intelligent device and the control terminal to send a connection data packet to the server every second designated time period, and the connection data packet is used to indicate that the device always exists in the server.
For example, the long connection uses a UDP protocol, the first device or the second device may send a connection packet to the server every second designated time period, and if the connection packet sent by the second device through the second long connection is received by the server, new address information of the second device is obtained from the connection packet; according to the second equipment account, acquiring old address information of the second equipment from the corresponding relation between the equipment account and the address information; when the new address information of the second device is different from the old address information of the second device, the old address information of the second device is replaced with the new address information of the second device.
Further, when the third device logs out, the third device sends a log-out request to the server, wherein the log-out request carries a third device account and a verification bill; acquiring a corresponding verification bill from the corresponding relation between the stored equipment account and the verification bill according to the third equipment account; if the authentication bill carried by the log-out request is the same as the acquired authentication bill, determining that the authentication of the third equipment passes; at this time, based on the third device account, the corresponding verification ticket in the correspondence between the device account and the verification ticket is deleted.
In the embodiment of the invention, a first long connection is established between the first device and the server, a second long connection is established between the second device and the server, and the first long connection and the second long connection are both network connections. The first device may send a communication message to the server over the first long connection, and when the server receives the communication message and verifies the identity of the first device, the server sends the communication content to the second device over the second long connection. Therefore, the first equipment and the second equipment can communicate through the network, the network is controlled remotely and is not limited by distance, and the communication is flexible.
Fig. 4 is a schematic structural diagram of a communication device according to an embodiment of the present invention. Referring to fig. 4, the apparatus includes:
a first receiving module 401, configured to receive a communication message sent by a first device through a first long connection, where the communication message carries communication content, a first device account, a verification ticket, and a second device account, and the first long connection is a network connection between the first device and a server;
a first verification module 402, configured to verify an identity of the first device according to the first device account and the verification ticket;
a first sending module 403, configured to send the communication content to the second device through a second long connection based on the second device account when the authentication of the first device passes, where the second long connection is a network connection between the second device and the server.
Optionally, the first verification module 402 comprises:
the first obtaining unit is used for obtaining a corresponding verification bill from the corresponding relation between the equipment account and the verification bill stored in the memory according to the first equipment account;
and the determining unit is used for determining that the identity authentication of the first equipment passes if the authentication ticket carried by the communication message is the same as the acquired authentication ticket, and otherwise, determining that the identity authentication of the first equipment does not pass.
Optionally, the first sending module 403 includes:
a second obtaining unit, configured to obtain, based on a second device account, corresponding address information from a correspondence between stored device accounts and address information;
and a sending unit, configured to send the communication content to the second device through the second long connection based on the acquired address information.
Optionally, the apparatus further comprises:
a first obtaining module, configured to, when receiving a connection data packet sent by a second device through the second long connection, obtain new address information of the second device from the connection data packet;
the second acquisition module is used for acquiring old address information of the second equipment from the corresponding relation between the equipment account and the address information according to the second equipment account;
and the first replacing module is used for replacing the old address information with the new address information when the new address information is different from the old address information.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a login request sent by third equipment, wherein the login request carries a third equipment account and a login password, and the third equipment is any one of the first equipment and the second equipment;
the third acquisition module is used for acquiring a corresponding login password from the stored corresponding relation between the equipment account and the login password according to the third equipment account;
the generation module is used for generating a verification bill for the third equipment if the login password carried by the login request is the same as the acquired login password;
and the second sending module is used for sending the verification bill to the third equipment based on the third equipment account.
Optionally, the apparatus further comprises:
and the first storage module is used for storing the third equipment account and the generated verification bill in the corresponding relation between the equipment account and the verification bill.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving a binding request sent by the first device when the first device is a control terminal, wherein the binding request carries the first device account, the verification bill and the second device account;
the second verification module is used for verifying the identity of the first equipment according to the first equipment account and the verification bill;
and the second storage module is used for storing the corresponding relation between the first equipment account and the second equipment account when the identity verification of the first equipment passes.
Optionally, the apparatus further comprises:
the fourth receiving module is used for receiving a password modification request sent by the first device, wherein the password modification request carries the first device account number, the verification bill, the second device account number and the new login password;
the third verification module is used for verifying the identity of the first equipment according to the first equipment account and the verification bill;
the second replacement module is used for replacing the corresponding login password in the corresponding relation between the stored equipment account and the login password with a new login password according to the second equipment account when the identity authentication of the first equipment passes;
and the third sending module is used for sending the new login password to the second equipment based on the second equipment account so that the second equipment replaces the stored login password with the new login password.
In the embodiment of the invention, a first long connection is established between the first device and the server, a second long connection is established between the second device and the server, and the first long connection and the second long connection are both network connections. The first device may send a communication message to the server over the first long connection, and when the server receives the communication message and verifies the identity of the first device, the server sends the communication content to the second device over the second long connection. Therefore, the first equipment and the second equipment can communicate through the network, the network is controlled remotely and is not limited by distance, and the communication is flexible.
It should be noted that: in the communication device provided in the above embodiment, only the division of the functional modules is illustrated in the communication, and in practical applications, the functions may be distributed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the communication device and the communication method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention. The server 500 includes a Central Processing Unit (CPU)501, a system memory 504 including a Random Access Memory (RAM)502 and a Read Only Memory (ROM)503, and a system bus 505 connecting the system memory 504 and the central processing unit 501. The server 500 also includes a basic input/output system (I/O system) 506, which facilitates information transfer between devices within the computer, and a mass storage device 507, which stores an operating system 513, application programs 510, and other program modules 515.
The basic input/output system 506 comprises a display 508 for displaying information and an input device 509, such as a mouse, keyboard, etc., for user input of information. Wherein the display 508 and the input device 509 are connected to the central processing unit 501 through an input output controller 510 connected to the system bus 505. The basic input/output system 506 may also include an input/output controller 510 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 510 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable media provide non-volatile storage for the server 500. That is, the mass storage device 507 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 504 and mass storage device 507 described above may be collectively referred to as memory.
The server 500 may also operate as a remote computer connected to a network via a network, such as the internet, in accordance with various embodiments of the present invention. That is, the server 500 may be connected to the network 512 through the network interface unit 511 connected to the system bus 505, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 511.
The memory also includes one or more programs stored in the memory, the one or more programs including instructions for performing the communication methods provided by embodiments of the present invention.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (9)

1. A communication method, applied to a server, the method comprising:
receiving a login request sent by a third device serving as any one of the first device and the second device, wherein the login request carries a third device account and a login password, and the third device is a control terminal or an intelligent device;
acquiring a corresponding login password from the corresponding relation between the stored equipment account and the login password according to the third equipment account, and if the login password carried by the login request is the same as the acquired login password, generating a verification bill for the third equipment;
sending the verification bill to the third device based on the third device account;
storing the third equipment account and the generated verification bill in a corresponding relation between the equipment account and the verification bill;
receiving a communication message sent by a first device through a first long connection, wherein the communication message carries communication content, a first device account, a verification bill and a second device account, the first long connection is a network connection between the first device and a server, the verification bill corresponding to each device is different, and the first device is a control terminal or an intelligent device;
acquiring a corresponding verification bill from the corresponding relation between the equipment account and the verification bill stored in the memory according to the first equipment account; if the verification bill is the same as the acquired verification bill, determining that the identity verification of the first equipment passes, otherwise, determining that the identity verification of the first equipment does not pass;
when the identity verification of the first device passes, based on the second device account, sending the communication content to a second device through a second long connection, wherein the second long connection is a network connection between the second device and the server, the second device is an intelligent device when the first device is a control terminal, and the second device is a control terminal when the first device is an intelligent device;
before receiving the communication message sent by the first device through the first long connection, the method further includes:
when the first device is the control terminal, receiving a binding request sent by the first device, wherein the binding request carries a first device account, a verification bill and a second device account, and the first device is used for acquiring the second device account by scanning a two-dimensional code pasted on the second device;
verifying the identity of the first equipment according to the first equipment account and the verification bill;
and when the identity verification of the first equipment passes, storing the corresponding relation between the first equipment account and the second equipment account, wherein one intelligent equipment is only bound by one control terminal.
2. The method of claim 1, wherein the sending the communication content to the second device over the second long connection based on the second device account comprises:
acquiring corresponding address information from the corresponding relation between the stored equipment account and the address information based on the second equipment account;
and sending the communication content to the second equipment through the second long connection based on the acquired address information.
3. The method of claim 2, wherein the method further comprises:
when a connection data packet sent by the second device through the second long connection is received, acquiring new address information of the second device from the connection data packet;
according to the second equipment account, acquiring old address information of the second equipment from the corresponding relation between the equipment account and the address information;
replacing the old address information with the new address information when the new address information is different from the old address information.
4. The method of claim 1, wherein after storing the correspondence between the first device account number and the second device account number, further comprising:
receiving a password modification request sent by the first device, wherein the password modification request carries the first device account, the verification bill, the second device account and a new login password;
verifying the identity of the first equipment according to the first equipment account and the verification bill;
when the identity authentication of the first equipment passes, replacing the corresponding login password in the corresponding relation between the stored equipment account and the login password with the new login password according to the second equipment account;
and sending the new login password to the second equipment based on the second equipment account, so that the second equipment replaces the stored login password with the new login password.
5. A communication device, applied to a server, the device comprising:
the second receiving module is used for receiving a login request sent by a third device serving as any one of the first device and the second device, wherein the login request carries a third device account and a login password, and the third device is a control terminal or an intelligent device;
the third acquisition module is used for acquiring a corresponding login password from the corresponding relation between the stored equipment account and the login password according to the third equipment account;
the generation module is used for generating a verification bill for the third equipment if the login password carried by the login request is the same as the acquired login password;
the second sending module is used for sending the verification bill to the third equipment based on the third equipment account;
the first storage module is used for storing the third equipment account and the generated verification bill in the corresponding relation between the equipment account and the verification bill;
the first receiving module is used for receiving a communication message sent by a first device through a first long connection, wherein the communication message carries communication content, a first device account, a verification bill and a second device account, the first long connection is a network connection between the first device and a server, the verification bills corresponding to each device are different, and the first device is a control terminal or an intelligent device;
the first verification module is used for acquiring a corresponding verification bill from the corresponding relation between the equipment account and the verification bill stored in the memory according to the first equipment account; if the verification bill is the same as the acquired verification bill, determining that the identity verification of the first equipment passes, otherwise, determining that the identity verification of the first equipment does not pass;
a first sending module, configured to send, when authentication of the first device passes, the communication content to a second device through a second long connection based on the second device account, where the second long connection is a network connection between the second device and the server, the second device is an intelligent device when the first device is a control terminal, and the second device is a control terminal when the first device is an intelligent device;
the apparatus further comprises:
a third receiving module, configured to receive, when the first device is a control terminal, a binding request sent by the first device, where the binding request carries a first device account, a verification ticket, and a second device account, and the first device is configured to obtain the second device account by scanning a two-dimensional code pasted on the second device;
the second verification module is used for verifying the identity of the first equipment according to the first equipment account and the verification bill;
and the second storage module is used for storing the corresponding relation between the first equipment account and the second equipment account when the identity verification of the first equipment passes, and one intelligent equipment is bound by only one control terminal.
6. The apparatus of claim 5, wherein the first sending module comprises:
a second obtaining unit, configured to obtain, based on the second device account, corresponding address information from a correspondence between stored device accounts and address information;
and the sending unit is used for sending the communication content to the second equipment through the second long connection based on the acquired address information.
7. The apparatus of claim 6, wherein the apparatus further comprises:
a first obtaining module, configured to obtain new address information of the second device from a connection data packet sent by the second device through the second long connection when the connection data packet is received;
a second obtaining module, configured to obtain, according to the second device account, old address information of the second device from a correspondence between the device account and the address information;
a first replacement module to replace the old address information with the new address information when the new address information is different from the old address information.
8. The apparatus of claim 5, wherein the apparatus further comprises:
a fourth receiving module, configured to receive a password modification request sent by the first device, where the password modification request carries the first device account, the verification ticket, the second device account, and a new login password;
the third verification module is used for verifying the identity of the first equipment according to the first equipment account and the verification bill;
the second replacement module is used for replacing the corresponding login password in the corresponding relation between the stored equipment account and the login password with the new login password according to the second equipment account when the identity authentication of the first equipment passes;
and the third sending module is used for sending the new login password to the second equipment based on the second equipment account so that the second equipment replaces the stored login password with the new login password.
9. A storage medium having stored thereon processor-executable instructions which, when executed by one or more processors, implement the communication method of any one of claims 1-4.
CN201410842900.0A 2014-12-29 2014-12-29 Communication method and device Active CN105812413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410842900.0A CN105812413B (en) 2014-12-29 2014-12-29 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410842900.0A CN105812413B (en) 2014-12-29 2014-12-29 Communication method and device

Publications (2)

Publication Number Publication Date
CN105812413A CN105812413A (en) 2016-07-27
CN105812413B true CN105812413B (en) 2020-04-21

Family

ID=56419987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410842900.0A Active CN105812413B (en) 2014-12-29 2014-12-29 Communication method and device

Country Status (1)

Country Link
CN (1) CN105812413B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107318100B (en) * 2017-06-02 2020-01-14 Oppo广东移动通信有限公司 Method, device and system for binding mobile phone number
CN107222498B (en) * 2017-06-30 2020-02-21 江西博瑞彤芸科技有限公司 Binding processing method for shared data
CN108471434B (en) * 2018-01-30 2020-09-08 阿里巴巴集团控股有限公司 Method and device for associating equipment with account, electronic equipment and system
CN109344584B (en) * 2018-09-27 2022-08-02 厦门立林科技有限公司 Safety management method for initial account of intelligent equipment
CN111935656B (en) * 2020-07-24 2021-12-14 深圳市沃特沃德软件技术有限公司 Method and device for long connection of IP data and computer equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060403A (en) * 2006-04-18 2007-10-24 钟曦辰 Wireless communication terminal-based interactive dynamic password safety service system
CN103324105A (en) * 2013-05-31 2013-09-25 广东天际电器股份有限公司 Remote control system of terminal cooking device and remote control method thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427472B (en) * 2011-11-24 2016-03-30 捷开通讯科技(上海)有限公司 The apparatus and method of Long-distance Control mobile communication equipment
CN102739800A (en) * 2012-07-05 2012-10-17 合一网络技术(北京)有限公司 System and method for remotely controlling browser Web page based on internet
CN102789682B (en) * 2012-07-13 2015-12-16 惠州Tcl移动通信有限公司 A kind of method and system of remote control home electrical appliance
CN103532933B (en) * 2013-09-28 2018-03-20 刘子茂 The method and intelligent terminal of client operation mandate are realized by fingerprint identification
CN104158710B (en) * 2014-08-15 2017-08-25 深圳市蜂联科技有限公司 Service application channel automatic switching method based on open type intelligent Networking Platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060403A (en) * 2006-04-18 2007-10-24 钟曦辰 Wireless communication terminal-based interactive dynamic password safety service system
CN103324105A (en) * 2013-05-31 2013-09-25 广东天际电器股份有限公司 Remote control system of terminal cooking device and remote control method thereof

Also Published As

Publication number Publication date
CN105812413A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
CN108833521B (en) Message pushing method, device, system, computer equipment and storage medium
CN110798471B (en) Air conditioner management method and related device
CN105812413B (en) Communication method and device
US20190166204A1 (en) Systems and methods for remote management of appliances
CN109413096B (en) A kind of login method and device more applied
CN112165712B (en) Method, device, system and storage medium for intelligent device to access wireless network
CN103152624A (en) Remote control processing method, device and system
CN105099985A (en) Login method and device of multiple applications
CN106161385A (en) The long-range control method of a kind of equipment and device
CN105519028A (en) Wireless system access control method and apparatus
CN104821940A (en) Method and equipment for sending portal redirected address
CN110932944A (en) Method and system for controlling intelligent household equipment by visitor terminal
CN108289074B (en) User account login method and device
CN105357110A (en) Mail sending method, device and system
CN104635543A (en) Method and device for carrying out management operation
CN102130853A (en) Group message interaction realization method and system
CN103812829A (en) Method and system for improving security of remote desktop, and remote desktop server
CN112165713B (en) Method, device, system and storage medium for intelligent device to access wireless network
CN111953520B (en) Method, device, equipment and medium for realizing group control through group virtual equipment
CN109218389A (en) The method, apparatus and storage medium and electronic equipment of processing business request
CN106850554B (en) Method and device for dual-system directional connection
CN109150981B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN103997437A (en) Cloud server registration function testing method
CN102685115A (en) Resource access method, resource management device and system
CN102164099A (en) Webpage-based group information interaction realization method and system

Legal Events

Date Code Title Description
C06 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