CN105610783B - A kind of data transmission method and Internet of things system - Google Patents
A kind of data transmission method and Internet of things system Download PDFInfo
- Publication number
- CN105610783B CN105610783B CN201510749902.XA CN201510749902A CN105610783B CN 105610783 B CN105610783 B CN 105610783B CN 201510749902 A CN201510749902 A CN 201510749902A CN 105610783 B CN105610783 B CN 105610783B
- Authority
- CN
- China
- Prior art keywords
- server
- smart home
- key
- home device
- sent
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/06—Network architectures or network communication protocols for network security for supporting key management in a packet data network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
Abstract
This application provides a kind of data transmission method and Internet of things system, wherein method includes:It is carried out in UDP communication process in smart home device and server by utilizing first key, security key change instruction is sent to smart home device with UDP communication mode;Receive the first feedback message that smart home device is sent with UDP communication mode;In the case where smart home device is established TCP communication with server and connect, the security key change request that smart home device is sent in a manner of TCP communication is received;The second key generated at random is sent to smart home device in a manner of TCP communication;After smart home device is properly received the second key, the second feedback message of smart home device transmission is received in a manner of TCP communication.Key in the application is the key of modifiable key rather than fixation;Also, the key of change is transmitted in the way of TCP communication, to guarantee the safety of data to be transmitted between smart home device and server.
Description
Technical field
This application involves field of communication technology more particularly to a kind of data transmission methods and Internet of things system.
Background technique
With the continuous development of science and technology, smart home device is gradually popularized, in order to smart home device into
The long-range control of row, generally installs WIFI module, so that smart home device can be with wireless parties in smart home device
Formula is communicated with server.Smart home device and server form emerging Internet of things system.
Currently, using UDP (User Datagram between smart home device and server in Internet of things system
Protocol, User Datagram Protocol) communication modes are communicated.UDP is OSI (Open System
Interconnection, open system interconnection) a kind of connectionless transport layer protocol in reference model, it provides towards affairs
Simple unreliable information transmission service.
In order to guarantee the safety of data between smart home device and server, AES (Advanced can be used
Encryption Standard, Advanced Encryption Standard) cipher mode encrypts transmission data between the two.But mesh
The code key encrypted between preceding smart home device and server be it is fixed, be easy to cause after code key is cracked transmission data
Leakage, in turn results in the out of control of Internet of things system, security risk is very big.
Accordingly, it is now desired to which a kind of new data transfer mode, to be passed between smart home device and server to guarantee
The safety of transmission of data.
Summary of the invention
This application provides a kind of data transmission method and Internet of things system, the application can guarantee smart home device with
The safety of data to be transmitted between server.
To achieve the goals above, the application uses following technological means:
A kind of data transmission method, applied to the server of Internet of things system, the method includes:
It is carried out in UDP communication process in smart home device and server by utilizing first key, with UDP communication mode to institute
It states smart home device and sends security key change instruction;Wherein, the security key change instruction is encrypted using the first key;
Receive the first feedback message that the smart home device is sent with UDP communication mode;Wherein, first feedback
Message is properly received the security key change instruction for indicating, and first feedback message is carried out using the first key
Encryption;
In the case where the smart home device is established TCP communication with the server and connect, the intelligent family is received
Occupy the security key change request that equipment is sent in a manner of TCP communication;Wherein, security key change request using the first key into
Row encryption;
The second key generated at random is sent to the smart home device in a manner of TCP communication;Wherein, described second is close
Key is encrypted using the first key;
After the smart home device is properly received second key, the intelligence is received in a manner of TCP communication
The second feedback message that home equipment is sent;Wherein, second feedback message indicates to be properly received second key, and
Second feedback message is encrypted using the first key.
Preferably, further include:
Receive the data information encrypted that the smart home device is sent with UDP communication mode;Wherein, the data
Information is encrypted using second key;
After receiving the data information encrypted with UDP communication mode, with UDP communication mode to the intelligent family
It occupies equipment and sends the data receiver success message encrypted;Wherein, the data receiver success message uses second key
It is encrypted.
Preferably, further include:
After receiving the data information encrypted with UDP communication mode, receives the smart home device and send
The instruction of closing TCP channel, closings TCP channel instruction closes the smart home device and the server for indicating
Between TCP communication connection TCP channel.
Preferably, further include:
After not receiving the data information encrypted with UDP communication mode, in the way of TCP communication with the intelligence
Energy home equipment carries out data transmission.
Preferably, before smart home device and server by utilizing first key carry out UDP communication process, further include:
The logging request that the smart home device is sent is responded, and is set when meeting preset condition to the smart home
Preparation send login success message.
Preferably, the logging request that the response smart home device is sent, and when meeting preset condition to institute
It states smart home device and sends login success message, including:
In the case where the smart home device is established TCP communication with the server and connect, the intelligent family is received
Occupy the logging request that equipment is sent in a manner of TCP communication;Wherein, the logging request uses public key encryption, also, the login
Request includes the identity information of the smart home device;
After decrypting using the public key to the logging request, the identity information in the logging request is obtained;
After the verifying identity information is correct, logined successfully in a manner of TCP communication to smart home device transmission
Message;Wherein, the login success message uses the public key encryption;
Within a preset time, the third feedback message that the smart home device is sent is received in a manner of TCP communication;Its
In, the third feedback message is for indicating that the smart home device is properly received the login success message.
Preferably, further include:
If not receiving the third feedback message that the smart home device is sent within a preset time, again with
TCP communication mode sends login success message to the smart home device;Wherein, the login success message uses the public affairs
Key encryption;
After the number for retransmitting login success message reaches preset times, the smart home device and the service are disconnected
TCP communication connection between device, and the instruction for disconnecting TCP communication and connecting is sent to the smart home device.
Preferably, further include:
After sending the instruction for disconnecting TCP communication connection to the smart home device, the intelligent family is responded again
The logging request of equipment transmission is occupied, and sends login success message to the smart home device when meeting preset condition.
Preferably, during smart home device is communicated in a manner of TCP communication with server, using SSL plus
Close mode encrypts TCP channel.
A kind of data transmission method, applied to the intelligent mobile terminal of Internet of things system, the method includes:
It is carried out in UDP communication process in smart home device and server by utilizing first key, is receiving the server
After the security key change instruction of transmission, the first feedback message from UDP communication mode to the server that sent with;Wherein, described
First feedback message is properly received the security key change instruction for indicating, and first feedback message uses described first
Key is encrypted;
In the case where the smart home device is established TCP communication with the server and is connect, in a manner of TCP communication to
The server sends security key change request;Wherein, the security key change request is encrypted using the first key;
After being properly received the second key that the server is sent, the second feedback message is sent to the server;
Wherein, the second key server generates at random;Second feedback message indicates to be properly received described second
Key, and second feedback message is encrypted using the first key.
Preferably, further include:
The data information encrypted sent with UDP communication mode to server;Wherein, described in the data information uses
Second key is encrypted;
The data receiver success message encrypted that the server is sent is received with UDP communication mode, wherein the number
It is encrypted according to success message is received using second key.
Preferably, further include:
After receiving the data receiver success message encrypted that the server is sent with UDP communication mode, close
The TCP channel of TCP communication connection between the smart home device and the server.
Preferably, further include:
After not receiving the data receiver success message encrypted that the server is sent with UDP communication mode, benefit
Carried out data transmission with TCP communication mode and the server.
Preferably, before smart home device and server by utilizing first key carry out UDP communication process, further include:
Send logging request to the server, and receive when meeting preset condition login that the server is sent at
Function message.
Preferably, described to send logging request to the server, the login success message that the server is sent is received,
Including:
In the case where the smart home device is established TCP communication with the server and is connect, in a manner of TCP communication to
The logging request that server is sent;Wherein, the logging request uses public key encryption, also, the logging request includes described
The identity information of smart home device;
After the identity information described in the server authentication is correct, sent out in a manner of TCP communication to the smart home device
Send login success message;Wherein, it after the server can use the public key to logging request decryption, is stepped on described in acquisition
The identity information in record request;The login success message uses the public key encryption;
Within a preset time, third feedback message is sent to the server;Wherein, the third feedback message is used for table
Show that the smart home device is properly received the login success message.
Preferably, further include:
If not sending third feedback message to the server within a preset time, it is logical with TCP that server is received again
Letter mode sends login success message to the smart home device;Wherein, the login success message is added using the public key
It is close;
After the number that the server retransmits login success message reaches preset times, receive what the server was sent
Disconnect the instruction of TCP communication connection.
Preferably, further include:
After the instruction for receiving the disconnection TCP communication connection that the server is sent, sent again to the server
Logging request, and receive when meeting preset condition the login success message that the server is sent.
Preferably, further include:
During smart home device is communicated in a manner of TCP communication with server, in the way of SSL encryption pair
TCP channel is encrypted.
A kind of Internet of things system, including:Server and smart home device;
The server, for being carried out in UDP communication process in smart home device and server by utilizing first key, with
UDP communication mode sends security key change instruction to the smart home device;Wherein, security key change instruction is using described the
One key is encrypted;Receive the first feedback message that the smart home device is sent with UDP communication mode;Wherein, described
First feedback message is properly received the security key change instruction for indicating, and first feedback message uses described first
Key is encrypted;In the case where the smart home device is established TCP communication with the server and connect, the intelligence is received
The security key change request that energy home equipment is sent in a manner of TCP communication;Wherein, the security key change request is close using described first
Key is encrypted;The second key generated at random is sent to the smart home device in a manner of TCP communication;Wherein, described
Two keys are encrypted using the first key;After the smart home device is properly received second key, connect
Receive the second feedback message that the smart home device is sent;Wherein, second feedback message indicates to be properly received described the
Two keys, and second feedback message is encrypted using the first key;
The smart home device was communicated for carrying out UDP in smart home device and server by utilizing first key
Cheng Zhong, after receiving the security key change instruction that the server is sent, sent with UDP communication mode to the server the
One feedback message;Wherein, first feedback message is properly received the security key change instruction, and described first for indicating
Feedback message is encrypted using the first key;TCP communication is established in the smart home device and the server to connect
In the case where connecing, security key change request is sent to the server in a manner of TCP communication;Wherein, the security key change request is adopted
It is encrypted with the first key;After being properly received the second key that the server is sent, sent out to the server
Send the second feedback message;Wherein, the second key server generates at random;Second feedback message is expressed as
Function receives second key, and second feedback message is encrypted using the first key.
What the key that can carry out data transmission between smart home device and server in the application can change, i.e., originally
Key in application is the key of modifiable key rather than fixation;Also, it is utilized between intelligent terminal and server
TCP communication mode transmits the key of change, since TCP communication mode reliability is stronger, it may therefore be assured that the key of change exists
Reliability in transmission process.Therefore, it is improved by the above both sides, the stolen risk of key can be greatly reduced.From
And guarantee the safety of data to be transmitted between smart home device and server.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of data transmission system disclosed in the embodiment of the present application;
Fig. 2 is a kind of flow chart of data transmission method disclosed in the embodiment of the present application;
Fig. 3 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 4 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 5 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 6 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 7 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 8 is the flow chart of another data transmission method disclosed in the embodiment of the present application;
Fig. 9 is the flow chart of another data transmission method disclosed in the embodiment of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
As shown in Figure 1, the system comprises 100 kimonos of smart home device this application provides a kind of Internet of things system
Business device 200.Smart home device 100 can carry out data transmission between server 200.
Before smart home device 100 and server 200 carry out data transmission, smart home device 100 needs to log in
Onto server 200, the process of 100 login service device 200 of smart home device is introduced first.General procedure can be:
Server 200 responds the logging request that the smart home device 100 is sent, and when meeting preset condition to institute
It states smart home device 100 and sends login success message.
This application provides the two ways of smart home device login service device, are situated between one by one to two ways below
It continues:
Firstly, introducing first way:Smart home device and UDP communication mode login service device.
As shown in Fig. 2, first way specifically includes following steps:
Step S201:Receive the logging request that the smart home device is sent with UDP communication mode;Wherein, described to step on
Record request uses public key encryption, also, the logging request includes the identity information of the smart home device.
Public key is stored on smart home device and server, public key refers to server and smart home device according to association
Discuss the fixed key of agreement.For the purpose for realizing smart home device and server carries out data transmission, smart home device
Logging request can be sent to server, and logging request includes the identity information of smart home device.In order to guarantee number
According to the safety of transmission, public key can be cooperated to encrypt logging request using AES encryption mode.
Step S202:After being decrypted using the public key to the logging request, obtain described in the logging request
Identity information.
Server receive smart home device send the logging request encrypted after, first with public key according to
Logging request is decrypted in AES manner of decryption, obtains the identity information in logging request after decryption.
Step S203:After the verifying identity information is correct, sent with UDP communication mode to the smart home device
Login success message;Wherein, the login success message uses the public key encryption.
Since there are many type of current smart home device, in order to verify whether the smart home device is the server
Governing category, server can verify the identity information of smart home device, if being stored with the identity information in server,
Illustrate that the smart home device belongs to the governing category of server, can carry out data transmission with smart home device, therefore connect
Receive the logging request of smart home device.
Then, after smart home device logins successfully, login success message can be fed back to smart home device, with
Just notice smart home device logins successfully.
Step S204:The third feedback message that the smart home device is sent is received with UDP communication mode;Wherein, institute
Third feedback message is stated for indicating that the smart home device is properly received the login success message.
Under normal circumstances, smart home device, can be to service after the login success message for receiving server transmission
Device sends third feedback message, and Tell server is successfully received the login success message.
After smart home device login service device, smart home device can carry out data transmission with server,
Encryption key in data transmission procedure can use public key.I.e. by public key temporarily as smart home device and server it
Between the first key carried out data transmission.
The above are smart home device using UDP communication mode come the process of login service device, since UDP communication mode has
There is unreliability, there is no retransmission mechanism.For example, also not requiring smart home after server does not receive logging request
The process of equipment repeating transmission logging request.Therefore, smart home device may be needed repeatedly to log in and can be logined successfully.
For this purpose, the second way is described below:Smart home device uses TCP (Transmission Control
Protocol, transmission control protocol) communication mode carrys out the process of login service device.TCP is a kind of connection-oriented, reliable
Transport layer communication protocol.I.e. communicating pair needs to verify, can if wherein a side does not receive the data packet of another party's transmission
It is required that another party retransmits, until receiving data packet (certain sending times are also to have number to limit), it is logical that here it is TCP
The transmission feature of letter mode.Therefore, logging in smart home device using TCP communication mode can be improved reliability.
As shown in figure 3, the second way specifically includes following steps:
Step S301:In the case where the smart home device is established TCP communication with the server and connect, institute is received
State the logging request that smart home device is sent in a manner of TCP communication;Wherein, the logging request uses public key encryption, also,
The logging request includes the identity information of the smart home device.
In order to realize the TCP communication between smart home device and server, smart home device is needed to build with server
Vertical TCP communication connection.The process for establishing TCP communication connection can refer to the prior art, and details are not described herein.In smart home device
On the basis of establishing TCP connection with server, logging request can be sent to server using TCP communication mode.In order to guarantee
The safety of logging request can use public key and encrypt to logging request.
Step S302:After being decrypted using the public key to the logging request, obtain described in the logging request
Identity information, and whether verify identity information correct.
If it is correct to verify identity information, illustrate the equipment that smart home device is administered by server, then enters step
Rapid S303 terminates program if verifying identity information is incorrect.
Step S303:After the verifying identity information is correct, sent in a manner of TCP communication to the smart home device
Login success message;Wherein, the login success message uses the public key encryption.
Step S304:Judge whether the third feedback message for receiving smart home device transmission within a preset time;Its
In, the third feedback message is for indicating that the smart home device is properly received the login success message.If so, into
Enter step S305;Otherwise S306 is entered step.
Step S305:Within a preset time, the third feedback that the smart home device is sent is received in a manner of TCP communication
Message.
Under normal circumstances, smart home device can be after receiving login success message, within a preset time to intelligence
Home equipment sends third feedback message.
Step S306:By sending times plus one;
Step S307:Judge whether sending times are greater than preset times, if more than S308 is then entered step, otherwise enters step
Rapid S303.I.e.:If not receiving the third feedback message that the smart home device is sent within a preset time, again
Login success message is sent to the smart home device in a manner of TCP communication;Wherein, described in the login success message uses
Public key encryption.
If within a preset time, server is not received by the third feedback message of smart home device transmission, then illustrate
Smart home device does not receive the login success message of server transmission.Therefore, it is not received within a preset time in server
When third feedback message, server can send login success message to the smart home device with UDP communication mode again.
Step S308:After the number for retransmitting login success message reaches preset times, the smart home device is disconnected
TCP communication between the server is connect, and the instruction for disconnecting TCP communication and connecting is sent to the smart home device.
Server record retransmits the sending times of login success message, when sending times reach preset times, still
The third feedback message for not receiving smart home device transmission then illustrates that the two can not be communicated now;TCP is disconnected at this time
Communication connection, is connect with driving smart home device to establish TCP communication with server again.
That is, server can respond again after sending the instruction for disconnecting TCP communication connection to the smart home device
The logging request that the smart home device is sent, and send to the smart home device when meeting preset condition log at
Function message.
After smart home device login service device, smart home device can carry out data transmission with server,
Encryption key in data transmission procedure can use public key.I.e. by public key temporarily as smart home device and server it
Between the first key carried out data transmission.
In the step S303 of the second way, server can also send the same of log messages to smart home device
When, send new key to smart home device, which is the key that generates at random of server, be used to replace between the two into
The public key of row data transmission.It hereafter, can be using new key as temporarily as the progress between smart home device and server
The first key of data transmission.
In the second way, communicated between server and smart home device using TCP communication mode, in order to more
It is further ensured that the reliability communicated between smart home device and server, the TCP communication of TCP communication can be carried out for the two
Channel carries out SSL (Security Socket Layer) encryption.SSL is operated on TCP/IP layer, under application layer, to answer
Encryption data channel is provided with program, it uses the Encryption Algorithm such as RC4, MD5 and RSA, the encryption suitable for business information.
SSL encryption is only to encrypt TCP channel rather than encryption data.For example, with smart home device with TCP communication side
Formula is sent to server for logging request:Smart home device uses AES encryption mode and public key for logging request encryption,
Then, SSL encryption mode is used to be encrypted for TCP connection channel.Server after receiving logging request, first with
SSL manner of decryption is decrypted, and then, recycles AES manner of decryption cooperation public key to be encrypted, to obtain logging request.
For another example, server sends new key to smart home device:Server is used utilizes public key in the way of AES encryption
It is encrypted for new key, and SSL encryption mode is used to be encrypted for TCP communication channel.Smart home device is solved first with SSL
Close mode is decrypted, and new key is decrypted using AES manner of decryption, to obtain new key.
That is the information that can be transmitted between smart home device and server using double-encryption mode of the application, thus
Prevent other people from stealing the encryption key between smart home device and server.
It, can be close using first between smart home device and server after smart home device login service device
Key carries out data transmission with server.As shown in figure 4, specifically including following step this application provides a kind of data transmission method
Suddenly:
Step S401:It is carried out in UDP communication process in smart home device and server by utilizing first key, it is logical with UDP
Letter mode sends security key change instruction to the smart home device;Wherein, the security key change instruction is close using described first
Key is encrypted.
During smart home device and server by utilizing first key carry out UDP communication, other people are stolen in order to prevent
Internet of things system is had an impact after taking first key.Server can change smart home device and service at any time in the application
The key that device carries out data transmission, so that other people, which can not destroy, destroys Internet of things system because stealing key.
For this purpose, server can send security key change instruction to smart home device with UDP communication mode, in order to guarantee to pacify
Quan Xing can encrypt security key change instruction using first key.
Step S402:Receive the first feedback message that the smart home device is sent with UDP communication mode;Wherein, institute
State the first feedback message for indicate be properly received security key change instruction, and first feedback message uses described the
One key is encrypted.
After smart home device receives security key change instruction with UDP communication mode, first with first key to close
Key alteration command is decrypted, and then sends the first feedback message to server again, is connect with the instruction of tell the server security key change
Harvest function.
Step S403:In the case where the smart home device is established TCP communication with the server and connect, institute is received
State the security key change request that smart home device is sent in a manner of TCP communication;Wherein, security key change request is using described the
One key is encrypted.
In smart home device after receiving security key change instruction, TCP connection can be established with server, to use
TCP communication mode needs key to be changed to transmit.After intelligentized Furniture equipment and server establish TCP connection, intelligent family
Security key change request can be sent to server in a manner of TCP communication by occupying equipment.In order to guarantee that the safety of communication can use the
The request of one key pair security key change is encrypted.
In order to further ensure the safety of transmission, SSL encryption can be opened during carrying out TCP communication, in order to
It is encrypted with the TCP channel to TCP communication.I.e. smart home device encrypts TCP channel using SSL encryption, and benefit
Security key change request is encrypted with first key.
Server receives the security key change request encrypted in a manner of TCP communication, and detailed process can be:First with
TCP channel is decrypted in SSL manner of decryption, recycles first key that security key change request is decrypted, to be solved
Security key change request after close.
Step S404:The second key generated at random is sent to the smart home device in a manner of TCP communication;Wherein,
Second key is encrypted using the first key.
Server generates the second key at random, and the second key is encrypted with first key, then, is utilizing SSL
Cipher mode encrypts TCP channel, and encrypted second key is then sent to smart home by TCP channel and is set
It is standby.
Step S405:After the smart home device is properly received second key, received in a manner of TCP communication
The second feedback message that the smart home device is sent;Wherein, second feedback message indicates to be properly received described second
Key, and second feedback message is encrypted using the first key.
After smart home device receives the second key encrypted, TCP channel is solved using SSL manner of decryption
It is close, recycle first key that the second key encrypted is decrypted, thus the second key after being decrypted.
After smart home device is properly received the second key, the second feedback is sent to server in a manner of TCP communication
Message, user indicate to be properly received second key.
The key that the application is randomly generated using server updates carry out between smart home device and server at any time
The key of data transmission, so as to reduce the probability of Key Exposure.After replacing key, smart home device then can be with
Server is carried out data transmission using updated second key.
Referring to Fig. 5, the process for using the second key to carry out data transmission for smart home device and server.
Step S501:Receive the data information encrypted that the smart home device is sent with UDP communication mode;Its
In, the data information is encrypted using second key.
Smart home device is logical with UDP using the data information that the second key is encrypted, and encrypted by data information
Letter mode is sent to server.
Step S502:After receiving the data information encrypted with UDP communication mode, with UDP communication mode to
The smart home device sends the data receiver success message encrypted;Wherein, the data receiver success message uses institute
The second key is stated to be encrypted.
Server receives the data information encrypted that smart home device is sent with UDP communication mode.Then with second
The data information that key pair has encrypted is decrypted, thus the data information after being decrypted.
Although the reliability of UDP communication is not high, its resource for occupying server is less, and UDP communication mode
Traffic rate is very fast, so can be communicated successfully if smart home device with server by utilizing UDP communication mode, it can
To close the TCP connection between smart home device and server, to reduce the resource that smart home device occupies server.
It cannot be communicated successfully if smart home device with server by utilizing UDP communication mode, in order to guarantee intelligence
Data transmission between home equipment and server, so that smart home device is counted with server using TCP communication mode
According to transmission.
The above are the processes that server side in Internet of things system executes data transmission method, and smart home device is described below
The process of side execution data transmission method.It is specifically as follows:Smart home device to the server send logging request, and
The login success message that the server is sent is received when meeting preset condition.
There are two types of modes for the process of smart home device login service device, are illustrated one by one to two ways below:
First way, as shown in fig. 6, first way specifically includes:
Step S601:The logging request sent with UDP communication mode to server;Wherein, the logging request is using public
Key encryption, also, the logging request includes the identity information of the smart home device.
Step S602:After the identity information described in the server authentication is correct, with UDP communication mode to the intelligent family
It occupies equipment and sends login success message;Wherein, it after the server can use the public key to logging request decryption, obtains
Obtain the identity information in the logging request;The login success message uses the public key encryption.
Step S603:Third feedback message is sent to the server;Wherein, the third feedback message is for indicating institute
It states smart home device and is properly received the login success message.
Specific implementation procedure is described in detail in the embodiment shown in Figure 2, and details are not described herein.
The second way, as shown in fig. 7, specifically including:
Step S701:In the case where the smart home device is established TCP communication with the server and connect, with TCP
The logging request that communication mode is sent to server;Wherein, the logging request uses public key encryption, also, the login is asked
Seek the identity information including the smart home device.
Step S702:After the identity information described in the server authentication is correct, to the intelligent family in a manner of TCP communication
It occupies equipment and sends login success message;Wherein, it after the server can use the public key to logging request decryption, obtains
Obtain the identity information in the logging request;The login success message uses the public key encryption.
Step S703:Within a preset time, third feedback message is sent to the server;Wherein, the third feedback
Message is for indicating that the smart home device is properly received the login success message.
Also, during smart home device is communicated in a manner of TCP communication with server, utilize SSL encryption
Mode encrypts TCP channel.
If not sending third feedback message to the server within a preset time, it is logical with TCP that server is received again
Letter mode sends login success message to the smart home device;Wherein, the login success message is added using the public key
It is close.
After the number that the server retransmits login success message reaches preset times, receive what the server was sent
Disconnect the instruction of TCP communication connection.After receiving the instruction that the disconnections TCP communication that the server is sent connects, again to
The server sends logging request, and the login success message of the server transmission is received when meeting preset condition.
The detailed process of the present embodiment is consistent with embodiment shown in Fig. 3, is detailed in specific implementation procedure shown in Fig. 3,
This is repeated no more.
It, can be close using first between smart home device and server after smart home device login service device
Key carries out data transmission with server.As shown in figure 8, the described method comprises the following steps:
Step S801:It is carried out in UDP communication process in smart home device and server by utilizing first key, is receiving institute
After the security key change instruction for stating server transmission, the first feedback message from UDP communication mode to the server that sent with;Its
In, first feedback message is properly received the security key change instruction for indicating, and first feedback message uses
The first key is encrypted.
Step S802:In the case where the smart home device is established TCP communication with the server and connect, with TCP
Communication mode sends security key change request to the server;Wherein, security key change request using the first key into
Row encryption.
Step S803:After being properly received the second key that the server is sent, second is sent to the server
Feedback message;Wherein, the second key server generates at random;Second feedback message indicates to be properly received
Second key, and second feedback message is encrypted using the first key.
The specific implementation procedure of step S801-S803 is specifically stated in the embodiment shown in fig. 4, herein no longer
It repeats.
Server replace key after, smart home device then can with server using updated second key into
The transmission of row data.As shown in figure 9, specific implementation procedure is:
Step S901:The data information encrypted sent with UDP communication mode to server;Wherein, the data letter
Breath is encrypted using second key.
Step S902:The data receiver success message encrypted that the server is sent is received with UDP communication mode,
In, the data receiver success message is encrypted using second key.
The detailed process that smart home device and server carry out data transmission, embodiment shown in Fig. 5 are had
Body explanation, details are not described herein.
After step S902, further include:Receive what the server was sent in smart home device with UDP communication mode
After the data receiver success message encrypted, the TCP communication closed between the smart home device and the server connects
The TCP channel connect.
The data receiver success encrypted that the server is sent is not received with UDP communication mode in smart home device
After message, carried out data transmission in the way of TCP communication with the server.
Referring to Fig. 1, this application provides a kind of Internet of things system, and the system comprises smart home devices 100 and service
Device 200.Smart home device 100 can carry out data transmission between server 200.
The smart home device 100, for carrying out UDP communication in smart home device and server by utilizing first key
In the process, it after receiving the security key change instruction that the server is sent, is sent with UDP communication mode to the server
First feedback message;Wherein, first feedback message is for indicating to be properly received security key change instruction, and described the
One feedback message is encrypted using the first key;TCP communication is established in the smart home device and the server
In the case where connection, security key change request is sent to the server in a manner of TCP communication;Wherein, the security key change request
It is encrypted using the first key;After being properly received the second key that the server is sent, to the server
Send the second feedback message;Wherein, the second key server generates at random;Second feedback message indicates
It is properly received second key, and second feedback message is encrypted using the first key.
The server 200, for carrying out UDP communication process in smart home device and server by utilizing first key
In, security key change instruction is sent to the smart home device with UDP communication mode;Wherein, the security key change instruction uses
The first key is encrypted;Receive the first feedback message that the smart home device is sent with UDP communication mode;Its
In, first feedback message is properly received the security key change instruction for indicating, and first feedback message uses
The first key is encrypted;In the case where the smart home device is established TCP communication with the server and connect, connect
Receive the security key change request that the smart home device is sent in a manner of TCP communication;Wherein, the security key change request uses institute
First key is stated to be encrypted;The second key generated at random is sent to the smart home device in a manner of TCP communication;Its
In, second key is encrypted using the first key;It is close that described second is properly received in the smart home device
After key, the second feedback message that the smart home device is sent is received;Wherein, second feedback message indicates successfully to connect
Second key is received, and second feedback message is encrypted using the first key.
Server 200 is for executing Fig. 2, Fig. 3, Fig. 4 and detailed process shown in fig. 5;Smart home device is for executing
Fig. 6, Fig. 7, Fig. 8 and specific implementation procedure shown in Fig. 9.Detailed content is referring to above content, and details are not described herein.
If function described in the present embodiment method is realized in the form of SFU software functional unit and as independent product pin
It sells or in use, can store in a storage medium readable by a compute device.Based on this understanding, the embodiment of the present application
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, this is soft
Part product is stored in a storage medium, including some instructions are used so that calculating equipment (it can be personal computer,
Server, mobile computing device or network equipment etc.) execute all or part of step of each embodiment the method for the application
Suddenly.And storage medium above-mentioned includes:USB flash disk, read-only memory (ROM, Read-Only Memory), is deposited mobile hard disk at random
The various media that can store program code such as access to memory (RAM, Random Access Memory), magnetic or disk.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with it is other
The difference of embodiment, same or similar part may refer to each other between each embodiment.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (19)
1. a kind of data transmission method, which is characterized in that applied to the server of Internet of things system, the method includes:
It is carried out in UDP communication process in smart home device and server by utilizing first key, with UDP communication mode to the intelligence
It can home equipment transmission security key change instruction;Wherein, the security key change instruction is encrypted using the first key;
Receive the first feedback message that the smart home device is sent with UDP communication mode;Wherein, first feedback message
For indicating to be properly received the security key change instruction, and first feedback message is added using the first key
It is close;
In the case where the smart home device is established TCP communication with the server and connect, receives the smart home and set
The standby security key change request sent in a manner of TCP communication;Wherein, the security key change request is added using the first key
It is close;
The second key generated at random is sent to the smart home device in a manner of TCP communication;Wherein, the second key benefit
It is encrypted with the first key;
After the smart home device is properly received second key, the smart home is received in a manner of TCP communication
The second feedback message that equipment is sent;Wherein, second feedback message indicates to be properly received second key, and described
Second feedback message is encrypted using the first key.
2. the method as described in claim 1, which is characterized in that further include:
Receive the data information encrypted that the smart home device is sent with UDP communication mode;Wherein, the data information
It is encrypted using second key;
After receiving the data information encrypted with UDP communication mode, set with UDP communication mode to the smart home
Preparation send the data receiver success message encrypted;Wherein, the data receiver success message is carried out using second key
Encryption.
3. method according to claim 2, which is characterized in that further include:
After receiving the data information encrypted with UDP communication mode, the pass that the smart home device is sent is received
TCP channel instruction is closed, the closing TCP channel instruction is closed between the smart home device and the server for indicating
TCP communication connection TCP channel.
4. method according to claim 2, which is characterized in that further include:
After not receiving the data information encrypted with UDP communication mode, in the way of TCP communication with the intelligent family
Equipment is occupied to carry out data transmission.
5. the method as described in claim 1, which is characterized in that carried out in smart home device and server by utilizing first key
Before UDP communication process, further include:
The logging request that the smart home device is sent is responded, and is sent out when meeting preset condition to the smart home device
Send login success message.
6. method as claimed in claim 5, which is characterized in that the login that the response smart home device is sent is asked
It asks, and sends login success message to the smart home device when meeting preset condition, including:
In the case where the smart home device is established TCP communication with the server and connect, receives the smart home and set
The standby logging request sent in a manner of TCP communication;Wherein, the logging request uses public key encryption, also, the logging request
Identity information including the smart home device;
After decrypting using the public key to the logging request, the identity information in the logging request is obtained;
After the verifying identity information is correct, login success message is sent to the smart home device in a manner of TCP communication;
Wherein, the login success message uses the public key encryption;
Within a preset time, the third feedback message that the smart home device is sent is received in a manner of TCP communication;Wherein, institute
Third feedback message is stated for indicating that the smart home device is properly received the login success message.
7. method as claimed in claim 6, which is characterized in that further include:
If the third feedback message that the smart home device is sent is not received within a preset time, again with TCP
Communication mode sends login success message to the smart home device;Wherein, the login success message uses the public key
Encryption;
After the number for retransmitting login success message reaches preset times, disconnect the smart home device and the server it
Between TCP communication connection, and to the smart home device send disconnect TCP communication connect instruction.
8. the method for claim 7, which is characterized in that further include:
After sending the instruction for disconnecting TCP communication connection to the smart home device, the smart home is responded again and is set
The logging request that preparation is sent, and login success message is sent to the smart home device when meeting preset condition.
9. the method according to claim 1, which is characterized in that logical with TCP in smart home device and server
During letter mode is communicated, TCP channel is encrypted in the way of SSL encryption.
10. a kind of data transmission method, which is characterized in that applied to the smart home device of Internet of things system, the method packet
It includes:
It carries out in UDP communication process in smart home device and server by utilizing first key, is sent receiving the server
Security key change instruction after, with UDP communication mode to the server send the first feedback message;Wherein, described first is anti-
Message is presented for indicating to be properly received security key change instruction, and first feedback message using the first key into
Row encryption;
In the case where the smart home device is established TCP communication with the server and connect, to described in a manner of TCP communication
Server sends security key change request;Wherein, the security key change request is encrypted using the first key;
After being properly received the second key that the server is sent, the second feedback message is sent to the server;Wherein,
The second key server generates at random;Second feedback message indicates successful reception second key,
And second feedback message is encrypted using the first key.
11. method as claimed in claim 10, which is characterized in that further include:
The data information encrypted sent with UDP communication mode to server;Wherein, the data information uses described second
Key is encrypted;
The data receiver success message encrypted that the server is sent is received with UDP communication mode, wherein the data connect
Success message is received to be encrypted using second key.
12. method as claimed in claim 11, which is characterized in that further include:
After receiving the data receiver success message encrypted that the server is sent with UDP communication mode, described in closing
The TCP channel of TCP communication connection between smart home device and the server.
13. method as claimed in claim 11, which is characterized in that further include:
After not receiving the data receiver success message encrypted that the server is sent with UDP communication mode, TCP is utilized
Communication mode carries out data transmission with the server.
14. method as claimed in claim 11, which is characterized in that smart home device and server by utilizing first key into
Before row UDP communication process, further include:
Logging request is sent to the server, and receives the logining successfully for server transmission when meeting preset condition and disappears
Breath.
15. method as claimed in claim 14, which is characterized in that it is described to send logging request to the server, receive institute
The login success message of server transmission is stated, including:
In the case where the smart home device is established TCP communication with the server and connect, to service in a manner of TCP communication
The logging request that device is sent;Wherein, the logging request uses public key encryption, also, the logging request includes the intelligence
The identity information of home equipment;
After the identity information described in the server authentication is correct, stepped in a manner of TCP communication to smart home device transmission
Record success message;Wherein, it after the server can use the public key to logging request decryption, obtains the login and asks
The identity information in asking;The login success message uses the public key encryption;
Within a preset time, third feedback message is sent to the server;Wherein, the third feedback message is for indicating institute
It states smart home device and is properly received the login success message.
16. method as claimed in claim 15, which is characterized in that further include:
If not sending third feedback message to the server within a preset time, server is received again with TCP communication side
Formula sends login success message to the smart home device;Wherein, the login success message uses the public key encryption;
After the number that the server retransmits login success message reaches preset times, the disconnection that the server is sent is received
The instruction of TCP communication connection.
17. the method described in claim 16, which is characterized in that further include:
After the instruction for receiving the disconnection TCP communication connection that the server is sent, sends and log in the server again
It requests, and receives the login success message of the server transmission when meeting preset condition.
18. such as the described in any item methods of claim 11-17, which is characterized in that further include:
During smart home device is communicated in a manner of TCP communication with server, to TCP in the way of SSL encryption
Channel is encrypted.
19. a kind of Internet of things system, which is characterized in that including:Server and smart home device;
The server, for being carried out in UDP communication process in smart home device and server by utilizing first key, with UDP
Communication mode sends security key change instruction to the smart home device;Wherein, the security key change instruction uses described first
Key is encrypted;Receive the first feedback message that the smart home device is sent with UDP communication mode;Wherein, described
One feedback message is properly received the security key change instruction for indicating, and first feedback message is close using described first
Key is encrypted;In the case where the smart home device is established TCP communication with the server and connect, the intelligence is received
The security key change request that home equipment is sent in a manner of TCP communication;Wherein, the security key change request uses the first key
It is encrypted;The second key generated at random is sent to the smart home device in a manner of TCP communication;Wherein, described second
Key is encrypted using the first key;After the smart home device is properly received second key, receive
The second feedback message that the smart home device is sent;Wherein, second feedback message indicates to be properly received described second
Key, and second feedback message is encrypted using the first key;
The smart home device, for being carried out in UDP communication process in smart home device and server by utilizing first key,
After receiving the security key change instruction that the server is sent, with UDP communication mode is sent to the server first instead
Present message;Wherein, first feedback message is properly received the security key change instruction, and first feedback for indicating
Message is encrypted using the first key;Establish what TCP communication was connect with the server in the smart home device
In the case of, security key change request is sent to the server in a manner of TCP communication;Wherein, the security key change request uses institute
First key is stated to be encrypted;After being properly received the second key that the server is sent, the is sent to the server
Two feedback messages;Wherein, the second key server generates at random;Second feedback message indicates successfully to connect
Second key is received, and second feedback message is encrypted using the first key.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510749902.XA CN105610783B (en) | 2015-11-05 | 2015-11-05 | A kind of data transmission method and Internet of things system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510749902.XA CN105610783B (en) | 2015-11-05 | 2015-11-05 | A kind of data transmission method and Internet of things system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105610783A CN105610783A (en) | 2016-05-25 |
CN105610783B true CN105610783B (en) | 2018-11-30 |
Family
ID=55990323
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510749902.XA Active CN105610783B (en) | 2015-11-05 | 2015-11-05 | A kind of data transmission method and Internet of things system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105610783B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105871548B (en) * | 2016-06-08 | 2019-06-04 | 美的集团股份有限公司 | The processing method of household appliance, Cloud Server and the debugging of family's power information |
CN106549966B (en) * | 2016-10-31 | 2020-09-04 | 美的智慧家居科技有限公司 | Method and system for switching communication security level, household appliance and mobile terminal |
WO2018076369A1 (en) * | 2016-10-31 | 2018-05-03 | 美的智慧家居科技有限公司 | Method and system for communication security level switching, household appliance, and mobile terminal |
CN106850669B (en) * | 2017-03-03 | 2020-10-23 | 重庆和航科技股份有限公司 | Message security transmission method for Internet of things monitoring system |
CN107370751B (en) * | 2017-08-18 | 2020-10-16 | 深圳市鑫宇鹏电子科技有限公司 | Method for updating session key in intelligent equipment communication |
US10764328B2 (en) * | 2017-11-03 | 2020-09-01 | International Business Machines Corporation | Altering cipher and key within an established session |
CN110868276A (en) * | 2018-08-28 | 2020-03-06 | 京东数字科技控股有限公司 | Data transmission method and system for Internet of things equipment and electronic equipment |
CN109274490B (en) * | 2018-09-25 | 2021-12-17 | 苏州科达科技股份有限公司 | SRTP code stream master key updating method, system, equipment and storage medium |
CN110519215B (en) * | 2019-07-02 | 2020-11-17 | 珠海格力电器股份有限公司 | Data communication method and device |
CN111007736A (en) * | 2019-12-20 | 2020-04-14 | 阮振荣 | Intelligent home system |
CN112769868A (en) * | 2021-02-07 | 2021-05-07 | 深圳市欧瑞博科技股份有限公司 | Communication method, communication device, electronic device and storage medium |
CN115550002A (en) * | 2022-09-20 | 2022-12-30 | 贵州电网有限责任公司 | TEE-based intelligent home remote control method and related device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101325483A (en) * | 2008-07-28 | 2008-12-17 | 中国电信股份有限公司 | Method and apparatus for updating symmetrical cryptographic key, symmetrical ciphering method and symmetrical deciphering method |
CN102130891A (en) * | 2010-01-18 | 2011-07-20 | 中兴通讯股份有限公司 | Method and system for coordinating keys based on transmission control protocol (TCP) |
US8509424B2 (en) * | 2009-11-15 | 2013-08-13 | Ante Deng | Fast key-changing hardware apparatus for AES block cipher |
CN103763107A (en) * | 2014-01-24 | 2014-04-30 | 刘文军 | Intelligent household appliance system secret key control method and intelligent household appliance system |
CN103841082A (en) * | 2012-11-22 | 2014-06-04 | 中国电信股份有限公司 | Security capability negotiation method, system, service server and user terminal |
CN104811444A (en) * | 2015-04-02 | 2015-07-29 | 谢杰涛 | Secure cloud control method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104618380B (en) * | 2015-02-03 | 2017-09-29 | 浙江师范大学 | A kind of key updating method suitable for Internet of Things |
-
2015
- 2015-11-05 CN CN201510749902.XA patent/CN105610783B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101325483A (en) * | 2008-07-28 | 2008-12-17 | 中国电信股份有限公司 | Method and apparatus for updating symmetrical cryptographic key, symmetrical ciphering method and symmetrical deciphering method |
US8509424B2 (en) * | 2009-11-15 | 2013-08-13 | Ante Deng | Fast key-changing hardware apparatus for AES block cipher |
CN102130891A (en) * | 2010-01-18 | 2011-07-20 | 中兴通讯股份有限公司 | Method and system for coordinating keys based on transmission control protocol (TCP) |
CN103841082A (en) * | 2012-11-22 | 2014-06-04 | 中国电信股份有限公司 | Security capability negotiation method, system, service server and user terminal |
CN103763107A (en) * | 2014-01-24 | 2014-04-30 | 刘文军 | Intelligent household appliance system secret key control method and intelligent household appliance system |
CN104811444A (en) * | 2015-04-02 | 2015-07-29 | 谢杰涛 | Secure cloud control method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105610783A (en) | 2016-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105610783B (en) | A kind of data transmission method and Internet of things system | |
CN110177354B (en) | Wireless control method and system for vehicle | |
US6263437B1 (en) | Method and apparatus for conducting crypto-ignition processes between thin client devices and server devices over data networks | |
EP2320621B1 (en) | Method for establishing cryptographic communications between a remote device and a medical device and system for carrying out the method | |
CN103828414B (en) | Security gateway communicates | |
EP2421292B1 (en) | Method and device for establishing security mechanism of air interface link | |
CN105337935B (en) | A kind of method and apparatus for establishing client and the long connection of server-side | |
CN110602703B (en) | Bluetooth communication data encryption method, terminal and system for BLE | |
CN105162599B (en) | A kind of data transmission system and its transmission method | |
EP2590356A1 (en) | Method, device and system for authenticating gateway, node and server | |
US20180131408A1 (en) | Wireless communication | |
US11245531B2 (en) | Method, apparatus and system for establishing biometric identification information transmission and storage medium | |
CN105323754B (en) | A kind of distributed method for authenticating based on wildcard | |
CN107682363B (en) | Intelligent household product safety communication method, system and computer readable storage medium | |
CN109754241B (en) | Hard wallet and verification method based on hard wallet | |
US20160112411A1 (en) | One time credentials for secure automated bluetooth pairing | |
CN108683641A (en) | A kind of data communications method, device, unmanned plane and computer storage media | |
CN113347010B (en) | Mutual authentication method and system based on SSL-TLS protocol | |
CN112425116B (en) | Intelligent door lock wireless communication method, intelligent door lock, gateway and communication equipment | |
CN107135228B (en) | Authentication system and authentication method based on central node | |
US20170359178A1 (en) | Network communication method having function of recovering terminal session | |
CN109474667B (en) | Unmanned aerial vehicle communication method based on TCP and UDP | |
JP2022503839A (en) | Distributed network cellular identity management | |
CN108600221A (en) | A kind of data communications method, device, earth station and computer storage media | |
WO2013152653A1 (en) | Air interface security method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |