Method and device for establishing secure communication, storage medium and electronic device
By obtaining the communication status of the target device and obtaining the appropriate encryption key from the device security service, the problem of frequent encryption key updates is solved, the pressure on the device security service is reduced, and the efficiency and accuracy of secure communication are improved.
Patent Information
- Application Number
- CN202210461491.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the existing technology, encryption keys are frequently updated and cannot be obtained flexibly according to communication needs, which leads to increased pressure on device security services and does not conform to the business process of user terminals actively initiating LAN communications.
By obtaining the current communication status of the target device, obtain the encryption key used to protect secure communication on the LAN from the device security service, and send an instruction message to establish secure communication based on the communication status to determine whether to establish secure communication in the LAN, reducing unnecessary Message interaction and key update.
It reduces the service pressure of equipment security services, improves the efficiency and matching of secure communications, and makes the establishment process of secure communications more convenient, efficient and accurate.
Smart Images

Figure CN115348048B
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and more specifically, to a method and device for establishing secure communication, a storage medium, and an electronic device. Background Art
[0002] With the development of Internet technology and Internet of Things technology, more and more devices support users to communicate with devices through APP. In some cases, it is based on the wide area network, but in some business scenarios, users and devices need to interact with each other in the local area network. In order to ensure the security of information, information must be encrypted for this kind of communication. Due to the requirements of communication efficiency, the encryption and decryption methods should meet the requirements of efficiency and security at the same time. In the related technology, when performing encrypted communication in the local area network, the encryption key is often generated by the device side, and the device side will also perform a large number of LAN encryption key update operations when the LAN encrypted communication is not required, which will cause the pressure on the device security service to surge when the number of devices is large; in addition, the above design does not conform to the business process of LAN communication initiated by the user terminal.
[0003] In view of the problems in related technologies such as frequent updates of encryption keys and inability to flexibly obtain encryption keys according to communication requirements, no effective technical solution has been proposed. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for establishing secure communication, a storage medium and an electronic device, so as to at least solve the problems in the related art, such as frequent updates of encryption keys and inability to flexibly obtain encryption keys according to communication requirements.
[0005] According to one embodiment of the present invention, a method for establishing secure communication is provided, comprising: obtaining a current communication status of a target device; obtaining an encryption key for protecting secure communication in a local area network from a device security service according to the current communication status, and sending an indication message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established; and obtaining a first feedback result of the target device for the indication message to determine whether to establish secure communication in the current local area network.
[0006] In an exemplary embodiment, obtaining the current communication status of the target device includes: sending a query message to the target communication area when receiving a communication request sent by the target object; receiving status information fed back by the target device in the target communication area in response to the query message; and determining the current communication status of the target device through the status information.
[0007] In an exemplary embodiment, an encryption key for protecting secure communications in a local area network is obtained from a device security service based on a current communication status, including: when the current communication status indicates that the target device is already in secure communications in the local area network, a first acquisition instruction is sent to the device security service to obtain a first encryption key for secure communications corresponding to the current local area network; wherein the first encryption key is a key that has been used for secure communications with the device in the local area network; when the current communication status indicates that the target device is not in secure communications in the local area network, a second acquisition instruction is sent to the device security service to obtain a second encryption key for secure communications corresponding to the current local area network, wherein the second encryption key is an updated or generated key that is not used in secure communications.
[0008] In an exemplary embodiment, a first feedback result of the target device for an indication message is obtained to determine whether to establish secure communication in the current local area network, including: when the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully obtained a third encryption key, determining a first degree of match between the second encryption key and the third encryption key; when the first feedback result indicates that the target device is in a local area network encryption state and has successfully obtained a fourth encryption key, determining a second degree of match between the fourth encryption key and the first encryption key; when the first degree of match or the second degree of match is greater than a preset threshold, determining that the target device is allowed to conduct secure communication in the local area network, and sending a confirmation message to the target device to establish secure communication in the current local area network.
[0009] In an exemplary embodiment, when the first match degree or the second match degree is greater than a preset threshold, it is determined that the target device is allowed to conduct secure communication in the local area network, and after sending a confirmation message to the target device to establish secure communication in the current local area network, the above method also includes: obtaining a response result of the target device to the confirmation message; when the response result indicates that the target device enters secure communication in the local area network, determining that the communication interaction with the target device is in an encrypted state, and displaying a first prompt information corresponding to the encrypted state; when the response result indicates that the target device is about to enter secure communication in the local area network, determining that the communication interaction with the target device is in an unencrypted state, and displaying a second prompt information corresponding to the unencrypted state.
[0010] In an exemplary embodiment, before obtaining the current communication status of the target device, the above method also includes: determining the communication authority of the target terminal; when the communication authority indicates that the target terminal cannot conduct secure communication in the local area network, sending a third prompt information prohibiting secure communication to the target object; when the communication authority indicates that the target terminal allows secure communication in the local area network, sending a fourth prompt information allowing secure communication to the target object.
[0011] In an exemplary embodiment, when the communication authority indicates that the target terminal is allowed to conduct secure communications in the local area network, after sending a fourth prompt message allowing secure communications to the target object, the method further includes: sending a request message to the target object to establish a key channel between the target terminal and the device security service; obtaining a second feedback result from the target object for the request message; and when the second feedback result indicates the establishment of the key channel, completing the establishment of the key channel between the target terminal and the device security service.
[0012] According to another embodiment of the present invention, there is provided a device for establishing secure communication, comprising: an acquisition module, used to acquire the current communication status of a target device; a sending module, used to acquire an encryption key for protecting secure communication in a local area network from a device security service according to the current communication status, and send an indication message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established; and a determination module, used to acquire a first feedback result of the target device for the indication message, so as to determine whether to establish secure communication in the current local area network.
[0013] In an exemplary embodiment, the above-mentioned acquisition module is also used to send a query message to the target communication area when a communication request sent by the target object is received; receive status information feedback by the target device in the target communication area in response to the query message; and determine the current communication status of the target device through the status information.
[0014] In an exemplary embodiment, the above-mentioned sending module is also used to send a first acquisition instruction to the device security service to obtain a first encryption key corresponding to the current secure communication in the local area network when the current communication status indicates that the target device is already in secure communication in the local area network; wherein the first encryption key is a key that has been used for secure communication of the device in the local area network; and when the current communication status indicates that the target device is not in secure communication in the local area network, send a second acquisition instruction to the device security service to obtain a second encryption key corresponding to the current secure communication in the local area network, wherein the second encryption key is an updated or generated key that is not used in secure communication.
[0015] In an exemplary embodiment, the above-mentioned determination module is also used to determine the first degree of match between the second encryption key and the third encryption key when the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully obtained the third encryption key; when the first feedback result indicates that the target device is in a local area network encryption state and has successfully obtained the fourth encryption key, determine the second degree of match between the fourth encryption key and the first encryption key; when the first degree of match or the second degree of match is greater than a preset threshold, determine that the target device is allowed to conduct secure communication in the local area network, and send a confirmation message to the target device to establish secure communication in the current local area network.
[0016] In an exemplary embodiment, the above-mentioned device also includes: a response module, which is used to obtain a response result of the target device to the confirmation message; when the response result indicates that the target device enters the secure communication of the local area network, it is determined that the communication interaction with the target device is in an encrypted state, and a first prompt information corresponding to the encrypted state is displayed; when the response result indicates that the target device is about to enter the secure communication of the local area network, it is determined that the communication interaction with the target device is in an unencrypted state, and a second prompt information corresponding to the unencrypted state is displayed.
[0017] In an exemplary embodiment, the above-mentioned device also includes: a permission module, which is used to determine the communication permission of the target terminal; when the communication permission indicates that the target terminal cannot conduct secure communication in the local area network, a third prompt information prohibiting secure communication is sent to the target object; when the communication permission indicates that the target terminal is allowed to conduct secure communication in the local area network, a fourth prompt information allowing secure communication is sent to the target object.
[0018] In an exemplary embodiment, the above-mentioned permission module is also used to send a request message to the target object to establish a key channel between the target terminal and the device security service; obtain a second feedback result of the target object for the request message; and complete the establishment of the key channel between the target terminal and the device security service when the second feedback result indicates the establishment of the key channel.
[0019] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0020] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0021] Through the present invention, the current communication status of the target device is obtained; according to the current communication status, an encryption key for protecting secure communication in the local area network is obtained from the device security service, and an indication message for establishing secure communication is sent to the target device; wherein the encryption key is used to encrypt the information exchange content in the communication after the secure communication is established; the first feedback result of the target device for the indication message is obtained to determine whether to establish secure communication in the current local area network, that is, by confirming the current communication status of the target device, and then confirming whether the target device is in a state where secure communication can be carried out, and further establishing secure communication, therefore, it is possible to solve the problems of frequent updates of encryption keys in the prior art, inability to flexibly obtain encryption keys according to communication needs, etc., reduce unnecessary message interactions in the secure communication process, reduce the service pressure of the device security service when the number of devices is large, and improve the matching degree of secure communication in the actual business process, so that the process of establishing secure communication is more convenient, efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 is a schematic diagram of a hardware environment for a method for establishing secure communication according to an embodiment of the present application;
[0025] Figure 2 is a flow chart of a method for establishing secure communication according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of interaction between a device and a user local area network for encrypted communication according to an optional embodiment of the present invention;
[0027] Figure 4 is an interactive schematic diagram corresponding to an improved design of encrypted communication between a device and a user terminal local area network according to an optional embodiment of the present invention;
[0028] Figure 5 It is a structural block diagram of a device for establishing secure communication according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0031] According to one aspect of an embodiment of the present application, a method for establishing secure communication is provided. The method for establishing secure communication is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for establishing secure communication can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0032] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0033] In this embodiment, a method for establishing secure communication is provided. Figure 2 : is a flowchart of a method for establishing secure communication according to an embodiment of the present invention, the process comprising the following steps:
[0034] Step S202, obtaining the current communication status of the target device;
[0035] Step S204, obtaining an encryption key for protecting secure communication in the local area network from the device security service according to the current communication state, and sending an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt the information exchange content in the communication after the secure communication is established;
[0036] Step S206: obtaining a first feedback result of the target device to the indication message to determine whether to establish secure communication in the current local area network.
[0037] Through the above steps, the current communication status of the target device is obtained; according to the current communication status, an encryption key for protecting secure communication in the local area network is obtained from the device security service, and an indication message for establishing secure communication is sent to the target device; wherein the encryption key is used to encrypt the information exchange content in the communication after the secure communication is established; the first feedback result of the target device for the indication message is obtained to determine whether to establish secure communication in the current local area network, that is, by confirming the current communication status of the target device, and then confirming whether the target device is in a state where secure communication can be carried out, and further establishing secure communication, therefore, it can solve the problems of frequent updates of encryption keys in the prior art, inability to flexibly obtain encryption keys according to communication needs, etc., reduce unnecessary message interactions in the secure communication process, reduce the service pressure of the device security service when the number of devices is large, improve the matching degree of secure communication in the actual business process, and make the process of establishing secure communication more convenient, efficient and accurate.
[0038] It should be noted that the above-mentioned method of establishing secure communication is mainly for secure communication between user terminals and devices in the local area network, avoiding a large number of LAN encryption KEY update operations on the device side when LAN encrypted communication is not required. It prevents a surge in device security service pressure when the number of devices is large, reduces unnecessary message interactions in secure communication interactions between user terminals and devices in the local area network, and improves the overall interaction efficiency of secure communications.
[0039] In an exemplary embodiment, obtaining the current communication status of the target device includes: sending a query message to the target communication area when receiving a communication request sent by the target object; receiving status information fed back by the target device in the target communication area in response to the query message; and determining the current communication status of the target device through the status information.
[0040] For example, when a user at a user terminal needs to initiate a secure communication control interaction with a device, the user terminal first initiates a query to the device, and then determines the current state of the device based on the current state information returned by the device, such as: the device is already in an encrypted communication state or the device is not in an encrypted communication state. Optionally, the above current state information may also include the device's operating time, corresponding operating functions, etc. The current state information can enable the user terminal to have an overall grasp of the current operating status of the device, providing a reference for subsequent secure communications.
[0041] In an exemplary embodiment, an encryption key for protecting secure communications in a local area network is obtained from a device security service based on a current communication status, including: when the current communication status indicates that the target device is already in secure communications in the local area network, a first acquisition instruction is sent to the device security service to obtain a first encryption key for secure communications corresponding to the current local area network; wherein the first encryption key is a key that has been used for secure communications with the device in the local area network; when the current communication status indicates that the target device is not in secure communications in the local area network, a second acquisition instruction is sent to the device security service to obtain a second encryption key for secure communications corresponding to the current local area network, wherein the second encryption key is an updated or generated key that is not used in secure communications.
[0042] In simple terms, when the target device is already in a secure communication state in the local area network, it means that only the first encryption key corresponding to the secure communication of the target device needs to be obtained, even if a secure communication connection can be established with the target device later; when the target device is not in a secure communication state in the local area network, it means that the user terminal needs to determine a new second encryption key in the device security service of the IoT cloud. The second encryption key can be updated based on the encryption key used before, or it can be generated according to the information of the user terminal; afterward, the user terminal can use the second encryption key to communicate securely with the target device also on the basis of obtaining the second encryption key from the device security service of the IoT cloud.
[0043] In an exemplary embodiment, a first feedback result of the target device for an indication message is obtained to determine whether to establish secure communication in the current local area network, including: when the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully obtained a third encryption key, determining a first degree of match between the second encryption key and the third encryption key; when the first feedback result indicates that the target device is in a local area network encryption state and has successfully obtained a fourth encryption key, determining a second degree of match between the fourth encryption key and the first encryption key; when the first degree of match or the second degree of match is greater than a preset threshold, determining that the target device is allowed to conduct secure communication in the local area network, and sending a confirmation message to the target device to establish secure communication in the current local area network.
[0044] That is to say, the basis for establishing secure communication is that the user terminal and the target device have the same encryption key. Therefore, it is necessary to determine the target device's acquisition of the security key, thereby ensuring that the target device establishing secure communication with the user terminal is secure.
[0045] In an exemplary embodiment, when the first match degree or the second match degree is greater than a preset threshold, it is determined that the target device is allowed to conduct secure communication in the local area network, and after sending a confirmation message to the target device to establish secure communication in the current local area network, the above method also includes: obtaining a response result of the target device to the confirmation message; when the response result indicates that the target device enters secure communication in the local area network, determining that the communication interaction with the target device is in an encrypted state, and displaying a first prompt information corresponding to the encrypted state; when the response result indicates that the target device is about to enter secure communication in the local area network, determining that the communication interaction with the target device is in an unencrypted state, and displaying a second prompt information corresponding to the unencrypted state.
[0046] That is, in order to enable the user corresponding to the user terminal to more clearly know the progress of establishing secure communication between the user terminal and the target device, the current state of secure communication is displayed to the user of the user terminal through corresponding prompt information.
[0047] In an exemplary embodiment, before obtaining the current communication status of the target device, the above method also includes: determining the communication authority of the target terminal; when the communication authority indicates that the target terminal cannot conduct secure communication in the local area network, sending a third prompt information prohibiting secure communication to the target object; when the communication authority indicates that the target terminal allows secure communication in the local area network, sending a fourth prompt information allowing secure communication to the target object.
[0048] It is understandable that in order to prevent fake user terminals from establishing a connection with the target device to steal data in the target device, the user terminal must verify the validity of the current user terminal before initiating secure communication, and can also determine the range of data in the target device that can be obtained after the user terminal and the target device have conducted secure communication interactions based on the user terminal's permissions, thereby avoiding the leakage of the target device's core data information.
[0049] In an exemplary embodiment, when the communication authority indicates that the target terminal is allowed to conduct secure communications in the local area network, after sending a fourth prompt message allowing secure communications to the target object, the method further includes: sending a request message to the target object to establish a key channel between the target terminal and the device security service; obtaining a second feedback result from the target object for the request message; and when the second feedback result indicates the establishment of the key channel, completing the establishment of the key channel between the target terminal and the device security service.
[0050] In order to better understand the process of the above-mentioned method for establishing secure communication, the process of the above-mentioned method for establishing secure communication is described below in combination with several optional embodiments.
[0051] As an optional embodiment, a design for encrypted communication between a device and a user terminal local area network is proposed. Figure 3 It is a schematic diagram of the interaction between the device and the user's LAN encrypted communication according to an optional embodiment of the present invention; specifically, the encryption KEY of the encrypted information (equivalent to the encryption key in the embodiment of the present invention) is generated by the device side. When the device WAN is connected to the platform, the device side generates a LAN encryption KEY, and when the device has not been operated for a long time, the LAN encryption KEY will be updated. When the device needs to communicate with the user in the LAN, the user terminal obtains the LAN communication encryption KEY of the device. In this way, encrypted communication between the device and the user is carried out.
[0052] However, the above encrypted communication has the following defects in the LAN encryption design: 1) The device side performs a large number of LAN encryption KEY update operations when LAN encrypted communication is not needed. When the number of devices is large, the pressure on device security services will surge; 2) It does not conform to the business process of LAN communication initiated by the user terminal.
[0053] In view of the above defects, in the optional embodiment of the present invention, an improved design for encrypting the communication information between the device and the user terminal in the local area network is also proposed. Before the device communicates with the user terminal, the user terminal actively initiates an inquiry about the current status of the device, and then determines whether the device is already in the encrypted communication of the local area network, so as to determine the corresponding encryption key in a targeted manner; then the user terminal initiates a notification to establish communication to the device, and completes the establishment of the encrypted communication channel when the device passes the verification and determines that the encrypted communication can be established, so as to ensure the efficiency of the encrypted communication between the user terminal and the device in the local area network. In addition, the above improved design conforms to the actual business process, reduces unnecessary message interactions, and alleviates the performance pressure of other platform services (such as device security services).
[0054] Optional, Figure 4 is an interactive schematic diagram corresponding to an improved design of encrypted communication between a device and a user terminal local area network according to an optional embodiment of the present invention;
[0055] Step 1: The user terminal inquires about the current status of the device;
[0056] Step 2: The device returns information corresponding to the current status to the user terminal;
[0057] Step 3: If the device is already in LAN encrypted communication, obtain the current device LAN encryption key from the device security service on the IoT cloud and return it to the user terminal;
[0058] Step 4: If the device is not in LAN encrypted communication, the current device LAN encryption key is updated or generated in the device security service on the IoT cloud and returned to the user terminal, that is, the user terminal actively obtains a new encryption key for subsequent secure communication encryption;
[0059] Step 5: When the encryption key is available, the user terminal notifies the device to perform encrypted communication on the local area network;
[0060] Step 6: If the device is not in the LAN encrypted communication state, the device obtains the LAN encrypted communication key from the device security service on the IoT cloud; if the device is in the LAN encrypted communication state, it indicates that the device has obtained the LAN encrypted communication key.
[0061] Step 7: The device sends a notification to the user terminal, notifying the user terminal that it can perform encrypted communication with the device over the local area network;
[0062] Step 8: The user terminal confirms the notification sent by the device to the user terminal, and returns the confirmation result of the local area encrypted communication completion to the device;
[0063] Step 9: The user terminal establishes encrypted communication with the device.
[0064] In summary, through the above improved design, the acquisition of LAN encryption communication KEY is limited to the moment when LAN communication is really needed. Compared with the original design, this design greatly reduces the information interaction between the device and the device security service in non-LAN communication scenarios, and at the same time satisfies the LAN security communication between multiple users and one device. On the basis of complying with the actual business process of the user terminal, the efficiency of encrypted communication between the user terminal and the device is improved.
[0065] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the establishment of secure communication described in each embodiment of the present invention.
[0066] In this embodiment, a device for establishing secure communication is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" refers to a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0067] Figure 5 is a structural block diagram of a device for establishing secure communication according to an embodiment of the present invention, such as Figure 5 As shown, the device includes:
[0068] (1) an acquisition module 52, used to acquire the current communication status of the target device;
[0069] (2) a sending module 54, configured to obtain an encryption key for protecting secure communication in the local area network from a device security service according to the current communication state, and to send an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established;
[0070] (3) A determination module 56, configured to obtain a first feedback result of the target device in response to the indication message, so as to determine whether to establish secure communication in the current local area network.
[0071] Through the above-mentioned device, the current communication status of the target device is obtained; according to the current communication status, an encryption key for protecting secure communication in the local area network is obtained from the device security service, and an indication message for establishing secure communication is sent to the target device; wherein the encryption key is used to encrypt the information exchange content in the communication after the secure communication is established; the first feedback result of the target device for the indication message is obtained to determine whether to establish secure communication in the current local area network, that is, by confirming the current communication status of the target device, and then confirming whether the target device is in a state where secure communication can be carried out, and further establishing secure communication, therefore, it can solve the problems of frequent updates of encryption keys in the prior art, inability to flexibly obtain encryption keys according to communication needs, etc., reduce unnecessary message interactions in the secure communication process, reduce the service pressure of the device security service when the number of devices is large, improve the matching degree of secure communication in the actual business process, and make the process of establishing secure communication more convenient, efficient and accurate.
[0072] In an exemplary embodiment, the above-mentioned acquisition module is also used to send a query message to the target communication area when a communication request sent by the target object is received; receive status information feedback by the target device in the target communication area in response to the query message; and determine the current communication status of the target device through the status information.
[0073] For example, when a user at a user terminal needs to initiate a secure communication control interaction with a device, the user terminal first initiates a query to the device, and then determines the current state of the device based on the current state information returned by the device, such as: the device is already in an encrypted communication state or the device is not in an encrypted communication state. Optionally, the above current state information may also include the device's operating time, corresponding operating functions, etc. The current state information can enable the user terminal to have an overall grasp of the current operating status of the device, providing a reference for subsequent secure communications.
[0074] In an exemplary embodiment, the above-mentioned sending module is also used to send a first acquisition instruction to the device security service to obtain a first encryption key corresponding to the current secure communication in the local area network when the current communication status indicates that the target device is already in secure communication in the local area network; wherein the first encryption key is a key that has been used for secure communication of the device in the local area network; and when the current communication status indicates that the target device is not in secure communication in the local area network, send a second acquisition instruction to the device security service to obtain a second encryption key corresponding to the current secure communication in the local area network, wherein the second encryption key is an updated or generated key that is not used in secure communication.
[0075] In simple terms, when the target device is already in a secure communication state in the local area network, it means that only the first encryption key corresponding to the secure communication of the target device needs to be obtained, even if a secure communication connection can be established with the target device later; when the target device is not in a secure communication state in the local area network, it means that the user terminal needs to determine a new second encryption key in the device security service of the IoT cloud. The second encryption key can be updated based on the encryption key used before, or it can be generated according to the information of the user terminal; afterward, the user terminal can use the second encryption key to communicate securely with the target device also on the basis of obtaining the second encryption key from the device security service of the IoT cloud.
[0076] In an exemplary embodiment, the above-mentioned determination module is also used to determine the first degree of match between the second encryption key and the third encryption key when the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully obtained the third encryption key; when the first feedback result indicates that the target device is in a local area network encryption state and has successfully obtained the fourth encryption key, determine the second degree of match between the fourth encryption key and the first encryption key; when the first degree of match or the second degree of match is greater than a preset threshold, determine that the target device is allowed to conduct secure communication in the local area network, and send a confirmation message to the target device to establish secure communication in the current local area network.
[0077] That is to say, the basis for establishing secure communication is that the user terminal and the target device have the same encryption key. Therefore, it is necessary to determine the target device's acquisition of the security key, thereby ensuring that the target device establishing secure communication with the user terminal is secure.
[0078] In an exemplary embodiment, the above-mentioned device also includes: a response module, which is used to obtain a response result of the target device to the confirmation message; when the response result indicates that the target device enters the secure communication of the local area network, it is determined that the communication interaction with the target device is in an encrypted state, and a first prompt information corresponding to the encrypted state is displayed; when the response result indicates that the target device is about to enter the secure communication of the local area network, it is determined that the communication interaction with the target device is in an unencrypted state, and a second prompt information corresponding to the unencrypted state is displayed.
[0079] That is, in order to enable the user corresponding to the user terminal to more clearly know the progress of establishing secure communication between the user terminal and the target device, the current state of secure communication is displayed to the user of the user terminal through corresponding prompt information.
[0080] In an exemplary embodiment, the above-mentioned device also includes: a permission module, which is used to determine the communication permission of the target terminal; when the communication permission indicates that the target terminal cannot conduct secure communication in the local area network, a third prompt information prohibiting secure communication is sent to the target object; when the communication permission indicates that the target terminal is allowed to conduct secure communication in the local area network, a fourth prompt information allowing secure communication is sent to the target object.
[0081] It is understandable that in order to prevent fake user terminals from establishing a connection with the target device to steal data in the target device, the user terminal must verify the validity of the current user terminal before initiating secure communication, and can also determine the range of data in the target device that can be obtained after the user terminal and the target device have conducted secure communication interactions based on the user terminal's permissions, thereby avoiding the leakage of the target device's core data information.
[0082] In an exemplary embodiment, the above-mentioned permission module is also used to send a request message to the target object to establish a key channel between the target terminal and the device security service; obtain a second feedback result of the target object for the request message; and complete the establishment of the key channel between the target terminal and the device security service when the second feedback result indicates the establishment of the key channel.
[0083] In the description of the present invention, it should be understood that the directions or positional relationships indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", etc. are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0084] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two components. When a component is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other component or there can also be a central component. When a component is considered to be "connected" to another element, it can be directly connected to the other element or there can be a central element at the same time. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0085] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0086] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0087] In an exemplary embodiment, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0088] S1, obtain the current communication status of the target device;
[0089] S2, obtaining an encryption key for protecting secure communication in the local area network from a device security service according to the current communication state, and sending an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established;
[0090] S3, obtaining a first feedback result of the target device to the indication message to determine whether to establish secure communication in the current local area network.
[0091] In an exemplary embodiment, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0092] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0093] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0094] In an exemplary embodiment, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0095] S1, obtain the current communication status of the target device;
[0096] S2, obtaining an encryption key for protecting secure communication in the local area network from a device security service according to the current communication state, and sending an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established;
[0097] S3, obtaining a first feedback result of the target device to the indication message to determine whether to establish secure communication in the current local area network.
[0098] In an exemplary embodiment, the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. In an exemplary embodiment, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0100] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for establishing secure communication, characterized in that: include: Get the current communication status of the target device; Obtaining an encryption key for protecting secure communication in the local area network from a device security service according to the current communication state, and sending an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established; Obtaining a first feedback result of the target device for the indication message to determine whether to establish secure communication in the current local area network; Wherein, obtaining an encryption key for protecting secure communication in the local area network from a device security service according to the current communication state includes: When the current communication state indicates that the target device is already in secure communication in the local area network, a first acquisition instruction is sent to the device security service to obtain a first encryption key corresponding to the secure communication in the current local area network; wherein the first encryption key is a key that has been used for secure communication of the device in the local area network; When the current communication state indicates that the target device is not in secure communication in the local area network, sending a second acquisition instruction to the device security service to obtain a second encryption key corresponding to the secure communication of the current local area network, wherein the second encryption key is an updated or generated key that is not used in secure communication; The step of obtaining a first feedback result of the target device for the indication message to determine whether to establish secure communication in the current local area network includes: When the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully obtained the third encryption key, determining a first matching degree between the second encryption key and the third encryption key; When the first feedback result indicates that the target device is already in a local area network encryption state and the fourth encryption key has been successfully obtained, determining a second matching degree between the fourth encryption key and the first encryption key; When the first matching degree or the second matching degree is greater than a preset threshold, it is determined that the target device is allowed to perform secure communication in the local area network, and a confirmation message for establishing secure communication in the current local area network is sent to the target device.
2. The method for establishing secure communication according to claim 1, characterized in that: Get the current communication status of the target device, including: Upon receiving a communication request sent by a target object, sending a query message to the target communication area; Receiving status information fed back by a target device in the target communication area in response to the query message; The current communication status of the target device is determined through the status information.
3. The method for establishing secure communication according to claim 1, characterized in that: When the first matching degree or the second matching degree is greater than a preset threshold, determining that the target device is allowed to perform secure communication in the local area network, and sending a confirmation message to the target device to establish secure communication in the current local area network, the method further includes: Obtaining a response result of the target device to the confirmation message; In the case where the response result indicates that the target device has entered into secure communication of the local area network, determining that the communication interaction with the target device is in an encrypted state, and displaying first prompt information corresponding to the encryption state; In the case where the response result indicates that the target device is about to enter secure communication in the local area network, it is determined that the communication interaction with the target device is in an unencrypted state, and second prompt information corresponding to the unencrypted state is displayed.
4. The method for establishing secure communication according to claim 1, characterized in that: Before obtaining the current communication status of the target device, the method further includes: Determine the communication rights of the target terminal; When the communication authority indicates that the target terminal cannot perform secure communication in the local area network, sending third prompt information prohibiting secure communication to the target object; In a case where the communication authority indicates that the target terminal allows secure communication in the local area network, fourth prompt information for allowing secure communication is sent to the target object.
5. The method for establishing secure communication according to claim 4, characterized in that: In the case where the communication authority indicates that the target terminal allows secure communication in the local area network, after sending fourth prompt information for allowing secure communication to the target object, the method further includes: Sending a request message to a target object to establish a key channel between the target terminal and a device security service; Obtaining a second feedback result of the target object in response to the request information; When the second feedback result indicates that a key channel is to be established, the key channel is established between the target terminal and the device security service.
6. A device for establishing secure communication in a local area network, characterized in that: include: An acquisition module is used to obtain the current communication status of the target device; A sending module, configured to obtain an encryption key for protecting secure communication in a local area network from a device security service according to the current communication state, and to send an instruction message for establishing secure communication to the target device; wherein the encryption key is used to encrypt information exchange content in the communication after secure communication is established; A determination module, configured to obtain a first feedback result of the target device for the indication message, so as to determine whether to establish secure communication in the current local area network; The sending module is further configured to, when the current communication state indicates that the target device is already in secure communication in the local area network, send a first acquisition instruction to the device security service to obtain a first encryption key corresponding to the secure communication of the current local area network; wherein the first encryption key is a key that has been used for secure communication of the device in the local area network; and when the current communication state indicates that the target device is not in secure communication in the local area network, send a second acquisition instruction to the device security service to obtain a second encryption key corresponding to the secure communication of the current local area network, wherein the second encryption key is an updated or generated key that is not used in secure communication; The determination module is further used to determine a first degree of match between the second encryption key and the third encryption key when the first feedback result indicates that the target device is not in a local area network encryption state and the target device has successfully acquired the third encryption key; to determine a second degree of match between the fourth encryption key and the first encryption key when the first feedback result indicates that the target device is in a local area network encryption state and has successfully acquired the fourth encryption key; and to determine that the target device is allowed to conduct secure communication in the local area network, and to send a confirmation message to the target device to establish secure communication in the current local area network, when the first matching degree or the second matching degree is greater than a preset threshold.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Communication control method and device of intelligent equipment, equipment and storage medium
CN110446197A
Wireless local area network connection method, device and system, equipment and storage medium
CN111182532A
Network distribution method and device, storage medium and electronic equipment
CN112533206A
Communication method and device, ECU, vehicle and storage medium
CN113162928A
Self arranged net mode shared key authentication and conversation key consulant method of radio LAN
CN1564514A
