CN112769868A - Communication method, communication device, electronic device and storage medium - Google Patents

Communication method, communication device, electronic device and storage medium Download PDF

Info

Publication number
CN112769868A
CN112769868A CN202110176771.6A CN202110176771A CN112769868A CN 112769868 A CN112769868 A CN 112769868A CN 202110176771 A CN202110176771 A CN 202110176771A CN 112769868 A CN112769868 A CN 112769868A
Authority
CN
China
Prior art keywords
communication
key
secret key
intelligent
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110176771.6A
Other languages
Chinese (zh)
Inventor
夏文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Oribo Technology Co Ltd
Original Assignee
Shenzhen Oribo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Oribo Technology Co Ltd filed Critical Shenzhen Oribo Technology Co Ltd
Priority to CN202110176771.6A priority Critical patent/CN112769868A/en
Publication of CN112769868A publication Critical patent/CN112769868A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/068Network architectures or network communication protocols for network security for supporting key management in a packet data network using time-dependent keys, e.g. periodically changing keys
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer

Abstract

The application discloses a communication method, a communication device, electronic equipment and a storage medium, and relates to the technical field of smart home, wherein a server establishes long connection with smart home equipment through a preset encryption protocol, generates a communication key when the server receives encryption information sent by the smart home equipment under the preset encryption protocol, sends the communication key to the smart home equipment, and sends the communication key under the preset encryption protocol, so that the safety of the communication key is ensured; the intelligent home equipment encrypts communication contents through the communication secret key to generate encrypted information and sends the encrypted information to the server; the server decrypts the encrypted information based on the communication secret key to obtain communication content, and double protection is performed on the communication content through a preset encryption protocol and the communication secret key, so that the safety of the communication content between the server and the intelligent household equipment is ensured, and the privacy of a user is protected.

Description

