Equipment control method, device and program product
By delegating private key management to gateway devices, the problems of private key leakage and limited storage space in smart device control systems are solved, thereby improving security and reliability, expanding the number of controllable devices, and reducing user costs.
Patent Information
- Application Number
- CN202411119921.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, intelligent device control systems suffer from security and reliability issues due to risks of private key leakage, limited storage space in control devices, and complex decryption strategies.
Private key management is handed over to a more powerful gateway device. The control device dynamically obtains the private key from the gateway device, and performs authentication and communication through the gateway device. This avoids the leakage of the private key on the control device side, and enables the control of an unlimited number of electronic devices through the powerful storage capacity of the gateway device.
It improves the security and reliability of device control, avoids the leakage of private keys on the control device side, expands the number of controllable devices, and reduces user costs.
Smart Images

Figure CN121531353A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet of Things (IoT) technology, and in particular to a device control method, apparatus, and program product. Background Technology
[0002] In the field of Internet of Things (IoT) technology, various items (such as home appliances, vehicles, sensors, etc.) are typically connected via the Internet, enabling them to communicate with each other, exchange data, promote automated collaboration between devices, and thus achieve intelligent management and control.
[0003] Taking home appliance management as an example, when users install new smart terminal devices in their homes, they typically add them to the home network and enable communication with existing terminal devices. For example, the new devices can be controlled via smart switches or smart remote controls. Summary of the Invention
[0004] This disclosure provides a device control method, apparatus, and program product that can improve the safety of device control.
[0005] On one hand, a device control method is provided, applied to a control device, comprising: sending a private key acquisition request to a gateway device, the private key acquisition request including an identifier of an electronic device; receiving a private key acquisition response sent by the gateway device, the private key acquisition response including an identifier of the electronic device and a private key of the electronic device; authenticating the electronic device based on the private key of the electronic device, and communicating with the electronic device if the authentication with the electronic device is successful.
[0006] On the other hand, a device control method is provided, applied to a gateway device, comprising: receiving a private key acquisition request sent by a control device, the private key acquisition request including an identifier of the electronic device; and sending a private key acquisition response to the control device, the private key acquisition response including an identifier of the electronic device and a private key of the electronic device, so that the control device performs authentication with the electronic device based on the private key of the electronic device.
[0007] In another aspect, a communication device is provided, comprising: a processor and a memory for storing processor-executable instructions; the processor is configured to execute the instructions such that the communication device implements any of the device control methods provided in the embodiments of this disclosure.
[0008] In another aspect, a computer-readable storage medium is provided, on which computer program instructions are stored, which, when executed on a computer, cause the computer to implement any of the device control methods provided in the embodiments of this disclosure.
[0009] In another aspect, a computer program product is provided, which includes computer program instructions that, when executed on a computer, cause the computer to implement any of the device control methods provided in the embodiments of this disclosure.
[0010] The device control method provided in this disclosure can, on the one hand, transfer the management of private keys to a more powerful gateway device, enabling the control device to dynamically obtain private keys from the gateway device. When controlling the device, it is not limited by the number of private keys it stores, thereby increasing the number of electronic devices that the control device can control. A single control device can control an unlimited number of electronic devices. Furthermore, it avoids the leakage of private keys on the control device side, thus improving the security of device control. Attached Figure Description
[0011] Figure 1 This is a schematic diagram illustrating an application scenario of a device control method according to some embodiments;
[0012] Figure 2 This is a schematic diagram illustrating an application scenario of a device control method according to some other embodiments;
[0013] Figure 3 This is a flowchart illustrating a device control method according to some embodiments;
[0014] Figure 4 This is a schematic flowchart of a device control method according to some other embodiments;
[0015] Figure 5 This is a schematic flowchart of a device control method according to some other embodiments;
[0016] Figure 6 This is a schematic flowchart of a device control method according to some other embodiments;
[0017] Figure 7 This is a schematic diagram of the structure of a communication device according to some embodiments. Detailed Implementation
[0018] The technical solutions in the embodiments of this disclosure will now be clearly and completely described with reference to the accompanying drawings.
[0019] In the description of this disclosure, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone.
[0020] Furthermore, "at least one" refers to one or more, and "more than one" refers to two or more. To facilitate a clear description of the technical solutions of the embodiments of this disclosure, the terms "first" and "second" are used in the embodiments of this disclosure to distinguish identical or similar items with substantially the same function and effect. It should be understood that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0021] Furthermore, in this disclosure, the words "exemplarily" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplarily" or "for example" in this disclosure should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0022] In the field of Internet of Things (IoT) technology, various items (such as home appliances, vehicles, sensors, etc.) are typically connected via the Internet, enabling them to communicate with each other, exchange data, promote automated collaboration between devices, and thus achieve intelligent management and control.
[0023] Taking home appliance management as an example, when users install new smart terminal devices in their homes, they typically add them to the home network and enable communication with existing terminal devices. For example, the new devices can be controlled via smart switches or smart remote controls.
[0024] In related technologies, a control channel is typically established by storing the private key corresponding to a new device through a smart switch or smart remote control, and then authenticating the device. However, this method has two drawbacks: firstly, it carries the risk of private key leakage, resulting in low security; secondly, the storage space of the chip within the control device is limited, restricting the number of private keys it can hold and thus limiting the number of terminal devices it can control. When users want to control more devices, they can only increase the number of switches or remote controls, increasing the user's operating costs.
[0025] Alternatively, related technologies involve obtaining encryption keys from various manufacturers' device management platforms through a gateway device; decrypting these keys according to a preset decryption strategy to generate and store a corresponding target key, which is then used to control the smart home devices associated with that target key. However, this approach is risky due to the complexity of the decryption strategy, and damage to the gateway can directly lead to the collapse of the entire device control system, reducing the reliability of device control.
[0026] In response, this disclosure provides a device control method, which includes: sending a private key acquisition request to a gateway device, the private key acquisition request including an identifier of an electronic device; receiving a private key acquisition response sent by the gateway device, the private key acquisition response including an identifier of the electronic device and a private key of the electronic device; authenticating the electronic device based on the private key of the electronic device, and communicating with the electronic device if the authentication with the electronic device is successful.
[0027] In this way, on the one hand, the management of the private key can be transferred to a more powerful gateway device, and the control device can dynamically obtain the private key from the gateway device. This allows the control device to control electronic devices without being limited by its own storage space. A single control device can control an unlimited number of electronic devices, increasing the number of controllable devices. On the other hand, it avoids the leakage of the private key on the control device side, improving the security of device control. Furthermore, the device control method provided in this disclosure does not rely on the encrypted keys of various manufacturers' devices for decryption, avoiding the problem of decryption failure due to complex decryption strategies, and improving the reliability of device control.
[0028] The device control method provided in this disclosure can be applied to systems with various communication standards. For example, applicable systems include, but are not limited to, Long Term Evolution (LTE) systems, various versions based on LTE evolution, 5th generation (5G) systems, New Radio (NR) systems, 5G NR systems, 5th generation new radio-advanced (5G-advanced) systems, and 6th generation (6G) systems, among other next-generation communication systems. Furthermore, the device control method provided in this disclosure can also be applied to future-oriented communication technologies.
[0029] Figure 1 The diagram illustrates an application scenario of a device control method according to this disclosure. (Refer to...) Figure 1 This application scenario includes gateway device 110, control device 120, and electronic device 130.
[0030] In this system, the gateway device 110, control device 120, and electronic device 130 are connected in pairs. For example, the communication connection can be achieved through at least one of the following methods: Zigbee, Wireless Fidelity (WiFi), Bluetooth, and radio frequency (RF). It should be understood that the number of electronic devices 130 in the figure is merely an example; in actual applications, there may be one or more electronic devices 130.
[0031] In this embodiment, gateway device 110, also referred to as a gateway, gateway server, or gateway interconnection device, can generate and / or store the public and private keys of electronic device 130. In some embodiments, gateway device 110 sends the public key of electronic device 130 to electronic device 130. In some embodiments, gateway device 110 sends the identifier and private key of electronic device 130 to control device 120. In some embodiments, gateway device 110 can also update the public and private keys of electronic device 130. In some embodiments, gateway device 110 can also receive the private key of a target device sent by control device 120, thereby managing and maintaining the private key of the target device on behalf of control device 120.
[0032] The control device 120, also known as a controller or wireless controller, can control at least one electronic device 130, enabling one-to-many device control. In some embodiments, the control device 120 authenticates with the electronic device 130 based on the private key of the electronic device 130 (or performs handshake authentication). Further, control of the electronic device 130 can be achieved after successful authentication, for example, by establishing a control channel with the electronic device 130. In some embodiments, the control device 120 can also migrate all or part of the private key of the electronic device 130 stored within it to the gateway device 110. The control device 120 can be an intelligent switch, a smart remote control, or a central controller, etc.; it should be understood that the control device can be any device with control capabilities in the IoT field, and this disclosure does not specifically limit it.
[0033] Electronic device 130, also known as an appliance, smart home device, etc., is capable of operating based on control commands from control device 120. In some embodiments, electronic device 130 authenticates with control device 120 using its public key, and receives control from control device 120 upon successful authentication. In some embodiments, the public key of electronic device 130 is sent by gateway device 110.
[0034] To explain this plan more clearly, Figure 2 The diagram illustrates an application scenario of another device method related to this disclosure. It can be seen that... Figure 2 The application scenarios shown further illustrate the internal structure of each device.
[0035] Reference Figure 2 The gateway device 110 may include at least one of the following: a first functional module 111, a key generation module 112, and a first key storage module 113.
[0036] The first functional module 111 is used to implement the basic functions of the gateway device 110 itself, such as protocol conversion and address allocation, which are not specifically limited in this disclosure. The key generation module 112 is used to generate the public key and private key of the electronic device 130, which can also be collectively referred to as the public and private keys of the electronic device 130, and will not be described in detail below. In some embodiments, the key generation module 112 can also send the private key of the electronic device 130 to the control device 120; furthermore, when sending the private key of the electronic device 130, the identifier of the electronic device 130 can also be sent so that the control device 120 can clearly know which electronic device 130's private key it is. In some embodiments, the key generation module 112 can also send the public key of the electronic device 130 to the electronic device 130 so that the electronic device 130 can perform authentication with the control device 120 based on the public key. The first key storage module 113 is used to store the identifier of at least one electronic device 130 and the private key of at least one electronic device 130, with each identifier corresponding to a private key; wherein the storage and transmission format of the private key can be described in the following description.
[0037] Reference Figure 2 The control device 120 may include at least one of the following: a second functional module 121 and an authentication module 122. In some embodiments, the control device 120 may further include a second key storage module 123 and / or a user input module 124.
[0038] The second functional module 121 is used to implement the basic functions of the control device 120 itself, such as controlling the opening and closing of the electronic device 130, which is not specifically limited in this disclosure. The authentication module 122 is used to authenticate with the electronic device 130. In some embodiments, the authentication module 122 can also load the private key of the electronic device 130 and verify the obtained public key of the electronic device 130 based on the private key. In some embodiments, the authentication module 122 can also delete and / or send the identifier of the target device and the private key of the target device stored in the control device 120 to the gateway device 110 for storage. The second key storage module 123 is used to store the private key of at least one electronic device 130. In a specific example, the second key storage module 123 stores one or two RSA (Rivest-Shamir-Adleman) private keys. In some examples, the key storage module 123 can also cache the private key received from the gateway device 110. The user input module 124 can recognize the identifier of the electronic device 130 entered by the user.
[0039] For example, the methods performed by each device are briefly described below with a specific example.
[0040] When a user needs to add a new electronic device 130 (such as a smart home device) to the device control system, the gateway device 110 identifies the new electronic device 130 and establishes a connection through short-range communication methods such as Zigbee, Wifi, and Bluetooth, so as to add the device to the home network.
[0041] Furthermore, the key generation module 112 of the gateway device 110 generates the public and private keys of the electronic device 130; the key generation module 112 sends the public key of the electronic device 130 to the electronic device 130, and transmits the private key and the identifier of the electronic device 130 to the first key storage module 113; correspondingly, the first key storage module 113 allocates a region and stores the identifier and private key of the electronic device 130 in the format "identifier: private key".
[0042] In some examples, the key generation module 112 will also dynamically update the public and private key pair of the electronic device 130 when a second preset condition is met. For details of the second preset condition, please refer to the method embodiments below.
[0043] Furthermore, the key generation module 112 in the gateway device 110 can also transmit the updated public key of the electronic device 130 to the electronic device 130 based on the identifier of the electronic device 130, thereby overwriting the original public key; and transmit the updated private key of the electronic device 130 to the first key storage module 113 in the gateway device 110, and update the original data in the first key storage module 113 according to the identifier of the electronic device 130 (e.g., update the original private key of the electronic device 130). It should be understood that because the gateway device 110 has a large storage capacity, it can store more private keys.
[0044] When a user needs to control the new electronic device 130 through the control device 120, for example, if the control device 120 (such as the user input module 124 in the control device 120) determines that the device the user wishes to control is the new electronic device 130 based on the device identifier input by the user, then a verification channel is created using a short-range communication method such as Zigbee, WiFi, or Bluetooth to broadcast information carrying the identifier of the electronic device 130. Alternatively, the control device 120 broadcasts an authentication request that includes the identifier of the electronic device 130.
[0045] Furthermore, after receiving the broadcast information, if the electronic device 130 identifies it as its own identifier, it responds and generates a random code, which can also be called a dynamic code and can be considered as a kind of authentication information. Then, based on the public key initially assigned to its electronic device 130 by the gateway device 110, the random code is encrypted to obtain the first encrypted information, and the first encrypted information is sent to the control device 120 through the response information.
[0046] The control device 120 receives the response information sent by the electronic device 130 and extracts the first encrypted information from it. Further, the authentication module 122 in the control device 120 queries the second key storage module 123 for available private key storage space. If the second key storage module 123 detects that the current number of stored keys has reached its limit, it randomly extracts a private key (which can also be called the old private key) and returns it to the authentication module 122, while simultaneously freeing up the storage space. The authentication module 122 attaches a message carrying the old private key and the device identifier corresponding to the old private key to a private key acquisition request and sends it to the gateway device 110. The private key acquisition request includes the identifier of the electronic device 130 that the control device 120 wishes to control.
[0047] Furthermore, after receiving the private key acquisition request, the gateway device 110 stores the old key and the device identifier corresponding to the old private key through the first key storage module 113, and feeds back the private key of the electronic device 130 to the control device 120 based on the identifier of the electronic device 130; correspondingly, the second key storage module 123 on the control device 120 loads the private key of the electronic device 130 into the freed-up space.
[0048] Furthermore, the authentication module 122 in the control device 120 decrypts the first encrypted information sent by the electronic device 130 based on the private key of the electronic device 130 to obtain the random code generated by the electronic device 130; then, after successful decryption, it encrypts the random code with the private key of the electronic device 130 to generate the second encrypted information and sends it to the electronic device 130, and waits for the feedback from the electronic device 130.
[0049] Furthermore, after receiving the second encrypted information, electronic device 130 decrypts the second encrypted information based on its stored public key to obtain a decrypted random code. If the obtained random code matches the random code initially generated by electronic device 130, authentication is successful. The information of control device 120 is recorded, and a connection establishment agreement response is sent to control device 120 to establish a control channel. If they do not match, authentication fails, and a connection establishment refusal response or an authentication failure response is sent. This completes a handshake process based on the authentication channel.
[0050] Furthermore, after receiving the response message from the electronic device 130 agreeing to establish a connection, the control device 120 establishes a control channel and sends relevant control information to the electronic device 130 through the channel, and the electronic device 130 accepts the control.
[0051] Furthermore, the control device 120 and the electronic device 130 will establish a closed, one-to-one secure connection based on this channel, free from interference from other devices, thus enhancing security. After a period of time, the gateway device 110 can allocate a new public key from the resource pool to the electronic device 130, which can then re-initiate the authentication process to ensure the security of the peer device. It should be understood that the allocation of a new key can also be interpreted as the gateway device 110 updating the public and private keys of the electronic device 130, enabling the electronic device 130 and the control device 120 to re-authenticate.
[0052] It should be noted that the above examples of equipment control systems are merely for illustrating the technical solutions of this disclosure more clearly and do not constitute a limitation of this disclosure. Those skilled in the art will understand that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in this disclosure are equally applicable to similar technical problems.
[0053] To illustrate the solution more clearly, the device control method provided in this disclosure is described below with reference to the accompanying drawings. It should be noted that the various embodiments of this disclosure can be referenced or understood from each other. For example, identical or similar steps, method embodiments, and device embodiments can be referenced from each other without limitation.
[0054] like Figure 3 As shown in the embodiments of this disclosure, a device control method is provided, applied to control a device, and the method may include the following operations:
[0055] S101. The control device sends a private key acquisition request to the gateway device. The private key acquisition request includes the identifier of the electronic device.
[0056] The control device may also be referred to as a controller or a wireless control device. In some embodiments, the control device may be a smart switch, a smart remote control, or a central controller, or it may be a user device, terminal, mobile phone, or handheld device, vehicle device, wearable device, computer, smart home device, or smart office device with control capabilities, etc.; it should be understood that the control device may be any device with control capabilities in the IoT field, and this disclosure does not specifically limit it.
[0057] An electronic device's identifier (ID) is used to uniquely identify the electronic device.
[0058] A private key retrieval request is used to request the private key of an electronic device.
[0059] In some embodiments, when it is necessary to control an electronic device, if the controlling device determines that it has stored the private key of the electronic device based on the identifier of the electronic device, it can directly control the electronic device based on the stored private key of the electronic device.
[0060] In other embodiments, when control of an electronic device is required, if the controlling device determines, based on the electronic device's identifier, that it does not store the electronic device's private key, then the controlling device sends a private key retrieval request to the gateway device. This request includes the electronic device's identifier, enabling the gateway device to send back the electronic device's private key based on that identifier. It should be understood that "the controlling device does not store the electronic device's private key" includes: the controlling device storing the private keys of other electronic devices but not the private key of this electronic device; or, the controlling device not storing the private key of any electronic device.
[0061] In some embodiments, the identifier of an electronic device is obtained based on user instructions. For example, the control device may have a keyboard or touchscreen to receive user instructions input by the user via the keyboard or touchscreen, the user instructions including the identifier of the electronic device.
[0062] In other embodiments, the identification of the electronic device is obtained through interaction between the control device and the electronic device. For example, the control device has a photographic recognition capability, and the electronic device has an image to be scanned corresponding to its identification. The image to be scanned includes, but is not limited to, at least one of the following: a QR code, a barcode, or a text image corresponding to the identification text; the control device obtains the identification of the electronic device by photographing and recognizing the image to be scanned. As another example, the control device has a reader / writer capability, and the electronic device has a built-in electronic tag bound to its identification; the control device obtains the identification of the electronic device by performing radio frequency identification on the electronic tag.
[0063] In some embodiments, the control device does not store the identifier of the electronic device, nor does it store the private key of the electronic device.
[0064] In other embodiments, the control device stores the identifier of the electronic device but not its private key. For example, the control device stores the identifier of the controlled electronic device and sends the private key of the controlled electronic device back to the gateway device. When it is necessary to re-authenticate the controlled electronic device, the identifier of the controlled electronic device is sent back to the gateway device to obtain the private key of the controlled electronic device from the gateway device again for authentication. This private key can be the private key sent by the control device last time, or it can be an updated private key by the gateway device based on the private key sent by the control device last time. Therefore, on the one hand, the control device does not need to obtain the identifier of the electronic device again, but can obtain the private key based on the existing identifier; on the other hand, the control device does not need to store the private key of the electronic device, transferring the storage and maintenance of the private key to the gateway device, avoiding private key leakage on the control device side, improving the security of device control, and allowing the control device to be unrestricted by storage space, increasing the number of electronic devices it can control.
[0065] In some embodiments, the control device directly sends a private key acquisition request to the gateway device.
[0066] In other embodiments, if a first preset condition is met, the control device sends a private key acquisition request to the gateway device; wherein the first preset condition includes: obtaining a device control instruction, which instructs the control device to control the electronic device, and the control device does not store the private key of the electronic device; and / or, the authentication between the control device and the electronic device fails.
[0067] For example, when a control device receives a device control command that includes the air conditioner's identifier, and determines that it does not have the air conditioner's private key stored based on this identifier, the control device sends a private key retrieval request to the gateway device to obtain the air conditioner's private key. This allows the control device to avoid storing the private keys of electronic devices (such as air conditioners) itself, instead managing and maintaining them through a more powerful gateway. This enables the control device to control more electronic devices simultaneously without being limited by storage space, while also preventing private key leakage and improving the security of device control.
[0068] For example, if the control device fails to authenticate with the electronic device using its stored private key, it sends a private key retrieval request to the gateway device to obtain the electronic device's private key for re-authentication. Based on this, even if the gateway device updates the electronic device's public key, the control device can still re-perform authentication, improving the security of device control.
[0069] It should be noted that the above-mentioned first preset condition is merely an example, and other conditions may also exist; for example, the first preset condition could also be: the usage duration of the electronic device's private key reaches a preset usage duration threshold. Thus, the control device sends a private key retrieval request to the gateway device when the private key's usage duration reaches the preset usage duration threshold, ensuring that the latest private key is obtained periodically to re-authenticate the electronic device, thereby improving the reliability of device control. It should be understood that this disclosure does not specifically limit other possible situations for the first preset condition, as long as they can trigger the control device to send a private key retrieval request.
[0070] In some embodiments, the private key acquisition request may also include the identifier of the control device, so that in the presence of multiple control devices, the gateway can accurately identify the control device with which it communicates. Furthermore, the gateway device may also set the private key management status of the electronic device based on the identifier of the control device, indicating that the electronic device is directly managed by the control device.
[0071] In other embodiments, the private key acquisition request does not include the identifier of the control device. It should be understood that, since the device control method provided in this disclosure does not present the problems of limited private key storage or risk of private key leakage when a single control device controls electronic devices, authentication and control of multiple electronic devices can actually be achieved through a single control device. Therefore, a single control device can be used by default in the device control system. Thus, even without sending the identifier of the control device, the gateway device can still determine the control device it is communicating with.
[0072] S102. The control device receives a private key acquisition response sent by the gateway device. The private key acquisition response includes the identifier of the electronic device and the private key of the electronic device.
[0073] In some embodiments, the private key of the electronic device is generated based on an asymmetric encryption algorithm. For example, the private key of the electronic device is generated based on the RSA algorithm. Furthermore, the format of the electronic device's identifier ID and the electronic device's private key in the private key retrieval response can be set to "Identifier:Private Key", for example, "ID:RSA Private Key".
[0074] In some embodiments, after receiving a private key acquisition response, the control device also stores the identifier and private key of the electronic device for future authentication with the electronic device. Furthermore, the format for storing the identifier and private key of the electronic device in the control device can also be set to "identifier:private key", for example, "ID:RSA private key".
[0075] In a specific example, if the control device does not store the private key of the electronic device, it directly stores the identifier and private key of the electronic device.
[0076] In another specific example, if the control device already stores the private key of the electronic device, upon receiving a private key retrieval response, it is determined whether the private key included in the response is the same as the private key already stored in the control device. If the private key in the response differs from the stored private key, the private key in the control device is updated with the private key from the response. Based on this, the private key stored in the control device can be updated only when the private key sent by the gateway device differs from the private key stored in the control device; thus, the number of times the storage devices in the control device are overwritten is reduced, and device wear and tear is minimized.
[0077] In another specific example, if the control device already stores the private key of the electronic device, then upon receiving the private key retrieval response, the control device directly updates the private key of the electronic device stored in the response with the private key already present. Based on this, the decision-making time of the control device can be reduced, and the efficiency of private key updates or storage can be improved.
[0078] In some embodiments, after receiving the private key acquisition response, the control device does not store it, but directly executes step S103 described below. Thus, control of electronic devices can be achieved without storing the private key in the control device; this avoids private key leakage and is not limited by storage space, allowing the control device to control multiple electronic devices; even if new electronic devices are added, authentication and device control can still be performed normally.
[0079] S103. The control device authenticates itself with the electronic device based on the electronic device's private key, and communicates with the electronic device if the authentication with the electronic device is successful.
[0080] In some embodiments, the control device performs authentication with the electronic device based on the private key of the electronic device, including: receiving first encrypted information sent by the electronic device, the first encrypted information being obtained by encrypting with the public key of the electronic device; performing decryption and encryption operations on the first encrypted information sequentially based on the private key of the electronic device to obtain second encrypted information; sending the second encrypted information to the electronic device; and receiving authentication results sent by the electronic device, the authentication results being used to indicate whether the authentication between the control device and the electronic device is successful.
[0081] The public key and private key of an electronic device are paired. Furthermore, both the public and private keys of the electronic device are generated or produced by the gateway device.
[0082] In some embodiments, the first encrypted information is obtained by encrypting the authentication information generated by the electronic device using the public key of the electronic device; the above-mentioned decryption and encryption operations on the first encrypted information based on the private key of the electronic device to obtain the second encrypted information include: decrypting the first encrypted information based on the private key of the electronic device to obtain the authentication information; and encrypting the authentication information based on the private key of the electronic device to obtain the second encrypted information.
[0083] In a specific example, the authentication information generated by the aforementioned electronic device is a random code generated by the electronic device. Then, the control device decrypts the first encrypted information using the private key of the electronic device to obtain the random code; the control device then encrypts the random code using the private key of the electronic device to obtain the second encrypted information.
[0084] In some embodiments, if authentication with the electronic device is successful, the control device also establishes a control channel with the electronic device in order to control the electronic device based on the control channel.
[0085] In other embodiments, if authentication with the electronic device fails, the control device can resend the private key acquisition request to the gateway device; for example, it can return to execute the above step S101.
[0086] In some embodiments, prior to step S103, the control device also broadcasts the identifier of the electronic device for authentication. For example, the control device broadcasts an authentication request, which requests authentication with the electronic device and includes the identifier of the electronic device. This enables the electronic device to perform a handshake authentication with the control device based on the authentication request.
[0087] The device control method provided in this disclosure has two advantages. First, it can delegate the management of private keys to a more powerful gateway device, dynamically obtaining private keys from the gateway device. This is not limited to the number of private keys stored within the control device, thereby increasing the number of electronic devices that the control device can control. A single control device can control an unlimited number of electronic devices, and it avoids the leakage of private keys on the control device side, thus improving the security of device control. Second, it controls electronic devices using keys allocated by the gateway, rather than relying on encrypted keys from various manufacturers for decryption. This avoids decryption failures due to complex decryption strategies, improving the reliability of device control.
[0088] To ensure the security of public and private keys, the gateway device can also update the public and private keys of electronic devices periodically or irregularly. Correspondingly, the control device can also receive the updated private key sent by the gateway device.
[0089] For example, the control device receives private key update information sent by the gateway device, wherein the private key update information includes the identifier of the electronic device and the updated private key of the electronic device; further, the control device stores the updated private key, and / or re-authenticates with the electronic device based on the updated private key.
[0090] In the private key update information, the identifier of the electronic device and the format of the updated private key of the electronic device can be "Identifier: Private Key", such as "ID: RSA Private Key".
[0091] Based on this, the public and private keys of electronic devices can be continuously updated, reducing the risk of private key leakage and improving the security of device control.
[0092] In some embodiments, the control device may not store the private key of any electronic device; steps S101 to S103 described above are only performed when control of the electronic device is required. It should be understood that in this case, the control device transfers all storage and management of the private key to the gateway device.
[0093] In other embodiments, the control device stores identifiers and private keys for one or more devices, with each device identifier corresponding to a private key. It should be understood that, when storing private keys for one or more devices in the control device, the control device may also migrate some or all of the stored private keys to the gateway device to improve the security of private key management, or delete some or all of the stored private keys and only request the gateway device to send the private keys again during authentication to reduce the memory pressure on the control device.
[0094] To more clearly illustrate the methods provided in this disclosure, the following example uses a control device that stores the private keys of one or more devices to specifically describe the device control methods involved in this disclosure.
[0095] In some embodiments, the private keys of one or more devices stored in the control device are sent by the gateway device and / or pre-stored in the control device itself.
[0096] In some embodiments, the control device stores identifiers and private keys for one or more devices, with each device identifier corresponding to a private key. The control device further performs the following methods: identifying at least one target device from the one or more devices; sending the target device's identifier and private key to the gateway device; and / or deleting the target device's identifier and private key from the control device. It should be understood that the process of sending the target device's identifier and private key to the gateway device enables private key migration, thereby utilizing the gateway device's large storage space to move old keys to the gateway device for storage, achieving a one-to-many secure connection between smart home devices and saving user costs. Furthermore, it makes electronic devices independent of external networks, improving security. The process of deleting the target device's identifier and private key from the control device frees up more storage space in the control device, reserving space for storing private keys for new devices and reducing the pressure on the control device's private key storage and management.
[0097] In some embodiments, the control device determines at least one device as the target device only when its private key storage space is insufficient. For example, upon receiving a private key retrieval response, if the control device's private key storage space is insufficient to store the private key of the electronic device included in the response, at least one device is determined as the target device, and the target device's private key is sent to the gateway device so that the control device can store the private key of the electronic device included in the response. Based on this, while moving the old key to the gateway device for storage, the new key can be loaded into the freed-up storage space, thereby achieving a one-to-many secure connection between smart home devices and saving users costs.
[0098] In other embodiments, where the control device is only allowed to store the identifier and private key of one device, the device stored in the control device is directly identified as the target device. Based on this, storage space checks can be omitted, and the device can be directly migrated or deleted, saving the control device's decision-making time and improving control efficiency.
[0099] In some embodiments, the target device satisfies any of the following: the target device is a device randomly selected by the control device from one or more devices; the usage frequency of the target device is lower than or equal to the usage frequency of any other device in one or more devices besides the target device; the idle time of the target device is greater than or equal to the idle time of any other device in one or more devices besides the target device; the usage frequency of the target device is lower than or equal to a preset minimum frequency threshold; the idle time of the target device is greater than or equal to a preset idle time threshold.
[0100] In some embodiments, the identifier of the target device and the private key of the target device sent by the control device are independent of the aforementioned private key acquisition request. Based on this, the migration of private keys already stored in the control device can be performed even without acquiring a new private key.
[0101] In other embodiments, the identifier and private key of the target device sent by the control device can be sent through the aforementioned private key acquisition request; that is, the private key acquisition request also includes the identifier and private key of the target device. Based on this, multiple transmissions of information can be avoided, improving communication efficiency.
[0102] As can be seen, the above mainly describes the device control method provided in this disclosure from the perspective of control equipment. In addition, this disclosure also provides a device control method applied to gateway devices. (Refer to...) Figure 4 The device control method includes the following steps S201 to S202:
[0103] S201. The gateway device receives a private key acquisition request sent by the control device. The private key acquisition request includes the identifier of the electronic device.
[0104] For details regarding the private key retrieval request, please refer to the description above.
[0105] In some embodiments, the gateway device stores at least one device identifier and at least one device private key, with each device identifier corresponding to a private key.
[0106] In other embodiments, the gateway device also stores the public key of the at least one device, with each device's private key corresponding to a device's public key.
[0107] S202. The gateway device sends a private key acquisition response to the control device. The private key acquisition response includes the identifier of the electronic device and the private key of the electronic device, so that the control device can authenticate the electronic device based on the private key of the electronic device.
[0108] The details regarding the private key retrieval response can be found in the description above.
[0109] In some embodiments, the private key of the electronic device is generated or produced by the gateway device; in addition, the gateway device may also generate or produce the public key of the electronic device.
[0110] In some embodiments, the gateway device generates the public key and private key of the electronic device based on an asymmetric encryption algorithm (such as RSA).
[0111] Furthermore, the gateway device can also store the electronic device's identifier and the electronic device's private key. In a specific example, the storage format is "identifier:private key", such as "ID:RSA private key".
[0112] Furthermore, the gateway device can also send the private key of the electronic device to the control device, and / or
[0113] Alternatively, send the public key of the electronic device to the electronic device.
[0114] The device control method provided in this disclosure has two advantages. First, it can delegate the management of private keys to a more powerful gateway device, dynamically obtaining private keys from the gateway device. This is not limited to the number of private keys stored within the control device, thereby increasing the number of electronic devices that the control device can control. A single control device can control an unlimited number of electronic devices, and it avoids the leakage of private keys on the control device side, thus improving the security of device control. Second, it controls electronic devices using keys generated or produced by the gateway, rather than relying on encrypted keys from various manufacturers for decryption. This avoids decryption failures due to complex decryption strategies, improving the reliability of device control.
[0115] In some embodiments, if the gateway device stores the identifier of the electronic device, the gateway device determines the private key of the electronic device corresponding to the identifier based on the identifier of the electronic device, and then performs the above step S202.
[0116] In some other embodiments, if the identifier of the electronic device is not stored in the gateway device, the method further includes, before step S202: the gateway device generates a public key and a private key of the electronic device; stores the identifier and the private key of the electronic device; and sends the public key of the electronic device to the electronic device.
[0117] To ensure the security of public and private keys, the gateway device can also update the public and private keys of electronic devices periodically or irregularly. Correspondingly, the control device can also receive the updated private key sent by the gateway device.
[0118] In some embodiments, if the second preset condition is met, the gateway device may also update the public key and private key of the electronic device to obtain the updated private key and updated public key of the electronic device; further, the gateway device sends the updated public key of the electronic device to the electronic device; and / or, the gateway device sends the identifier of the electronic device and the updated private key of the electronic device to the control device.
[0119] The second preset condition includes at least one of the following: the current time reaches the start time of the next update cycle; the private key of the electronic device is stored in the gateway device for a period of time exceeding a preset storage time threshold; a key update instruction is received, which is used to instruct the updating of the private key and public key of the electronic device; and the number of consecutive authentication failures of the control device based on the private key of the electronic device exceeds a failure count threshold.
[0120] Based on this, the private key can be updated in a timely manner when the update cycle is reached or the private key storage time is too long, thereby improving the security of private key storage; or, it can be updated based on instructions to meet more update needs of users; or, it can be updated when the control device fails to authenticate multiple times, so as to avoid continuous authentication failures caused by errors in the public or private key generated in a single instance.
[0121] Furthermore, the gateway device also stores the identifier of the electronic device and the updated private key of the electronic device.
[0122] In some embodiments, the gateway device sends the identifier of the electronic device and the private key of the electronic device to the control device, including: the gateway device directly sends private key update information to the control device, the private key update information including the identifier of the electronic device and the updated private key of the electronic device.
[0123] In other embodiments, the gateway device sends the identifier of the electronic device and the private key of the electronic device to the control device, including: if a third preset condition is met, the gateway device sends private key update information to the control device; wherein the third preset condition includes at least one of the following: the gateway device stores the private key management status of the electronic device, and the private key management status of the electronic device indicates that the private key of the electronic device is directly managed by the control device; and / or, the gateway device receives a private key acquisition request sent by the control device again.
[0124] In some embodiments, the gateway device also receives the identifier of the target device and the private key of the target device sent by the control device; furthermore, the gateway device stores the identifier of the target device and the private key of the target device. Based on this, the gateway device can take over the device private keys stored in the control device, realizing the migration of private keys. On the one hand, this provides security for private key management; on the other hand, it frees up more storage space for the control device, allowing the control device to dynamically obtain private keys from the gateway device, not limited by the number of private keys it can store, thus increasing the number of electronic devices that the control device can control.
[0125] In some embodiments, the identifier of the target device and the private key of the target device sent by the control device are independent of the aforementioned private key acquisition request. Based on this, the migration of private keys already stored in the control device can be performed even without acquiring a new private key.
[0126] In other embodiments, the identifier and private key of the target device sent by the control device can be sent through the aforementioned private key acquisition request; that is, the private key acquisition request also includes the identifier and private key of the target device. Based on this, multiple transmissions of information can be avoided, improving communication efficiency.
[0127] In addition, this disclosure also provides a device control method applied to an electronic device. The device control method includes: the electronic device receiving its public key from a gateway device; authenticating with a control device based on the electronic device's public key; and communicating with the control device if authentication with the control device is successful.
[0128] In some embodiments, the above-mentioned authentication with the control device based on the public key of the electronic device includes: the electronic device generating authentication information; encrypting the authentication information based on the public key of the electronic device to obtain first encrypted information; sending the first encrypted information to the control device; receiving second encrypted information sent by the control device; decrypting the second encrypted information based on the public key of the electronic device to obtain a decryption result; and determining that the authentication is successful if the decryption result is consistent with the authentication information, otherwise confirming that the authentication has failed.
[0129] In a specific example, the authentication information is a random code generated by the electronic device.
[0130] In some embodiments, if authentication with the control device is successful, the electronic device also establishes a control channel with the control device so as to receive control from the control device based on the control channel.
[0131] In some embodiments, the method further includes: the electronic device receiving an updated public key from the gateway device; the electronic device storing the updated public key, and / or re-authenticating with the control device based on the updated public key; and communicating with the control device if authentication with the control device is successful.
[0132] To more clearly illustrate the device control method provided in this disclosure, a specific example is given below.
[0133] like Figure 5 As shown, after a new electronic device 130 is added to the home network, the electronic device 130 establishes a connection with the gateway device 110. Correspondingly, after the gateway device 110 learns that a new electronic device 130 has joined the home network, it generates a public and private key for the electronic device and sends the public key of the electronic device 130 to the electronic device 130. Furthermore, the private key of the electronic device 130 is stored internally in the gateway device 110 for use by a control device (not shown in the figure).
[0134] like Figure 6 As shown, when the control device 120 needs to control the electronic device 130, the device control method provided in this disclosure further includes the following steps:
[0135] Control device 120 broadcasts the identifier of electronic device 130 to request the establishment of a connection, for example, broadcasting an authentication request that includes the identifier of electronic device 130 to request the establishment of a connection; correspondingly, electronic device 130 receives the identifier of electronic device 130.
[0136] Furthermore, after receiving the identifier sent by the control device 120, the electronic device 130 encrypts the generated random code based on its public key to obtain the first encrypted information; wherein, the public key of the electronic device 130 is generated and sent by the gateway device 110, for example, through the aforementioned Figure 5 Obtain it in the manner shown.
[0137] Furthermore, the electronic device 130 sends the first encrypted information to the control device 120.
[0138] After receiving the first encrypted information, the control device 120 determines whether there is private key storage space; if the private key storage space is insufficient, it randomly determines the private key of a target device.
[0139] Furthermore, the control device 120 sends the identifier of the target device and the private key of the target device, as well as the identifier of the electronic device 130, to the gateway device 110. In a specific example, the identifier of the target device, the private key of the target device, and the identifier of the electronic device 130 are all sent via a private key retrieval request.
[0140] Correspondingly, gateway device 110 receives the identifier and private key of the target device; further, gateway device 110 stores the identifier and private key of the target device, and sends the private key of electronic device 130 to control device 120 based on the identifier of electronic device 130. In a specific example, gateway device 110 sends the private key of electronic device 130 to control device 120 through a private key acquisition response.
[0141] Furthermore, the control device 120 decrypts and encrypts the first encrypted information sequentially based on the private key of the electronic device 130 to obtain the second encrypted information; and sends the second encrypted information to the electronic device 130.
[0142] Correspondingly, electronic device 130 receives the second encrypted information; further, electronic device 130 verifies the second encrypted information based on its public key; if the second encrypted information passes the verification, electronic device 130 establishes a connection with control device 120. For example, electronic device 130 decrypts the second encrypted information based on its public key to obtain a decryption result; if the decryption result matches the random code, electronic device 130 establishes a connection with control device 120.
[0143] Furthermore, a control channel is established between the control device 120 and the electronic device 130, which can also be referred to as a communication channel or a security channel.
[0144] Based on this, on the one hand, the management of private keys can be transferred to more powerful gateway devices, which can dynamically obtain private keys from the gateway devices. This is not limited to the number of private keys stored in the control device, thereby increasing the number of electronic devices that the control device can control. A single control device can control an unlimited number of electronic devices; and it avoids the leakage of private keys on the control device side, improving the security of device control. On the other hand, it does not rely on the encrypted keys of various manufacturers' devices for decryption, avoiding the problem of decryption failure due to complex decryption strategies, thus improving the reliability of device control.
[0145] As can be seen, the above mainly describes the solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the above functions, the embodiments of this disclosure provide corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0146] The related apparatus provided in this disclosure will now be described. It should be understood that the communication apparatus described below can be referred to in correspondence with the device control method described above.
[0147] For example, embodiments of this disclosure also provide a control device for executing the device control method provided in embodiments of this disclosure, including a first communication module and an authentication module. In some embodiments, the control device further includes at least one of the following: a private key migration module and / or a private key update module.
[0148] The first communication module is used to send a private key acquisition request to the gateway device, the private key acquisition request including the identifier of the electronic device; and to receive a private key acquisition response sent by the gateway device, the private key acquisition response including the identifier of the electronic device and the private key of the electronic device.
[0149] The authentication module is used to authenticate the electronic device with the electronic device based on the electronic device's private key, and to communicate with the electronic device if the authentication is successful.
[0150] In some embodiments, the control device stores the identifiers of one or more devices and the private keys of one or more devices, with each device identifier corresponding to a private key; the private key migration module is used to determine at least one device as the target device from the one or more devices; send the identifier and private key of the target device to the gateway device, and / or delete the identifier and private key of the target device in the control device.
[0151] In some embodiments, the private key migration module is specifically used to determine at least one device as the target device from one or more devices when the private key storage space of the control device is insufficient; and / or, when the control device is only allowed to store the identifier of one device and the private key of one device, directly determine one device stored in the control device as the target device.
[0152] In some embodiments, the relevant content of the target device can be referred to the description of the method embodiments above.
[0153] In some embodiments, the private key update module is used to receive private key update information sent by the gateway device. The private key update information includes the identifier of the electronic device and the updated private key of the electronic device. The authentication module is also used to re-authenticate with the electronic device based on the updated private key.
[0154] In some embodiments, the first communication module is specifically used to send a private key acquisition request to the gateway device when a first preset condition is met; wherein the first preset condition can be referred to the description above.
[0155] In some embodiments, the authentication module is specifically used to receive first encrypted information sent by an electronic device, the first encrypted information being encrypted using the public key of the electronic device; to decrypt and encrypt the first encrypted information sequentially using the private key of the electronic device to obtain second encrypted information; to send the second encrypted information to the electronic device; and to receive the authentication result sent by the electronic device, the authentication result being used to indicate whether the authentication between the control device and the electronic device was successful.
[0156] For example, embodiments of this disclosure also provide a gateway device for executing the device control method provided in embodiments of this disclosure, including: a second communication module; in some embodiments, the gateway device further includes: a key generation module and / or a private key storage module.
[0157] The second communication module is used to receive a private key acquisition request sent by the control device, the private key acquisition request including the identifier of the electronic device; and to send a private key acquisition response to the control device, the private key acquisition response including the identifier of the electronic device and the private key of the electronic device, so that the control device can perform authentication with the electronic device based on the private key of the electronic device.
[0158] The key generation module is used to generate the public key and private key of the electronic device when the identifier of the electronic device is not stored in the gateway device; the private key storage module is also used to store the identifier and private key of the electronic device; and the second communication module is also used to send the public key of the electronic device to the electronic device.
[0159] The key generation module is also used to update the public key and private key of the electronic device when the second preset condition is met, so as to obtain the updated private key and updated public key of the electronic device. The second preset condition is described above. The second communication module is also used to send the updated public key of the electronic device to the electronic device and / or send the identifier of the electronic device and the updated private key of the electronic device to the control device.
[0160] The second communication module is specifically used to directly send private key update information to the control device. The private key update information includes the identifier of the electronic device and the updated private key of the electronic device; or, under the condition that a third preset condition is met, it sends private key update information to the control device. The third preset condition can be referred to the description above.
[0161] The second communication module is also used to receive the identifier of the target device and the private key of the target device sent by the control device; the private key storage module is also used to store the identifier of the target device and the private key of the target device in the gateway device.
[0162] It should be noted that the above module division is illustrative and represents only one logical functional division. In actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single processing module. Specifically, the above-described approach can also be used. Figure 2 The module division method is shown above. The integrated modules described above can be implemented either in hardware or as software functional modules.
[0163] In implementing the functions of the integrated modules described above in hardware, this disclosure also provides a possible structure for a communication device used to execute the device control method provided in this disclosure. Similarly, the communication device and the device control method described above can be referred to in correspondence with each other.
[0164] like Figure 7 As shown, the communication device includes a processor 702 and a communication interface 703. In some examples, the communication device may also include at least one of a bus 704 and a memory 701.
[0165] Processor 702 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 702 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 702 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0166] The communication interface 703 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0167] The memory 701 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0168] In one possible implementation, the memory 701 can exist independently of the processor 702. The memory 701 can be connected to the processor 702 via a bus 704 and is used to store instructions or program code executable by the processor 702, such as computer program instructions. When the processor 702 calls and executes the instructions or program code stored in the memory 701, it can implement the device control method provided in the embodiments of this disclosure.
[0169] In another possible implementation, the memory 701 can also be integrated with the processor 702.
[0170] The 704 bus can be an extended industry standard architecture (EISA) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0171] Some embodiments of this disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer (e.g., the aforementioned communication device, base station, first terminal, second terminal, and their processor, etc.), cause the computer to perform the device control method as described in any of the above embodiments. It should be understood that this disclosure does not limit the specific form of the computer.
[0172] In some examples, the aforementioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical discs (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage media" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0173] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the device control method described in any of the above embodiments.
[0174] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A device control method, characterized in that, Applied to control equipment, the method includes: Send a private key acquisition request to the gateway device, the private key acquisition request including the identifier of the electronic device; Receive a private key acquisition response sent by the gateway device, the private key acquisition response including the identifier of the electronic device and the private key of the electronic device; The device authenticates itself using its private key and communicates with the device if authentication is successful.
2. The method according to claim 1, characterized in that, The control device stores identifiers of one or more devices and private keys for the one or more devices, with each device identifier corresponding to a private key. The method further includes: At least one device is selected as the target device from the one or more devices; Send the identifier of the target device and the private key of the target device to the gateway device, and / or delete the identifier of the target device and the private key of the target device in the control device.
3. The method according to claim 2, characterized in that, The step of determining at least one device from the one or more devices as the target device includes: If the private key storage space of the control device is insufficient, at least one device is determined from the one or more devices as the target device; and / or, If the control device is only allowed to store the identifier of one device and the private key of that one device, then the device stored in the control device is directly identified as the target device.
4. The method according to claim 2, characterized in that, The target device satisfies any one of the following: The target device is a device randomly selected by the control device from the one or more devices; The usage frequency of the target device is lower than or equal to the usage frequency of any other device among the one or more devices besides the target device; The idle time of the target device is greater than or equal to the idle time of any other device among the one or more devices except the target device; The usage frequency of the target device is lower than or equal to a preset minimum frequency threshold. The idle time of the target device is greater than or equal to a preset idle time threshold.
5. The method according to claim 1, characterized in that, The method further includes: Receive private key update information sent by the gateway device, the private key update information including the identifier of the electronic device and the updated private key of the electronic device; The updated private key is used to re-authenticate with the electronic device.
6. The method according to claim 1, characterized in that, Sending a private key acquisition request to the gateway device includes: If the first preset condition is met, a private key acquisition request is sent to the gateway device; The first preset condition includes: obtaining a device control command, the device control command being used to instruct the control device to control the electronic device, and the control device not storing the private key of the electronic device; and / or, the authentication between the control device and the electronic device failing.
7. A device control method, characterized in that, Applied to a gateway device, the method includes: Receive a private key acquisition request sent by a control device, wherein the private key acquisition request includes the identifier of the electronic device; Send a private key acquisition response to the control device. The private key acquisition response includes the identifier of the electronic device and the private key of the electronic device, so that the control device can authenticate the electronic device based on the private key of the electronic device.
8. The method according to claim 7, characterized in that, Before sending the private key to the control device to obtain a response, the method further includes: If the identifier of the electronic device is not stored in the gateway device, a public key and a private key of the electronic device are generated. Store the identifier and private key of the electronic device, and send the public key of the electronic device to the electronic device.
9. The method according to claim 7, characterized in that, The gateway device stores the private key and the public key of the electronic device, and the method further includes: Under the condition that the second preset condition is met, the public key and the private key of the electronic device are updated to obtain the updated private key and the updated public key of the electronic device. Send the updated public key of the electronic device to the electronic device; and / or send the identifier of the electronic device and the updated private key of the electronic device to the control device; The second preset condition includes at least one of the following: the current time reaches the start time of the next update cycle; the private key of the electronic device is stored in the gateway device for a period of time exceeding a preset storage time threshold; a key update instruction is received, which is used to indicate the update of the private key and the public key of the electronic device; and the number of consecutive authentication failures of the control device based on the private key of the electronic device exceeds a failure count threshold.
10. The method according to claim 9, characterized in that, Sending the identifier of the electronic device and the updated private key of the electronic device to the control device includes: Send private key update information directly to the control device. The private key update information includes the identifier of the electronic device and the updated private key of the electronic device; or... If the third preset condition is met, the identifier of the electronic device and the updated private key of the electronic device are sent to the control device; The third preset condition includes at least one of the following: the gateway device stores the private key management status of the electronic device and the private key management status of the electronic device indicates that the private key of the electronic device is directly managed by the control device, and / or the gateway device receives a private key acquisition request sent by the control device again.
11. The method according to claim 7, characterized in that, The method further includes: Receive the identifier of the target device and the private key of the target device sent by the control device; The gateway device stores the identifier of the target device and the private key of the target device.
12. A communication device, characterized in that, include: A processor and a memory for storing processor-executable instructions; The processor is configured to execute the instructions, causing the communication device to perform the device control method as described in any one of claims 1-11.
13. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed on a computer, cause the computer to perform the device control method as described in any one of claims 1-11.