Communication method, communication device, electronic device and storage medium
Technical Field
The present application relates to the field of smart home technologies, and in particular, to a communication method, apparatus, electronic device, and storage medium.
Background
The intelligent home is characterized in that a house is used as a platform, various intelligent home devices in the house are connected with a server through the Internet of things technology, and an intelligent living environment is achieved. In the smart home, when communication is performed between the smart home device and the server, communication contents between the smart home device and the server may be leaked, so that privacy of a user is leaked.
Disclosure of Invention
In view of the above problems, the present application provides a communication method, an apparatus, an electronic device, and a storage medium, which can solve the above problems.
In a first aspect, an embodiment of the present application provides a communication method, which is applied to a server, and the method includes: establishing long connection with the intelligent household equipment through a preset encryption protocol; when a communication request of the intelligent home equipment is received, generating a communication secret key, and sending the communication secret key to the intelligent home equipment; receiving encryption information sent by the intelligent home equipment, wherein the encryption information is generated by the intelligent home equipment through encrypting communication contents of the intelligent home equipment by using the communication secret key; and decrypting the encrypted information based on the communication secret key to obtain the communication content.
In a second aspect, an embodiment of the present application provides a communication apparatus, including: the connection module is used for establishing long connection with the intelligent household equipment through a preset encryption protocol; the generation module is used for generating a communication secret key when receiving a communication request of the intelligent household equipment and sending the communication secret key to the intelligent household equipment; the receiving module is used for receiving encrypted information sent by the intelligent home equipment, wherein the encrypted information is generated by the intelligent home equipment through encrypting communication contents of the intelligent home equipment by using the communication secret key; and the decryption module is used for decrypting the encrypted information based on the communication secret key to obtain the communication content.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above-described methods.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
Compared with the prior art, according to the communication method, the communication device, the electronic equipment and the storage medium, the server establishes long connection with the intelligent household equipment through the preset encryption protocol, under the preset encryption protocol, the whole communication or conversation between the server and the intelligent household equipment can be protected, a safe communication environment is provided for the communication between the server and the intelligent household equipment, under the preset encryption protocol, when the server receives encryption information sent by the intelligent household equipment, a communication secret key is generated and sent to the intelligent household equipment, and under the preset encryption protocol, the communication secret key is sent, so that the safety of the communication secret key is guaranteed; the intelligent home equipment encrypts communication contents through the communication secret key to generate encrypted information and sends the encrypted information to the server; the server decrypts the encrypted information based on the communication secret key to obtain communication content, and double protection is performed on the communication content through a preset encryption protocol and the communication secret key, so that the safety of the communication content between the server and the intelligent household equipment is ensured, and the privacy of a user is protected.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, 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 schematic diagram illustrating an application environment of a communication system suitable for use in an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating a communication method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a communication method according to another embodiment of the present application;
fig. 4 shows a flow chart of step S240 of the communication method shown in fig. 3 of the present application;
fig. 5 is a schematic flow chart illustrating a communication method according to another embodiment of the present application;
fig. 6 is a flow chart illustrating a communication method according to still another embodiment of the present application;
fig. 7 is a schematic flow chart illustrating a communication method according to yet another embodiment of the present application;
fig. 8 is a flow chart illustrating a communication method according to still another embodiment of the present application;
fig. 9 is a block diagram of a communication device provided by an embodiment of the present application;
fig. 10 is a block diagram of an electronic device for executing a communication method according to an embodiment of the present application;
fig. 11 is a storage unit for storing or carrying program codes for implementing a communication method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
The intelligent home is characterized in that a house is used as a platform, various intelligent home devices in the house are connected with a server through the Internet of things technology, and an intelligent living environment is achieved. In the smart home, when communication is performed between the smart home device and the server, communication contents between the smart home device and the server may be leaked, so that privacy of a user is leaked.
In view of the above technical problems, the inventor has found, through long-term research, that a communication method, an apparatus, an electronic device, and a storage medium establish a communication connection between a server and an intelligent home device through a preset encryption protocol, and encrypt communication contents between the server and the intelligent home device based on a communication key, so that double encryption ensures security of the communication contents and prevents disclosure of user privacy.
For convenience of understanding, this embodiment shows a communication system, fig. 1 shows an application environment schematic diagram of a communication system suitable for the embodiment of the present application, please refer to fig. 1, a communication system 100 includes an intelligent home device 110 and a server 120, a long connection is performed between the intelligent home device 110 and the server 120 through an encryption protocol, and under the long connection, the intelligent home device 110 and the server 120 send communication content to each other.
Optionally, the number of the smart home devices connected to the server may be one or multiple.
In this embodiment, fig. 2 shows a schematic flow chart of a communication method provided in an embodiment of the present application. In a specific embodiment, the communication method is applied to the smart home device 110 shown in fig. 1, the communication apparatus 200 shown in fig. 9, and the electronic device 300 configured with the communication apparatus 200 shown in fig. 10. The specific flow of the present embodiment will be described below by taking the server 120 as an example. It can be understood that the server applied in this embodiment may be a cloud server, and may also be a physical server, which is not specifically limited herein. As will be described in detail with respect to the flow shown in fig. 2, the communication method may specifically include the following steps:
and step S110, establishing long connection with the intelligent household equipment through a preset encryption protocol.
In an intelligent home system formed by the intelligent home devices and the server, the server establishes a long connection with the intelligent home devices through a preset encryption protocol, optionally, the preset encryption protocol may be a Secure Sockets Layer (SSL), where the SSL is a protocol for encrypting the entire communication between the server and the intelligent home devices. The server establishes long connection with the intelligent household equipment through an SSL protocol so as to encrypt communication and provide a safe communication environment for the communication between the server and the intelligent household equipment.
In some embodiments, when the smart home device and the server belong to the same communication system, the server establishes a long connection with the smart home device through a preset encryption protocol.
In other embodiments, when the smart home device logs in the server through the account and the password, the server establishes a long connection with the smart home device through a preset encryption protocol. The account may be a User Identity (UID). When logging in for the first time, the validity of the UID and the correctness of the password need to be checked, when the UID is matched with the UID in the legal identity library, the UID is legal, and when the password is a password bound with the UID, the password is correct. When the user logs in for the first time, the correctness of the password which is input into the device for the first time and stored by the user only needs to be checked.
Optionally, the smart home device applied in this embodiment may be an intelligent audio and video device, an intelligent curtain, an intelligent air conditioning device, an intelligent door lock, an intelligent lighting device, an intelligent security device, and the like, which is not limited herein. In addition, the number of the smart home devices is not limited, and the smart home devices can be one, two or five.
Step S120, when receiving a communication request of the smart home device, generating a communication key, and sending the communication key to the smart home device.
When the long connection between the server and the intelligent home equipment is successfully established and the intelligent home equipment needs to communicate with the server, the intelligent home equipment generates a communication request, and the intelligent home equipment sends the communication request to the server through the long connection successfully established by the preset encryption protocol. When the server receives the communication request, in order to ensure the safety of communication between the server and the intelligent household equipment, a communication secret key is generated, and the communication secret key is sent to the intelligent household equipment. The communication key is used for encrypting and decrypting communication content, specifically, for a message sender, the communication content is encrypted through the communication key to obtain the encrypted communication content; and for the message receiver, decrypting the communication content encrypted by the other party by using the communication secret key to obtain the communication content.
In some embodiments, when the user has a regulation requirement, the user directly performs an input operation through the control panel of the smart home device, and the smart home device generates a communication request based on the input operation and sends the communication request to the server.
In other embodiments, communication conditions may be preset, and when the communication conditions are met, the smart home devices generate a communication request and upload the communication request to the server. For example, the communication condition may be to adjust the temperature within a preset time period, for example, the user usually goes home from work between 17:00 to 23:00, so the preset time period may be 17:00 to 23:00, and the user may set the smart home device to generate the first communication request within the preset time period 17:00 to 23:00, so as to request the server to adjust the indoor temperature, and create a comfortable home environment for the user. For another example, the communication condition is that the working parameters are uploaded at a preset time point, and the smart home device generates a second communication request at the preset time point to request to upload the working parameters of the smart home device, optionally, the preset time point may be 24:00, and the working parameters may be current power consumption, heating conditions of the smart home device, and the like.
Optionally, in order to ensure security of the communication content, a random dynamic communication key is generated, a validity period of the communication key is set, or the communication key is updated periodically, for example, the validity period or the update period may be a first preset time interval, the server updates the communication key according to the first preset time interval, and sends the updated communication key to the smart home device. Wherein, the first preset time interval may be, but is not limited to, 5 seconds, 10 seconds, 30 seconds, 5 minutes, 8 minutes, etc.
Step S130, receiving encryption information sent by the smart home device, where the encryption information is generated by the smart home device by encrypting communication content of the smart home device with the communication key.
After receiving the communication secret key, the intelligent home equipment encrypts the communication content of the intelligent home equipment by using the communication secret key to generate encrypted information, and then sends the encrypted information to the server.
Optionally, the communication content may be an operation parameter of the smart home device, a control request preset by a user, and the like.
Step S140, decrypting the encrypted information based on the communication key to obtain the communication content.
Since the encrypted information is the encrypted communication content, the server cannot directly acquire the communication content therein, and therefore, the server decrypts the encrypted information based on the communication key to acquire the communication content.
Similarly, the server encrypts the communication content of the server by using the communication secret key to generate encryption information, and sends the encryption information to the smart home device, and the smart home device decrypts the encryption information sent by the server by using the communication secret key to obtain the communication content of the server.
After the server and the intelligent household equipment are communicated, the long connection is disconnected, and the communication secret key of the connection is cleared, namely the communication secret key is invalid. If the server and the smart home device communicate again, the communication key needs to be updated again, that is, the above steps S110 to S140 need to be performed again.
According to the communication method provided by the embodiment, the server establishes long connection with the intelligent home equipment through the preset encryption protocol, and it can be understood that under the preset encryption protocol, the whole communication or session between the server and the intelligent home equipment can be protected, a safe communication environment is provided for the communication between the server and the intelligent home equipment, under the preset encryption protocol, when the server receives encryption information sent by the intelligent home equipment, a communication key is generated and sent to the intelligent home equipment, and under the preset encryption protocol, the communication key is sent, so that the safety of the communication key is ensured; the intelligent home equipment encrypts communication contents through the communication secret key to generate encrypted information and sends the encrypted information to the server; the server decrypts the encrypted information based on the communication secret key to obtain communication content, and double encryption protection is performed on the communication content through a preset encryption protocol and the communication secret key, so that the safety of the communication content between the server and the intelligent household equipment is ensured, and the privacy of a user is protected.
On the basis of the foregoing embodiment, this embodiment provides a communication method, when a server communicates with multiple smart home devices simultaneously, a communication key corresponding to each of the multiple smart devices is obtained, so as to decrypt encrypted information corresponding to each of the multiple smart devices, and obtain communication content. Fig. 3 is a schematic flow chart of a communication method according to another embodiment of the present application, please refer to fig. 3, where the communication method includes the following steps:
and step S210, establishing long connection with the intelligent household equipment through a preset encryption protocol.
For detailed description of step S210, please refer to step S110, which is not described herein again.
Step S220, when the communication request of the smart home device is received, generating the communication key and the communication identifier.
In this embodiment, the number of the smart home devices communicating with the server may be multiple, the server creates multiple sessions with the multiple smart home devices, and generates a unique communication identifier for uniquely characterizing one session for each session, and generates a communication key for each session.
For example, the server communicates with three smart home devices, for example, the server communicates with a smart home device a and a smart home device B, the server creates a first session with the smart home device a, and generates a first communication key and a first communication identifier corresponding to the first session, the first communication identifier is used for uniquely characterizing the first session, and in the first session, the server and the smart home device a are encrypted and decrypted by the first communication key. Similarly, the server and the smart home device B create a second session, and generate a second communication key and a second communication identifier corresponding to the second session, where the second communication identifier is used to uniquely characterize the second session, and in the second session, both the server and the smart home device B are encrypted and decrypted by the first communication key.
Step S230, establishing a corresponding relationship between the communication key and the communication identifier.
And binding the communication secret key and the communication identifier, and establishing a corresponding relation between the plurality of communication secret keys and the plurality of communication identifiers. Continuing with the example of step S220, in the first session, a first correspondence between the first communication identifier and the first communication key is established. In the second session, a second correspondence between the second communication identity and the second communication key is established.
Step S240, sending the communication key and the communication identifier to the smart home device.
The server sends the communication secret key and the communication identifier to the intelligent home equipment in the session, and the intelligent home equipment encrypts communication contents through the communication secret key to generate encryption information so as to prevent the communication contents from being leaked. And the intelligent home equipment sends the communication identifier and the encryption information to the server together, so that the server determines the communication key corresponding to the intelligent home equipment in a plurality of communication keys corresponding to a plurality of sessions according to the communication identifier, and the server is ensured to find out a correct key according to the corresponding relation for decryption.
In some embodiments, in order to ensure security in the process of receiving and sending the communication key, and prevent the communication key from being stolen in the process of transmitting the communication key from the server to the smart home device, therefore, the communication key may be encrypted by using a static key and then sent to the smart home device, fig. 4 shows a flowchart of step S240 of the communication method shown in fig. 3 of the present application, please refer to fig. 4, and step S240 includes the following sub-steps:
step S241, encrypt the communication key and the communication identifier with a static key to obtain an encrypted packet.
In some embodiments, the server receives a static key sent by the smart home device, and performs Advanced Encryption Standard (AES) Encryption on the communication key and the communication identifier by using the static key to obtain an Encryption packet. After the intelligent household equipment receives the encryption package, the encryption package is decrypted through the static secret key, and a communication secret key and a communication identifier are obtained.
In other embodiments, the server and the smart home device respectively store static keys in advance, and the server encrypts the communication key and the communication identifier through the static keys stored in the server to obtain an encryption package. After the intelligent home equipment receives the encryption package, the encryption package is decrypted through a static secret key stored in the intelligent home equipment, and a communication secret key and a communication identifier are obtained.
Optionally, the server may send the encryption packet to the smart home device in a form of a message, where a header of the message includes an encryption manner for the communication key, and if pt ═ pk in the header of the message, it indicates that the message is encrypted with a static key (skey). The message body comprises an encryption packet.
Optionally, the static key may be only used for encrypting the communication key, and the static key is used for encrypting the communication key to obtain an encrypted communication key, and then the encrypted communication key and the communication identifier are sent to the smart home device.
Step S242, sending the encryption packet to the smart home device, so that the smart home device decrypts the encryption packet according to the static secret key to obtain the communication secret key and the communication identifier.
The server sends the encryption packet to the intelligent home equipment, and the intelligent home equipment decrypts the encryption packet according to the static secret key stored in the intelligent home equipment to obtain the communication secret key and the communication identifier.
Step S250, receiving the encryption information and the communication identifier sent by the smart home device.
The intelligent household equipment encrypts the communication content of the intelligent household equipment by using the communication secret key to obtain the encrypted information, and sends the encrypted information and the communication identifier to the server. It will be appreciated that the communication content is in the form of ciphertext (i.e., encrypted information) and the communication identifier is sent to the server in the form of plaintext.
Step S260, determining a communication key corresponding to the communication identifier based on the correspondence relationship.
Continuing with the above example as an example, when the server receives the first communication identifier sent by the smart home device a in the first session, based on the first correspondence relationship, the server obtains the first communication key corresponding to the first communication identifier, and may decrypt the first encrypted information sent by the smart home device a through the first communication key.
The server receives a second communication identifier sent by the intelligent home device B in a second session, obtains a second communication key corresponding to the second communication identifier based on the second correspondence, and can decrypt second encrypted information sent by the intelligent home device B through the second communication key.
Step S270, decrypting the encrypted information based on the communication key corresponding to the communication identifier to obtain the communication content.
Optionally, the smart home device may send the encrypted information to the server in the form of a message, where the message header includes an encryption manner for the communication key, and if pt ═ pd in the message header indicates that the message is encrypted with the communication key (dkey). The message body includes encryption information.
For the detailed description of step S270, please refer to step S140, which is not described herein again.
Optionally, the server receives a heartbeat packet sent by the smart home device, and reports the state of the smart home device through the heartbeat packet; if the heartbeat packet sent by the intelligent home equipment is received again after the second preset time interval, the intelligent home equipment is still on line, and the intelligent home equipment needs to continuously communicate with the server; if the heartbeat packet sent by the intelligent household equipment is not received again after the second preset time interval, the intelligent household equipment is offline or fails, the intelligent household equipment does not need to communicate with the server, long connection between the intelligent household equipment and the intelligent household equipment is disconnected, and bandwidth resources are made available for other intelligent household equipment.
In this embodiment, when a plurality of smart home devices communicate with the server, the server obtains the communication key corresponding to each smart home device according to the corresponding relationship, and decrypts the encrypted information by using the communication key to obtain the communication content, thereby ensuring that the server can accurately obtain the key, and thus obtaining the communication content of the server.
On the basis of the foregoing embodiments, this embodiment provides a communication method for determining, according to a communication security level corresponding to communication content between a server and smart home devices, whether a communication key needs to be generated to encrypt and decrypt communication content between two parties according to the communication security level, where fig. 5 shows a schematic flow diagram of a communication method provided in another embodiment of the present application, and please refer to fig. 5, where the communication method includes the following steps:
and S310, establishing long connection with the intelligent household equipment through a preset encryption protocol.
For detailed description of step S310, please refer to step S110, which is not described herein again.
Step S320, when the communication request of the intelligent household equipment is received, determining a communication safety level according to the communication request.
When the server receives a communication request sent by the smart home device, optionally, the communication request may request to control a working state of the smart home device, or may request to upload a working parameter of the smart home device, and determine a communication security level corresponding to the communication request, where the higher the privacy of the communication content requested by the communication request is, the higher the corresponding security level is, and conversely, the lower the privacy of the communication content requested by the communication request is, the lower the corresponding security level is.
In some embodiments, a mapping relationship between a plurality of communication requests and a plurality of communication security levels may be established in advance, and according to the mapping relationship, a communication security level corresponding to the communication request is determined.
In other embodiments, the security level of the communication request may be determined according to the type of the smart home device.
For example, the smart home devices are smart windows, when the smart windows request that the outdoor dust concentration is smaller than a preset dust concentration threshold value, the smart windows are opened, and the security level corresponding to the request is low.
For another example, the smart home device is a smart air conditioner, and when the user inputs a timing switch request through the smart air conditioner, the time when the user is at home and the time when the user is not at home can be estimated according to the set time period, and the age of the user can be estimated according to the set air conditioning temperature.
The communication safety levels of the intelligent household equipment of different types are preset, when the communication safety levels are smaller than the preset safety levels, the communication content between the intelligent household equipment and the server can be free of encryption, and the server directly communicates with the intelligent household equipment according to the communication request so as to reduce the communication time delay between the intelligent household equipment and the server.
Step S330, when the communication security level is greater than a preset security level, generating the communication secret key, and sending the communication secret key to the smart home device.
When the communication security level is higher than the preset security level, the communication content between the intelligent home equipment and the server needs to be encrypted, the server generates a communication secret key, and the communication secret key is sent to the intelligent home equipment.
Step S340, receiving encrypted information sent by the smart home device, where the encrypted information is generated by the smart home device through communication content of the smart home device encrypted by the communication key.
Step S350, decrypting the encrypted information based on the communication key to obtain the communication content.
For the detailed description of steps S340 to S350, refer to steps S130 to S140, which are not described herein again.
In this embodiment, according to a communication request of the smart home device, a communication security level corresponding to the communication request is determined, when the communication security level is greater than a preset security level, a communication key is generated and sent to the smart home device, the smart home device encrypts its own communication content based on the communication key to obtain encrypted information and sends the encrypted information to the server, and the server decrypts the encrypted information based on the communication key to obtain the communication content, so that the security of the communication content with a high communication security level is ensured, and the privacy of a user is prevented from being leaked.
On the basis of the foregoing embodiments, this embodiment provides a communication method for determining a corresponding encryption level according to a communication security level and encrypting communication contents with different communication security levels at different encryption levels, and fig. 6 shows a flow diagram of a communication method according to still another embodiment of the present application, and please refer to fig. 6, where the communication method includes the following steps:
and S410, establishing long connection with the intelligent household equipment through a preset encryption protocol.
For detailed description of step S410, please refer to step S110, which is not described herein again.
Step S420, when the communication request of the intelligent household equipment is received, determining a communication safety level according to the communication request.
For detailed description of step S420, please refer to step S320, which is not described herein.
And step S430, determining the encryption level corresponding to the communication security level.
And the different security levels correspond to different encryption levels, the mapping relation between the communication security levels and the encryption levels is preset, and the encryption level corresponding to the communication security level is determined according to the mapping relation.
The communication security level is positively correlated with the encryption level, and the higher the communication security level is, the higher the encryption level is, whereas the lower the communication security level is, the lower the encryption level is.
Step S440, generating a communication key corresponding to the encryption level, and sending the communication key to the smart home device.
The higher the encryption level is, the higher the complexity of the generated communication secret key is, and the security of the communication content is ensured so as to reduce the risk of leakage of the communication content. On the contrary, the lower the encryption level, the lower the complexity of the generated communication key, the security of the content can be ensured by encrypting the communication key, and the encryption and decryption time can be reduced by encrypting and decrypting the communication key with lower complexity, thereby improving the communication efficiency.
Step S450, receiving encrypted information sent by the smart home device, where the encrypted information is generated by the smart home device through the communication content of the smart home device encrypted by the communication key.
Step S460, decrypting the encrypted information based on the communication key to obtain the communication content.
For the detailed description of steps S450 to S460, refer to steps S130 to S140, which are not described herein again.
In this embodiment, the server establishes a long connection with the smart home device through a preset encryption protocol, when the communication request of the smart home device is received, the communication security level is determined according to the communication request, the encryption level corresponding to the communication security level is determined, a communication key corresponding to the encryption level is generated, and the communication key is sent to the smart home device, the server and the smart home device perform encryption and decryption through the communication key, for a key with a higher encryption level, a more complex communication key is matched for encryption and decryption, the security of communication content is ensured, for a key with a lower encryption level, a simpler communication key is matched for encryption and decryption, the security of the communication content is ensured, the time for encryption and decryption can be reduced, and the communication efficiency is improved.
Optionally, fig. 7 shows a schematic flow chart of a communication method provided by yet another embodiment of the present application, where the communication method is applied to the smart home device 110 shown in fig. 1, please refer to fig. 7, and the communication method includes the following steps:
step S510, a long connection with the server is established through a preset encryption protocol.
Step S520, sending a communication request to the server, and receiving a communication key sent by the server.
Step S530, encrypting the communication content by using the communication key to generate encrypted information.
Step S540, sending the encrypted information to the server, so that the server decrypts the encrypted information based on the communication key to obtain the communication content.
The steps S510 to S540 may refer to the foregoing steps, and are not described herein again.
Optionally, fig. 8 shows a flowchart of a communication method provided by yet another embodiment of the present application, where the communication method is applied to the communication system 100 shown in fig. 1, please refer to fig. 8, and the communication method includes the following steps:
step S610, the intelligent household equipment sends a communication request to a server.
In step S620, when receiving the communication request, the server generates a communication key and a communication identifier, and establishes a corresponding relationship between the communication key and the communication identifier.
In step S630, the server sends the communication key and the communication identifier to the smart home device.
In step S640, the smart home device encrypts the communication content through the communication key to generate encrypted information.
And step S650, the intelligent household equipment sends the encrypted information and the communication identification.
In step S660, the server determines a communication key corresponding to the communication identifier based on the correspondence relationship.
In step S670, the server decrypts the encrypted information based on the communication key corresponding to the communication identifier to obtain the communication content.
The steps S610 to S670 refer to the foregoing steps, and are not described herein again.
To implement the above method class embodiments, the present embodiment provides a communication device, fig. 9 shows a block diagram of the communication device according to an embodiment of the present application, and referring to fig. 9, the communication device 200 includes: a connection module 210, a generation module 220, a reception module 230 and a decryption module 240.
The connection module 210 is configured to establish a long connection with the smart home device through a preset encryption protocol;
the generating module 220 is configured to generate a communication key when receiving a communication request of the smart home device, and send the communication key to the smart home device.
A receiving module 230, configured to receive encrypted information sent by the smart home device, where the encrypted information is generated by the smart home device by encrypting communication content of the smart home device with the communication key.
A decryption module 240, configured to decrypt the encrypted information based on the communication key to obtain the communication content.
Optionally, the key generating module 220 includes: the system comprises a secret key and identification generating submodule, a corresponding relation generating submodule and a secret key and communication identification sending submodule.
And the secret key and identifier generation submodule is used for generating the communication secret key and the communication identifier when the communication request of the intelligent household equipment is received.
And the corresponding relation generation submodule is used for establishing the corresponding relation between the communication secret key and the communication identifier.
And the secret key and communication identifier sending submodule is used for sending the communication secret key and the communication identifier to the intelligent household equipment.
The receiving module 230 includes: and an encrypted information receiving sub-module.
And the encrypted information receiving submodule is used for receiving the encrypted information and the communication identifier sent by the intelligent household equipment.
The decryption module 240 includes: a key determining submodule and a communication content obtaining submodule.
And the key determining submodule is used for determining the communication key corresponding to the communication identifier based on the corresponding relation.
And the communication content acquisition submodule is used for decrypting the encrypted information based on the communication secret key corresponding to the communication identifier to obtain the communication content.
Optionally, the key and communication identifier sending sub-module includes: an encrypted packet acquisition sub-module and an encrypted packet transmission sub-module.
And the encryption packet obtaining submodule is used for encrypting the communication secret key and the communication identifier through a static secret key to obtain an encryption packet.
And the encryption packet sending submodule is used for sending the encryption packet to the intelligent home equipment so that the intelligent home equipment decrypts the encryption packet according to the static secret key to obtain the communication secret key and the communication identifier.
Optionally, the generating module 220 includes: a first security level determining submodule and a first secret key sending submodule.
And the first safety level determining submodule is used for determining a communication safety level according to the communication request when the communication request of the intelligent household equipment is received.
And the first secret key sending submodule is used for generating the communication secret key and sending the communication secret key to the intelligent household equipment when the communication security level is greater than a preset security level.
Optionally, the generating module 220 includes: a second security level determining submodule, an encryption level determining submodule and a second secret key sending submodule.
And the second safety level determining submodule is used for determining a communication safety level according to the communication request when the communication request of the intelligent household equipment is received.
And the encryption level determining submodule is used for determining the encryption level corresponding to the communication security level.
And the second secret key sending submodule is used for generating a communication secret key corresponding to the encryption grade and sending the communication secret key to the intelligent household equipment.
Optionally, the connection module 210 includes: and connecting the sub-modules.
And the connection submodule is used for establishing long connection with the intelligent household equipment through an SSL protocol.
The communication apparatus 200 further includes: and updating the module.
And the updating module is used for updating the communication secret key according to a first preset time interval and sending the updated communication secret key to the intelligent household equipment.
The communication apparatus 200 further includes: the heartbeat packet receiving module and the disconnection module.
And the heartbeat packet receiving module is used for receiving the heartbeat packet sent by the intelligent household equipment.
And the disconnection module is used for disconnecting the long connection with the intelligent household equipment after a second preset time interval without receiving the heartbeat packet sent by the intelligent household equipment again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Fig. 10 is a block diagram of an electronic device for executing a communication method according to an embodiment of the present application, and please refer to fig. 10, which shows a block diagram of an electronic device 300 according to an embodiment of the present application.
The electronic device 300 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 300 in the present application may include one or more of the following components: a processor 310, a memory 320, and one or more applications, wherein the one or more applications may be stored in the memory 320 and configured to be executed by the one or more processors 310, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 310 may include one or more processing cores, among other things. The processor 310 connects various parts throughout the electronic device 300 using various interfaces and lines, and performs various functions of the electronic device 300 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 320 and calling data stored in the memory 320. Alternatively, the processor 310 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 310 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 310, but may be implemented by a communication chip.
The Memory 320 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 320 may be used to store instructions, programs, code sets, or instruction sets. The memory 320 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 300 during use (e.g., phone book, audio-video data, chat log data), etc.
Fig. 11 is a storage unit for storing or carrying program codes for implementing a communication method according to an embodiment of the present application, and please refer to fig. 11, which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 400 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 400 includes a non-volatile computer-readable storage medium. The computer readable storage medium 400 has storage space for program code 410 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. Program code 410 may be compressed, for example, in a suitable form.
In summary, the present application provides a communication method, an apparatus, an electronic device, and a storage medium, where a server establishes a long connection with an intelligent home device through a preset encryption protocol, and it can be understood that, under the preset encryption protocol, the entire communication or session between the server and the intelligent home device can be protected, and a secure communication environment is provided for the communication between the server and the intelligent home device, and under the preset encryption protocol, when the server receives encryption information sent by the intelligent home device, a communication key is generated and sent to the intelligent home device, and a communication key is sent under the preset encryption protocol, so that the security of the communication key is ensured; the intelligent home equipment encrypts communication contents through the communication secret key to generate encrypted information and sends the encrypted information to the server; the server decrypts the encrypted information based on the communication secret key to obtain communication content, and double protection is performed on the communication content through a preset encryption protocol and the communication secret key, so that the safety of the communication content between the server and the intelligent household equipment is ensured, and the privacy of a user is protected.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A communication method, applied to a server, the method comprising:
establishing long connection with the intelligent household equipment through a preset encryption protocol;
when a communication request of the intelligent home equipment is received, generating a communication secret key, and sending the communication secret key to the intelligent home equipment;
receiving encryption information sent by the intelligent home equipment, wherein the encryption information is generated by the intelligent home equipment through encrypting communication contents of the intelligent home equipment by using the communication secret key;
and decrypting the encrypted information based on the communication secret key to obtain the communication content.
2. The method according to claim 1, wherein the generating a communication key and sending the communication key to the smart home device when receiving a communication request of the smart home device comprises:
when the communication request of the intelligent household equipment is received, generating the communication secret key and a communication identifier;
establishing a corresponding relation between the communication secret key and the communication identifier;
sending the communication secret key and the communication identifier to the intelligent household equipment;
the receiving of the encryption information sent by the smart home device includes:
receiving the encryption information and the communication identification sent by the intelligent household equipment;
the decrypting the encrypted information based on the communication key to obtain the communication content includes:
determining a communication secret key corresponding to the communication identifier based on the corresponding relation;
and decrypting the encrypted information based on the communication key corresponding to the communication identifier to obtain the communication content.
3. The method according to claim 2, wherein the sending the communication key and the communication identifier to the smart home device comprises:
encrypting the communication secret key and the communication identifier by using a static secret key to obtain an encryption packet;
and sending the encryption packet to the intelligent home equipment, so that the intelligent home equipment decrypts the encryption packet according to the static secret key to obtain the communication secret key and the communication identifier.
4. The method according to claim 1, wherein the generating a communication key and sending the communication key to the smart home device when receiving a communication request of the smart home device comprises:
when the communication request of the intelligent household equipment is received, determining a communication safety level according to the communication request;
and when the communication security level is greater than a preset security level, generating the communication secret key and sending the communication secret key to the intelligent household equipment.
5. The method according to claim 1, wherein the generating a communication key and sending the communication key to the smart home device when receiving a communication request of the smart home device comprises:
when the communication request of the intelligent household equipment is received, determining a communication safety level according to the communication request;
determining an encryption level corresponding to the communication security level;
and generating a communication secret key corresponding to the encryption level, and sending the communication secret key to the intelligent household equipment.
6. The method according to any one of claims 1-5, further comprising:
and updating the communication secret key according to a first preset time interval, and sending the updated communication secret key to the intelligent household equipment.
7. The method according to any one of claims 1-5, further comprising:
receiving a heartbeat packet sent by the intelligent household equipment;
after a second preset time interval, the heartbeat packet sent by the intelligent household equipment is not received again, and then the long connection with the intelligent household equipment is disconnected.
8. A communications apparatus, the apparatus comprising:
the connection module is used for establishing long connection with the intelligent household equipment through a preset encryption protocol;
the generation module is used for generating a communication secret key when receiving a communication request of the intelligent household equipment and sending the communication secret key to the intelligent household equipment;
the receiving module is used for receiving encrypted information sent by the intelligent home equipment, wherein the encrypted information is generated by the intelligent home equipment through encrypting communication contents of the intelligent home equipment by using the communication secret key;
and the decryption module is used for decrypting the encrypted information based on the communication secret key to obtain the communication content.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN202110176771.6A 2021-02-07 2021-02-07 Communication method, communication device, electronic device and storage medium Pending CN112769868A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110176771.6A CN112769868A (en) 2021-02-07 2021-02-07 Communication method, communication device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110176771.6A CN112769868A (en) 2021-02-07 2021-02-07 Communication method, communication device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN112769868A true CN112769868A (en) 2021-05-07

Family

ID=75705435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110176771.6A Pending CN112769868A (en) 2021-02-07 2021-02-07 Communication method, communication device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112769868A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113359500A (en) * 2021-07-02 2021-09-07 佛山市淇特科技有限公司 Smart home equipment state synchronization method, device, equipment and storage medium
CN113422758A (en) * 2021-06-08 2021-09-21 深圳市欢太数字科技有限公司 Data encryption method and device, Internet of things system, electronic equipment and storage medium
CN115277143A (en) * 2022-07-19 2022-11-01 中天动力科技(深圳)有限公司 Data secure transmission method, device, equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192919A (en) * 2006-11-21 2008-06-04 中兴通讯股份有限公司 Method for realizing user-defined security level
CN105610783A (en) * 2015-11-05 2016-05-25 珠海格力电器股份有限公司 Data transmission method and IoT (Internet of Things) system
CN106161404A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 The method of SSL Session state reuse, server and system
CN106790156A (en) * 2016-12-29 2017-05-31 海尔优家智能科技(北京)有限公司 A kind of smart machine binding method and device
CN106888206A (en) * 2017-02-13 2017-06-23 海信集团有限公司 Key exchange method, apparatus and system
CN107172001A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 Control method, key proxy server and the web proxy server of web proxy server
WO2018036204A1 (en) * 2016-08-26 2018-03-01 中兴通讯股份有限公司 Encryption and decryption control method and apparatus for smart home system, and home device
US20180332041A1 (en) * 2016-05-17 2018-11-15 Tencent Technology (Shenzhen) Company Limited Network connection method, apparatus, storage medium and terminal
CN109246053A (en) * 2017-05-26 2019-01-18 阿里巴巴集团控股有限公司 A kind of data communications method, device, equipment and storage medium
CN109495265A (en) * 2018-12-06 2019-03-19 江苏中威科技软件系统有限公司 Network data transmission method, communication terminal and the device with store function
CN111259435A (en) * 2020-01-09 2020-06-09 平安科技(深圳)有限公司 Contract encryption and decryption method and device and computer readable storage medium
CN111600914A (en) * 2020-07-27 2020-08-28 北京信安世纪科技股份有限公司 Data transmission method, server and client

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192919A (en) * 2006-11-21 2008-06-04 中兴通讯股份有限公司 Method for realizing user-defined security level
CN106161404A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 The method of SSL Session state reuse, server and system
CN105610783A (en) * 2015-11-05 2016-05-25 珠海格力电器股份有限公司 Data transmission method and IoT (Internet of Things) system
CN107172001A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 Control method, key proxy server and the web proxy server of web proxy server
US20180332041A1 (en) * 2016-05-17 2018-11-15 Tencent Technology (Shenzhen) Company Limited Network connection method, apparatus, storage medium and terminal
WO2018036204A1 (en) * 2016-08-26 2018-03-01 中兴通讯股份有限公司 Encryption and decryption control method and apparatus for smart home system, and home device
CN106790156A (en) * 2016-12-29 2017-05-31 海尔优家智能科技(北京)有限公司 A kind of smart machine binding method and device
CN106888206A (en) * 2017-02-13 2017-06-23 海信集团有限公司 Key exchange method, apparatus and system
CN109246053A (en) * 2017-05-26 2019-01-18 阿里巴巴集团控股有限公司 A kind of data communications method, device, equipment and storage medium
CN109495265A (en) * 2018-12-06 2019-03-19 江苏中威科技软件系统有限公司 Network data transmission method, communication terminal and the device with store function
CN111259435A (en) * 2020-01-09 2020-06-09 平安科技(深圳)有限公司 Contract encryption and decryption method and device and computer readable storage medium
CN111600914A (en) * 2020-07-27 2020-08-28 北京信安世纪科技股份有限公司 Data transmission method, server and client

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422758A (en) * 2021-06-08 2021-09-21 深圳市欢太数字科技有限公司 Data encryption method and device, Internet of things system, electronic equipment and storage medium
CN113422758B (en) * 2021-06-08 2023-04-07 深圳市欢太数字科技有限公司 Data encryption method and device, internet of things system, electronic equipment and storage medium
CN113359500A (en) * 2021-07-02 2021-09-07 佛山市淇特科技有限公司 Smart home equipment state synchronization method, device, equipment and storage medium
CN115277143A (en) * 2022-07-19 2022-11-01 中天动力科技(深圳)有限公司 Data secure transmission method, device, equipment and storage medium
CN115277143B (en) * 2022-07-19 2023-10-20 中天动力科技(深圳)有限公司 Data security transmission method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US20220321543A1 (en) Systems and methods for secure communication over a network using a linking address
CN112769868A (en) Communication method, communication device, electronic device and storage medium
EP4054221A1 (en) Key agreement method and electronic device
US20170126623A1 (en) Protected Subnet Interconnect
US20180262352A1 (en) Secure Authentication of Remote Equipment
US11558361B2 (en) Communication method between mesh network and cloud server, mesh network system and node device thereof
CN109150508A (en) Equipment control and controlled method, device, computer equipment and storage medium
EP3197190A1 (en) Methods for fast, secure and privacy-friendly internet connection discovery in wireless networks
WO2020237880A1 (en) Data exchange method based on asymmetric encryption technology, sending terminal and computer readable storage medium
CN112769761A (en) Signal transmission mode selection method and device based on service classification
CN107872315B (en) Data processing method and intelligent terminal
WO2022083410A1 (en) Time correction method and apparatus, and device and storage medium
CN103973543A (en) Method and device for instant messaging
CN113434905B (en) Data transmission method and device, computer equipment and storage medium
CN112492004B (en) Method, device, system and storage medium for establishing local communication link
CN112511620A (en) Network communication method, device, equipment and storage medium
CN114793178B (en) Network distribution method, device, equipment and storage medium
CN106537962B (en) Wireless network configuration, access and access method, device and equipment
CN107343001B (en) Data processing method and device
Arvandy et al. Design of secure iot platform for smart home system
WO2018054144A1 (en) Method, apparatus, device and system for dynamically generating symmetric key
CN114417309A (en) Bidirectional identity authentication method, device, equipment and storage medium
CN111698096B (en) Automatic safe login method for intelligent household equipment based on NDN
CN113839958A (en) Communication encryption method and device for smart home, control system and storage medium
CN114221822A (en) Network distribution method, gateway device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination