WO2022116209A1 - Internet of things device access authentication method and apparatus, device, and storage medium - Google Patents

Internet of things device access authentication method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2022116209A1
WO2022116209A1 PCT/CN2020/134087 CN2020134087W WO2022116209A1 WO 2022116209 A1 WO2022116209 A1 WO 2022116209A1 CN 2020134087 W CN2020134087 W CN 2020134087W WO 2022116209 A1 WO2022116209 A1 WO 2022116209A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
key
random number
cloud platform
authentication
Prior art date
Application number
PCT/CN2020/134087
Other languages
French (fr)
Chinese (zh)
Inventor
罗朝明
茹昭
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/134087 priority Critical patent/WO2022116209A1/en
Priority to CN202080106961.4A priority patent/CN116420338A/en
Publication of WO2022116209A1 publication Critical patent/WO2022116209A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords

Definitions

  • the present application relates to the field of wireless communications, and in particular, to a method, apparatus, device, and storage medium for access authentication of IoT devices.
  • IoT devices In the Internet of Things (IoT) technology, IoT devices usually involve cross-platform access scenarios, and need to access the cloud platform to issue access keys for IoT devices.
  • the IoT device In order to ensure the security of access, in the process of each result of the IoT device, before the access cloud platform issues the access key for the IoT device, the IoT device needs to be authenticated at least once. , to issue access keys for IoT devices.
  • the embodiments of the present application provide an access authentication method, apparatus, device, and storage medium for an Internet of Things device.
  • a method for authentication of IoT device access is provided, the method is performed by an access cloud platform, and the method includes:
  • the device key is set in the IoT device and the device cloud platform;
  • a method for authentication of IoT device access is provided, the method is performed by the IoT device, and the method includes:
  • the first random number is generated by the access cloud platform, and the device cloud platform that obtains the IoT device passes the device key and the first random number. provided after the first access key generated by a random number; the device key is set in the IoT device and the device cloud platform;
  • a method for authentication of IoT device access is provided, the method is performed by an access cloud platform, and the method includes:
  • the device information of the IoT device send the first random number to the device cloud platform corresponding to the IoT device;
  • the IoT device Receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, where the second access key is obtained by the IoT device according to the device key, the generated by the encrypted ciphertext and the first random number;
  • a method for authentication of IoT device access is provided, the method is performed by the IoT device, and the method includes:
  • the encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform through the first encryption key for the first access password.
  • the encrypted ciphertext obtained by encrypting the key; the first encryption key is the key generated by the device cloud platform of the Internet of Things device encrypting the first random number with the device key; the device key is set in the IoT device and the device cloud platform;
  • the first random number is encrypted by the device key to generate the second encryption key
  • an IoT device access authentication apparatus the apparatus is used for accessing a cloud platform, and the apparatus includes:
  • the device information acquisition module is used to acquire the device information of the IoT device
  • a first random number generating module for generating a first random number
  • a first random number sending module configured to send the first random number to the device cloud platform according to the device information of the IoT device
  • a first access key receiving module configured to receive the first access key generated by the device cloud platform through the device key and the first random number; the device key is set in the IoT device and in the device cloud platform;
  • a first random number providing module configured to provide the first random number to the Internet of Things device
  • the authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key and the first random number;
  • An access authentication module configured to perform access authentication on the IoT device according to the first access key and the second access key.
  • an apparatus for authentication of IoT device access is provided, the apparatus is used in an IoT device, and the apparatus includes:
  • a device information providing module configured to provide the device information of the IoT device to the access cloud platform
  • a first random number acquisition module configured to acquire a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform and obtained from the device cloud of the IoT device The platform is provided after the first access key generated by the device key and the first random number; the device key is set in the IoT device and the device cloud platform;
  • a second access key generation module configured to generate a second access key according to the device key and the first random number
  • an authentication request sending module configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  • an IoT device access authentication apparatus the apparatus is used for accessing a cloud platform, and the apparatus includes:
  • the device information acquisition module is used to acquire the device information of the IoT device
  • a random number and key generation module for generating a first random number and a first access key
  • a first random number sending module configured to send the first random number to a device cloud platform corresponding to the IoT device according to the device information of the IoT device;
  • a first encryption key receiving module configured to receive a first encryption key generated by the device cloud platform by encrypting the first random number with the device key
  • an encrypted ciphertext obtaining module configured to encrypt the first access key by using the first encryption key to obtain an encrypted ciphertext
  • a ciphertext and random number providing module configured to provide the encrypted ciphertext and the first random number to the IoT device
  • the authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key, the encrypted ciphertext and the first random number;
  • An access authentication module configured to perform access authentication on the IoT device according to the first access key and the second access key.
  • an apparatus for authentication of IoT device access is provided, the apparatus is used in an IoT device, and the apparatus includes:
  • a device information providing module configured to provide the device information of the IoT device to the access cloud platform
  • the ciphertext and random number acquisition module is used to acquire the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is obtained by the access cloud platform through the first random number.
  • the second encryption key generation module is used for encrypting the first random number by the device key to generate the second encryption key
  • a second access key obtaining module configured to decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key
  • an authentication request sending module configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  • a device for accessing a cloud platform includes: a processor and a transceiver connected to the processor; wherein,
  • the processor is used for acquiring device information of the IoT device; generating a first random number;
  • the transceiver is configured to send the first random number to the device cloud platform according to the device information of the Internet of Things device; receive the first random number generated by the device cloud platform through the device key and the first random number; a first access key; the device key is set in the IoT device and the device cloud platform;
  • the processor configured to provide the first random number to the Internet of Things device
  • the transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key and the first random number;
  • the processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  • an IoT device comprising: a processor and a transceiver connected to the processor; wherein,
  • the processor is configured to provide device information of the Internet of Things device to the access cloud platform; obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform generated and provided after obtaining the first access key generated by the device cloud platform of the IoT device through the device key and the first random number; the device key is set on the IoT device and in the device cloud platform;
  • the processor configured to generate a second access key according to the device key and the first random number
  • the transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first
  • the access key and the second access key are used to perform access authentication on the IoT device.
  • a device for accessing a cloud platform includes: a processor and a transceiver connected to the processor; wherein,
  • the processor for acquiring device information of the IoT device; generating a first random number and a first access key;
  • the transceiver is configured to send the first random number to the device cloud platform corresponding to the Internet of Things device according to the device information of the Internet of Things device; the first encryption key generated by encrypting the first random number;
  • the processor is configured to encrypt the first access key by using the first encryption key to obtain encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT devices;
  • the transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key, the encrypted ciphertext and the first random number;
  • the processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  • an IoT device comprising: a processor and a transceiver connected to the processor; wherein,
  • the processor is configured to provide the device information of the Internet of Things device to the access cloud platform; obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the The encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform using the first encryption key to encrypt the first access key; the first encryption key is the device cloud platform of the IoT device through the device A key generated by encrypting the first random number with a key; the device key is set in the IoT device and the device cloud platform;
  • the processor is configured to encrypt the first random number with a device key to generate a second encryption key; decrypt the encrypted ciphertext with the second encryption key to obtain a second access key ;
  • the transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first
  • the access key and the second access key are used to perform access authentication on the IoT device.
  • a computer-readable storage medium is provided, and a computer program is stored in the readable storage medium, and the computer program is loaded and executed by a processor to implement the method for authentication of access to an Internet of Things device as described in the above aspects .
  • a chip is provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip runs on a network device, it is used to implement the Internet of Things described in the above aspect Device access authentication method.
  • a computer program product which when running on a processor of a network device, enables the network device to execute the method for authentication of IoT device access described in the above aspect.
  • the device key is preset in the IoT device and the device cloud platform.
  • the access cloud platform can obtain the first access key by interacting with the device cloud platform. and the first random number generated by itself, where the first access key is generated by the device key and the first random number, that is, after the access cloud platform provides the first random number to the IoT device , the IoT device can obtain the second access key for access through the locally stored device key, combined with the first random number, and use the second access key to request access to the cloud platform for access authentication.
  • the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly, which can ensure security.
  • Device identity authentication can simplify the access authentication process, thereby improving the efficiency of IoT device access authentication while ensuring the security of access authentication.
  • FIG. 1 is a block diagram of an access authentication system provided by an exemplary embodiment of the present application.
  • FIG. 2 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application
  • FIG. 3 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application
  • FIG. 4 is a flowchart of access authentication in the network distribution process involved in the embodiment shown in FIG. 3;
  • FIG. 5 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application
  • FIG. 6 is a flow chart of access authentication after completion of the distribution network involved in the embodiment shown in FIG. 5;
  • FIG. 7 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application.
  • FIG. 8 is a flowchart of access authentication in the network distribution process involved in the embodiment shown in FIG. 7;
  • FIG. 9 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application.
  • FIG. 10 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application.
  • FIG. 11 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application.
  • FIG. 12 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application.
  • Soft Wireless Access Point Soft Access Point, Soft AP
  • Soft AP is a technology that uses special software to realize AP function on non-AP devices through wireless network card. It can replace AP (Access Point, wireless access point) in wireless network, thereby reducing the cost of wireless networking.
  • Soft AP The hardware part of Soft AP is a standard wireless network card, which provides the same signal transfer, routing and other functions as AP through drivers. Compared with traditional AP, the cost of Soft AP is very low. Compared with ordinary wireless network cards, the integrated driver/software of Soft AP can provide great convenience for users who are new to the network.
  • Network distribution refers to a process in which a device to be connected to the network obtains network access information (such as a network identifier and an access key), and accesses the network based on the network access information.
  • network access information such as a network identifier and an access key
  • the distribution network based on Soft AP refers to the process that the device to be connected to the network requests network access information and accesses the network with the help of the distribution network device (such as a mobile phone) through the Soft AP function.
  • Scanning the code to configure the network means that the device to be connected to the Internet scans the graphic code (such as a two-dimensional code) through an image acquisition component (such as a camera) and decodes it, obtains the network access information carried in the graphic code, and connects based on the network access information. the process of entering the network.
  • the graphic code such as a two-dimensional code
  • an image acquisition component such as a camera
  • FIG. 1 shows a block diagram of an access authentication system provided by an exemplary embodiment of the present application.
  • the system may include: an Internet of Things device 12 , an access cloud platform 14 , and a device cloud platform 16 .
  • the IoT device 12 may be a smart device (such as VR (Virtual Reality, virtual reality) glasses, a smart wearable device, etc.), a terminal device, a sensor device, or other device with network access capability, which is not made in this embodiment of the present application. limited.
  • a smart device such as VR (Virtual Reality, virtual reality) glasses, a smart wearable device, etc.
  • terminal device such as a terminal device, a sensor device, or other device with network access capability, which is not made in this embodiment of the present application. limited.
  • the IoT devices 12 may be smart home devices such as smart TVs, smart speakers, smart air conditioners, smart lights, smart doors and windows, smart curtains, and smart sockets.
  • the number of IoT devices 12 may be combined with application requirements or access the cloud platform 14. The maximum number of devices that can be managed is determined.
  • the access cloud platform 14 includes an access point device 141 and an access cloud 142 .
  • the access point device 141 is used to provide network access services to the IoT device 12 , for example, the access point device 141 may be a wireless router, a wireless gateway device, and the like. In some scenarios, the access point device 141 may also be implemented as a terminal device, such as a mobile phone, a tablet computer, a wearable device, and the like.
  • the number of access point devices 141 may be one or multiple, which is not limited in this embodiment of the present application. Generally, for the consideration of resource saving and other aspects, the number of access point devices 141 is one .
  • the access cloud 142 may be a cloud server of the access point device 141 .
  • the access point device 141 and the access cloud 142 are connected through a wired or wireless network.
  • the IoT device 12 is developed based on the device cloud platform cloud 16 .
  • a communication link exists between the access cloud 142 and the device cloud platform 16 .
  • the access cloud 142 interacts with the device cloud platform 16 during the access process of the IoT device 12 .
  • the above-mentioned access cloud 142 and device cloud platform 16 may be implemented as a cloud computing resource pool in the field of cloud technology, and multiple types of virtual resources are deployed in the resource pool for external customers to choose and use.
  • the cloud computing resource pool mainly includes: computing devices (which are virtualized machines, including operating systems), storage devices, and network devices. It can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, intermediate Cloud servers for basic cloud computing services such as software services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
  • CDN Content Delivery Network
  • the system may further include a network distribution device 18, and the access cloud 142 and the network distribution device 18 are connected through a wired or wireless network.
  • the network distribution device 18 is a device for the user to operate to control the network distribution process of the IoT device 12 .
  • the distribution network device 18 may be implemented as a terminal device, such as a mobile phone, a tablet computer, a wearable device, and the like.
  • FIG. 2 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application.
  • the method can be applied to the access authentication system shown in FIG. 1, and is performed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
  • Step 201 the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
  • the above-mentioned device information includes a device identification (Identity, ID) of the Internet of Things device, for example, a Media Access Control (Media Access Control, MAC) address of the Internet of Things device.
  • ID a device identification
  • MAC Media Access Control
  • the above-mentioned device information may also include indication information of the device cloud platform corresponding to the IoT device, for example, the device information also includes the manufacturer information of the IoT device, or the address of the device cloud platform, and so on.
  • the IoT device may provide the device information of the IoT device to the access cloud platform through the network configuration terminal during the network distribution process.
  • the IoT device provides the device information of the IoT device to the access cloud platform through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
  • the IoT device may directly send the device information of the IoT device to the access cloud platform after completing the network configuration.
  • Step 202 the access cloud platform performs key generation interaction with the device cloud platform corresponding to the IoT device according to the device information of the IoT device, and obtains a first access key and key indication information; wherein the first access key and key indication information are obtained;
  • the access key and the key indication information are information associated with a device key; the device key is set in the IoT device and the device cloud platform.
  • the same device key is stored in the device cloud platform and the IoT device, respectively.
  • the access cloud platform When the access cloud platform assigns the access key to the IoT device, it interacts with the device cloud. In this process, in addition to generating the first access key, it also obtains key indication information, and the first access key is The key and the key indication information are associated by the device key, that is, the first access key can be obtained by encrypting or decrypting the key indication information by using the device key.
  • Step 203 the access cloud platform provides the key indication information to the IoT device; correspondingly, the IoT device obtains the key indication information provided by the access cloud platform.
  • the device cloud platform provides key indication information to the IoT device, but does not directly provide the access key.
  • the access cloud platform provides key indication information to the IoT device through the network configuration terminal.
  • the access cloud platform provides key indication information to the IoT device through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
  • the access cloud platform may directly send key indication information to the IoT device.
  • Step 204 the IoT device generates a second access key according to the device key and the key indication information.
  • the IoT device Since the key indication information and the first access key are associated with the device key, after the IoT device obtains the key indication information, it can encrypt/decrypt the key indication information with the device key to obtain the encrypted key indication information. /Decryption is the above-mentioned second access key.
  • Step 205 the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
  • Step 206 the access cloud platform performs access authentication on the Internet of Things device according to the first access key and the second access key.
  • the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes The device cloud platform interacts to obtain the first access key and the key indication information, wherein the first access key and the key indication information are associated with the device key, that is, the access cloud platform will After the key indication information is provided to the IoT device, the IoT device can obtain the second access key for access through the locally stored device key, combined with the key indication information, and request the access key through the second access key. Access to the cloud platform for access authentication.
  • the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly, which can ensure security and at the same time , because the identity authentication of the IoT device is not required in this process, the access authentication process can be simplified, thereby improving the efficiency of the access authentication of the IoT device while ensuring the security of the access authentication.
  • the above-mentioned first access key may be generated by the device cloud platform , and the above key indication information includes the first random number generated by the access cloud platform.
  • access the cloud platform to obtain device information of the IoT device; generate a first random number; send the first random number to the device cloud platform according to the device information of the IoT device; receive the device cloud platform A first access key generated by the device key and the first random number; the device key is set in the IoT device and the device cloud platform; the first random number is provided to the IoT device; receiving An access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is generated by the IoT device according to the device key and the first random number ; According to the first access key and the second access key, perform access authentication on the Internet of Things device.
  • the IoT device provides the device information of the IoT device to the access cloud platform; obtains the first random number provided by the access cloud platform, the first random number is generated by the access cloud platform, and obtained
  • the device cloud platform of the IoT device is provided after the device key and the first access key generated by the first random number; the device key is set in the IoT device and the device cloud platform; according to the device key and the first random number to generate a second access key; send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform According to the first access key and the second access key, access authentication is performed on the Internet of Things device.
  • FIG. 3 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application.
  • the method can be applied to the access authentication system as shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
  • Step 301 the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
  • the device information can be provided to the access cloud platform.
  • the above-mentioned device information includes a device identification (Identity, ID) of the Internet of Things device, for example, a Media Access Control (Media Access Control, MAC) address of the Internet of Things device.
  • ID a device identification
  • MAC Media Access Control
  • the above-mentioned device information may also include indication information of the device cloud platform corresponding to the IoT device, for example, the device information also includes the manufacturer information of the IoT device, or the address of the device cloud platform, and so on.
  • the IoT device may provide the device information of the IoT device to the access cloud platform through the network configuration terminal during the network distribution process.
  • the IoT device provides the device information of the IoT device to the access cloud platform through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
  • the IoT device may directly send the device information of the IoT device to the access cloud platform after completing the network configuration.
  • Step 302 accessing the cloud platform to generate a first random number.
  • the first random number is used as key indication information.
  • the access cloud platform generates the first random number corresponding to the IoT device through a preset random number generation algorithm.
  • the access cloud platform also generates an access authentication identifier of the IoT device.
  • the access cloud platform after the access cloud platform obtains the device information of the IoT device, it can generate an access authentication identifier for the IoT device, and the access authentication identifier is used to identify when the IoT device initiates access the IoT device.
  • the access cloud platform also generates a device registration code of the IoT device.
  • the access cloud platform may also generate a corresponding device registration code for the IoT device, and the device registration code is used as an additional or auxiliary access authentication information when the IoT device initiates access .
  • Step 303 the access cloud platform sends the first random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number.
  • the access cloud platform may determine the device cloud platform corresponding to the IoT device according to the device information of the IoT device, and send the first random number to the determined device cloud platform.
  • the access cloud platform can use the device manufacturer information to determine the address/interface of the device cloud platform corresponding to the IoT device (for example, through the device The vendor information looks up the table to obtain the address/interface of the device cloud platform), and sends the above-mentioned first random number to the device cloud platform through the determined address/interface.
  • Step 304 the device cloud platform generates a first access key by using the device key of the IoT device and the first random number.
  • the above-mentioned device cloud platform encrypts the first random number through the device key corresponding to the IoT device to generate the first access key.
  • the device manufacturer may preset a device key for the IoT device, and the device key is set in the IoT device before the IoT device leaves the factory. At the same time, the device manufacturer also sets the device corresponding to the IoT device
  • the device key of the IoT device is stored in the cloud platform, for example, the corresponding relationship between the device identifier (eg, MAC address) of the IoT device and the device key is stored in the device cloud platform.
  • Step 305 the device cloud platform returns the first access key to the access cloud platform, and the access cloud platform receives the first access key.
  • the access cloud platform receives the first access key generated by the device cloud platform by encrypting the first random number with the device key.
  • the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
  • the access cloud platform may pre-establish an association table between the access authentication identifier and the access key. Whenever the access cloud platform generates an access authentication identifier for an IoT device and obtains the first access key, the access authentication identifier of the IoT device and the first access key are stored in the association table correspondingly , so that it can be queried and used in the subsequent access authentication process.
  • Step 306 the access cloud platform provides the first random number to the IoT device, and accordingly, the IoT device obtains the first random number provided by the access cloud platform.
  • the access cloud platform delivers key indication information to the IoT device that requires the device key processing to obtain the access key, rather than directly delivering the access key, thereby ensuring that the key is downloaded hair security.
  • the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
  • the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
  • the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
  • Step 307 the IoT device generates a second access key by using the device key and the first random number.
  • the IoT device encrypts the first random number with the device key to generate the second access key.
  • the IoT device after the IoT device obtains the key indication information sent by the access cloud platform (that is, the above-mentioned first random number), it can encrypt the first random number according to the device key stored by itself. to obtain the second access key.
  • the key indication information sent by the access cloud platform that is, the above-mentioned first random number
  • the device cloud platform encrypts the first random number to obtain the encryption algorithm used for the first access key
  • the IoT device encrypts the first random number with the device key to obtain the second encryption algorithm.
  • the encryption algorithm used for the access key is the same.
  • the IoT device needs the locally stored device key to process the key indication information to obtain the access key, that is, only the IoT device with a specific identity can obtain the correct access key, Therefore, the identity authentication in the access key distribution process is realized without the need for an additional authentication process, thereby ensuring the security of the key distribution and reducing the complex process of authentication.
  • Step 308 the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
  • the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
  • Step 309 the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
  • the access cloud platform establishes a Transport Layer Security (Transport Layer Security, TLS)/Datagram Transport Layer Security (Datagram) protocol according to the first access key and the second access key.
  • Transport Layer Security, DTLS) pre-shared key (Pre-Shared Key, PSK) method to establish and authenticate the data connection of IoT devices.
  • the access cloud platform can use the second access key in the request as the PSK to match the first access key. If they match, the access authentication is confirmed to be successful, and a TLS/DTLS connection is established.
  • the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
  • the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request;
  • the access key and the second access key are used for one-way or two-way challenge authentication.
  • the IoT device sends the random value S1 and the verification value X1 generated by using the second access key to the access cloud platform, and the access cloud platform uses the first access key and the random value S1 to generate the verification value X2, and the verification value X2 is generated with the first access key and the random value S1.
  • X1 is compared; at the same time, the access cloud platform sends the random value S2 and the verification value X3 generated with the first access key to the IoT device, and the IoT device uses the second access key and the random value S2 to generate the verification value X4 Come and compare with X3.
  • the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
  • FIG. 4 shows a flowchart of access authentication in the network distribution process involved in the embodiment of the present application.
  • the access authentication process of IoT devices is as follows:
  • the IoT device broadcasts the beacon frame or displays the QR code; the distribution network device obtains the device information of the IoT device through the Soft AP discovery or code scanning method.
  • the distribution network device can receive the beacon frame broadcast by the IoT device through Soft AP discovery, and parse the Service Set Identifier (SSID)/Basic Service Set Identifier (BSSID) in the beacon frame. / Manufacturer-defined information element (Information Element, IE) to obtain device information of the IoT device, for example, the MAC address of the IoT device (denoted as ID1, corresponding to the device identifier in the above embodiment), and the device manufacturer information of the IoT device .
  • SSID Service Set Identifier
  • BSSID Basic Service Set Identifier
  • IE Manufacturer-defined information element
  • the distribution network device scans the QR code on the IoT device through the camera (which can be displayed through the entity label or display screen), and decodes to obtain the above-mentioned device information of the IoT device.
  • the network distribution device establishes a secure connection with the access cloud platform.
  • the network distribution device sends the above-mentioned device information of the IoT device to the access cloud platform, such as ID1 and device manufacturer information.
  • the access cloud platform determines the device cloud platform according to the device manufacturer information.
  • the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, and a random number R1 (corresponding to the above-mentioned first random number). In a possible implementation manner, the access cloud platform also allocates a device registration code A1 to the IoT device.
  • the access cloud platform establishes a secure connection with the device cloud platform.
  • the access cloud platform sends ID1 and R1 to the device cloud platform.
  • the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
  • the device cloud platform encrypts R1 through K to generate K1 (corresponding to the above-mentioned first access key).
  • the device cloud platform returns K1 to the access cloud platform.
  • the access cloud platform returns the ID2 and the random number R1 to the distribution network device. In a possible implementation manner, the access cloud platform also returns A1 to the distribution network device.
  • the IoT device obtains ID2, R1, network information, and access cloud platform address through Soft AP discovery or code scanning; in a possible implementation, the IoT device also obtains A1 through Soft AP discovery or scanning code.
  • a Soft AP-based connection is established between the distribution terminal and the IoT device, and the distribution terminal sends the above ID2, R1, network information, and access cloud platform address (optionally including A1) to the IoT device.
  • the distribution terminal generates and displays a QR code based on the above ID2, R1, network information, and access cloud platform address (optionally including A1), and the IoT device scans the QR code to obtain ID2, R1, network information, access Cloud platform address (optionally including A1) and other information.
  • the IoT device uses the locally stored K to encrypt R1 to obtain K1' (corresponding to the above-mentioned second access key).
  • the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
  • the IoT device may also perform the following step S415.
  • the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
  • the IoT device manufacturer assigns a unique key K to each device (identified by device ID1), and presets the key K into the corresponding device.
  • the key K and the corresponding The ID1 of the device is stored in the device cloud platform of the device manufacturer.
  • the access cloud platform Access the cloud platform to obtain the device ID1 from the device.
  • the access cloud platform generates ID2 for the device according to the device ID1, and a random value R1 (the access cloud platform needs to save the R1 and the ID2 of the corresponding device).
  • the access cloud platform sends the aforementioned ID1 and R1 to the device cloud platform.
  • the device cloud platform generates a key K1, and the generation method is as follows: use a predefined key generation algorithm S1 for R1, such as Advanced Encryption Standard (AES) 256-Code-Based Message Authentication Code (Code-Based Message Authentication Code) , CMAC) algorithm, key derivative function (Key Derivation Function, KDF) based on HMAC algorithm, wherein, HMAC algorithm refers to the message authentication code (Message Authentication Code, MAC) algorithm based on hash (Hash), password-based key Derived function (Password-Based Key Derivation Function, PBKDF) algorithm, etc., use K encryption to obtain K1.
  • AES Advanced Encryption Standard
  • CMAC CMAC
  • KDF key derivative function
  • HMAC algorithm refers to the message authentication code (Message Authentication Code, MAC) algorithm based on hash (Hash), password-based key Derived function (Password-Based Key Derivation Function, PBKDF) algorithm, etc.
  • the device cloud platform returns K1 to the access cloud platform.
  • the access cloud platform returns ID2 and R1 to the device through the distribution network terminal.
  • the device uses the predefined key generation algorithm S1 to encrypt R1 with K to obtain K1' (equivalent to K1).
  • the intermediate node (such as the distribution network terminal) does not have K, so K1 cannot be obtained, which can prevent the key leakage caused by the cracking and hijacking of the distribution network terminal.
  • the device uses K1' as a pre-shared key to establish a TLS/DTLS connection with the mobile phone cloud platform through PSK.
  • ID2 is used to uniquely identify the device on the access cloud platform and to index K1.
  • the network distribution device sends network information, ID2, R1, device registration code A1 and access cloud address to the IoT device. Every time the IoT device connects to the above-mentioned access cloud platform, it uses TLS/ The DTLS method uses the device registration code as the pre-shared key or negotiates the communication key in an anonymous way to establish a secure connection, and then uses K1 as the key to perform one-way or two-way challenge authentication with the mobile cloud platform.
  • the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes The device cloud platform interacts to obtain the first access key and the first random number generated by itself, wherein the first access key is generated by the device key and the first random number, that is, After accessing the cloud platform and providing the first random number to the IoT device, the IoT device can obtain the second access key for access by combining the locally stored device key and the first random number, and use the second access key for access.
  • the access key requests access to the cloud platform for access authentication.
  • the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly.
  • the access authentication process can be simplified, thereby improving the efficiency of access authentication of IoT devices while ensuring the security of access authentication. .
  • the first access key can be generated by the device cloud platform, and
  • the above key indication information includes the first random number generated by the access cloud platform.
  • the above-mentioned first access key may be generated based on the first random number and the second random number allocated by the IoT device itself.
  • FIG. 5 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application.
  • the method can be applied to the access authentication system shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
  • Step 501 the IoT device generates a second random number.
  • the IoT device further encrypts the second random number by using the device key to generate the first device authentication information.
  • the IoT device in addition to providing the second random number, the IoT device also encrypts the second random number with the device key to obtain the first device authentication information , which is used for subsequent device cloud platforms to authenticate IoT devices.
  • Step 502 the IoT device provides a second random number and device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the second random number and device information of the IoT device.
  • the IoT device further acquires the first device authentication information provided by the IoT device.
  • Step 503 accessing the cloud platform to generate a first random number.
  • the first random number is used as key indication information.
  • the access cloud platform also generates an access authentication identifier of the IoT device.
  • the access cloud platform also generates a device registration code of the IoT device.
  • Step 504 the access cloud platform sends the first random number and the second random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number and the second random number .
  • the access cloud platform sends the first random number, the second random number and the first device authentication information to the device cloud platform; correspondingly, the device cloud platform receives the first random number, the second random number and the first random number. number and first device authentication information.
  • Step 505 the device cloud platform encrypts the first random number and the second random number through the device key corresponding to the IoT device to generate a first access key.
  • the device cloud platform uses the device key to encrypt the second random number to generate the second device authentication information, and uses the second device authentication information to authenticate the first device authentication information. After the device authentication information passes the authentication of the first device authentication information, the device cloud platform generates a third random number, and encrypts the second random number and the third random number with the device key to generate the first cloud authentication information.
  • Step 506 the device cloud platform returns the first access key to the access cloud platform, and the access cloud platform receives the first access key.
  • the access cloud platform receives the first access key, the first cloud authentication information, and the third random sent by the device cloud platform after passing the authentication of the first device authentication information according to the second device authentication information number.
  • the second device authentication information is generated by the device cloud platform by encrypting the second random number through the device key; the first cloud authentication information is the device cloud platform using the device key to encrypt the second random number. generated by encrypting the third random number and the third random number; the third random number is generated by the device cloud platform.
  • the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
  • Step 507 the access cloud platform provides the first random number to the IoT device, and correspondingly, the IoT device obtains the first random number provided by the access cloud platform.
  • the access cloud platform further provides the first cloud authentication information and the third random number to the IoT device.
  • the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
  • the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
  • the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
  • Step 508 the IoT device encrypts the first random number and the second random number with the device key to generate the second access key.
  • the IoT device encrypts the second random number and the third random number with the device key to generate the second cloud authentication information; when authenticating the first cloud authentication information according to the second cloud authentication information After passing, the second access key is generated according to the device key and the key indication information.
  • the algorithm used by the IoT device to encrypt the second random number and the third random number through the device key and the algorithm used by the device cloud platform to encrypt the second random number and the third random number through the device key.
  • the algorithm used by the IoT device to encrypt the first random number and the second random number through the device key is the same as the algorithm used by the device cloud platform to encrypt the first random number and the second random number through the device key.
  • the algorithm used is the same.
  • Step 509 the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
  • the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
  • Step 510 the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
  • the access cloud platform authenticates the IoT device for establishing a data connection by using the TLS/DTLS pre-shared key PSK method according to the first access key and the second access key.
  • the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
  • the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request;
  • the access key and the second access key are used for one-way or two-way challenge authentication.
  • the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
  • the access cloud platform receives the first access key, the third cloud authentication information, the third device authentication information, and the third random number sent by the device cloud platform; the third The cloud authentication information is generated by the device cloud platform by encrypting the second random number with the device key; the third device authentication information is generated by the device cloud platform by encrypting the third random number; the third The random number is generated by the device cloud platform;
  • the access cloud platform Before receiving the access authentication request sent by the IoT device, the access cloud platform also provides the third cloud authentication information and the third random number to the IoT device;
  • the access cloud platform When the access cloud platform receives the access authentication request sent by the Internet of Things device, it receives the access authentication request sent by the Internet of Things device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information; the fourth cloud The authentication information is generated by the Internet of Things device by encrypting the second random number with the device key; the access authentication request also includes fourth device authentication information, and the fourth device authentication information is the Internet of Things device through the The device key is generated by encrypting the third random number;
  • the access cloud platform When the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key, after passing the authentication on the fourth device authentication information according to the third device authentication information , and perform access authentication on the Internet of Things device according to the first access key and the second access key.
  • the IoT device before generating the second access key according to the device key and the first random number, obtains the third cloud authentication information and the third random number provided by the access cloud platform; the third cloud authentication The information is generated by the device cloud platform by encrypting the second random number with the device key; the third random number is generated by the device cloud platform;
  • the IoT device When the IoT device generates a second access key according to the device key and the first random number, the second random number is encrypted by the device key to generate fourth cloud authentication information; After the authentication information has passed the authentication of the third cloud authentication information, the second access key is generated according to the device key and the first random number;
  • the IoT device also encrypts the third random number through the device key to generate fourth device authentication information
  • the IoT device When the IoT device sends an access authentication request containing the second access key to the access cloud platform, it sends the access cloud platform the access authentication request containing the second access key and the fourth device authentication information. Access authentication request.
  • FIG. 6 shows a flowchart of access authentication after the network distribution is completed according to the embodiment of the present application.
  • the access authentication process of IoT devices is as follows:
  • the IoT device establishes a secure connection with the access cloud platform.
  • the IoT device generates a random string R2 (corresponding to the above-mentioned second random number), and encrypts R2 with the device key K to generate device authentication information Hc1 (corresponding to the above-mentioned first device authentication information).
  • the IoT device sends R2, Hc1, and device information of the IoT device (including the device identifier ID1 of the IoT device and the device manufacturer information) to the access cloud platform.
  • the access cloud platform determines the device cloud platform according to the device manufacturer information.
  • the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, and a random number R1 (corresponding to the above-mentioned first random number). In a possible implementation manner, the access cloud platform also allocates a device registration code A1 to the IoT device.
  • the access cloud platform establishes a secure connection with the device cloud platform.
  • the access cloud platform sends ID1, R1, R2 and Hc1 to the device cloud platform.
  • the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
  • the device cloud platform encrypts R2 by K, and generates Hc1' (corresponding to the above-mentioned second device authentication information); if Hc1' is the same as Hc1, the IoT device is authenticated successfully, and the process goes to S610, otherwise the authentication fails.
  • the device cloud platform generates a random number R3 (that is, the above-mentioned third random number).
  • the device cloud platform encrypts R2 and R3 by K to generate cloud authentication information Hc2 (corresponding to the above-mentioned first cloud authentication information).
  • the device cloud platform encrypts R1 through K to generate K1 (corresponding to the above-mentioned first access key).
  • the device cloud platform returns K1, R3 and Hc2 to the access cloud platform.
  • the access cloud platform returns ID2, R1, R3 and Hc2 to the IoT device. In a possible implementation manner, the access cloud platform also returns A1 to the IoT device.
  • the IoT device obtains ID2, R1, R3, and Hc2 network information, and accesses the cloud platform address through a secure connection; in a possible implementation, the IoT device also obtains A1 through a secure connection.
  • the IoT device encrypts R2 and R3 through K to generate Hc2' (corresponding to the above-mentioned second cloud authentication information).
  • the IoT device compares Hc2' and Hc2, if they are the same, the authentication succeeds, and the process proceeds to S618, otherwise the authentication fails.
  • the IoT device uses the locally stored K to encrypt R1 and R2 to obtain K1' (corresponding to the above-mentioned second access key).
  • the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
  • the IoT device may also perform the following step S415.
  • the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
  • the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the IoT device sends the access to the cloud platform.
  • the cloud platform provides the second random number, and the access cloud platform can obtain the first access key and the first random number generated by itself by interacting with the device cloud platform, wherein the first access key is obtained by the device.
  • the key is generated from the first random number and the second random number, that is to say, after accessing the cloud platform to provide the first random number to the IoT device, the IoT device can use the locally stored device key and the second random number.
  • the second access key for access is obtained in combination with the first random number, and the second access key is used to request access to the cloud platform for access authentication.
  • the access cloud platform does not directly contact the cloud platform.
  • the IoT device provides the access key, which can also enable the IoT device to obtain the access key correctly, which can ensure security.
  • the access authentication process can be simplified. , so as to improve the efficiency of the access authentication of the IoT device under the condition of ensuring the security of the access authentication.
  • the above-mentioned first access key can be accessed by the cloud platform. generated, and the key indication information includes the ciphertext obtained by encrypting the first access key.
  • access the cloud platform to obtain device information of the IoT device; generate a first random number and a first access key; Send the first random number; receive the first encryption key generated by the device cloud platform encrypting the first random number with the device key; encrypt the first access key with the first encryption key , obtain the encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT device; receive an access authentication request sent by the IoT device, where the access authentication request includes the second access key , the second access key is generated by the IoT device according to the device key, the encrypted ciphertext and the first random number;
  • the IoT device performs access authentication.
  • the IoT device provides the device information of the IoT device to the access cloud platform; obtains the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is the The encrypted ciphertext obtained by the access cloud platform encrypting the first access key with the first encryption key; the first encryption key is the first random number obtained by the device cloud platform of the IoT device through the device key A key generated by encryption; the device key is set in the IoT device and the device cloud platform; the first random number is encrypted by the device key, and a second encryption key is generated; through the second encryption key Decrypt the encrypted ciphertext to obtain a second access key; send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform According to the first access key and the second access key, access authentication is performed on the Internet of Things device.
  • FIG. 7 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application.
  • the method can be applied to the access authentication system as shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
  • Step 701 the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
  • step 701 reference may be made to the description under step 401 in the embodiment shown in FIG. 3 , and details are not repeated here.
  • Step 702 the access cloud platform generates a first random number and a first access key.
  • the access cloud platform in addition to generating the first random number, the access cloud platform also generates a first access key.
  • the access cloud platform also generates an access authentication identifier of the IoT device.
  • the access cloud platform also generates a device registration code of the IoT device.
  • the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
  • Step 703 the access cloud platform sends the first random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number.
  • Step 704 the device cloud platform encrypts the first random number through the device key corresponding to the IoT device to generate a first encryption key.
  • Step 705 the device cloud platform returns the first encryption key to the access cloud platform, and the access cloud platform receives the first encryption key.
  • the access cloud platform receives the first encryption key generated by the IoT device by encrypting the first random number with the device key.
  • Step 706 the access cloud platform encrypts the first access key with the first encryption key to obtain the encrypted ciphertext.
  • the above encrypted ciphertext and the first random number are key indication information.
  • Step 707 the access cloud platform provides the encrypted ciphertext and the first random number to the IoT device, and accordingly, the IoT device obtains the encrypted ciphertext and the first random number provided by the access cloud platform.
  • the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
  • the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
  • the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
  • Step 708 the IoT device encrypts the first random number with the device key to generate a second encryption key; decrypts the encrypted ciphertext with the second encryption key to obtain a second access key.
  • the encryption algorithm used by the IoT device to encrypt the first random number by using the device key is the same as the encryption algorithm used by the device cloud platform to encrypt the first random number by using the device key.
  • the algorithm for decrypting the encrypted ciphertext by the second encryption key of the IoT device matches the algorithm for encrypting the first access key by the access cloud platform using the first encryption key.
  • Step 709 the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
  • the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
  • the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
  • Step 710 the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
  • the access cloud platform performs data connection establishment authentication on the IoT device through the pre-shared key TLS/DTLSPSK method according to the first access key and the second access key.
  • the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
  • the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request;
  • the access key and the second access key are used for one-way or two-way challenge authentication.
  • the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
  • FIG. 8 shows a flowchart of access authentication in the network distribution process involved in the embodiment of the present application.
  • the access authentication process of IoT devices is as follows:
  • the IoT device broadcasts the beacon frame or displays the QR code; the distribution network device obtains the device information of the IoT device through Soft AP discovery or code scanning.
  • the network distribution device establishes a secure connection with the access cloud platform.
  • the network distribution device sends the above-mentioned device information of the IoT device to the access cloud platform, such as ID1 and device manufacturer information.
  • the access cloud platform determines the device cloud platform according to the device manufacturer information.
  • the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, a key K1 (corresponding to the above-mentioned first access key) and a random number R1 (corresponding to the above-mentioned first random number).
  • the access cloud platform also allocates a device registration code A1 to the IoT device.
  • the access cloud platform establishes a secure connection with the device cloud platform.
  • the access cloud platform sends ID1 and R1 to the device cloud platform.
  • the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
  • the device cloud platform encrypts R1 through K to generate K2 (corresponding to the above-mentioned first encryption key).
  • the device cloud platform returns K2 to the access cloud platform.
  • the access cloud platform returns the ID2, the random number R1, and the ciphertext C1 to the distribution network device. In a possible implementation manner, the access cloud platform also returns A1 to the distribution network device.
  • the IoT device obtains ID2, R1, ciphertext C1, network information, and access cloud platform address through the Soft AP discovery or code scanning method; in a possible implementation, the IoT device also discovers or scans the code through the Soft AP way to get A1.
  • a Soft AP-based connection is established between the distribution terminal and the IoT device, and the distribution terminal sends the above ID2, R1, C1, network information, and access cloud platform address (optionally including A1) to the IoT device.
  • the distribution network terminal generates and displays a QR code based on the above ID2, R1, C1, network information, and access cloud platform address (optionally including A1), and the IoT device scans the QR code to obtain ID2, R1, C1, network Information, access cloud platform address (optionally including A1) and other information.
  • the IoT device uses the locally stored K to encrypt R1 to obtain K2' (corresponding to the above-mentioned second encryption key), and decrypts C1 through K2' to obtain K1' (corresponds to the above-mentioned second access key).
  • the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
  • the IoT device may also perform the following step S816.
  • the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
  • the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes By interacting with the device cloud platform, you can obtain the first access key generated by yourself, the first random number generated by yourself, and the ciphertext obtained by encrypting the first random number with the device key. After the text and the first random number are provided to the IoT device, the IoT device can obtain the second access key for access by combining the first random number and the cipher text with the device key stored locally, and pass the second access key through the second access key. The access key requests access to the cloud platform for access authentication.
  • the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly.
  • the access authentication process can be simplified, thereby improving the efficiency of access authentication of IoT devices while ensuring the security of access authentication. .
  • FIG. 9 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application.
  • the apparatus can be used to access a cloud platform to become an access cloud platform device, or to become an access cloud platform device.
  • the device includes:
  • a first random number generation module 902 configured to generate a first random number
  • a first random number sending module 903 configured to send the first random number to the device cloud platform according to the device information of the IoT device;
  • the first access key receiving module 904 is configured to receive the first access key generated by the device cloud platform through the device key and the first random number; the device key is set in the IoT device and in the device cloud platform;
  • a first random number providing module 905, configured to provide the first random number to the IoT device
  • An authentication request receiving module 906, configured to receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is the IoT device generated according to the device key and the first random number;
  • An access authentication module 907 configured to perform access authentication on the IoT device according to the first access key and the second access key.
  • the apparatus further includes:
  • the second random number obtaining module is configured to obtain the first random number generated by the IoT device before the first random number sending module sends the first random number to the device cloud platform according to the device information of the IoT device.
  • the first random number sending module configured to send the first random number and the second random number to the device cloud platform according to the device information of the IoT device;
  • the first access key receiving module is configured to receive the first access key generated by the device cloud platform by encrypting the first random number and the second random number with the device key; key.
  • the apparatus further includes:
  • a first device authentication information acquisition module configured to acquire the first random number and the second random number before the first random number sending module sends the first random number and the second random number to the device cloud platform according to the device information of the Internet of Things device first device authentication information, where the first device authentication information is generated by the Internet of Things device encrypting the second random number by using the device key;
  • the first random number sending module is configured to send the first random number, the second random number and the first device authentication information to the device cloud platform according to the device information of the IoT device;
  • the first access key receiving module is configured to receive the first access key, the first access key and the first access key sent by the device cloud platform after passing the authentication of the first device authentication information according to the second device authentication information.
  • Cloud authentication information and a third random number the second device authentication information is generated by the device cloud platform encrypting the second random number with the device key; the first cloud authentication information is the The device cloud platform encrypts and generates the second random number and the third random number by using the device key; the third random number is generated by the device cloud platform;
  • the device also includes:
  • a first cloud authentication information providing module configured to provide the first cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
  • the authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the first cloud authentication information according to the second cloud authentication information; the second cloud authentication information is the The IoT device encrypts the second random number and the third random number with the device key and generates it.
  • the first access key receiving module is configured to receive the first access key, third cloud authentication information, and third device authentication information sent by the device cloud platform , and a third random number; the third cloud authentication information is generated by the device cloud platform encrypting the second random number with the device key; the third device authentication information is the device The cloud platform is encrypted and generated by the third random number; the third random number is generated by the device cloud platform;
  • the device also includes:
  • An authentication information and random number providing module configured to provide the third cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
  • the authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information;
  • the fourth cloud authentication information is the The Internet of Things device encrypts the second random number with the device key;
  • the access authentication request also includes fourth device authentication information, and the fourth device authentication information is the Internet of Things device Generated by encrypting the third random number with the device key;
  • the access authentication module is configured to, according to the first access key and the second access key, authenticate the fourth device authentication information according to the third device authentication information and pass the authentication.
  • the Internet of Things device performs access authentication.
  • the access authentication module is configured to, according to the first access key and the second access key, authenticate the IoT devices perform data connection establishment authentication.
  • the apparatus further includes:
  • a device registration code generating module configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
  • a device registration code providing module configured to provide the device registration code to the IoT device
  • the authentication request receiving module configured to receive the access authentication request carrying the device registration code
  • the access authentication module is used for,
  • the device registration code carried in the access authentication request through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
  • One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  • the access authentication module is configured to:
  • One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  • the apparatus further includes:
  • an access authentication identifier generating module configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
  • an association relationship establishing module configured to establish an association relationship between the access authentication identifier and the first access key
  • an access authentication identifier providing module configured to provide the access authentication identifier to the Internet of Things device
  • the authentication request receiving module configured to receive the access authentication request carrying the access authentication identifier
  • the access authentication module is used for,
  • FIG. 10 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application.
  • the apparatus can be used in an IoT device to be implemented as an IoT device, or be implemented as an IoT device in the IoT device.
  • the device includes:
  • a first random number obtaining module 1002 configured to obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform and obtained from the device of the Internet of Things device
  • the cloud platform is provided after the device key and the first access key generated by the first random number; the device key is set in the IoT device and the device cloud platform;
  • a second access key generation module 1003, configured to generate a second access key according to the device key and the first random number
  • An authentication request sending module 1004 configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first access key.
  • An access key and the second access key are used to perform access authentication on the IoT device.
  • the apparatus further includes:
  • a second random number generating module configured to generate a second random number before the first random number obtaining module obtains the first random number provided by the access cloud platform;
  • a second random number providing module configured to provide the second random number to the access cloud platform
  • the second access key generation module is configured to encrypt the first random number and the second random number by using the device key to generate the second access key.
  • the apparatus further includes:
  • a first device authentication information generation module configured to obtain the first random number provided by the access cloud platform and encrypt the second random number with the device key to generate first device authentication information
  • a first device authentication information providing module configured to provide the first device authentication information to the access cloud platform
  • the first cloud authentication information and the third random number acquisition module are configured to acquire the access key before the second access key generation module generates the second access key according to the device key and the first random number.
  • the authentication information is generated by encrypting the second random number and the third random number with the device key after passing the authentication of the first device authentication information; the second device authentication information is the device Generated by the cloud platform encrypting the second random number by using the device key;
  • the second access key generation module is used for,
  • the second access key is generated according to the device key and the first random number.
  • the apparatus further includes:
  • the authentication information and random number acquisition module is configured to acquire the access key provided by the access cloud platform before the second access key generation module generates the second access key according to the device key and the first random number.
  • third cloud authentication information and a third random number is generated by the device cloud platform encrypting the second random number with the device key; the third random number is the generated by the device cloud platform;
  • the second access key generation module is used for,
  • the device also includes:
  • a fourth device authentication information generating module configured to encrypt the third random number by using the device key to generate fourth device authentication information
  • the authentication request sending module is configured to send the access authentication request including the second access key and the fourth device authentication information to the access cloud platform.
  • the apparatus further includes:
  • a device registration code obtaining module configured to obtain the device registration code provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform;
  • the authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
  • the apparatus further includes:
  • an access authentication identification acquiring module configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
  • the authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  • FIG. 11 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application.
  • the apparatus can be used to access a cloud platform to become an access cloud platform device, or to become an access cloud platform device.
  • the device includes:
  • a random number and key generation module 1102 configured to generate a first random number and a first access key
  • a first random number sending module 1103, configured to send the first random number to the device cloud platform corresponding to the IoT device according to the device information of the IoT device;
  • a first encryption key receiving module 1104 configured to receive a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
  • An encrypted ciphertext obtaining module 1105 configured to encrypt the first access key by using the first encryption key to obtain an encrypted ciphertext
  • a ciphertext and random number providing module 1106, configured to provide the encrypted ciphertext and the first random number to the IoT device;
  • An authentication request receiving module 1107 configured to receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is the IoT device generated according to the device key, the encrypted ciphertext and the first random number;
  • An access authentication module 1108, configured to perform access authentication on the IoT device according to the first access key and the second access key.
  • the access authentication module is configured to, according to the first access key and the second access key, authenticate the IoT devices perform data connection establishment authentication.
  • the apparatus further includes:
  • a device registration code generating module configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
  • a device registration code providing module configured to provide the device registration code to the IoT device
  • the authentication request receiving module configured to receive the access authentication request carrying the device registration code
  • the access authentication module is used for,
  • the device registration code carried in the access authentication request through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
  • One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  • the access authentication module is configured to:
  • One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  • the apparatus further includes:
  • an access authentication identifier generating module configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
  • an association relationship establishing module configured to establish an association relationship between the access authentication identifier and the first access key
  • an access authentication identifier providing module configured to provide the access authentication identifier to the Internet of Things device
  • the authentication request receiving module configured to receive the access authentication request carrying the access authentication identifier
  • the access authentication module is used for,
  • FIG. 12 shows a block diagram of the structure of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application.
  • the apparatus can be used in an IoT device, implemented as an IoT device, or implemented as an IoT device in an IoT device.
  • the device includes:
  • the ciphertext and random number acquisition module 1202 is configured to acquire the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is obtained by the access cloud platform through the The encrypted ciphertext obtained by encrypting the first access key with the first encryption key; the first encryption key is the first random number encrypted by the device cloud platform of the IoT device through the device key The generated key; the device key is set in the IoT device and the device cloud platform;
  • the second encryption key generation module 1203 is configured to encrypt the first random number with the device key, and generate a second encryption key
  • a second access key obtaining module 1204 configured to decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key
  • An authentication request sending module 1205 is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to request the access cloud platform according to the first access key.
  • An access key and the second access key are used to perform access authentication on the IoT device.
  • the apparatus further includes:
  • a device registration code obtaining module configured to obtain the device registration code provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform;
  • the authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
  • the apparatus further includes:
  • an access authentication identification acquiring module configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
  • the authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  • FIG. 13 shows a schematic structural diagram of a computer device (such as an Internet of Things device, an access cloud platform device, or a device platform cloud) provided by an exemplary embodiment of the present application.
  • the computer device includes: a processor 131 , a receiver 132 , a transmitter 133, memory 134 and bus 135.
  • the processor 131 includes one or more processing cores, and the processor 131 executes various functional applications and information processing by running software programs and modules.
  • the receiver 132 and the transmitter 133 may be implemented as a communication component, which may be a communication chip.
  • the memory 134 is connected to the processor 131 through the bus 135 .
  • the memory 134 may be configured to store at least one instruction, and the processor 131 may be configured to execute the at least one instruction to implement the various steps in the above method embodiments.
  • memory 134 may be implemented by any type or combination of volatile or non-volatile storage devices including, but not limited to, magnetic or optical disks, electrically erasable programmable Read Only Memory (Electrically-Erasable Programmable Read Only Memory, EEPROM), Erasable Programmable Read Only Memory (EPROM), Static Random Access Memory (SRAM), Read Only Memory (Read-Only Memory, ROM), magnetic memory, flash memory, programmable read-only memory (Programmable Read-Only Memory, PROM).
  • volatile or non-volatile storage devices including, but not limited to, magnetic or optical disks, electrically erasable programmable Read Only Memory (Electrically-Erasable Programmable Read Only Memory, EEPROM), Erasable Programmable Read Only Memory (EPROM), Static Random Access Memory (SRAM), Read Only Memory (Read-Only Memory, ROM), magnetic memory, flash memory, programmable read-only memory (Programmable Read-Only Memory, PROM).
  • the computer device includes a processor, a memory, and a transceiver (the transceiver may include a receiver for receiving information and a transmitter for transmitting information) and a transmitter.
  • the transceiver may include a receiver for receiving information and a transmitter for transmitting information
  • the processor is used for acquiring device information of the IoT device; generating a first random number;
  • the transceiver is configured to send the first random number to the device cloud platform according to the device information of the Internet of Things device; receive the first random number generated by the device cloud platform through the device key and the first random number; a first access key; the device key is set in the IoT device and the device cloud platform;
  • the processor configured to provide the first random number to the Internet of Things device
  • the transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key and the first random number;
  • the processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  • the computer device when the computer device is implemented as an IoT device,
  • the processor is configured to provide device information of the Internet of Things device to the access cloud platform; obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform generated and provided after obtaining the first access key generated by the device cloud platform of the IoT device through the device key and the first random number; the device key is set on the IoT device and in the device cloud platform;
  • the processor configured to generate a second access key according to the device key and the first random number
  • the transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first access key.
  • the access key and the second access key are used to perform access authentication on the IoT device.
  • the processor is used for acquiring device information of the IoT device; generating a first random number and a first access key;
  • the transceiver is configured to send the first random number to the device cloud platform corresponding to the Internet of Things device according to the device information of the Internet of Things device; the first encryption key generated by encrypting the first random number;
  • the processor is configured to encrypt the first access key by using the first encryption key to obtain encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT devices;
  • the transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key, the encrypted ciphertext and the first random number;
  • the processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  • the computer device when the computer device is implemented as an IoT device,
  • the processor is configured to provide the device information of the Internet of Things device to the access cloud platform; obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the The encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform using the first encryption key to encrypt the first access key; the first encryption key is the device cloud platform of the IoT device through the device A key generated by encrypting the first random number with a key; the device key is set in the IoT device and the device cloud platform;
  • the processor is configured to encrypt the first random number with a device key to generate a second encryption key; decrypt the encrypted ciphertext with the second encryption key to obtain a second access key ;
  • the transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first
  • the access key and the second access key are used to perform access authentication on the IoT device.
  • the processor and transceiver in the computer device involved in the embodiments of the present application may perform any of the methods shown in FIG. 2 to FIG. The steps performed by accessing the platform cloud or the IoT device will not be repeated here.
  • a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the methods provided by the foregoing method embodiments.
  • An IoT device access authentication method performed by a computer device.
  • a computer program product which, when running on a processor of a computer device, enables a network device to execute the method for authentication of IoT device access described in the above aspects.
  • a chip is also provided, the chip includes a programmable logic circuit and/or program instructions, when the chip runs on a computer device, for implementing the IoT device described in the above aspects Access authentication method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the field of wireless communications. Disclosed are an Internet of Things device access authentication method and apparatus, a device, and a storage medium. The method comprises: obtaining device information of an Internet of Things device; generating a first random number; sending the first random number to a device cloud platform according to the device information; receiving a first access key generated by the device cloud platform by means of a device key and the first random number; supplying the first random number to the Internet of Things device; and receiving an access authentication request sent by the Internet of Things device, the access authentication request comprising a second access key generated by the Internet of Things device according to the device key and the first random number, and performing access authentication on the Internet of Things according to the first access key and the second access key. In the process, it is not necessary to perform identity authentication on the Internet of Things device, so that an access authentication process can be simplified, thereby improving the efficiency of the access authentication of Internet of Things devices while ensuring the security of the access authentication.

Description

物联网设备接入认证方法、装置、设备及存储介质IoT device access authentication method, device, device and storage medium 技术领域technical field
本申请涉及无线通信领域,特别涉及一种物联网设备接入认证方法、装置、设备及存储介质。The present application relates to the field of wireless communications, and in particular, to a method, apparatus, device, and storage medium for access authentication of IoT devices.
背景技术Background technique
在物联网(The Internet of Things,IoT)技术中,物联网设备通常会涉及到跨平台接入的场景,需要接入云平台为物联网设备下发访问密钥。In the Internet of Things (IoT) technology, IoT devices usually involve cross-platform access scenarios, and need to access the cloud platform to issue access keys for IoT devices.
为了保证接入的安全性,在物联网设备每次结果的过程中,接入云平台为物联网设备下发访问密钥之前,需要对物联网设备进行至少一次身份认证,在身份认证通过后,对为物联网设备下发访问密钥。In order to ensure the security of access, in the process of each result of the IoT device, before the access cloud platform issues the access key for the IoT device, the IoT device needs to be authenticated at least once. , to issue access keys for IoT devices.
然而,接入云平台对物联网设备进行身份认证的过程会导致物联网设备的接入认证流程复杂,影响物联网设备的接入认证的效率。However, the process of accessing the cloud platform to authenticate the IoT device will lead to a complicated access authentication process for the IoT device, which affects the efficiency of the IoT device's access authentication.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种物联网设备接入认证方法、装置、设备及存储介质。The embodiments of the present application provide an access authentication method, apparatus, device, and storage medium for an Internet of Things device.
一方面,提供了一种物联网设备接入认证方法,所述方法由接入云平台执行,所述方法包括:In one aspect, a method for authentication of IoT device access is provided, the method is performed by an access cloud platform, and the method includes:
获取物联网设备的设备信息;Obtain device information of IoT devices;
生成第一随机数;generate a first random number;
根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;sending the first random number to the device cloud platform according to the device information of the IoT device;
接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;receiving a first access key generated by the device cloud platform through a device key and the first random number; the device key is set in the IoT device and the device cloud platform;
将所述第一随机数提供给所述物联网设备;providing the first random number to the IoT device;
接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;Receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is obtained by the Internet of Things device according to the device key and the generated by the first random number;
根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the IoT device according to the first access key and the second access key.
一方面,提供了一种物联网设备接入认证方法,所述方法由物联网设备执行,所述方法包括:In one aspect, a method for authentication of IoT device access is provided, the method is performed by the IoT device, and the method includes:
向接入云平台提供所述物联网设备的设备信息;Provide the device information of the IoT device to the access cloud platform;
获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;Obtain the first random number provided by the access cloud platform, the first random number is generated by the access cloud platform, and the device cloud platform that obtains the IoT device passes the device key and the first random number. provided after the first access key generated by a random number; the device key is set in the IoT device and the device cloud platform;
根据所述设备密钥以及所述第一随机数生成第二接入密钥;generating a second access key according to the device key and the first random number;
向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to match the first access key with the The second access key is used to perform access authentication on the IoT device.
一方面,提供了一种物联网设备接入认证方法,所述方法由接入云平台执行,所述方法包括:In one aspect, a method for authentication of IoT device access is provided, the method is performed by an access cloud platform, and the method includes:
获取物联网设备的设备信息;Obtain device information of IoT devices;
生成第一随机数和第一接入密钥;generating a first random number and a first access key;
根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;According to the device information of the IoT device, send the first random number to the device cloud platform corresponding to the IoT device;
接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;receiving a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;Encrypting the first access key by using the first encryption key to obtain encrypted ciphertext;
将所述加密密文以及所述第一随机数,提供给所述物联网设备;providing the encrypted ciphertext and the first random number to the IoT device;
接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;Receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, where the second access key is obtained by the IoT device according to the device key, the generated by the encrypted ciphertext and the first random number;
根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the IoT device according to the first access key and the second access key.
一方面,提供了一种物联网设备接入认证方法,所述方法由物联网设备执行,所述方法包括:In one aspect, a method for authentication of IoT device access is provided, the method is performed by the IoT device, and the method includes:
向接入云平台提供所述物联网设备的设备信息;Provide the device information of the IoT device to the access cloud platform;
获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;Obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform through the first encryption key for the first access password. The encrypted ciphertext obtained by encrypting the key; the first encryption key is the key generated by the device cloud platform of the Internet of Things device encrypting the first random number with the device key; the device key is set in the IoT device and the device cloud platform;
通过设备密钥对第一随机数进行加密,生成第二加密密钥;The first random number is encrypted by the device key to generate the second encryption key;
通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;Decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key;
向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to match the first access key with the The second access key is used to perform access authentication on the IoT device.
一方面,提供了一种物联网设备接入认证装置,所述装置用于接入云平台中,所述装置包括:In one aspect, there is provided an IoT device access authentication apparatus, the apparatus is used for accessing a cloud platform, and the apparatus includes:
设备信息获取模块,用于获取物联网设备的设备信息;The device information acquisition module is used to acquire the device information of the IoT device;
第一随机数生成模块,用于生成第一随机数;a first random number generating module for generating a first random number;
第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;a first random number sending module, configured to send the first random number to the device cloud platform according to the device information of the IoT device;
第一接入密钥接收模块,用于接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;a first access key receiving module, configured to receive the first access key generated by the device cloud platform through the device key and the first random number; the device key is set in the IoT device and in the device cloud platform;
第一随机数提供模块,用于将所述第一随机数提供给所述物联网设备;a first random number providing module, configured to provide the first random number to the Internet of Things device;
认证请求接收模块,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;The authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key and the first random number;
接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module, configured to perform access authentication on the IoT device according to the first access key and the second access key.
一方面,提供了一种物联网设备接入认证装置,所述装置用于物联网设备中,所述装置包括:In one aspect, an apparatus for authentication of IoT device access is provided, the apparatus is used in an IoT device, and the apparatus includes:
设备信息提供模块,用于向接入云平台提供所述物联网设备的设备信息;a device information providing module, configured to provide the device information of the IoT device to the access cloud platform;
第一随机数获取模块,用于获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;A first random number acquisition module, configured to acquire a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform and obtained from the device cloud of the IoT device The platform is provided after the first access key generated by the device key and the first random number; the device key is set in the IoT device and the device cloud platform;
第二接入密钥生成模块,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;a second access key generation module, configured to generate a second access key according to the device key and the first random number;
认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。an authentication request sending module, configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
一方面,提供了一种物联网设备接入认证装置,所述装置用于接入云平台中,所述装置包括:In one aspect, there is provided an IoT device access authentication apparatus, the apparatus is used for accessing a cloud platform, and the apparatus includes:
设备信息获取模块,用于获取物联网设备的设备信息;The device information acquisition module is used to acquire the device information of the IoT device;
随机数及密钥生成模块,用于生成第一随机数和第一接入密钥;a random number and key generation module for generating a first random number and a first access key;
第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;a first random number sending module, configured to send the first random number to a device cloud platform corresponding to the IoT device according to the device information of the IoT device;
第一加密密钥接收模块,用于接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;a first encryption key receiving module, configured to receive a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
加密密文获取模块,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;an encrypted ciphertext obtaining module, configured to encrypt the first access key by using the first encryption key to obtain an encrypted ciphertext;
密文及随机数提供模块,用于将所述加密密文以及所述第一随机数,提供给所述物联网设备;a ciphertext and random number providing module, configured to provide the encrypted ciphertext and the first random number to the IoT device;
认证请求接收模块,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;The authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key, the encrypted ciphertext and the first random number;
接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module, configured to perform access authentication on the IoT device according to the first access key and the second access key.
一方面,提供了一种物联网设备接入认证装置,所述装置用于物联网设备中,所述装置包括:In one aspect, an apparatus for authentication of IoT device access is provided, the apparatus is used in an IoT device, and the apparatus includes:
设备信息提供模块,用于向接入云平台提供所述物联网设备的设备信息;a device information providing module, configured to provide the device information of the IoT device to the access cloud platform;
密文及随机数获取模块,用于获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The ciphertext and random number acquisition module is used to acquire the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is obtained by the access cloud platform through the first random number. An encrypted ciphertext obtained by encrypting the first access key with an encryption key; the first encryption key is generated by the device cloud platform of the IoT device encrypting the first random number with the device key The key of the device; the device key is set in the IoT device and the device cloud platform;
第二加密密钥生成模块,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;The second encryption key generation module is used for encrypting the first random number by the device key to generate the second encryption key;
第二接入密钥获取模块,用于通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;A second access key obtaining module, configured to decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key;
认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。an authentication request sending module, configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
一方面,提供了一种接入云平台设备,所述接入云平台设备包括:处理器和与所述处理器相连的收发器;其中,In one aspect, a device for accessing a cloud platform is provided, and the device for accessing a cloud platform includes: a processor and a transceiver connected to the processor; wherein,
所述处理器,用于获取物联网设备的设备信息;生成第一随机数;The processor is used for acquiring device information of the IoT device; generating a first random number;
所述收发器,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The transceiver is configured to send the first random number to the device cloud platform according to the device information of the Internet of Things device; receive the first random number generated by the device cloud platform through the device key and the first random number; a first access key; the device key is set in the IoT device and the device cloud platform;
所述处理器,用于将所述第一随机数提供给所述物联网设备;the processor, configured to provide the first random number to the Internet of Things device;
所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key and the first random number;
所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
一方面,提供了一种物联网设备,所述物联网设备包括:处理器和与所述处理器相连的收发器;其中,In one aspect, an IoT device is provided, the IoT device comprising: a processor and a transceiver connected to the processor; wherein,
所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The processor is configured to provide device information of the Internet of Things device to the access cloud platform; obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform generated and provided after obtaining the first access key generated by the device cloud platform of the IoT device through the device key and the first random number; the device key is set on the IoT device and in the device cloud platform;
所述处理器,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;the processor, configured to generate a second access key according to the device key and the first random number;
所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
一方面,提供了一种接入云平台设备,所述接入云平台设备包括:处理器和与所述处理器相连的收发器;其中,In one aspect, a device for accessing a cloud platform is provided, and the device for accessing a cloud platform includes: a processor and a transceiver connected to the processor; wherein,
所述处理器,用于获取物联网设备的设备信息;生成第一随机数和第一接入密钥;the processor, for acquiring device information of the IoT device; generating a first random number and a first access key;
所述收发器,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;The transceiver is configured to send the first random number to the device cloud platform corresponding to the Internet of Things device according to the device information of the Internet of Things device; the first encryption key generated by encrypting the first random number;
所述处理器,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;将所述加密密文以及所述第一随机数,提供给所述物联网设备;The processor is configured to encrypt the first access key by using the first encryption key to obtain encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT devices;
所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key, the encrypted ciphertext and the first random number;
所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
一方面,提供了一种物联网设备,所述物联网设备包括:处理器和与所述处理器相连的收发器;其中,In one aspect, an IoT device is provided, the IoT device comprising: a processor and a transceiver connected to the processor; wherein,
所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;the processor is configured to provide the device information of the Internet of Things device to the access cloud platform; obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the The encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform using the first encryption key to encrypt the first access key; the first encryption key is the device cloud platform of the IoT device through the device A key generated by encrypting the first random number with a key; the device key is set in the IoT device and the device cloud platform;
所述处理器,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;The processor is configured to encrypt the first random number with a device key to generate a second encryption key; decrypt the encrypted ciphertext with the second encryption key to obtain a second access key ;
所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
一方面,提供了一种计算机可读存储介质,所述可读存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现如上述方面所述的物联网设备接入认证方法。In one aspect, a computer-readable storage medium is provided, and a computer program is stored in the readable storage medium, and the computer program is loaded and executed by a processor to implement the method for authentication of access to an Internet of Things device as described in the above aspects .
根据本申请实施例的一个方面,提供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片在网络设备上运行时,用于实现上述方面所述的物联网设备接入认证方法。According to an aspect of the embodiments of the present application, a chip is provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip runs on a network device, it is used to implement the Internet of Things described in the above aspect Device access authentication method.
根据本申请的一个方面,提供了一种计算机程序产品,该计算机程序产品在网络设备的处理器上运行时,使得网络设备执行上述方面所述的物联网设备接入认证方法。According to an aspect of the present application, there is provided a computer program product, which when running on a processor of a network device, enables the network device to execute the method for authentication of IoT device access described in the above aspect.
本申请实施例提供的技术方案至少包括如下有益效果:The technical solutions provided by the embodiments of the present application include at least the following beneficial effects:
物联网设备和设备云平台中预先设置设备密钥,物联网设备向接入云平台发起接入的过程中,接入云平台通过与设备云平台进行交互,可以得到第一接入密钥,以及自己生成的第一随机数,其中,该第一接入密钥是通过设备密钥和第一随机数生成的,也就是说,接入云平台将第一随机数提供给物联网设备后,物联网设备可以通过本地存储的设备密钥,结合第一随机数获得用于接入的第二接入密钥,并通过第二接入密钥请求接入云平台进行接入认证,在此过程中,接入云平台不直接向物联网设备提供接入密钥,也能够使得物联网设备正确获取到接入密钥,能够保证安全性,同时,由于该过程中不需要对物联网设备进行身份认证,能够简化接入认证过程,从而在保证接入认证的安全性的情况下,提高物联网设备的接入认证的效率。The device key is preset in the IoT device and the device cloud platform. During the process that the IoT device initiates access to the access cloud platform, the access cloud platform can obtain the first access key by interacting with the device cloud platform. and the first random number generated by itself, where the first access key is generated by the device key and the first random number, that is, after the access cloud platform provides the first random number to the IoT device , the IoT device can obtain the second access key for access through the locally stored device key, combined with the first random number, and use the second access key to request access to the cloud platform for access authentication. In this process, the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly, which can ensure security. Device identity authentication can simplify the access authentication process, thereby improving the efficiency of IoT device access authentication while ensuring the security of access authentication.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本申请一个示例性实施例提供的接入认证系统的框图;1 is a block diagram of an access authentication system provided by an exemplary embodiment of the present application;
图2是本申请一个示例性实施例提供的物联网设备接入认证方法的流程图;FIG. 2 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application;
图3是本申请一个示例性实施例提供的物联网设备接入认证方法的流程图;3 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application;
图4是图3所示实施例涉及的配网过程中的接入认证流程图;FIG. 4 is a flowchart of access authentication in the network distribution process involved in the embodiment shown in FIG. 3;
图5是本申请一个示例性实施例提供的物联网设备接入认证方法的流程图;FIG. 5 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application;
图6是图5所示实施例涉及的配网完成后的接入认证流程图;FIG. 6 is a flow chart of access authentication after completion of the distribution network involved in the embodiment shown in FIG. 5;
图7是本申请一个示例性实施例提供的物联网设备接入认证方法的流程图;FIG. 7 is a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application;
图8是图7所示实施例涉及的配网过程中的接入认证流程图;FIG. 8 is a flowchart of access authentication in the network distribution process involved in the embodiment shown in FIG. 7;
图9是本申请一个示例性实施例提供的接入认证方法装置的结构框图;FIG. 9 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application;
图10是本申请一个示例性实施例提供的接入认证方法装置的结构框图;10 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application;
图11是本申请一个示例性实施例提供的接入认证方法装置的结构框图;FIG. 11 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application;
图12是本申请一个示例性实施例提供的接入认证方法装置的结构框图;FIG. 12 is a structural block diagram of an access authentication method and apparatus provided by an exemplary embodiment of the present application;
图13是本申请一个示例性实施例提供的计算机设备的结构示意图。FIG. 13 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
首先,对本申请实施例中涉及的名词进行简单介绍:First, briefly introduce the terms involved in the embodiments of the present application:
1)软无线接入点(Soft Access Point,Soft AP)。1) Soft Wireless Access Point (Soft Access Point, Soft AP).
Soft AP是一种通过无线网卡,使用专用软件在非AP设备上实现AP功能的技术,其可以取代无线网络中的AP(Access Point,无线接入点),从而降低无线组网的成本。Soft AP is a technology that uses special software to realize AP function on non-AP devices through wireless network card. It can replace AP (Access Point, wireless access point) in wireless network, thereby reducing the cost of wireless networking.
Soft AP的硬件部分是一块标准的无线网卡,其通过驱动程序使其提供与AP一样的信号转接、路由等功能。与传统AP相比,Soft AP的成本很低。相比普通无线网卡,Soft AP整合化的驱动/软件可为初接触网络的用户提供很大的使用便利。The hardware part of Soft AP is a standard wireless network card, which provides the same signal transfer, routing and other functions as AP through drivers. Compared with traditional AP, the cost of Soft AP is very low. Compared with ordinary wireless network cards, the integrated driver/software of Soft AP can provide great convenience for users who are new to the network.
2)基于Soft AP的配网。2) Distribution network based on Soft AP.
配网是指待联网的设备获取网络接入信息(比如网络标识和访问密钥),并基于网络接入信息接入网络的过程。Network distribution refers to a process in which a device to be connected to the network obtains network access information (such as a network identifier and an access key), and accesses the network based on the network access information.
而基于Soft AP的配网,是指待联网的设备通过Soft AP功能,借助于配网设备(比如手机)请求网络接入信息并接入网络的过程。The distribution network based on Soft AP refers to the process that the device to be connected to the network requests network access information and accesses the network with the help of the distribution network device (such as a mobile phone) through the Soft AP function.
3)扫码配网。3) Scan the code to configure the network.
扫码配网,是指待联网的设备通过图像采集组件(比如摄像头)扫描图形码(比如二维码)并进行解码,获得图形码中携带的网络接入信息,并基于网络接入信息接入网络的过程。Scanning the code to configure the network means that the device to be connected to the Internet scans the graphic code (such as a two-dimensional code) through an image acquisition component (such as a camera) and decodes it, obtains the network access information carried in the graphic code, and connects based on the network access information. the process of entering the network.
在物联网技术中,由于物联网设备通常缺乏直接有效的信息输入手段,因此,Soft AP配网和扫码配网,是指物联网设备接入网络的重要手段。In IoT technology, because IoT devices usually lack direct and effective means of information input, Soft AP network distribution and scanning code distribution are important means for IoT devices to access the network.
图1示出了本申请一个示例性实施例提供的接入认证系统的框图,该系统可以包括:物联网设备12、接入云平台14、设备云平台16。FIG. 1 shows a block diagram of an access authentication system provided by an exemplary embodiment of the present application. The system may include: an Internet of Things device 12 , an access cloud platform 14 , and a device cloud platform 16 .
物联网设备12可以为智能设备(如VR(Virtual Reality,虚拟现实)眼镜、智能可穿戴设备等)、终端设备、传感器设备,或者其它具备网络接入能力的设备,本申请实施例对此不作限定。The IoT device 12 may be a smart device (such as VR (Virtual Reality, virtual reality) glasses, a smart wearable device, etc.), a terminal device, a sensor device, or other device with network access capability, which is not made in this embodiment of the present application. limited.
在一个示例中,在智能家居生活的情况下,物联网设备12可以是智能电视、智能音箱、智能空调、智能电灯、智能门窗、智能窗帘、智能插座等智能家居设备。可选的,物联网设备12为一个,或者,物联网设备12为多个,本申请实施例对此不作限定,实际应用中,物联网设备12的数量可以结合应用需求或者接入云平台14所能管理的最大设备数量等确定。In one example, in the case of smart home life, the IoT devices 12 may be smart home devices such as smart TVs, smart speakers, smart air conditioners, smart lights, smart doors and windows, smart curtains, and smart sockets. Optionally, there is one IoT device 12, or there are multiple IoT devices 12, which is not limited in this embodiment of the present application. In practical applications, the number of IoT devices 12 may be combined with application requirements or access the cloud platform 14. The maximum number of devices that can be managed is determined.
接入云平台14包括接入点设备141和接入云142。The access cloud platform 14 includes an access point device 141 and an access cloud 142 .
接入点设备141用于向物联网设备12提供网络接入服务,例如,接入点设备141可以是无线路由器、无线网关设备等等。在某些场景下,接入点设备141也可以实现为终端设备,比如手机、平板电脑、可穿戴设备等。可选的,接入点设备141的数量可以为一个,也可以为多个,本申请实施例对此不作限定,通常,出于节约资源等方面的考虑,接入点设备141的数量为一个。The access point device 141 is used to provide network access services to the IoT device 12 , for example, the access point device 141 may be a wireless router, a wireless gateway device, and the like. In some scenarios, the access point device 141 may also be implemented as a terminal device, such as a mobile phone, a tablet computer, a wearable device, and the like. Optionally, the number of access point devices 141 may be one or multiple, which is not limited in this embodiment of the present application. Generally, for the consideration of resource saving and other aspects, the number of access point devices 141 is one .
接入云142可以是接入点设备141的云端服务器。接入点设备141与接入云142之间通过有线或无线网络相连。The access cloud 142 may be a cloud server of the access point device 141 . The access point device 141 and the access cloud 142 are connected through a wired or wireless network.
物联网设备12基于设备云平台云16开发。The IoT device 12 is developed based on the device cloud platform cloud 16 .
接入云142和设备云平台16之间存在通信链路。可选的,接入云142与设备云平台16在物联网设备12接入过程中进行交互。A communication link exists between the access cloud 142 and the device cloud platform 16 . Optionally, the access cloud 142 interacts with the device cloud platform 16 during the access process of the IoT device 12 .
其中,上述接入云142和设备云平台16可以实现为云技术领域中的云计算资源池,在资源池中部署多种类型的虚拟资源,供外部客户选择使用。云计算资源池中主要包括:计算设备(为虚拟化机器,包含操作系统)、存储设备、网络设备。其可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The above-mentioned access cloud 142 and device cloud platform 16 may be implemented as a cloud computing resource pool in the field of cloud technology, and multiple types of virtual resources are deployed in the resource pool for external customers to choose and use. The cloud computing resource pool mainly includes: computing devices (which are virtualized machines, including operating systems), storage devices, and network devices. It can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, intermediate Cloud servers for basic cloud computing services such as software services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
在一种可能的实现方式中,该系统还可以包括配网设备18,接入云142与配网设备18之间通过有线或无线网络相连。配网设备18是供用户进行操作,以对物联网设备12的配网过程进行控制的设备。配网设备18可以实现为终端设备,比如手机、平板电脑、可穿戴设备等等。In a possible implementation manner, the system may further include a network distribution device 18, and the access cloud 142 and the network distribution device 18 are connected through a wired or wireless network. The network distribution device 18 is a device for the user to operate to control the network distribution process of the IoT device 12 . The distribution network device 18 may be implemented as a terminal device, such as a mobile phone, a tablet computer, a wearable device, and the like.
图2示出了本申请一个示例性实施例提供的物联网设备接入认证方法的流程图。该方法可以应用于如 图1示出的接入认证系统中,由物联网设备12、接入云平台14以及设备云平台16交互执行,该方法可以包括如下步骤:FIG. 2 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application. The method can be applied to the access authentication system shown in FIG. 1, and is performed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
步骤201,物联网设备向接入云平台提供该物联网设备的设备信息;相应的,接入云平台获取该物联网设备的设备信息。Step 201, the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
其中,上述设备信息包含物联网设备的设备标识(Identity,ID),比如,物联网设备的介质访问控制(Media Access Control,MAC)地址。The above-mentioned device information includes a device identification (Identity, ID) of the Internet of Things device, for example, a Media Access Control (Media Access Control, MAC) address of the Internet of Things device.
上述设备信息还可以包含物联网设备对应的设备云平台的指示信息,比如,该设备信息中还包含该物联网设备的厂商信息,或者,设备云平台的地址等等。The above-mentioned device information may also include indication information of the device cloud platform corresponding to the IoT device, for example, the device information also includes the manufacturer information of the IoT device, or the address of the device cloud platform, and so on.
在本申请实施例的一种可能实现方式中,物联网设备可以在配网过程中,通过配网终端向接入云平台提供物联网设备的设备信息。例如,物联网设备通过配网终端,以Soft AP配网方式或者扫码配网方式,向接入云平台提供物联网设备的设备信息。In a possible implementation manner of the embodiment of the present application, the IoT device may provide the device information of the IoT device to the access cloud platform through the network configuration terminal during the network distribution process. For example, the IoT device provides the device information of the IoT device to the access cloud platform through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
在本申请实施例的一种可能实现方式中,物联网设备可以在完成配网后,直接向接入云平台发送物联网设备的设备信息。In a possible implementation manner of the embodiment of the present application, the IoT device may directly send the device information of the IoT device to the access cloud platform after completing the network configuration.
步骤202,接入云平台根据该物联网设备的设备信息,与该物联网设备对应的设备云平台进行密钥生成交互,获得第一接入密钥以及密钥指示信息;其中,该第一接入密钥和密钥指示信息是通过设备密钥进行关联的信息;该设备密钥设置在该物联网设备以及该设备云平台中。Step 202, the access cloud platform performs key generation interaction with the device cloud platform corresponding to the IoT device according to the device information of the IoT device, and obtains a first access key and key indication information; wherein the first access key and key indication information are obtained; The access key and the key indication information are information associated with a device key; the device key is set in the IoT device and the device cloud platform.
在本申请实施例中,设备云平台和物联网设备中各自存储相同的设备密钥,In this embodiment of the present application, the same device key is stored in the device cloud platform and the IoT device, respectively.
接入云平台为物联网设备分配接入密钥时,与设备云进行交互,在此过程中,除了生成第一接入密钥之外,还获取密钥指示信息,并且,第一接入密钥和密钥指示信息之间通过设备密钥进行关联,也就是说,通过设备密钥对密钥指示信息进行加密或解密,可以得到第一接入密钥。When the access cloud platform assigns the access key to the IoT device, it interacts with the device cloud. In this process, in addition to generating the first access key, it also obtains key indication information, and the first access key is The key and the key indication information are associated by the device key, that is, the first access key can be obtained by encrypting or decrypting the key indication information by using the device key.
步骤203,接入云平台将该密钥指示信息提供给该物联网设备;相应的,物联网设备获取该接入云平台提供的密钥指示信息。Step 203, the access cloud platform provides the key indication information to the IoT device; correspondingly, the IoT device obtains the key indication information provided by the access cloud platform.
在本申请实施例中,设备云平台向物联网设备提供密钥指示信息,而并不直接提供接入密钥。In the embodiment of the present application, the device cloud platform provides key indication information to the IoT device, but does not directly provide the access key.
例如,在本申请实施例的一种可能实现方式中,在物联网设备配网过程中,接入云平台通过配网终端向物联网设备提供密钥指示信息。例如,接入云平台通过配网终端,以Soft AP配网方式或者扫码配网方式,向物联网设备提供密钥指示信息。For example, in a possible implementation manner of the embodiment of the present application, during the network configuration process of the IoT device, the access cloud platform provides key indication information to the IoT device through the network configuration terminal. For example, the access cloud platform provides key indication information to the IoT device through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
在本申请实施例的一种可能实现方式中,在物联网设备完成配网后,接入云平台可以直接向物联网设备发送密钥指示信息。In a possible implementation manner of the embodiment of the present application, after the IoT device completes network configuration, the access cloud platform may directly send key indication information to the IoT device.
步骤204,物联网设备根据该设备密钥以及该密钥指示信息生成第二接入密钥。Step 204, the IoT device generates a second access key according to the device key and the key indication information.
由于密钥指示信息与第一接入密钥之间通过设备密钥进行关联,因此,物联网设备获取到密钥指示信息后,可以通过设备密钥对密钥指示信息加密/解密,得到加密/解密即为上述第二接入密钥。Since the key indication information and the first access key are associated with the device key, after the IoT device obtains the key indication information, it can encrypt/decrypt the key indication information with the device key to obtain the encrypted key indication information. /Decryption is the above-mentioned second access key.
步骤205,物联网设备向接入云平台发送包含该第二接入密钥的接入认证请求;相应的,接入云平台接收该物联网设备发送的该接入认证请求。Step 205, the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
步骤206,接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Step 206, the access cloud platform performs access authentication on the Internet of Things device according to the first access key and the second access key.
综上所述,本申请实施例所示的方案中,物联网设备和设备云平台中预先设置设备密钥,物联网设备向接入云平台发起接入的过程中,接入云平台通过与设备云平台进行交互得到第一接入密钥和密钥指示信息,其中,该第一接入密钥和密钥指示信息之间通过设备密钥进行关联,也就是说,接入云平台将密钥指示信息提供给物联网设备后,物联网设备可以通过本地存储的设备密钥,结合密钥指示信息获得用于接入的第二接入密钥,并通过第二接入密钥请求接入云平台进行接入认证,在此过程中,接入云平台不直接向物联网设备提供接入密钥,也能够使得物联网设备正确获取到接入密钥,能够保证安全性,同时,由于该过程中不需要对物联网设备进行身份认证,能够简化接入认证过程,从而在保证接入认证的安全性的情况下,提高物联网设备的接入认证的效率。To sum up, in the solution shown in the embodiment of this application, the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes The device cloud platform interacts to obtain the first access key and the key indication information, wherein the first access key and the key indication information are associated with the device key, that is, the access cloud platform will After the key indication information is provided to the IoT device, the IoT device can obtain the second access key for access through the locally stored device key, combined with the key indication information, and request the access key through the second access key. Access to the cloud platform for access authentication. In this process, the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly, which can ensure security and at the same time , because the identity authentication of the IoT device is not required in this process, the access authentication process can be simplified, thereby improving the efficiency of the access authentication of the IoT device while ensuring the security of the access authentication.
在一种可能的实现方式中,当上述图2所示实施例中的方案应用在对物联网设备的配网过程中或者配网完成后,上述第一接入密钥可以由设备云平台生成,且上述密钥指示信息包括接入云平台生成的第一随机数。In a possible implementation manner, when the solution in the above-mentioned embodiment shown in FIG. 2 is applied in the process of network distribution to the IoT device or after the network distribution is completed, the above-mentioned first access key may be generated by the device cloud platform , and the above key indication information includes the first random number generated by the access cloud platform.
在这种情况下,接入云平台获取物联网设备的设备信息;生成第一随机数;根据该物联网设备的设备信息,向该设备云平台发送该第一随机数;接收该设备云平台通过设备密钥以及该第一随机数生成的第一接入密钥;该设备密钥设置在该物联网设备以及该设备云平台中;将该第一随机数提供给该物联网设备;接收该物联网设备发送的接入认证请求,该接入认证请求中包含第二接入密钥,该第二接入密钥是该物联网设备根据该设备密钥以及该第一随机数生成的;根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。In this case, access the cloud platform to obtain device information of the IoT device; generate a first random number; send the first random number to the device cloud platform according to the device information of the IoT device; receive the device cloud platform A first access key generated by the device key and the first random number; the device key is set in the IoT device and the device cloud platform; the first random number is provided to the IoT device; receiving An access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is generated by the IoT device according to the device key and the first random number ; According to the first access key and the second access key, perform access authentication on the Internet of Things device.
相应的,物联网设备向接入云平台提供该物联网设备的设备信息;获取该接入云平台提供的第一随机数,该第一随机数是由该接入云平台生成,且获取到该物联网设备的设备云平台通过设备密钥以及该第一 随机数生成的第一接入密钥之后提供的;该设备密钥设置在该物联网设备以及该设备云平台中;根据该设备密钥以及该第一随机数生成第二接入密钥;向该接入云平台发送包含该第二接入密钥的接入认证请求,该接入认证请求用于请求该接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Correspondingly, the IoT device provides the device information of the IoT device to the access cloud platform; obtains the first random number provided by the access cloud platform, the first random number is generated by the access cloud platform, and obtained The device cloud platform of the IoT device is provided after the device key and the first access key generated by the first random number; the device key is set in the IoT device and the device cloud platform; according to the device key and the first random number to generate a second access key; send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform According to the first access key and the second access key, access authentication is performed on the Internet of Things device.
下面,对这种情况下的接入认证的过程进行示例性的说明。Below, the process of access authentication in this case is exemplarily described.
图3示出了本申请一个示例性实施例提供的物联网设备接入认证方法的流程图。该方法可以应用于如图1示出的接入认证系统中,由物联网设备12、接入云平台14以及设备云平台16交互执行,该方法可以包括如下步骤:FIG. 3 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application. The method can be applied to the access authentication system as shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
步骤301,物联网设备向接入云平台提供该物联网设备的设备信息;相应的,接入云平台获取该物联网设备的设备信息。Step 301, the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
在本申请实施例中,物联网设备需要进行配网时,可以向接入云平台提供设备信息。In the embodiment of the present application, when the Internet of Things device needs to perform network distribution, the device information can be provided to the access cloud platform.
其中,上述设备信息包含物联网设备的设备标识(Identity,ID),比如,物联网设备的介质访问控制(Media Access Control,MAC)地址。The above-mentioned device information includes a device identification (Identity, ID) of the Internet of Things device, for example, a Media Access Control (Media Access Control, MAC) address of the Internet of Things device.
上述设备信息还可以包含物联网设备对应的设备云平台的指示信息,比如,该设备信息中还包含该物联网设备的厂商信息,或者,设备云平台的地址等等。The above-mentioned device information may also include indication information of the device cloud platform corresponding to the IoT device, for example, the device information also includes the manufacturer information of the IoT device, or the address of the device cloud platform, and so on.
在本申请实施例的一种可能实现方式中,物联网设备可以在配网过程中,通过配网终端向接入云平台提供物联网设备的设备信息。例如,物联网设备通过配网终端,以Soft AP配网方式或者扫码配网方式,向接入云平台提供物联网设备的设备信息。In a possible implementation manner of the embodiment of the present application, the IoT device may provide the device information of the IoT device to the access cloud platform through the network configuration terminal during the network distribution process. For example, the IoT device provides the device information of the IoT device to the access cloud platform through the network distribution terminal in the Soft AP distribution method or the scanning code distribution method.
在本申请实施例的一种可能实现方式中,物联网设备可以在完成配网后,直接向接入云平台发送物联网设备的设备信息。In a possible implementation manner of the embodiment of the present application, the IoT device may directly send the device information of the IoT device to the access cloud platform after completing the network configuration.
步骤302,接入云平台生成第一随机数。Step 302, accessing the cloud platform to generate a first random number.
其中,该第一随机数作为密钥指示信息。Wherein, the first random number is used as key indication information.
在本申请实施例中,接入云平台通过预先设置的随机数生成算法,生成物联网设备对应的第一随机数。In the embodiment of the present application, the access cloud platform generates the first random number corresponding to the IoT device through a preset random number generation algorithm.
在一种可能的实现方式中,接入云平台还生成物联网设备的接入认证标识。In a possible implementation manner, the access cloud platform also generates an access authentication identifier of the IoT device.
在本申请实施例中,接入云平台获取到物联网设备的设备信息后,可以为该物联网设备生成一个接入认证标识,该接入认证标识用于在物联网设备发起接入时标识该物联网设备。In the embodiment of the present application, after the access cloud platform obtains the device information of the IoT device, it can generate an access authentication identifier for the IoT device, and the access authentication identifier is used to identify when the IoT device initiates access the IoT device.
在一种可能的实现方式中,接入云平台还生成该物联网设备的设备注册码。In a possible implementation manner, the access cloud platform also generates a device registration code of the IoT device.
在本申请实施例中,接入云平台还可以为物联网设备生成对应的设备注册码,该设备注册码用于在物联网设备发起接入时,作为一项额外或辅助的接入认证信息。In the embodiment of the present application, the access cloud platform may also generate a corresponding device registration code for the IoT device, and the device registration code is used as an additional or auxiliary access authentication information when the IoT device initiates access .
步骤303,接入云平台根据该物联网设备的设备信息,向该设备云平台发送该第一随机数;相应的,设备云平台接收该第一随机数。Step 303, the access cloud platform sends the first random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number.
其中,接入云平台可以根据该物联网设备的设备信息,确定该物联网设备对应的设备云平台,并向确定的设备云平台发送第一随机数。The access cloud platform may determine the device cloud platform corresponding to the IoT device according to the device information of the IoT device, and send the first random number to the determined device cloud platform.
例如,当物联网设备的设备信息中包含该物联网设备的设备厂商信息时,接入云平台可以通过该设备厂商信息确定物联网设备对应的设备云平台的地址/接口(比如,可以通过备厂商信息查表获取设备云平台的地址/接口),并通过确定的地址/接口,向设备云平台发送上述第一随机数。For example, when the device information of the IoT device includes the device manufacturer information of the IoT device, the access cloud platform can use the device manufacturer information to determine the address/interface of the device cloud platform corresponding to the IoT device (for example, through the device The vendor information looks up the table to obtain the address/interface of the device cloud platform), and sends the above-mentioned first random number to the device cloud platform through the determined address/interface.
步骤304,设备云平台通过物联网设备的设备密钥以及第一随机数生成第一接入密钥。Step 304, the device cloud platform generates a first access key by using the device key of the IoT device and the first random number.
在一种可能的实现方式中,上述设备云平台通过物联网设备对应的设备密钥,对第一随机数进行加密生成第一接入密钥。In a possible implementation manner, the above-mentioned device cloud platform encrypts the first random number through the device key corresponding to the IoT device to generate the first access key.
在本申请实施例中,设备厂商可以为物联网设备预先设置一个设备密钥,该设备密钥在物联网设备出厂前设置到物联网设备中,同时,设备厂商还在物联网设备对应的设备云平台中存储该物联网设备的设备密钥,比如,在设备云平台中存储该物联网设备的设备标识(比如MAC地址)与设备密钥之间的对应关系。In the embodiment of the present application, the device manufacturer may preset a device key for the IoT device, and the device key is set in the IoT device before the IoT device leaves the factory. At the same time, the device manufacturer also sets the device corresponding to the IoT device The device key of the IoT device is stored in the cloud platform, for example, the corresponding relationship between the device identifier (eg, MAC address) of the IoT device and the device key is stored in the device cloud platform.
步骤305,设备云平台将第一接入密钥返回给接入云平台,接入云平台接收该第一接入密钥。Step 305, the device cloud platform returns the first access key to the access cloud platform, and the access cloud platform receives the first access key.
也就是说,接入云平台接收该设备云平台通过该设备密钥对该第一随机数进行加密生成的该第一接入密钥。That is, the access cloud platform receives the first access key generated by the device cloud platform by encrypting the first random number with the device key.
在一种可能的实现方式中,接入云平台还建立上述接入认证标识与第一接入密钥之间的关联关系。In a possible implementation manner, the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
例如,接入云平台可以预先建立一个接入认证标识与接入密钥之间的关联关系表。每当接入云平台为一个物联网设备生成接入认证标识并获取到第一接入密钥之后,将该物联网设备的接入认证标识和第一接入密钥对应存储到关联关系表,以便后续接入认证过程中查询使用。For example, the access cloud platform may pre-establish an association table between the access authentication identifier and the access key. Whenever the access cloud platform generates an access authentication identifier for an IoT device and obtains the first access key, the access authentication identifier of the IoT device and the first access key are stored in the association table correspondingly , so that it can be queried and used in the subsequent access authentication process.
步骤306,接入云平台将第一随机数提供给物联网设备,相应的,物联网设备获取接入云平台提供的第一随机数。Step 306, the access cloud platform provides the first random number to the IoT device, and accordingly, the IoT device obtains the first random number provided by the access cloud platform.
在本申请实施例中,接入云平台向物联网设备下发需要通过设备密钥处理才能得到接入密钥的密钥指 示信息,而不是直接下发接入密钥,从而保证密钥下发的安全性。In this embodiment of the present application, the access cloud platform delivers key indication information to the IoT device that requires the device key processing to obtain the access key, rather than directly delivering the access key, thereby ensuring that the key is downloaded hair security.
在一种可能的实现方式中,接入云平台还将接入认证标识提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识。In a possible implementation manner, the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将设备注册码提供给物联网设备;相应的,物联网设备获取接入云平台提供的该设备注册码。In a possible implementation manner, the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将接入认证标识和设备注册码一起提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识和设备注册码。In a possible implementation manner, the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
步骤307,物联网设备通过设备密钥以及第一随机数,生成第二接入密钥。Step 307, the IoT device generates a second access key by using the device key and the first random number.
在一种可能的实现方式中,物联网设备通过设备密钥对第一随机数进行加密,生成第二接入密钥。In a possible implementation manner, the IoT device encrypts the first random number with the device key to generate the second access key.
在本申请实施例中,物联网设备获取到接入云平台发送的密钥指示信息(即上述第一随机数)之后,即可以根据自身存储的设备密钥,对该第一随机数进行加密,得到第二接入密钥。In this embodiment of the present application, after the IoT device obtains the key indication information sent by the access cloud platform (that is, the above-mentioned first random number), it can encrypt the first random number according to the device key stored by itself. to obtain the second access key.
在一种可能的实现方式中,设备云平台对第一随机数进行加密得到第一接入密钥所使用的加密算法,与物联网设备通过设备密钥对第一随机数进行加密得到第二接入密钥所使用的加密算法相同。In a possible implementation manner, the device cloud platform encrypts the first random number to obtain the encryption algorithm used for the first access key, and the IoT device encrypts the first random number with the device key to obtain the second encryption algorithm. The encryption algorithm used for the access key is the same.
在本申请实施例中,由于物联网设备需要本地存储的设备密钥对密钥指示信息进行处理才能得到接入密钥,也就是只有特定身份的物联网设备才能得到正确的接入密钥,从而在不需要额外的身份验证流程的情况下实现接入密钥分发过程中的身份认证,从而保证了密钥分发的安全性,同时减少了身份验证的复杂流程。In the embodiment of the present application, because the IoT device needs the locally stored device key to process the key indication information to obtain the access key, that is, only the IoT device with a specific identity can obtain the correct access key, Therefore, the identity authentication in the access key distribution process is realized without the need for an additional authentication process, thereby ensuring the security of the key distribution and reducing the complex process of authentication.
步骤308,物联网设备向接入云平台发送包含第二接入密钥的接入认证请求;相应的,接入云平台接收该物联网设备发送的该接入认证请求。Step 308, the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及接入认证标识的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥、接入认证标识以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
步骤309,接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Step 309, the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
在一种可能的实现方式中,接入云平台根据第一接入密钥与第二接入密钥,通过建立传输层安全协议(Transport Layer Security,TLS)/数据包传输层安全协议(Datagram Transport Layer Security,DTLS)预共享密钥(Pre-Shared Key,PSK)方式对物联网设备进行数据连接建立认证。In a possible implementation manner, the access cloud platform establishes a Transport Layer Security (Transport Layer Security, TLS)/Datagram Transport Layer Security (Datagram) protocol according to the first access key and the second access key. Transport Layer Security, DTLS) pre-shared key (Pre-Shared Key, PSK) method to establish and authenticate the data connection of IoT devices.
在本申请实施例中,接入云平台接收到物联网设备发送的接入认证请求后,可以将请求中的第二接入密钥作为PSK,与第一接入密钥进行匹配,若两者匹配,则确认接入认证成功,建立TLS/DTLS连接。In this embodiment of the present application, after receiving the access authentication request sent by the IoT device, the access cloud platform can use the second access key in the request as the PSK to match the first access key. If they match, the access authentication is confirmed to be successful, and a TLS/DTLS connection is established.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的接入认证标识查询上述关联关系,获得第一接入密钥;并根据查询到的第一接入密钥与第二接入密钥,对物联网设备进行接入认证。In a possible implementation manner, the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的设备注册码,通过TLS/DTLS预共享密钥PSK方式,与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In a possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request; The access key and the second access key are used for one-way or two-way challenge authentication.
比如,物联网设备发送随机值S1和使用第二接入密钥生成的验证值X1给接入云平台,接入云平台使用第一接入密钥和随机值S1生成验证值X2,并与X1比对;同时,接入云平台发送随机值S2和用第一接入密钥生成的验证值X3给物联网设备,物联网设备使用第二接入密钥和随机值S2生成验证值X4来与X3比对。For example, the IoT device sends the random value S1 and the verification value X1 generated by using the second access key to the access cloud platform, and the access cloud platform uses the first access key and the random value S1 to generate the verification value X2, and the verification value X2 is generated with the first access key and the random value S1. X1 is compared; at the same time, the access cloud platform sends the random value S2 and the verification value X3 generated with the first access key to the IoT device, and the IoT device uses the second access key and the random value S2 to generate the verification value X4 Come and compare with X3.
在另一种可能的实现方式中,接入云平台通过TLS/DTLS匿名方式与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In another possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
请参考图4,其示出了本申请实施例涉及的配网过程中的接入认证流程图。如图4所示,物联网设备的接入认证过程如下:Please refer to FIG. 4 , which shows a flowchart of access authentication in the network distribution process involved in the embodiment of the present application. As shown in Figure 4, the access authentication process of IoT devices is as follows:
S41,IoT设备广播信标帧或者展示二维码;配网设备通过Soft AP发现或者扫码方式,获取IoT设备的设备信息。S41, the IoT device broadcasts the beacon frame or displays the QR code; the distribution network device obtains the device information of the IoT device through the Soft AP discovery or code scanning method.
比如,配网设备可以通过Soft AP发现的方式接收IoT设备广播的信标帧,解析信标帧中的服务集群标识(Service Set Identifier,SSID)/基本服务集群标识(Basic Service Set Identifier,BSSID)/厂商自定义的信息单元(Information Element,IE),获取IoT设备的设备信息,例如,IoT设备的MAC地址(记为ID1,对应上述实施例中的设备标识),以及IoT设备的设备厂商信息。For example, the distribution network device can receive the beacon frame broadcast by the IoT device through Soft AP discovery, and parse the Service Set Identifier (SSID)/Basic Service Set Identifier (BSSID) in the beacon frame. / Manufacturer-defined information element (Information Element, IE) to obtain device information of the IoT device, for example, the MAC address of the IoT device (denoted as ID1, corresponding to the device identifier in the above embodiment), and the device manufacturer information of the IoT device .
或者,配网设备通过摄像头扫描IoT设备上的二维码(可以通过实体标签或者显示屏幕展示),解码获得IoT设备的上述设备信息。Alternatively, the distribution network device scans the QR code on the IoT device through the camera (which can be displayed through the entity label or display screen), and decodes to obtain the above-mentioned device information of the IoT device.
S42,配网设备与接入云平台建立安全连接。S42, the network distribution device establishes a secure connection with the access cloud platform.
S43,配网设备向接入云平台发送IoT设备的上述设备信息,例如ID1和设备厂商信息。S43, the network distribution device sends the above-mentioned device information of the IoT device to the access cloud platform, such as ID1 and device manufacturer information.
S44,接入云平台根据设备厂商信息确定设备云平台。S44, the access cloud platform determines the device cloud platform according to the device manufacturer information.
S45,接入云平台根据ID1生成为IoT设备分配的ID2(对应上述接入认证标识),以及随机数R1(对应上述第一随机数)。在一种可能的实现方式中,接入云平台还为IoT设备分配设备注册码A1。S45, the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, and a random number R1 (corresponding to the above-mentioned first random number). In a possible implementation manner, the access cloud platform also allocates a device registration code A1 to the IoT device.
S46,接入云平台与设备云平台建立安全连接。S46, the access cloud platform establishes a secure connection with the device cloud platform.
S47,接入云平台向设备云平台发送ID1和R1。S47, the access cloud platform sends ID1 and R1 to the device cloud platform.
S48,设备云平台根据ID1获取IoT设备的密钥K(对应上述设备密钥)。S48, the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
S49,设备云平台通过K对R1加密,生成K1(对应上述第一接入密钥)。S49, the device cloud platform encrypts R1 through K to generate K1 (corresponding to the above-mentioned first access key).
S410,设备云平台将K1返回给接入云平台。S410, the device cloud platform returns K1 to the access cloud platform.
S411,接入云平台将ID2和随机数R1返回给配网设备。在一种可能的实现方式中,接入云平台还将A1返回给配网设备。S411, the access cloud platform returns the ID2 and the random number R1 to the distribution network device. In a possible implementation manner, the access cloud platform also returns A1 to the distribution network device.
S412,IoT设备通过Soft AP发现或者扫码方式,获取ID2、R1、网络信息、接入云平台地址;在一种可能的实现方式中,IoT设备还通过Soft AP发现或者扫码方式获取A1。S412, the IoT device obtains ID2, R1, network information, and access cloud platform address through Soft AP discovery or code scanning; in a possible implementation, the IoT device also obtains A1 through Soft AP discovery or scanning code.
比如,配网终端与IoT设备之间建立基于Soft AP的连接,配网终端将上述ID2、R1、网络信息、接入云平台地址(可选包括A1),发送给IoT设备。For example, a Soft AP-based connection is established between the distribution terminal and the IoT device, and the distribution terminal sends the above ID2, R1, network information, and access cloud platform address (optionally including A1) to the IoT device.
或者,配网终端基于上述ID2、R1、网络信息、接入云平台地址(可选包括A1)生成并展示二维码,由IoT设备扫描该二维码获得ID2、R1、网络信息、接入云平台地址(可选包括A1)等信息。Alternatively, the distribution terminal generates and displays a QR code based on the above ID2, R1, network information, and access cloud platform address (optionally including A1), and the IoT device scans the QR code to obtain ID2, R1, network information, access Cloud platform address (optionally including A1) and other information.
S413,IoT设备使用本地存储的K加密R1,得到K1’(对应上述第二接入密钥)。S413, the IoT device uses the locally stored K to encrypt R1 to obtain K1' (corresponding to the above-mentioned second access key).
S414,IoT设备以K1’为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接。S414, the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
可选的,当IoT设备获取到A1时,IoT设备也可以执行下述步骤S415。Optionally, when the IoT device obtains A1, the IoT device may also perform the following step S415.
S415,IoT设备以A1作为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接;并以K1’为密钥,与接入云平台进行单向或双向挑战认证。S415, the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
在上述图4所示的方案中,IoT设备厂商为每个设备(由设备ID1来标识)分配一个唯一的密钥K,将密钥K预置到对应的设备中,密钥K和对应的设备的ID1保存在设备厂商的设备云平台中。In the solution shown in Figure 4 above, the IoT device manufacturer assigns a unique key K to each device (identified by device ID1), and presets the key K into the corresponding device. The key K and the corresponding The ID1 of the device is stored in the device cloud platform of the device manufacturer.
接入云平台从设备获取到设备ID1。接入云平台根据设备ID1为设备生成ID2,和随机值R1(接入云平台需要保存该R1和对应的设备的ID2)。接入云平台将前述ID1和R1发送到设备云平台。Access the cloud platform to obtain the device ID1 from the device. The access cloud platform generates ID2 for the device according to the device ID1, and a random value R1 (the access cloud platform needs to save the R1 and the ID2 of the corresponding device). The access cloud platform sends the aforementioned ID1 and R1 to the device cloud platform.
设备云平台生成密钥K1,生成方法为:对R1采用预定义密钥生成算法S1,例如基于高级加密标准(Advanced Encryption Standard,AES)256-基于密码的消息认证码(Code-Based Message Authentication Code,CMAC)算法,基于HMAC算法的键衍生函数(Key Derivation Function,KDF),其中,HMAC算法是指基于哈希(Hash)的消息认证码(Message Authentication Code,MAC)算法,基于密码的密钥导出函数(Password-Based Key Derivation Function,PBKDF)算法等,用K加密得到K1。The device cloud platform generates a key K1, and the generation method is as follows: use a predefined key generation algorithm S1 for R1, such as Advanced Encryption Standard (AES) 256-Code-Based Message Authentication Code (Code-Based Message Authentication Code) , CMAC) algorithm, key derivative function (Key Derivation Function, KDF) based on HMAC algorithm, wherein, HMAC algorithm refers to the message authentication code (Message Authentication Code, MAC) algorithm based on hash (Hash), password-based key Derived function (Password-Based Key Derivation Function, PBKDF) algorithm, etc., use K encryption to obtain K1.
设备云平台将K1返回给接入云平台。接入云平台将ID2和R1通过配网终端返回给设备。The device cloud platform returns K1 to the access cloud platform. The access cloud platform returns ID2 and R1 to the device through the distribution network terminal.
设备对R1采用预定义密钥生成算法S1用K加密得到K1’(等同于K1)。中间节点(例如配网终端)没有K,所以无法得到K1,能防止配网终端被破解劫持导致的密钥泄露。The device uses the predefined key generation algorithm S1 to encrypt R1 with K to obtain K1' (equivalent to K1). The intermediate node (such as the distribution network terminal) does not have K, so K1 cannot be obtained, which can prevent the key leakage caused by the cracking and hijacking of the distribution network terminal.
在一种可能的实现方式中,设备通过PSK方式使用K1’作为预共享密钥与手机云平台建立TLS/DTLS连接。ID2用来在接入云平台上唯一标识该设备并用来索引K1。In a possible implementation, the device uses K1' as a pre-shared key to establish a TLS/DTLS connection with the mobile phone cloud platform through PSK. ID2 is used to uniquely identify the device on the access cloud platform and to index K1.
在另一种可能的实现方式中,配网设备给IoT设备下发网络信息、ID2、R1、设备注册码A1和接入云地址,IoT设备每次连接上述接入云平台时,采用TLS/DTLS方法,使用设备注册码作为预共享密钥或者匿名方式协商通讯密钥建立安全连接后,使用K1作为密钥与手机云平台进行单向或双向挑战认证。In another possible implementation, the network distribution device sends network information, ID2, R1, device registration code A1 and access cloud address to the IoT device. Every time the IoT device connects to the above-mentioned access cloud platform, it uses TLS/ The DTLS method uses the device registration code as the pre-shared key or negotiates the communication key in an anonymous way to establish a secure connection, and then uses K1 as the key to perform one-way or two-way challenge authentication with the mobile cloud platform.
综上所述,本申请实施例所示的方案中,物联网设备和设备云平台中预先设置设备密钥,物联网设备向接入云平台发起接入的过程中,接入云平台通过与设备云平台进行交互,可以得到第一接入密钥,以及自己生成的第一随机数,其中,该第一接入密钥是通过设备密钥和第一随机数生成的,也就是说,接入云平台将第一随机数提供给物联网设备后,物联网设备可以通过本地存储的设备密钥,结合第一随机数获得用于接入的第二接入密钥,并通过第二接入密钥请求接入云平台进行接入认证,在此过程中,接入云平台不直接向物联网设备提供接入密钥,也能够使得物联网设备正确获取到接入密钥,能够保证安全性,同时,由于该过程中不需要对物联网设备进行身份认证,能够简化接入认证过程,从而在保证接入认证的安全性的情况下,提高物联网设备的接入认证的效率。To sum up, in the solution shown in the embodiment of this application, the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes The device cloud platform interacts to obtain the first access key and the first random number generated by itself, wherein the first access key is generated by the device key and the first random number, that is, After accessing the cloud platform and providing the first random number to the IoT device, the IoT device can obtain the second access key for access by combining the locally stored device key and the first random number, and use the second access key for access. The access key requests access to the cloud platform for access authentication. During this process, the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly. To ensure security, at the same time, since the identity authentication of IoT devices is not required in this process, the access authentication process can be simplified, thereby improving the efficiency of access authentication of IoT devices while ensuring the security of access authentication. .
基于上述图3所示的方案,在一种可能的实现方式中,当本申请所示的方案应用在物联网设备配网完成后,上述第一接入密钥可以由设备云平台生成,且上述密钥指示信息包括接入云平台生成的第一随机数。为了提高安全性,上述第一接入密钥可以是基于第一随机数,以及物联网设备自己分配的第二随机数生成的。Based on the solution shown in FIG. 3 above, in a possible implementation manner, after the solution shown in this application is applied to the Internet of Things device network configuration, the first access key can be generated by the device cloud platform, and The above key indication information includes the first random number generated by the access cloud platform. In order to improve security, the above-mentioned first access key may be generated based on the first random number and the second random number allocated by the IoT device itself.
下面,对这种情况下的接入认证的过程进行示例性的说明。Below, the process of access authentication in this case is exemplarily described.
图5示出了本申请一个示例性实施例提供的物联网设备接入认证方法的流程图。该方法可以应用于如 图1示出的接入认证系统中,由物联网设备12、接入云平台14以及设备云平台16交互执行,该方法可以包括如下步骤:FIG. 5 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application. The method can be applied to the access authentication system shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
步骤501,物联网设备生成第二随机数。Step 501, the IoT device generates a second random number.
在一种可能的实现方式中,物联网设备还通过设备密钥对第二随机数进行加密,生成第一设备认证信息。In a possible implementation manner, the IoT device further encrypts the second random number by using the device key to generate the first device authentication information.
在本申请实施例中,为了进一步提高接入密钥分发的安全性,物联网设备除了提供第二随机数之外,还通过设备密钥对该第二随机数进行加密得到第一设备认证信息,用于后续设备云平台对物联网设备进行认证。In this embodiment of the present application, in order to further improve the security of access key distribution, in addition to providing the second random number, the IoT device also encrypts the second random number with the device key to obtain the first device authentication information , which is used for subsequent device cloud platforms to authenticate IoT devices.
步骤502,物联网设备向接入云平台提供第二随机数以及该物联网设备的设备信息;相应的,接入云平台获取该第二随机数以及该物联网设备的设备信息。Step 502, the IoT device provides a second random number and device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the second random number and device information of the IoT device.
在一种可能的实现方式中,物联网设备还获取该物联网设备提供的第一设备认证信息。In a possible implementation manner, the IoT device further acquires the first device authentication information provided by the IoT device.
步骤503,接入云平台生成第一随机数。Step 503, accessing the cloud platform to generate a first random number.
其中该第一随机数作为密钥指示信息。The first random number is used as key indication information.
在一种可能的实现方式中,接入云平台还生成物联网设备的接入认证标识。In a possible implementation manner, the access cloud platform also generates an access authentication identifier of the IoT device.
在一种可能的实现方式中,接入云平台还生成该物联网设备的设备注册码。In a possible implementation manner, the access cloud platform also generates a device registration code of the IoT device.
步骤504,接入云平台根据该物联网设备的设备信息,向该设备云平台发送该第一随机数和第二随机数;相应的,设备云平台接收该第一随机数和第二随机数。Step 504, the access cloud platform sends the first random number and the second random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number and the second random number .
在一种可能的实现方式中,接入云平台向设备云平台发送第一随机数、第二随机数和第一设备认证信息;相应的,设备云平台接收该第一随机数、第二随机数和第一设备认证信息。In a possible implementation manner, the access cloud platform sends the first random number, the second random number and the first device authentication information to the device cloud platform; correspondingly, the device cloud platform receives the first random number, the second random number and the first random number. number and first device authentication information.
步骤505,设备云平台通过物联网设备对应的设备密钥,对第一随机数和第二随机数进行加密生成第一接入密钥。Step 505, the device cloud platform encrypts the first random number and the second random number through the device key corresponding to the IoT device to generate a first access key.
在一种可能的实现方式中,设备云平台通过设备密钥对第二随机数进行加密生成的第二设备认证信息,通过第二设备认证信息对第一设备认证信息进行认证,当根据第二设备认证信息对第一设备认证信息认证通过后,设备云平台生成第三随机数,并通过设备密钥对第二随机数和第三随机数进行加密,生成第一云认证信息。In a possible implementation manner, the device cloud platform uses the device key to encrypt the second random number to generate the second device authentication information, and uses the second device authentication information to authenticate the first device authentication information. After the device authentication information passes the authentication of the first device authentication information, the device cloud platform generates a third random number, and encrypts the second random number and the third random number with the device key to generate the first cloud authentication information.
步骤506,设备云平台将第一接入密钥返回给接入云平台,接入云平台接收该第一接入密钥。Step 506, the device cloud platform returns the first access key to the access cloud platform, and the access cloud platform receives the first access key.
在一种可能的实现方式中,接入云平台接收设备云平台根据第二设备认证信息对第一设备认证信息认证通过后发送的第一接入密钥、第一云认证信息以及第三随机数。In a possible implementation manner, the access cloud platform receives the first access key, the first cloud authentication information, and the third random sent by the device cloud platform after passing the authentication of the first device authentication information according to the second device authentication information number.
其中,该第二设备认证信息是该设备云平台通过该设备密钥对该第二随机数进行加密生成的;该第一云认证信息是该设备云平台通过该设备密钥对该第二随机数和该第三随机数进行加密生成的;该第三随机数是该设备云平台生成的。The second device authentication information is generated by the device cloud platform by encrypting the second random number through the device key; the first cloud authentication information is the device cloud platform using the device key to encrypt the second random number. generated by encrypting the third random number and the third random number; the third random number is generated by the device cloud platform.
在一种可能的实现方式中,接入云平台还建立上述接入认证标识与第一接入密钥之间的关联关系。In a possible implementation manner, the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
步骤507,接入云平台将第一随机数提供给物联网设备,相应的,物联网设备获取接入云平台提供的第一随机数。Step 507 , the access cloud platform provides the first random number to the IoT device, and correspondingly, the IoT device obtains the first random number provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将第一云认证信息以及第三随机数提供给物联网设备。In a possible implementation manner, the access cloud platform further provides the first cloud authentication information and the third random number to the IoT device.
在一种可能的实现方式中,接入云平台还将接入认证标识提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识。In a possible implementation manner, the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将设备注册码提供给物联网设备;相应的,物联网设备获取接入云平台提供的该设备注册码。In a possible implementation manner, the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将接入认证标识和设备注册码一起提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识和设备注册码。In a possible implementation manner, the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
步骤508,物联网设备通过设备密钥对第一随机数和第二随机数进行加密生成,第二接入密钥。Step 508, the IoT device encrypts the first random number and the second random number with the device key to generate the second access key.
在一种可能的实现方式中,物联网设备通过设备密钥对第二随机数和第三随机数进行加密,生成第二云认证信息;在根据第二云认证信息对第一云认证信息认证通过后,根据设备密钥以及密钥指示信息生成第二接入密钥。In a possible implementation manner, the IoT device encrypts the second random number and the third random number with the device key to generate the second cloud authentication information; when authenticating the first cloud authentication information according to the second cloud authentication information After passing, the second access key is generated according to the device key and the key indication information.
其中,物联网设备通过设备密钥对第二随机数和第三随机数进行加密所使用的算法,与设备云平台通过设备密钥对第二随机数和第三随机数进行加密所使用的算法相同;相应的,物联网设备通过设备密钥对第一随机数和第二随机数进行加密所使用的算法,与设备云平台通过设备密钥对第一随机数和第二随机数进行加密所使用的算法相同。Among them, the algorithm used by the IoT device to encrypt the second random number and the third random number through the device key, and the algorithm used by the device cloud platform to encrypt the second random number and the third random number through the device key. The same; correspondingly, the algorithm used by the IoT device to encrypt the first random number and the second random number through the device key is the same as the algorithm used by the device cloud platform to encrypt the first random number and the second random number through the device key. The algorithm used is the same.
步骤509,物联网设备向接入云平台发送包含第二接入密钥的接入认证请求;相应的,接入云平台接收该物联网设备发送的该接入认证请求。Step 509, the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及接入认证标识的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥、接入认证标识以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
步骤510,接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Step 510, the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
在一种可能的实现方式中,接入云平台根据第一接入密钥与第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对物联网设备进行数据连接建立认证。In a possible implementation manner, the access cloud platform authenticates the IoT device for establishing a data connection by using the TLS/DTLS pre-shared key PSK method according to the first access key and the second access key.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的接入认证标识查询上述关联关系,获得第一接入密钥;并根据查询到的第一接入密钥与第二接入密钥,对物联网设备进行接入认证。In a possible implementation manner, the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的设备注册码,通过TLS/DTLS预共享密钥PSK方式,与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In a possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request; The access key and the second access key are used for one-way or two-way challenge authentication.
在另一种可能的实现方式中,接入云平台通过TLS/DTLS匿名方式与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In another possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
在另一种可能的实现方式中,接入云平台接收该设备云平台发送的该第一接入密钥、第三云认证信息、第三设备认证信息、以及第三随机数;该第三云认证信息是由该设备云平台通过该设备密钥对该第二随机数进行加密生成的;该第三设备认证信息是该设备云平台通过该第三随机数进行加密生成的;该第三随机数是该设备云平台生成的;In another possible implementation manner, the access cloud platform receives the first access key, the third cloud authentication information, the third device authentication information, and the third random number sent by the device cloud platform; the third The cloud authentication information is generated by the device cloud platform by encrypting the second random number with the device key; the third device authentication information is generated by the device cloud platform by encrypting the third random number; the third The random number is generated by the device cloud platform;
接入云平台接收该物联网设备发送的接入认证请求之前,还将该第三云认证信息以及该第三随机数提供给该物联网设备;Before receiving the access authentication request sent by the IoT device, the access cloud platform also provides the third cloud authentication information and the third random number to the IoT device;
接入云平台接收该物联网设备发送的接入认证请求时,接收该物联网设备根据第四云认证信息对该第三云认证信息认证通过后发送的该接入认证请求;该第四云认证信息是该物联网设备通过该设备密钥对该第二随机数进行加密生成的;该接入认证请求中还包括第四设备认证信息,该第四设备认证信息是该物联网设备通过该设备密钥对该第三随机数进行加密生成的;When the access cloud platform receives the access authentication request sent by the Internet of Things device, it receives the access authentication request sent by the Internet of Things device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information; the fourth cloud The authentication information is generated by the Internet of Things device by encrypting the second random number with the device key; the access authentication request also includes fourth device authentication information, and the fourth device authentication information is the Internet of Things device through the The device key is generated by encrypting the third random number;
接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证时,在根据该第三设备认证信息对该第四设备认证信息认证通过后,根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。When the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key, after passing the authentication on the fourth device authentication information according to the third device authentication information , and perform access authentication on the Internet of Things device according to the first access key and the second access key.
相应的,物联网设备根据该设备密钥以及该第一随机数生成第二接入密钥之前,获取该接入云平台提供的第三云认证信息以及第三随机数;该第三云认证信息是该设备云平台通过该设备密钥对该第二随机数进行加密生成的;该第三随机数是该设备云平台生成的;Correspondingly, before generating the second access key according to the device key and the first random number, the IoT device obtains the third cloud authentication information and the third random number provided by the access cloud platform; the third cloud authentication The information is generated by the device cloud platform by encrypting the second random number with the device key; the third random number is generated by the device cloud platform;
物联网设备根据该设备密钥以及该第一随机数生成第二接入密钥时,通过该设备密钥对该第二随机数进行加密,生成第四云认证信息;在根据该第四云认证信息对该第三云认证信息认证通过后,根据该设备密钥以及该第一随机数生成该第二接入密钥;When the IoT device generates a second access key according to the device key and the first random number, the second random number is encrypted by the device key to generate fourth cloud authentication information; After the authentication information has passed the authentication of the third cloud authentication information, the second access key is generated according to the device key and the first random number;
物联网设备还通过该设备密钥对该第三随机数进行加密,生成第四设备认证信息;The IoT device also encrypts the third random number through the device key to generate fourth device authentication information;
物联网设备向该接入云平台发送包含该第二接入密钥的接入认证请求时,向该接入云平台发送包含该第二接入密钥,以及该第四设备认证信息的该接入认证请求。When the IoT device sends an access authentication request containing the second access key to the access cloud platform, it sends the access cloud platform the access authentication request containing the second access key and the fourth device authentication information. Access authentication request.
请参考图6,其示出了本申请实施例涉及的配网完成后的接入认证流程图。如图6所示,物联网设备的接入认证过程如下:Please refer to FIG. 6 , which shows a flowchart of access authentication after the network distribution is completed according to the embodiment of the present application. As shown in Figure 6, the access authentication process of IoT devices is as follows:
S61,IoT设备与接入云平台建立安全连接。S61, the IoT device establishes a secure connection with the access cloud platform.
S62,IoT设备生成随机串R2(对应上述第二随机数),通过设备密钥K对R2加密生成设备认证信息Hc1(对应上述第一设备认证信息)。S62 , the IoT device generates a random string R2 (corresponding to the above-mentioned second random number), and encrypts R2 with the device key K to generate device authentication information Hc1 (corresponding to the above-mentioned first device authentication information).
S63,IoT设备向接入云平台发送R2、Hc1、以及IoT设备的设备信息(包括IoT设备的设备标识ID1,以及设备厂商信息)。S63, the IoT device sends R2, Hc1, and device information of the IoT device (including the device identifier ID1 of the IoT device and the device manufacturer information) to the access cloud platform.
S64,接入云平台根据设备厂商信息确定设备云平台。S64, the access cloud platform determines the device cloud platform according to the device manufacturer information.
S65,接入云平台根据ID1生成为IoT设备分配的ID2(对应上述接入认证标识),以及随机数R1(对应上述第一随机数)。在一种可能的实现方式中,接入云平台还为IoT设备分配设备注册码A1。S65, the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, and a random number R1 (corresponding to the above-mentioned first random number). In a possible implementation manner, the access cloud platform also allocates a device registration code A1 to the IoT device.
S66,接入云平台与设备云平台建立安全连接。S66, the access cloud platform establishes a secure connection with the device cloud platform.
S67,接入云平台向设备云平台发送ID1、R1、R2和Hc1。S67, the access cloud platform sends ID1, R1, R2 and Hc1 to the device cloud platform.
S68,设备云平台根据ID1获取IoT设备的密钥K(对应上述设备密钥)。S68, the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
S69,设备云平台通过K加密R2,生成Hc1’(对应上述第二设备认证信息);若Hc1’与Hc1相同,则对IoT设备认证成功,进入S610,否则认证失败。S69, the device cloud platform encrypts R2 by K, and generates Hc1' (corresponding to the above-mentioned second device authentication information); if Hc1' is the same as Hc1, the IoT device is authenticated successfully, and the process goes to S610, otherwise the authentication fails.
S610,设备云平台生成随机数R3(即上述第三随机数)。S610, the device cloud platform generates a random number R3 (that is, the above-mentioned third random number).
S611,设备云平台通过K加密R2和R3,生成云认证信息Hc2(对应上述第一云认证信息)。S611 , the device cloud platform encrypts R2 and R3 by K to generate cloud authentication information Hc2 (corresponding to the above-mentioned first cloud authentication information).
S612,设备云平台通过K对R1加密,生成K1(对应上述第一接入密钥)。S612, the device cloud platform encrypts R1 through K to generate K1 (corresponding to the above-mentioned first access key).
S613,设备云平台将K1、R3和Hc2返回给接入云平台。S613, the device cloud platform returns K1, R3 and Hc2 to the access cloud platform.
S614,接入云平台将ID2、R1、R3和Hc2返回给IoT设备。在一种可能的实现方式中,接入云平台还将A1返回给IoT设备。S614, the access cloud platform returns ID2, R1, R3 and Hc2 to the IoT device. In a possible implementation manner, the access cloud platform also returns A1 to the IoT device.
IoT设备通过安全连接,获取ID2、R1、R3、Hc2网络信息、接入云平台地址;在一种可能的实现方式中,IoT设备还通过安全连接获取A1。The IoT device obtains ID2, R1, R3, and Hc2 network information, and accesses the cloud platform address through a secure connection; in a possible implementation, the IoT device also obtains A1 through a secure connection.
S615,IoT设备通过K加密R2和R3,生成Hc2’(对应上述第二云认证信息)。S615, the IoT device encrypts R2 and R3 through K to generate Hc2' (corresponding to the above-mentioned second cloud authentication information).
S616,IoT设备比对Hc2’与Hc2,若相同,则认证成功,进入S618,否则认证失败。S616, the IoT device compares Hc2' and Hc2, if they are the same, the authentication succeeds, and the process proceeds to S618, otherwise the authentication fails.
S617,IoT设备使用本地存储的K加密R1和R2,得到K1’(对应上述第二接入密钥)。S617, the IoT device uses the locally stored K to encrypt R1 and R2 to obtain K1' (corresponding to the above-mentioned second access key).
S618,IoT设备以K1’为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接。S618, the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
可选的,当IoT设备获取到A1时,IoT设备也可以执行下述步骤S415。Optionally, when the IoT device obtains A1, the IoT device may also perform the following step S415.
S619,IoT设备以A1作为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接;并以K1’为密钥,与接入云平台进行单向或双向挑战认证。S619, the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
综上所述,本申请实施例所示的方案中,物联网设备和设备云平台中预先设置设备密钥,物联网设备向接入云平台发起接入的过程中,物联网设备向接入云平台提供第二随机数,接入云平台通过与设备云平台进行交互,可以得到第一接入密钥,以及自己生成的第一随机数,其中,该第一接入密钥是通过设备密钥和第一随机数、第二随机数生成的,也就是说,接入云平台将第一随机数提供给物联网设备后,物联网设备可以通过本地存储的设备密钥和第二随机数,结合第一随机数获得用于接入的第二接入密钥,并通过第二接入密钥请求接入云平台进行接入认证,在此过程中,接入云平台不直接向物联网设备提供接入密钥,也能够使得物联网设备正确获取到接入密钥,能够保证安全性,同时,由于该过程中不需要对物联网设备进行身份认证,能够简化接入认证过程,从而在保证接入认证的安全性的情况下,提高物联网设备的接入认证的效率。To sum up, in the solution shown in the embodiment of this application, the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the IoT device sends the access to the cloud platform. The cloud platform provides the second random number, and the access cloud platform can obtain the first access key and the first random number generated by itself by interacting with the device cloud platform, wherein the first access key is obtained by the device The key is generated from the first random number and the second random number, that is to say, after accessing the cloud platform to provide the first random number to the IoT device, the IoT device can use the locally stored device key and the second random number. The second access key for access is obtained in combination with the first random number, and the second access key is used to request access to the cloud platform for access authentication. During this process, the access cloud platform does not directly contact the cloud platform. The IoT device provides the access key, which can also enable the IoT device to obtain the access key correctly, which can ensure security. At the same time, since the IoT device does not need to be authenticated in this process, the access authentication process can be simplified. , so as to improve the efficiency of the access authentication of the IoT device under the condition of ensuring the security of the access authentication.
在一种可能的实现方式中,当上述图2所示实施例中的方案应用在对物联网设备的配网过程中或者配网完成后,上述第一接入密钥可以由接入云平台生成,且上述密钥指示信息包括对第一接入密钥进行加密得到的密文。In a possible implementation manner, when the solution in the above-mentioned embodiment shown in FIG. 2 is applied in the process of network allocation to the Internet of Things device or after the network allocation is completed, the above-mentioned first access key can be accessed by the cloud platform. generated, and the key indication information includes the ciphertext obtained by encrypting the first access key.
在这种情况下,接入云平台获取物联网设备的设备信息;生成第一随机数和第一接入密钥;根据该物联网设备的设备信息,向该物联网设备对应的设备云平台发送该第一随机数;接收该设备云平台通过该设备密钥对该第一随机数进行加密生成的第一加密密钥;通过该第一加密密钥对该第一接入密钥进行加密,获得加密密文;将该加密密文以及该第一随机数,提供给该物联网设备;接收该物联网设备发送的接入认证请求,该接入认证请求中包含第二接入密钥,该第二接入密钥是该物联网设备根据该设备密钥、该加密密文以及该第一随机数生成的;根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。In this case, access the cloud platform to obtain device information of the IoT device; generate a first random number and a first access key; Send the first random number; receive the first encryption key generated by the device cloud platform encrypting the first random number with the device key; encrypt the first access key with the first encryption key , obtain the encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT device; receive an access authentication request sent by the IoT device, where the access authentication request includes the second access key , the second access key is generated by the IoT device according to the device key, the encrypted ciphertext and the first random number; The IoT device performs access authentication.
相应的,物联网设备向接入云平台提供该物联网设备的设备信息;获取该接入云平台提供的加密密文以及该接入云平台生成的第一随机数;该加密密文是该接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;该第一加密密钥是该物联网设备的设备云平台通过设备密钥对该第一随机数进行加密生成的密钥;该设备密钥设置在该物联网设备以及该设备云平台中;通过设备密钥对第一随机数进行加密,生成第二加密密钥;通过该第二加密密钥对该加密密文进行解密,获得第二接入密钥;向该接入云平台发送包含该第二接入密钥的接入认证请求,该接入认证请求用于请求该接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Correspondingly, the IoT device provides the device information of the IoT device to the access cloud platform; obtains the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is the The encrypted ciphertext obtained by the access cloud platform encrypting the first access key with the first encryption key; the first encryption key is the first random number obtained by the device cloud platform of the IoT device through the device key A key generated by encryption; the device key is set in the IoT device and the device cloud platform; the first random number is encrypted by the device key, and a second encryption key is generated; through the second encryption key Decrypt the encrypted ciphertext to obtain a second access key; send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform According to the first access key and the second access key, access authentication is performed on the Internet of Things device.
下面,对这种情况下的接入认证的过程进行示例性的说明。Below, the process of access authentication in this case is exemplarily described.
图7示出了本申请一个示例性实施例提供的物联网设备接入认证方法的流程图。该方法可以应用于如图1示出的接入认证系统中,由物联网设备12、接入云平台14以及设备云平台16交互执行,该方法可以包括如下步骤:FIG. 7 shows a flowchart of a method for authentication of IoT device access provided by an exemplary embodiment of the present application. The method can be applied to the access authentication system as shown in FIG. 1, and is executed interactively by the Internet of Things device 12, the access cloud platform 14 and the device cloud platform 16, and the method can include the following steps:
步骤701,物联网设备向接入云平台提供该物联网设备的设备信息;相应的,接入云平台获取该物联网设备的设备信息。Step 701, the IoT device provides the device information of the IoT device to the access cloud platform; correspondingly, the access cloud platform obtains the device information of the IoT device.
上述步骤701可以参考图3所示实施例中的步骤401下的描述,此处不再赘述。For the above step 701, reference may be made to the description under step 401 in the embodiment shown in FIG. 3 , and details are not repeated here.
步骤702,接入云平台生成第一随机数和第一接入密钥。Step 702, the access cloud platform generates a first random number and a first access key.
在本申请实施例中,接入云平台除了生成第一随机数之外,还生成第一接入密钥。In this embodiment of the present application, in addition to generating the first random number, the access cloud platform also generates a first access key.
在一种可能的实现方式中,接入云平台还生成物联网设备的接入认证标识。In a possible implementation manner, the access cloud platform also generates an access authentication identifier of the IoT device.
在一种可能的实现方式中,接入云平台还生成该物联网设备的设备注册码。In a possible implementation manner, the access cloud platform also generates a device registration code of the IoT device.
在一种可能的实现方式中,接入云平台还建立上述接入认证标识与第一接入密钥之间的关联关系。In a possible implementation manner, the access cloud platform further establishes an association relationship between the above-mentioned access authentication identifier and the first access key.
步骤703,接入云平台根据该物联网设备的设备信息,向该设备云平台发送该第一随机数;相应的,设备云平台接收该第一随机数。Step 703, the access cloud platform sends the first random number to the device cloud platform according to the device information of the IoT device; correspondingly, the device cloud platform receives the first random number.
步骤704,设备云平台通过物联网设备对应的设备密钥,对第一随机数进行加密生成第一加密密钥。Step 704, the device cloud platform encrypts the first random number through the device key corresponding to the IoT device to generate a first encryption key.
步骤705,设备云平台将第一加密密钥返回给接入云平台,接入云平台接收该第一加密密钥。Step 705, the device cloud platform returns the first encryption key to the access cloud platform, and the access cloud platform receives the first encryption key.
也就是说,接入云平台接收该物联网设备通过该设备密钥对该第一随机数进行加密生成的该第一加密密钥。That is, the access cloud platform receives the first encryption key generated by the IoT device by encrypting the first random number with the device key.
步骤706,接入云平台通过第一加密密钥对第一接入密钥进行加密,获得加密密文。Step 706, the access cloud platform encrypts the first access key with the first encryption key to obtain the encrypted ciphertext.
其中,上述加密密文以及第一随机数,即为密钥指示信息。The above encrypted ciphertext and the first random number are key indication information.
步骤707,接入云平台将加密密文以及第一随机数提供给物联网设备,相应的,物联网设备获取接入云平台提供的加密密文以及第一随机数。Step 707, the access cloud platform provides the encrypted ciphertext and the first random number to the IoT device, and accordingly, the IoT device obtains the encrypted ciphertext and the first random number provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将接入认证标识提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识。In a possible implementation manner, the access cloud platform also provides the access authentication identifier to the IoT device; correspondingly, the IoT device obtains the access authentication identifier provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将设备注册码提供给物联网设备;相应的,物联网设备获取接入云平台提供的该设备注册码。In a possible implementation manner, the access cloud platform also provides the device registration code to the IoT device; correspondingly, the IoT device obtains the device registration code provided by the access cloud platform.
在一种可能的实现方式中,接入云平台还将接入认证标识和设备注册码一起提供给物联网设备;相应的,物联网设备获取接入云平台提供的该接入认证标识和设备注册码。In a possible implementation manner, the access cloud platform also provides the access authentication identifier and the device registration code to the IoT device; correspondingly, the IoT device obtains the access authentication identifier and device provided by the access cloud platform registration code.
步骤708,物联网设备通过设备密钥对第一随机数进行加密,生成第二加密密钥;通过第二加密密钥对加密密文进行解密,获得第二接入密钥。Step 708, the IoT device encrypts the first random number with the device key to generate a second encryption key; decrypts the encrypted ciphertext with the second encryption key to obtain a second access key.
在本申请实施例中,物联网设备通过设备密钥对第一随机数进行加密所使用的加密算法,与设备云平台通过设备密钥对第一随机数进行加密所使用的加密算法相同。In the embodiment of the present application, the encryption algorithm used by the IoT device to encrypt the first random number by using the device key is the same as the encryption algorithm used by the device cloud platform to encrypt the first random number by using the device key.
并且,物联网设备第二加密密钥对加密密文进行解密的算法,与接入云平台通过第一加密密钥对第一接入密钥进行加密的算法相匹配。In addition, the algorithm for decrypting the encrypted ciphertext by the second encryption key of the IoT device matches the algorithm for encrypting the first access key by the access cloud platform using the first encryption key.
步骤709,物联网设备向接入云平台发送包含第二接入密钥的接入认证请求;相应的,接入云平台接收该物联网设备发送的该接入认证请求。Step 709, the IoT device sends an access authentication request including the second access key to the access cloud platform; correspondingly, the access cloud platform receives the access authentication request sent by the IoT device.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及接入认证标识的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the access authentication identifier to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key and the device registration code to the access cloud platform.
在一种可能的实现方式中,接入云平台向接入云平台发送包含第二接入密钥、接入认证标识以及设备注册码的接入认证请求。In a possible implementation manner, the access cloud platform sends an access authentication request including the second access key, the access authentication identifier and the device registration code to the access cloud platform.
步骤710,接入云平台根据该第一接入密钥与该第二接入密钥,对该物联网设备进行接入认证。Step 710, the access cloud platform performs access authentication on the IoT device according to the first access key and the second access key.
在一种可能的实现方式中,接入云平台根据第一接入密钥与第二接入密钥,通过预共享密钥TLS/DTLSPSK方式对物联网设备进行数据连接建立认证。In a possible implementation manner, the access cloud platform performs data connection establishment authentication on the IoT device through the pre-shared key TLS/DTLSPSK method according to the first access key and the second access key.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的接入认证标识查询上述关联关系,获得第一接入密钥;并根据查询到的第一接入密钥与第二接入密钥,对物联网设备进行接入认证。In a possible implementation manner, the access cloud platform queries the above association relationship according to the access authentication identifier carried in the access authentication request, and obtains the first access key; and according to the queried first access key and the The second access key is used to authenticate the access of the IoT device.
在一种可能的实现方式中,接入云平台根据接入认证请求中携带的设备注册码,通过TLS/DTLS预共享密钥PSK方式,与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In a possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device through the TLS/DTLS pre-shared key PSK method according to the device registration code carried in the access authentication request; The access key and the second access key are used for one-way or two-way challenge authentication.
在另一种可能的实现方式中,接入云平台通过TLS/DTLS匿名方式与物联网设备建立安全数据连接;并根据第一接入密钥与第二接入密钥,进行单向或双向挑战认证。In another possible implementation manner, the access cloud platform establishes a secure data connection with the IoT device in an anonymous way through TLS/DTLS; Challenge authentication.
请参考图8,其示出了本申请实施例涉及的配网过程中的接入认证流程图。如图8所示,物联网设备的接入认证过程如下:Please refer to FIG. 8 , which shows a flowchart of access authentication in the network distribution process involved in the embodiment of the present application. As shown in Figure 8, the access authentication process of IoT devices is as follows:
S81,IoT设备广播信标帧或者展示二维码;配网设备通过Soft AP发现或者扫码方式,获取IoT设备的设备信息。S81, the IoT device broadcasts the beacon frame or displays the QR code; the distribution network device obtains the device information of the IoT device through Soft AP discovery or code scanning.
S82,配网设备与接入云平台建立安全连接。S82, the network distribution device establishes a secure connection with the access cloud platform.
S83,配网设备向接入云平台发送IoT设备的上述设备信息,例如ID1和设备厂商信息。S83, the network distribution device sends the above-mentioned device information of the IoT device to the access cloud platform, such as ID1 and device manufacturer information.
S84,接入云平台根据设备厂商信息确定设备云平台。S84, the access cloud platform determines the device cloud platform according to the device manufacturer information.
S85,接入云平台根据ID1生成为IoT设备分配的ID2(对应上述接入认证标识),密钥K1(对应上述第一接入密钥)以及随机数R1(对应上述第一随机数)。在一种可能的实现方式中,接入云平台还为IoT设备分配设备注册码A1。S85, the access cloud platform generates an ID2 (corresponding to the above-mentioned access authentication identifier) allocated to the IoT device according to the ID1, a key K1 (corresponding to the above-mentioned first access key) and a random number R1 (corresponding to the above-mentioned first random number). In a possible implementation manner, the access cloud platform also allocates a device registration code A1 to the IoT device.
S86,接入云平台与设备云平台建立安全连接。S86, the access cloud platform establishes a secure connection with the device cloud platform.
S87,接入云平台向设备云平台发送ID1和R1。S87, the access cloud platform sends ID1 and R1 to the device cloud platform.
S88,设备云平台根据ID1获取IoT设备的密钥K(对应上述设备密钥)。S88, the device cloud platform obtains the key K of the IoT device (corresponding to the above-mentioned device key) according to ID1.
S89,设备云平台通过K对R1加密,生成K2(对应上述第一加密密钥)。S89, the device cloud platform encrypts R1 through K to generate K2 (corresponding to the above-mentioned first encryption key).
S810,设备云平台将K2返回给接入云平台。S810, the device cloud platform returns K2 to the access cloud platform.
S811,接入云平台通过K2加密K1,得到密文C1。S811, access the cloud platform and encrypt K1 through K2 to obtain the ciphertext C1.
S812,接入云平台将ID2、随机数R1、密文C1返回给配网设备。在一种可能的实现方式中,接入云平台还将A1返回给配网设备。S812, the access cloud platform returns the ID2, the random number R1, and the ciphertext C1 to the distribution network device. In a possible implementation manner, the access cloud platform also returns A1 to the distribution network device.
S813,IoT设备通过Soft AP发现或者扫码方式,获取ID2、R1、密文C1、网络信息、接入云平台地址;在一种可能的实现方式中,IoT设备还通过Soft AP发现或者扫码方式获取A1。S813, the IoT device obtains ID2, R1, ciphertext C1, network information, and access cloud platform address through the Soft AP discovery or code scanning method; in a possible implementation, the IoT device also discovers or scans the code through the Soft AP way to get A1.
比如,配网终端与IoT设备之间建立基于Soft AP的连接,配网终端将上述ID2、R1、C1、网络信息、接入云平台地址(可选包括A1),发送给IoT设备。For example, a Soft AP-based connection is established between the distribution terminal and the IoT device, and the distribution terminal sends the above ID2, R1, C1, network information, and access cloud platform address (optionally including A1) to the IoT device.
或者,配网终端基于上述ID2、R1、C1、网络信息、接入云平台地址(可选包括A1)生成并展示二维码,由IoT设备扫描该二维码获得ID2、R1、C1、网络信息、接入云平台地址(可选包括A1)等信息。Alternatively, the distribution network terminal generates and displays a QR code based on the above ID2, R1, C1, network information, and access cloud platform address (optionally including A1), and the IoT device scans the QR code to obtain ID2, R1, C1, network Information, access cloud platform address (optionally including A1) and other information.
S814,IoT设备使用本地存储的K加密R1,得到K2’(对应上述第二加密密钥),并通过K2’对C1进行解密,得到K1’(对应上述第二接入密钥)。S814, the IoT device uses the locally stored K to encrypt R1 to obtain K2' (corresponding to the above-mentioned second encryption key), and decrypts C1 through K2' to obtain K1' (corresponds to the above-mentioned second access key).
S815,IoT设备以K1’为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接。S815, the IoT device uses K1' as the key to establish a TLS/DTLS connection with the access cloud platform through PSK.
可选的,当IoT设备获取到A1时,IoT设备也可以执行下述步骤S816。Optionally, when the IoT device obtains A1, the IoT device may also perform the following step S816.
S816,IoT设备以A1作为密钥,通过PSK方式与接入云平台建立TLS/DTLS连接;并以K1’为密钥,与接入云平台进行单向或双向挑战认证。S816, the IoT device uses A1 as the key to establish a TLS/DTLS connection with the access cloud platform through PSK; and uses K1' as the key to perform one-way or two-way challenge authentication with the access cloud platform.
综上所述,本申请实施例所示的方案中,物联网设备和设备云平台中预先设置设备密钥,物联网设备向接入云平台发起接入的过程中,接入云平台通过与设备云平台进行交互,可以得到自己生成第一接入密钥,自己生成的第一随机数,以及通过设备密钥加密第一随机数得到的密文,也就是说,接入云平台将密文和第一随机数提供给物联网设备后,物联网设备可以通过本地存储的设备密钥,结合第一随机数和密文获得用于接入的第二接入密钥,并通过第二接入密钥请求接入云平台进行接入认证,在此过程中,接入云平台不直接向物联网设备提供接入密钥,也能够使得物联网设备正确获取到接入密钥,能够保证安全性,同时,由于该过程中不需要对物联网设备进行身份认证,能够简化接入认证过程,从而在保证接入认证的安全性的情况下,提高物联网设备的接入认证的效率。To sum up, in the solution shown in the embodiment of this application, the device key is preset in the IoT device and the device cloud platform, and the IoT device initiates access to the access cloud platform, and the access cloud platform passes By interacting with the device cloud platform, you can obtain the first access key generated by yourself, the first random number generated by yourself, and the ciphertext obtained by encrypting the first random number with the device key. After the text and the first random number are provided to the IoT device, the IoT device can obtain the second access key for access by combining the first random number and the cipher text with the device key stored locally, and pass the second access key through the second access key. The access key requests access to the cloud platform for access authentication. During this process, the access cloud platform does not directly provide the access key to the IoT device, but also enables the IoT device to obtain the access key correctly. To ensure security, at the same time, since the identity authentication of IoT devices is not required in this process, the access authentication process can be simplified, thereby improving the efficiency of access authentication of IoT devices while ensuring the security of access authentication. .
图9示出了本申请一个示例性实施例提供的物联网设备接入认证装置的结构框图,该装置可以用于接入云平台中,实现成为接入云平台设备,或者,实现成为接入云平台设备中的一部分,该装置包括:FIG. 9 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application. The apparatus can be used to access a cloud platform to become an access cloud platform device, or to become an access cloud platform device. Part of the cloud platform equipment, the device includes:
设备信息获取模块901,用于获取物联网设备的设备信息;A device information acquisition module 901, configured to acquire device information of an IoT device;
第一随机数生成模块902,用于生成第一随机数;a first random number generation module 902, configured to generate a first random number;
第一随机数发送模块903,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;a first random number sending module 903, configured to send the first random number to the device cloud platform according to the device information of the IoT device;
第一接入密钥接收模块904,用于接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The first access key receiving module 904 is configured to receive the first access key generated by the device cloud platform through the device key and the first random number; the device key is set in the IoT device and in the device cloud platform;
第一随机数提供模块905,用于将所述第一随机数提供给所述物联网设备;a first random number providing module 905, configured to provide the first random number to the IoT device;
认证请求接收模块906,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;An authentication request receiving module 906, configured to receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is the IoT device generated according to the device key and the first random number;
接入认证模块907,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module 907, configured to perform access authentication on the IoT device according to the first access key and the second access key.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
第二随机数获取模块,用于在第一随机数发送模块根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数之前,获取所述物联网设备生成的第二随机数;The second random number obtaining module is configured to obtain the first random number generated by the IoT device before the first random number sending module sends the first random number to the device cloud platform according to the device information of the IoT device. two random numbers;
所述第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数;the first random number sending module, configured to send the first random number and the second random number to the device cloud platform according to the device information of the IoT device;
所述第一接入密钥接收模块,用于接收所述设备云平台通过所述设备密钥对所述第一随机数和所述第二随机数进行加密生成的所述第一接入密钥。The first access key receiving module is configured to receive the first access key generated by the device cloud platform by encrypting the first random number and the second random number with the device key; key.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
第一设备认证信息获取模块,用于在第一随机数发送模块根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数之前,获取第一设备认证信息,所述第一设备认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成;A first device authentication information acquisition module, configured to acquire the first random number and the second random number before the first random number sending module sends the first random number and the second random number to the device cloud platform according to the device information of the Internet of Things device first device authentication information, where the first device authentication information is generated by the Internet of Things device encrypting the second random number by using the device key;
所述第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数、所述第二随机数以及所述第一设备认证信息;The first random number sending module is configured to send the first random number, the second random number and the first device authentication information to the device cloud platform according to the device information of the IoT device;
所述第一接入密钥接收模块,用于接收所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后发送的所述第一接入密钥、第一云认证信息以及第三随机数;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第一云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;The first access key receiving module is configured to receive the first access key, the first access key and the first access key sent by the device cloud platform after passing the authentication of the first device authentication information according to the second device authentication information. Cloud authentication information and a third random number; the second device authentication information is generated by the device cloud platform encrypting the second random number with the device key; the first cloud authentication information is the The device cloud platform encrypts and generates the second random number and the third random number by using the device key; the third random number is generated by the device cloud platform;
所述装置还包括:The device also includes:
第一云认证信息提供模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,将所述第一云认证信息以及所述第三随机数提供给所述物联网设备;a first cloud authentication information providing module, configured to provide the first cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
所述认证请求接收模块,用于接收所述物联网设备根据第二云认证信息对所述第一云认证信息认证通过后发送的所述接入认证请求;所述第二云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的。The authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the first cloud authentication information according to the second cloud authentication information; the second cloud authentication information is the The IoT device encrypts the second random number and the third random number with the device key and generates it.
在一种可能的实现方式中,所述第一接入密钥接收模块,用于接收所述设备云平台发送的所述第一接入密钥、第三云认证信息、第三设备认证信息、以及第三随机数;所述第三云认证信息是由所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三设备认证信息是所述设备云平台通过所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;In a possible implementation manner, the first access key receiving module is configured to receive the first access key, third cloud authentication information, and third device authentication information sent by the device cloud platform , and a third random number; the third cloud authentication information is generated by the device cloud platform encrypting the second random number with the device key; the third device authentication information is the device The cloud platform is encrypted and generated by the third random number; the third random number is generated by the device cloud platform;
所述装置还包括:The device also includes:
认证信息及随机数提供模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,将所述第三云认证信息以及所述第三随机数提供给所述物联网设备;An authentication information and random number providing module, configured to provide the third cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
所述认证请求接收模块,用于接收所述物联网设备根据第四云认证信息对所述第三云认证信息认证通过后发送的所述接入认证请求;所述第四云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成的;所述接入认证请求中还包括第四设备认证信息,所述第四设备认证信息是所述物联网设备通过所述设备密钥对所述第三随机数进行加密生成的;The authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information; the fourth cloud authentication information is the The Internet of Things device encrypts the second random number with the device key; the access authentication request also includes fourth device authentication information, and the fourth device authentication information is the Internet of Things device Generated by encrypting the third random number with the device key;
所述接入认证模块,用于在根据所述第三设备认证信息对所述第四设备认证信息认证通过后,根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The access authentication module is configured to, according to the first access key and the second access key, authenticate the fourth device authentication information according to the third device authentication information and pass the authentication. The Internet of Things device performs access authentication.
在一种可能的实现方式中,所述接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。In a possible implementation manner, the access authentication module is configured to, according to the first access key and the second access key, authenticate the IoT devices perform data connection establishment authentication.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
设备注册码生成模块,用于在所述认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成设备注册码;a device registration code generating module, configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
设备注册码提供模块,用于将所述设备注册码提供给所述物联网设备;a device registration code providing module, configured to provide the device registration code to the IoT device;
所述认证请求接收模块,用于接收携带有所述设备注册码的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the device registration code;
所述接入认证模块,用于,The access authentication module is used for,
根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
在一种可能的实现方式中,所述接入认证模块,用于,In a possible implementation manner, the access authentication module is configured to:
通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
接入认证标识生成模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成所述物联网设备的接入认证标识;an access authentication identifier generating module, configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
关联关系建立模块,用于建立所述接入认证标识与所述第一接入密钥之间的关联关系;an association relationship establishing module, configured to establish an association relationship between the access authentication identifier and the first access key;
接入认证标识提供模块,用于将所述接入认证标识提供给所述物联网设备;an access authentication identifier providing module, configured to provide the access authentication identifier to the Internet of Things device;
所述认证请求接收模块,用于接收携带有所述接入认证标识的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the access authentication identifier;
所述接入认证模块,用于,The access authentication module is used for,
根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
图10示出了本申请一个示例性实施例提供的物联网设备接入认证装置的结构框图,该装置可以用于物联网设备中,实现成为物联网设备,或者,实现成为物联网设备中的一部分,该装置包括:FIG. 10 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application. The apparatus can be used in an IoT device to be implemented as an IoT device, or be implemented as an IoT device in the IoT device. In part, the device includes:
设备信息提供模块1001,用于向接入云平台提供所述物联网设备的设备信息;A device information providing module 1001, configured to provide device information of the IoT device to the access cloud platform;
第一随机数获取模块1002,用于获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;A first random number obtaining module 1002, configured to obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform and obtained from the device of the Internet of Things device The cloud platform is provided after the device key and the first access key generated by the first random number; the device key is set in the IoT device and the device cloud platform;
第二接入密钥生成模块1003,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;A second access key generation module 1003, configured to generate a second access key according to the device key and the first random number;
认证请求发送模块1004,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An authentication request sending module 1004, configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first access key. An access key and the second access key are used to perform access authentication on the IoT device.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
第二随机数生成模块,用于在第一随机数获取模块获取所述接入云平台提供的第一随机数之前,生成第二随机数;a second random number generating module, configured to generate a second random number before the first random number obtaining module obtains the first random number provided by the access cloud platform;
第二随机数提供模块,用于向所述接入云平台提供所述第二随机数;A second random number providing module, configured to provide the second random number to the access cloud platform;
所述第二接入密钥生成模块,用于通过所述设备密钥对所述第一随机数和所述第二随机数进行加密,生成所述第二接入密钥。The second access key generation module is configured to encrypt the first random number and the second random number by using the device key to generate the second access key.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
第一设备认证信息生成模块,用于获取所述接入云平台提供的第一随机数通过所述设备密钥对所述第二随机数进行加密,生成第一设备认证信息;a first device authentication information generation module, configured to obtain the first random number provided by the access cloud platform and encrypt the second random number with the device key to generate first device authentication information;
第一设备认证信息提供模块,用于向所述接入云平台提供所述第一设备认证信息;a first device authentication information providing module, configured to provide the first device authentication information to the access cloud platform;
第一云认证信息以及第三随机数获取模块,用于在第二接入密钥生成模块根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,获取所述接入云平台提供的第一云认证信息以及第三随机数;所述第三随机数是所述设备云平台生成的;所述第一云认证信息是由所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后,通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;The first cloud authentication information and the third random number acquisition module are configured to acquire the access key before the second access key generation module generates the second access key according to the device key and the first random number. The first cloud authentication information and the third random number provided by the cloud access platform; the third random number is generated by the device cloud platform; the first cloud authentication information is generated by the device cloud platform according to the second device The authentication information is generated by encrypting the second random number and the third random number with the device key after passing the authentication of the first device authentication information; the second device authentication information is the device Generated by the cloud platform encrypting the second random number by using the device key;
所述第二接入密钥生成模块,用于,The second access key generation module is used for,
通过所述设备密钥对所述第二随机数和所述第三随机数进行加密,生成第二云认证信息;Encrypting the second random number and the third random number with the device key to generate second cloud authentication information;
在根据所述第二云认证信息对所述第一云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥。After passing the authentication on the first cloud authentication information according to the second cloud authentication information, the second access key is generated according to the device key and the first random number.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
认证信息及随机数获取模块,用于在第二接入密钥生成模块根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,获取所述接入云平台提供的第三云认证信息以及第三随机数;所述第三云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;The authentication information and random number acquisition module is configured to acquire the access key provided by the access cloud platform before the second access key generation module generates the second access key according to the device key and the first random number. third cloud authentication information and a third random number; the third cloud authentication information is generated by the device cloud platform encrypting the second random number with the device key; the third random number is the generated by the device cloud platform;
所述第二接入密钥生成模块,用于,The second access key generation module is used for,
通过所述设备密钥对所述第二随机数进行加密,生成第四云认证信息;Encrypting the second random number with the device key to generate fourth cloud authentication information;
在根据所述第四云认证信息对所述第三云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥;After passing the authentication on the third cloud authentication information according to the fourth cloud authentication information, generating the second access key according to the device key and the first random number;
所述装置还包括:The device also includes:
第四设备认证信息生成模块,用于通过所述设备密钥对所述第三随机数进行加密,生成第四设备认证信息;a fourth device authentication information generating module, configured to encrypt the third random number by using the device key to generate fourth device authentication information;
所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥,以及所述第四设备认证信息的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the fourth device authentication information to the access cloud platform.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
设备注册码获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的设备注册码;a device registration code obtaining module, configured to obtain the device registration code provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform;
所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
接入认证标识获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的,所述物联网设备的接入认证标识;an access authentication identification acquiring module, configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
图11示出了本申请一个示例性实施例提供的物联网设备接入认证装置的结构框图,该装置可以用于接入云平台中,实现成为接入云平台设备,或者,实现成为接入云平台设备中的一部分,该装置包括:FIG. 11 shows a structural block diagram of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application. The apparatus can be used to access a cloud platform to become an access cloud platform device, or to become an access cloud platform device. Part of the cloud platform equipment, the device includes:
设备信息获取模块1101,用于获取物联网设备的设备信息;A device information acquisition module 1101, configured to acquire device information of an IoT device;
随机数及密钥生成模块1102,用于生成第一随机数和第一接入密钥;a random number and key generation module 1102, configured to generate a first random number and a first access key;
第一随机数发送模块1103,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;A first random number sending module 1103, configured to send the first random number to the device cloud platform corresponding to the IoT device according to the device information of the IoT device;
第一加密密钥接收模块1104,用于接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;a first encryption key receiving module 1104, configured to receive a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
加密密文获取模块1105,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;An encrypted ciphertext obtaining module 1105, configured to encrypt the first access key by using the first encryption key to obtain an encrypted ciphertext;
密文及随机数提供模块1106,用于将所述加密密文以及所述第一随机数,提供给所述物联网设备;a ciphertext and random number providing module 1106, configured to provide the encrypted ciphertext and the first random number to the IoT device;
认证请求接收模块1107,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第 二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;An authentication request receiving module 1107, configured to receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, and the second access key is the IoT device generated according to the device key, the encrypted ciphertext and the first random number;
接入认证模块1108,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module 1108, configured to perform access authentication on the IoT device according to the first access key and the second access key.
在一种可能的实现方式中,所述接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。In a possible implementation manner, the access authentication module is configured to, according to the first access key and the second access key, authenticate the IoT devices perform data connection establishment authentication.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
设备注册码生成模块,用于在所述认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成设备注册码;a device registration code generating module, configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
设备注册码提供模块,用于将所述设备注册码提供给所述物联网设备;a device registration code providing module, configured to provide the device registration code to the IoT device;
所述认证请求接收模块,用于接收携带有所述设备注册码的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the device registration code;
所述接入认证模块,用于,The access authentication module is used for,
根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
在一种可能的实现方式中,所述接入认证模块,用于,In a possible implementation manner, the access authentication module is configured to:
通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
接入认证标识生成模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成所述物联网设备的接入认证标识;an access authentication identifier generating module, configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
关联关系建立模块,用于建立所述接入认证标识与所述第一接入密钥之间的关联关系;an association relationship establishing module, configured to establish an association relationship between the access authentication identifier and the first access key;
接入认证标识提供模块,用于将所述接入认证标识提供给所述物联网设备;an access authentication identifier providing module, configured to provide the access authentication identifier to the Internet of Things device;
所述认证请求接收模块,用于接收携带有所述接入认证标识的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the access authentication identifier;
所述接入认证模块,用于,The access authentication module is used for,
根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
图12示出了本申请一个示例性实施例提供的物联网设备接入认证装置的结构框图,该装置可以用于物联网设备中,实现成为物联网设备,或者,实现成为物联网设备中的一部分,该装置包括:FIG. 12 shows a block diagram of the structure of an IoT device access authentication apparatus provided by an exemplary embodiment of the present application. The apparatus can be used in an IoT device, implemented as an IoT device, or implemented as an IoT device in an IoT device. In part, the device includes:
设备信息提供模块1201,用于向接入云平台提供所述物联网设备的设备信息;A device information providing module 1201, configured to provide device information of the IoT device to the access cloud platform;
密文及随机数获取模块1202,用于获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The ciphertext and random number acquisition module 1202 is configured to acquire the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is obtained by the access cloud platform through the The encrypted ciphertext obtained by encrypting the first access key with the first encryption key; the first encryption key is the first random number encrypted by the device cloud platform of the IoT device through the device key The generated key; the device key is set in the IoT device and the device cloud platform;
第二加密密钥生成模块1203,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;The second encryption key generation module 1203 is configured to encrypt the first random number with the device key, and generate a second encryption key;
第二接入密钥获取模块1204,用于通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;A second access key obtaining module 1204, configured to decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key;
认证请求发送模块1205,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An authentication request sending module 1205 is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to request the access cloud platform according to the first access key. An access key and the second access key are used to perform access authentication on the IoT device.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
设备注册码获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的设备注册码;a device registration code obtaining module, configured to obtain the device registration code provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform;
所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
接入认证标识获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的,所述物联网设备的接入认证标识;an access authentication identification acquiring module, configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
需要说明的是,上述实施例提供的装置在实现其功能时,仅以上述各个功能模块的划分进行举例说明,实际应用中,可以根据实际需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that when the device provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated to different functional modules according to actual needs. The content structure of the device is divided into different functional modules to complete all or part of the functions described above.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
图13示出了本申请一个示例性实施例提供的计算机设备(如物联网设备、接入云平台设备或设备平台云)的结构示意图,该计算机设备包括:处理器131、接收器132、发射器133、存储器134和总线135。FIG. 13 shows a schematic structural diagram of a computer device (such as an Internet of Things device, an access cloud platform device, or a device platform cloud) provided by an exemplary embodiment of the present application. The computer device includes: a processor 131 , a receiver 132 , a transmitter 133, memory 134 and bus 135.
处理器131包括一个或者一个以上处理核心,处理器131通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。The processor 131 includes one or more processing cores, and the processor 131 executes various functional applications and information processing by running software programs and modules.
接收器132和发射器133可以实现为一个通信组件,该通信组件可以是一块通信芯片。The receiver 132 and the transmitter 133 may be implemented as a communication component, which may be a communication chip.
存储器134通过总线135与处理器131相连。The memory 134 is connected to the processor 131 through the bus 135 .
存储器134可用于存储至少一个指令,处理器131用于执行该至少一个指令,以实现上述方法实施例中的各个步骤。The memory 134 may be configured to store at least one instruction, and the processor 131 may be configured to execute the at least one instruction to implement the various steps in the above method embodiments.
此外,存储器134可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(Electrically-Erasable Programmable Read Only Memory,EEPROM),可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM),静态随时存取存储器(Static Random Access Memory,SRAM),只读存储器(Read-Only Memory,ROM),磁存储器,快闪存储器,可编程只读存储器(Programmable Read-Only Memory,PROM)。Additionally, memory 134 may be implemented by any type or combination of volatile or non-volatile storage devices including, but not limited to, magnetic or optical disks, electrically erasable programmable Read Only Memory (Electrically-Erasable Programmable Read Only Memory, EEPROM), Erasable Programmable Read Only Memory (EPROM), Static Random Access Memory (SRAM), Read Only Memory (Read-Only Memory, ROM), magnetic memory, flash memory, programmable read-only memory (Programmable Read-Only Memory, PROM).
在示例性实施例中,所述计算机设备包括处理器、存储器和收发器(该收发器可以包括接收器和发射器,接收器用于接收信息,发射器用于发送信息)。In an exemplary embodiment, the computer device includes a processor, a memory, and a transceiver (the transceiver may include a receiver for receiving information and a transmitter for transmitting information) and a transmitter.
在一种可能的实现方式中,当计算机设备实现为接入云平台设备时,In a possible implementation manner, when the computer device is implemented as a device that accesses the cloud platform,
所述处理器,用于获取物联网设备的设备信息;生成第一随机数;The processor is used for acquiring device information of the IoT device; generating a first random number;
所述收发器,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The transceiver is configured to send the first random number to the device cloud platform according to the device information of the Internet of Things device; receive the first random number generated by the device cloud platform through the device key and the first random number; a first access key; the device key is set in the IoT device and the device cloud platform;
所述处理器,用于将所述第一随机数提供给所述物联网设备;the processor, configured to provide the first random number to the Internet of Things device;
所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key and the first random number;
所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
在一种可能的实现方式中,当计算机设备实现为物联网设备时,In one possible implementation, when the computer device is implemented as an IoT device,
所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The processor is configured to provide device information of the Internet of Things device to the access cloud platform; obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform generated and provided after obtaining the first access key generated by the device cloud platform of the IoT device through the device key and the first random number; the device key is set on the IoT device and in the device cloud platform;
所述处理器,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;the processor, configured to generate a second access key according to the device key and the first random number;
所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first access key. The access key and the second access key are used to perform access authentication on the IoT device.
在一种可能的实现方式中,当计算机设备实现为接入云平台设备时,In a possible implementation manner, when the computer device is implemented as a device connected to the cloud platform,
所述处理器,用于获取物联网设备的设备信息;生成第一随机数和第一接入密钥;The processor is used for acquiring device information of the IoT device; generating a first random number and a first access key;
所述收发器,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;The transceiver is configured to send the first random number to the device cloud platform corresponding to the Internet of Things device according to the device information of the Internet of Things device; the first encryption key generated by encrypting the first random number;
所述处理器,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;将所述加密密文以及所述第一随机数,提供给所述物联网设备;The processor is configured to encrypt the first access key by using the first encryption key to obtain encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT devices;
所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key, the encrypted ciphertext and the first random number;
所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
在一种可能的实现方式中,当计算机设备实现为物联网设备时,In one possible implementation, when the computer device is implemented as an IoT device,
所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;the processor is configured to provide the device information of the Internet of Things device to the access cloud platform; obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the The encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform using the first encryption key to encrypt the first access key; the first encryption key is the device cloud platform of the IoT device through the device A key generated by encrypting the first random number with a key; the device key is set in the IoT device and the device cloud platform;
所述处理器,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;The processor is configured to encrypt the first random number with a device key to generate a second encryption key; decrypt the encrypted ciphertext with the second encryption key to obtain a second access key ;
所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
其中,当计算机设备实现为接入平台云或者物联网设备时,本申请实施例涉及的计算机设备中的处理 器和收发器,可以执行上述图2至图8任一所示的方法中,由接入平台云或者物联网设备执行的步骤,此处不再赘述。Wherein, when the computer device is implemented as an access platform cloud or an Internet of Things device, the processor and transceiver in the computer device involved in the embodiments of the present application may perform any of the methods shown in FIG. 2 to FIG. The steps performed by accessing the platform cloud or the IoT device will not be repeated here.
在示例性实施例中,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现上述各个方法实施例提供的由计算机设备执行的物联网设备接入认证方法。In an exemplary embodiment, a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the methods provided by the foregoing method embodiments. An IoT device access authentication method performed by a computer device.
在示例性实施例中,还提供了一种计算机程序产品,该计算机程序产品在计算机设备的处理器上运行时,使得网络设备执行上述方面所述的物联网设备接入认证方法。In an exemplary embodiment, a computer program product is also provided, which, when running on a processor of a computer device, enables a network device to execute the method for authentication of IoT device access described in the above aspects.
在示例性实施例中,还提供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片在计算机设备上运行时,用于实现上述方面所述的物联网设备接入认证方法。In an exemplary embodiment, a chip is also provided, the chip includes a programmable logic circuit and/or program instructions, when the chip runs on a computer device, for implementing the IoT device described in the above aspects Access authentication method.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.

Claims (49)

  1. 一种物联网设备接入认证方法,其特征在于,所述方法由接入云平台执行,所述方法包括:An Internet of Things device access authentication method, characterized in that the method is performed by an access cloud platform, and the method includes:
    获取物联网设备的设备信息;Obtain device information of IoT devices;
    生成第一随机数;generate a first random number;
    根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;sending the first random number to the device cloud platform according to the device information of the IoT device;
    接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;receiving a first access key generated by the device cloud platform through a device key and the first random number; the device key is set in the IoT device and the device cloud platform;
    将所述第一随机数提供给所述物联网设备;providing the first random number to the Internet of Things device;
    接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;Receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is obtained by the Internet of Things device according to the device key and the generated by the first random number;
    根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the IoT device according to the first access key and the second access key.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数之前,包括:The method according to claim 1, wherein before the sending the first random number to the device cloud platform according to the device information of the Internet of Things device, the method comprises:
    获取所述物联网设备生成的第二随机数;obtaining a second random number generated by the IoT device;
    所述根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数,包括:The sending the first random number to the device cloud platform according to the device information of the IoT device includes:
    根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数;sending the first random number and the second random number to the device cloud platform according to the device information of the IoT device;
    所述接收所述物联网设备通过设备密钥以及所述第一随机数生成的第一接入密钥,包括:The receiving the first access key generated by the IoT device through the device key and the first random number includes:
    接收所述设备云平台通过所述设备密钥对所述第一随机数和所述第二随机数进行加密生成的所述第一接入密钥。Receive the first access key generated by the device cloud platform by encrypting the first random number and the second random number with the device key.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数之前,还包括:The method according to claim 2, wherein before the sending the first random number and the second random number to the device cloud platform according to the device information of the Internet of Things device, the method further comprises:
    获取第一设备认证信息,所述第一设备认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成;Obtain first device authentication information, where the first device authentication information is generated by the Internet of Things device encrypting the second random number by using the device key;
    所述根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数,包括:The sending the first random number and the second random number to the device cloud platform according to the device information of the IoT device includes:
    根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数、所述第二随机数以及所述第一设备认证信息;sending the first random number, the second random number and the first device authentication information to the device cloud platform according to the device information of the IoT device;
    所述接收所述设备云平台通过所述设备密钥对所述第一随机数和所述第二随机数进行加密生成的所述第一接入密钥,包括:The receiving, by the device cloud platform, the first access key generated by encrypting the first random number and the second random number with the device key includes:
    接收所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后发送的所述第一接入密钥、第一云认证信息以及第三随机数;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第一云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;receiving the first access key, the first cloud authentication information and the third random number sent by the device cloud platform after passing the authentication on the first device authentication information according to the second device authentication information; the second The device authentication information is generated by the device cloud platform encrypting the second random number by using the device key; the first cloud authentication information is the device cloud platform encrypting the second random number by using the device key. The second random number and the third random number are encrypted and generated; the third random number is generated by the device cloud platform;
    所述接收所述物联网设备发送的接入认证请求之前,还包括:Before receiving the access authentication request sent by the IoT device, the method further includes:
    将所述第一云认证信息以及所述第三随机数提供给所述物联网设备;providing the first cloud authentication information and the third random number to the IoT device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收所述物联网设备根据第二云认证信息对所述第一云认证信息认证通过后发送的所述接入认证请求;所述第二云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的。Receive the access authentication request sent by the Internet of Things device after passing the authentication of the first cloud authentication information according to the second cloud authentication information; the second cloud authentication information is that the Internet of Things device has passed the device password. The key is generated by encrypting the second random number and the third random number.
  4. 根据权利要求2所述的方法,其特征在于,所述接收所述设备云平台通过所述设备密钥对所述第一随机数和所述第二随机数进行加密生成的所述第一接入密钥,包括:The method according to claim 2, wherein the receiving the first connection generated by the device cloud platform encrypting the first random number and the second random number by using the device key key, including:
    接收所述设备云平台发送的所述第一接入密钥、第三云认证信息、第三设备认证信息、以及第三随机数;所述第三云认证信息是由所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三设备认证信息是所述设备云平台通过所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;Receive the first access key, the third cloud authentication information, the third device authentication information, and the third random number sent by the device cloud platform; the third cloud authentication information is passed by the device cloud platform The device key is generated by encrypting the second random number; the third device authentication information is generated by the device cloud platform by encrypting the third random number; the third random number is the generated by the device cloud platform;
    所述接收所述物联网设备发送的接入认证请求之前,还包括:Before receiving the access authentication request sent by the IoT device, the method further includes:
    将所述第三云认证信息以及所述第三随机数提供给所述物联网设备;providing the third cloud authentication information and the third random number to the IoT device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收所述物联网设备根据第四云认证信息对所述第三云认证信息认证通过后发送的所述接入认证请求;所述第四云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成的;所述接入认证请求中还包括第四设备认证信息,所述第四设备认证信息是所述物联网设备通过所述设备密钥对所 述第三随机数进行加密生成的;Receive the access authentication request sent by the Internet of Things device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information; the fourth cloud authentication information is that the Internet of Things device has passed the device password. The second random number is generated by encrypting the second random number with the key; the access authentication request also includes fourth device authentication information, and the fourth device authentication information is that the IoT device uses the device key to encrypt the second random number. The third random number is encrypted and generated;
    所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The performing access authentication on the IoT device according to the first access key and the second access key includes:
    在根据所述第三设备认证信息对所述第四设备认证信息认证通过后,根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。After passing the authentication on the fourth device authentication information according to the third device authentication information, perform access authentication on the IoT device according to the first access key and the second access key .
  5. 根据权利要求1至4任一所述的方法,其特征在于,所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The method according to any one of claims 1 to 4, wherein the performing access authentication on the Internet of Things device according to the first access key and the second access key, comprising: :
    根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。According to the first access key and the second access key, the Internet of Things device is authenticated for establishing a data connection by means of a TLS/DTLS pre-shared key PSK.
  6. 根据权利要求1至4任一所述的方法,其特征在于,所述接收所述物联网设备发送的接入认证请求之前,还包括:The method according to any one of claims 1 to 4, wherein before the receiving an access authentication request sent by the Internet of Things device, the method further comprises:
    生成设备注册码;Generate device registration code;
    将所述设备注册码提供给所述物联网设备;providing the device registration code to the IoT device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收携带有所述设备注册码的所述接入认证请求;receiving the access authentication request carrying the device registration code;
    所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The performing access authentication on the IoT device according to the first access key and the second access key includes:
    根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  7. 根据权利要求1至4任一所述的方法,其特征在于,所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The method according to any one of claims 1 to 4, wherein the performing access authentication on the Internet of Things device according to the first access key and the second access key, comprising: :
    通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  8. 根据权利要求1至4任一所述的方法,其特征在于,所述接收所述物联网设备发送的接入认证请求之前,还包括:The method according to any one of claims 1 to 4, wherein before the receiving an access authentication request sent by the Internet of Things device, the method further comprises:
    生成所述物联网设备的接入认证标识;generating an access authentication identifier of the IoT device;
    建立所述接入认证标识与所述第一接入密钥之间的关联关系;establishing an association relationship between the access authentication identifier and the first access key;
    将所述接入认证标识提供给所述物联网设备;providing the access authentication identifier to the Internet of Things device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收携带有所述接入认证标识的所述接入认证请求;receiving the access authentication request carrying the access authentication identifier;
    所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The performing access authentication on the IoT device according to the first access key and the second access key includes:
    根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
    根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
  9. 一种物联网设备接入认证方法,其特征在于,所述方法由物联网设备执行,所述方法包括:An Internet of Things device access authentication method, characterized in that the method is performed by the Internet of Things device, and the method includes:
    向接入云平台提供所述物联网设备的设备信息;Provide the device information of the IoT device to the access cloud platform;
    获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;Obtain the first random number provided by the access cloud platform, the first random number is generated by the access cloud platform, and the device cloud platform that obtains the IoT device passes the device key and the first random number. provided after the first access key generated by a random number; the device key is set in the IoT device and the device cloud platform;
    根据所述设备密钥以及所述第一随机数生成第二接入密钥;generating a second access key according to the device key and the first random number;
    向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to match the first access key with the The second access key is used to perform access authentication on the IoT device.
  10. 根据权利要求9所述的方法,其特征在于,所述获取所述接入云平台提供的第一随机数之前,还包括:The method according to claim 9, wherein before acquiring the first random number provided by the access cloud platform, the method further comprises:
    生成第二随机数;generate a second random number;
    向所述接入云平台提供所述第二随机数;providing the second random number to the access cloud platform;
    所述根据所述设备密钥以及所述第一随机数生成第二接入密钥,包括:The generating a second access key according to the device key and the first random number includes:
    通过所述设备密钥对所述第一随机数和所述第二随机数进行加密,生成所述第二接入密钥。The second access key is generated by encrypting the first random number and the second random number with the device key.
  11. 根据权利要求10所述的方法,其特征在于,所述获取所述接入云平台提供的第一随机数之前,还包括:The method according to claim 10, wherein before acquiring the first random number provided by the access cloud platform, the method further comprises:
    通过所述设备密钥对所述第二随机数进行加密,生成第一设备认证信息;Encrypting the second random number with the device key to generate first device authentication information;
    向所述接入云平台提供所述第一设备认证信息;providing the first device authentication information to the access cloud platform;
    所述根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,还包括:Before generating the second access key according to the device key and the first random number, the method further includes:
    获取所述接入云平台提供的第一云认证信息以及第三随机数;所述第三随机数是所述设备云平台生成 的;所述第一云认证信息是由所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后,通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;Obtain the first cloud authentication information and the third random number provided by the access cloud platform; the third random number is generated by the device cloud platform; the first cloud authentication information is stored by the device cloud platform in After the first device authentication information is authenticated according to the second device authentication information, the second random number and the third random number are encrypted and generated by using the device key; the second device authentication information is generated by the device cloud platform encrypting the second random number with the device key;
    所述根据所述设备密钥以及所述第一随机数生成第二接入密钥,包括:The generating a second access key according to the device key and the first random number includes:
    通过所述设备密钥对所述第二随机数和所述第三随机数进行加密,生成第二云认证信息;Encrypting the second random number and the third random number with the device key to generate second cloud authentication information;
    在根据所述第二云认证信息对所述第一云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥。After passing the authentication on the first cloud authentication information according to the second cloud authentication information, the second access key is generated according to the device key and the first random number.
  12. 根据权利要求10所述的方法,其特征在于,所述根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,还包括:The method according to claim 10, wherein before generating the second access key according to the device key and the first random number, the method further comprises:
    获取所述接入云平台提供的第三云认证信息以及第三随机数;所述第三云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;Obtain the third cloud authentication information and the third random number provided by the access cloud platform; the third cloud authentication information is generated by the device cloud platform encrypting the second random number by using the device key ; the third random number is generated by the device cloud platform;
    所述根据所述设备密钥以及所述第一随机数生成第二接入密钥,包括:The generating a second access key according to the device key and the first random number includes:
    通过所述设备密钥对所述第二随机数进行加密,生成第四云认证信息;Encrypting the second random number with the device key to generate fourth cloud authentication information;
    在根据所述第四云认证信息对所述第三云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥;After passing the authentication on the third cloud authentication information according to the fourth cloud authentication information, generating the second access key according to the device key and the first random number;
    所述方法还包括:The method also includes:
    通过所述设备密钥对所述第三随机数进行加密,生成第四设备认证信息;Encrypting the third random number with the device key to generate fourth device authentication information;
    所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求,包括:The sending an access authentication request including the second access key to the access cloud platform includes:
    向所述接入云平台发送包含所述第二接入密钥,以及所述第四设备认证信息的所述接入认证请求。Send the access authentication request including the second access key and the fourth device authentication information to the access cloud platform.
  13. 根据权利要求9至12任一所述的方法,其特征在于,所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,还包括:The method according to any one of claims 9 to 12, wherein before the sending an access authentication request including the second access key to the access cloud platform, the method further comprises:
    获取所述接入云平台提供的设备注册码;Obtain the device registration code provided by the access cloud platform;
    所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求,包括:The sending an access authentication request including the second access key to the access cloud platform includes:
    向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。Send the access authentication request including the second access key and the device registration code to the access cloud platform.
  14. 根据权利要求9至12任一所述的方法,其特征在于,所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,还包括:The method according to any one of claims 9 to 12, wherein before the sending an access authentication request including the second access key to the access cloud platform, the method further comprises:
    获取所述接入云平台提供的,所述物联网设备的接入认证标识;Obtain the access authentication identifier of the IoT device provided by the access cloud platform;
    所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求,包括:The sending an access authentication request including the second access key to the access cloud platform includes:
    向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。Send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  15. 一种物联网设备接入认证方法,其特征在于,所述方法由接入云平台执行,所述方法包括:A method for authentication of IoT device access, characterized in that the method is performed by an access cloud platform, and the method includes:
    获取物联网设备的设备信息;Obtain device information of IoT devices;
    生成第一随机数和第一接入密钥;generating a first random number and a first access key;
    根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;According to the device information of the IoT device, send the first random number to the device cloud platform corresponding to the IoT device;
    接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;receiving a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
    通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;Encrypting the first access key by using the first encryption key to obtain encrypted ciphertext;
    将所述加密密文以及所述第一随机数,提供给所述物联网设备;providing the encrypted ciphertext and the first random number to the IoT device;
    接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;Receive an access authentication request sent by the IoT device, where the access authentication request includes a second access key, where the second access key is obtained by the IoT device according to the device key, the generated by the encrypted ciphertext and the first random number;
    根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the IoT device according to the first access key and the second access key.
  16. 根据权利要求15所述的方法,其特征在于,所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The method according to claim 15, wherein the performing access authentication on the Internet of Things device according to the first access key and the second access key comprises:
    根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。According to the first access key and the second access key, the Internet of Things device is authenticated for establishing a data connection by means of a TLS/DTLS pre-shared key PSK.
  17. 根据权利要求15所述的方法,其特征在于,所述接收所述物联网设备发送的接入认证请求之前,还包括:The method according to claim 15, wherein before the receiving the access authentication request sent by the Internet of Things device, the method further comprises:
    生成设备注册码;Generate device registration code;
    将所述设备注册码提供给所述物联网设备;providing the device registration code to the IoT device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收携带有所述设备注册码的所述接入认证请求;receiving the access authentication request carrying the device registration code;
    所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The performing access authentication on the IoT device according to the first access key and the second access key includes:
    根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  18. 根据权利要求15所述的方法,其特征在于,所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The method according to claim 15, wherein the performing access authentication on the Internet of Things device according to the first access key and the second access key comprises:
    通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  19. 根据权利要求15所述的方法,其特征在于,所述接收所述物联网设备发送的接入认证请求之前,还包括:The method according to claim 15, wherein before the receiving the access authentication request sent by the Internet of Things device, the method further comprises:
    生成所述物联网设备的接入认证标识;generating an access authentication identifier of the IoT device;
    建立所述接入认证标识与所述第一接入密钥之间的关联关系;establishing an association relationship between the access authentication identifier and the first access key;
    将所述接入认证标识提供给所述物联网设备;providing the access authentication identifier to the Internet of Things device;
    所述接收所述物联网设备发送的接入认证请求,包括:The receiving an access authentication request sent by the IoT device includes:
    接收携带有所述接入认证标识的所述接入认证请求;receiving the access authentication request carrying the access authentication identifier;
    所述根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证,包括:The performing access authentication on the IoT device according to the first access key and the second access key includes:
    根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
    根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
  20. 一种物联网设备接入认证方法,其特征在于,所述方法由物联网设备执行,所述方法包括:An Internet of Things device access authentication method, characterized in that the method is performed by the Internet of Things device, and the method includes:
    向接入云平台提供所述物联网设备的设备信息;Provide the device information of the IoT device to the access cloud platform;
    获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;Obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform through the first encryption key for the first access password. The encrypted ciphertext obtained by encrypting the key; the first encryption key is the key generated by the device cloud platform of the Internet of Things device encrypting the first random number with the device key; the device key is set in the IoT device and the device cloud platform;
    通过设备密钥对第一随机数进行加密,生成第二加密密钥;The first random number is encrypted by the device key to generate the second encryption key;
    通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;Decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key;
    向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform to match the first access key with the The second access key is used to perform access authentication on the IoT device.
  21. 根据权利要求20所述的方法,其特征在于,所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,还包括:The method according to claim 20, wherein before the sending an access authentication request including the second access key to the access cloud platform, the method further comprises:
    获取所述接入云平台提供的设备注册码;Obtain the device registration code provided by the access cloud platform;
    所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求,包括:The sending an access authentication request including the second access key to the access cloud platform includes:
    向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。Send the access authentication request including the second access key and the device registration code to the access cloud platform.
  22. 根据权利要求20所述的方法,其特征在于,所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,还包括:The method according to claim 20, wherein before the sending an access authentication request including the second access key to the access cloud platform, the method further comprises:
    获取所述接入云平台提供的,所述物联网设备的接入认证标识;Obtain the access authentication identifier of the IoT device provided by the access cloud platform;
    所述向所述接入云平台发送包含所述第二接入密钥的接入认证请求,包括:The sending an access authentication request including the second access key to the access cloud platform includes:
    向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。Send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  23. 一种物联网设备接入认证装置,其特征在于,所述装置用于接入云平台中,所述装置包括:An IoT device access authentication device, characterized in that the device is used for accessing a cloud platform, and the device includes:
    设备信息获取模块,用于获取物联网设备的设备信息;The device information acquisition module is used to acquire the device information of the IoT device;
    第一随机数生成模块,用于生成第一随机数;a first random number generating module for generating a first random number;
    第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;a first random number sending module, configured to send the first random number to the device cloud platform according to the device information of the IoT device;
    第一接入密钥接收模块,用于接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;a first access key receiving module, configured to receive the first access key generated by the device cloud platform through the device key and the first random number; the device key is set in the IoT device and in the device cloud platform;
    第一随机数提供模块,用于将所述第一随机数提供给所述物联网设备;a first random number providing module, configured to provide the first random number to the Internet of Things device;
    认证请求接收模块,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;The authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key and the first random number;
    接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module, configured to perform access authentication on the IoT device according to the first access key and the second access key.
  24. 根据权利要求23所述的装置,其特征在于,所述装置还包括:The apparatus of claim 23, wherein the apparatus further comprises:
    第二随机数获取模块,用于在第一随机数发送模块根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数之前,获取所述物联网设备生成的第二随机数;The second random number obtaining module is configured to obtain the first random number generated by the IoT device before the first random number sending module sends the first random number to the device cloud platform according to the device information of the IoT device. two random numbers;
    所述第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数;the first random number sending module, configured to send the first random number and the second random number to the device cloud platform according to the device information of the IoT device;
    所述第一接入密钥接收模块,用于接收所述设备云平台通过所述设备密钥对所述第一随机数和所述第二随机数进行加密生成的所述第一接入密钥。The first access key receiving module is configured to receive the first access key generated by the device cloud platform by encrypting the first random number and the second random number with the device key. key.
  25. 根据权利要求24所述的装置,其特征在于,所述装置还包括:The apparatus of claim 24, wherein the apparatus further comprises:
    第一设备认证信息获取模块,用于在第一随机数发送模块根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数和所述第二随机数之前,获取第一设备认证信息,所述第一设备认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成;A first device authentication information acquisition module, configured to acquire the first random number and the second random number before the first random number sending module sends the first random number and the second random number to the device cloud platform according to the device information of the Internet of Things device first device authentication information, where the first device authentication information is generated by the Internet of Things device encrypting the second random number by using the device key;
    所述第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数、所述第二随机数以及所述第一设备认证信息;The first random number sending module is configured to send the first random number, the second random number and the first device authentication information to the device cloud platform according to the device information of the IoT device;
    所述第一接入密钥接收模块,用于接收所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后发送的所述第一接入密钥、第一云认证信息以及第三随机数;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第一云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;The first access key receiving module is configured to receive the first access key, the first access key and the first access key sent by the device cloud platform after passing the authentication of the first device authentication information according to the second device authentication information. Cloud authentication information and a third random number; the second device authentication information is generated by the device cloud platform encrypting the second random number with the device key; the first cloud authentication information is the The device cloud platform encrypts and generates the second random number and the third random number by using the device key; the third random number is generated by the device cloud platform;
    所述装置还包括:The device also includes:
    第一云认证信息提供模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,将所述第一云认证信息以及所述第三随机数提供给所述物联网设备;a first cloud authentication information providing module, configured to provide the first cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
    所述认证请求接收模块,用于接收所述物联网设备根据第二云认证信息对所述第一云认证信息认证通过后发送的所述接入认证请求;所述第二云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的。The authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the first cloud authentication information according to the second cloud authentication information; the second cloud authentication information is the The IoT device encrypts the second random number and the third random number with the device key and generates it.
  26. 根据权利要求24所述的装置,其特征在于,The apparatus of claim 24, wherein:
    所述第一接入密钥接收模块,用于接收所述设备云平台发送的所述第一接入密钥、第三云认证信息、第三设备认证信息、以及第三随机数;所述第三云认证信息是由所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三设备认证信息是所述设备云平台通过所述第三随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;The first access key receiving module is configured to receive the first access key, the third cloud authentication information, the third device authentication information, and the third random number sent by the device cloud platform; the The third cloud authentication information is generated by the device cloud platform by encrypting the second random number with the device key; the third device authentication information is generated by the device cloud platform through the third random number Generated by encryption; the third random number is generated by the device cloud platform;
    所述装置还包括:The device also includes:
    认证信息及随机数提供模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,将所述第三云认证信息以及所述第三随机数提供给所述物联网设备;An authentication information and random number providing module, configured to provide the third cloud authentication information and the third random number to the Internet of Things before the authentication request receiving module receives the access authentication request sent by the Internet of Things device equipment;
    所述认证请求接收模块,用于接收所述物联网设备根据第四云认证信息对所述第三云认证信息认证通过后发送的所述接入认证请求;所述第四云认证信息是所述物联网设备通过所述设备密钥对所述第二随机数进行加密生成的;所述接入认证请求中还包括第四设备认证信息,所述第四设备认证信息是所述物联网设备通过所述设备密钥对所述第三随机数进行加密生成的;The authentication request receiving module is configured to receive the access authentication request sent by the IoT device after passing the authentication of the third cloud authentication information according to the fourth cloud authentication information; the fourth cloud authentication information is the The Internet of Things device encrypts the second random number with the device key; the access authentication request also includes fourth device authentication information, and the fourth device authentication information is the Internet of Things device Generated by encrypting the third random number with the device key;
    所述接入认证模块,用于在根据所述第三设备认证信息对所述第四设备认证信息认证通过后,根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The access authentication module is configured to, according to the first access key and the second access key, authenticate the fourth device authentication information according to the third device authentication information and pass the authentication. The Internet of Things device performs access authentication.
  27. 根据权利要求23至26任一所述的装置,其特征在于,所述接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。The apparatus according to any one of claims 23 to 26, wherein the access authentication module is configured to pre-register through TLS/DTLS according to the first access key and the second access key The data connection establishment authentication is performed on the IoT device in the shared key PSK manner.
  28. 根据权利要求23至26任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 23 to 26, wherein the device further comprises:
    设备注册码生成模块,用于在所述认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成设备注册码;a device registration code generating module, configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
    设备注册码提供模块,用于将所述设备注册码提供给所述物联网设备;a device registration code providing module, configured to provide the device registration code to the IoT device;
    所述认证请求接收模块,用于接收携带有所述设备注册码的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the device registration code;
    所述接入认证模块,用于,The access authentication module is used for,
    根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  29. 根据权利要求23至26任一所述的装置,其特征在于,所述接入认证模块,用于,The device according to any one of claims 23 to 26, wherein the access authentication module is configured to:
    通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  30. 根据权利要求23至26任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 23 to 26, wherein the device further comprises:
    接入认证标识生成模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成所述物联网设备的接入认证标识;an access authentication identifier generating module, configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
    关联关系建立模块,用于建立所述接入认证标识与所述第一接入密钥之间的关联关系;an association relationship establishing module, configured to establish an association relationship between the access authentication identifier and the first access key;
    接入认证标识提供模块,用于将所述接入认证标识提供给所述物联网设备;an access authentication identifier providing module, configured to provide the access authentication identifier to the Internet of Things device;
    所述认证请求接收模块,用于接收携带有所述接入认证标识的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the access authentication identifier;
    所述接入认证模块,用于,The access authentication module is used for,
    根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
    根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
  31. 一种物联网设备接入认证装置,其特征在于,所述装置用于物联网设备中,所述装置包括:An Internet of Things device access authentication device, characterized in that the device is used in Internet of Things devices, and the device includes:
    设备信息提供模块,用于向接入云平台提供所述物联网设备的设备信息;a device information providing module, configured to provide the device information of the IoT device to the access cloud platform;
    第一随机数获取模块,用于获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;A first random number acquisition module, configured to acquire a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform and obtained from the device cloud of the IoT device The platform is provided after the first access key generated by the device key and the first random number; the device key is set in the IoT device and the device cloud platform;
    第二接入密钥生成模块,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;a second access key generation module, configured to generate a second access key according to the device key and the first random number;
    认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。an authentication request sending module, configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  32. 根据权利要求31所述的装置,其特征在于,所述装置还包括:The apparatus of claim 31, wherein the apparatus further comprises:
    第二随机数生成模块,用于在第一随机数获取模块获取所述接入云平台提供的第一随机数之前,生成第二随机数;a second random number generating module, configured to generate a second random number before the first random number obtaining module obtains the first random number provided by the access cloud platform;
    第二随机数提供模块,用于向所述接入云平台提供所述第二随机数;A second random number providing module, configured to provide the second random number to the access cloud platform;
    所述第二接入密钥生成模块,用于通过所述设备密钥对所述第一随机数和所述第二随机数进行加密,生成所述第二接入密钥。The second access key generation module is configured to encrypt the first random number and the second random number by using the device key to generate the second access key.
  33. 根据权利要求32所述的装置,其特征在于,所述装置还包括:The apparatus of claim 32, wherein the apparatus further comprises:
    第一设备认证信息生成模块,用于获取所述接入云平台提供的第一随机数通过所述设备密钥对所述第二随机数进行加密,生成第一设备认证信息;a first device authentication information generation module, configured to obtain the first random number provided by the access cloud platform and encrypt the second random number with the device key to generate first device authentication information;
    第一设备认证信息提供模块,用于向所述接入云平台提供所述第一设备认证信息;a first device authentication information providing module, configured to provide the first device authentication information to the access cloud platform;
    第一云认证信息以及第三随机数获取模块,用于在第二接入密钥生成模块根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,获取所述接入云平台提供的第一云认证信息以及第三随机数;所述第三随机数是所述设备云平台生成的;所述第一云认证信息是由所述设备云平台在根据第二设备认证信息对所述第一设备认证信息认证通过后,通过所述设备密钥对所述第二随机数和所述第三随机数进行加密生成的;所述第二设备认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;The first cloud authentication information and the third random number acquisition module are configured to acquire the access key before the second access key generation module generates the second access key according to the device key and the first random number. The first cloud authentication information and the third random number provided by the cloud access platform; the third random number is generated by the device cloud platform; the first cloud authentication information is generated by the device cloud platform according to the second device The authentication information is generated by encrypting the second random number and the third random number with the device key after passing the authentication of the first device authentication information; the second device authentication information is the device Generated by the cloud platform encrypting the second random number by using the device key;
    所述第二接入密钥生成模块,用于,The second access key generation module is used for,
    通过所述设备密钥对所述第二随机数和所述第三随机数进行加密,生成第二云认证信息;Encrypting the second random number and the third random number with the device key to generate second cloud authentication information;
    在根据所述第二云认证信息对所述第一云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥。After passing the authentication on the first cloud authentication information according to the second cloud authentication information, the second access key is generated according to the device key and the first random number.
  34. 根据权利要求32所述的装置,其特征在于,所述装置还包括:The apparatus of claim 32, wherein the apparatus further comprises:
    认证信息及随机数获取模块,用于在第二接入密钥生成模块根据所述设备密钥以及所述第一随机数生成第二接入密钥之前,获取所述接入云平台提供的第三云认证信息以及第三随机数;所述第三云认证信息是所述设备云平台通过所述设备密钥对所述第二随机数进行加密生成的;所述第三随机数是所述设备云平台生成的;The authentication information and random number acquisition module is configured to acquire the access key provided by the access cloud platform before the second access key generation module generates the second access key according to the device key and the first random number. third cloud authentication information and a third random number; the third cloud authentication information is generated by the device cloud platform encrypting the second random number with the device key; the third random number is the generated by the device cloud platform;
    所述第二接入密钥生成模块,用于,The second access key generation module is used for,
    通过所述设备密钥对所述第二随机数进行加密,生成第四云认证信息;Encrypting the second random number with the device key to generate fourth cloud authentication information;
    在根据所述第四云认证信息对所述第三云认证信息认证通过后,根据所述设备密钥以及所述第一随机数生成所述第二接入密钥;After passing the authentication on the third cloud authentication information according to the fourth cloud authentication information, generating the second access key according to the device key and the first random number;
    所述装置还包括:The device also includes:
    第四设备认证信息生成模块,用于通过所述设备密钥对所述第三随机数进行加密,生成第四设备认证信息;a fourth device authentication information generating module, configured to encrypt the third random number by using the device key to generate fourth device authentication information;
    所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥,以及所述第四设备认证信息的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the fourth device authentication information to the access cloud platform.
  35. 根据权利要求31至34任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 31 to 34, wherein the device further comprises:
    设备注册码获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的设备注册码;a device registration code obtaining module, configured to obtain the device registration code provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform;
    所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
  36. 根据权利要求31至34任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 31 to 34, wherein the device further comprises:
    接入认证标识获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接 入认证请求之前,获取所述接入云平台提供的,所述物联网设备的接入认证标识;an access authentication identification acquiring module, configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
    所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  37. 一种物联网设备接入认证装置,其特征在于,所述装置用于接入云平台中,所述装置包括:An IoT device access authentication device, characterized in that the device is used for accessing a cloud platform, and the device includes:
    设备信息获取模块,用于获取物联网设备的设备信息;The device information acquisition module is used to acquire the device information of the IoT device;
    随机数及密钥生成模块,用于生成第一随机数和第一接入密钥;a random number and key generation module for generating a first random number and a first access key;
    第一随机数发送模块,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;a first random number sending module, configured to send the first random number to a device cloud platform corresponding to the IoT device according to the device information of the IoT device;
    第一加密密钥接收模块,用于接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;a first encryption key receiving module, configured to receive a first encryption key generated by the device cloud platform by encrypting the first random number with the device key;
    加密密文获取模块,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;an encrypted ciphertext obtaining module, configured to encrypt the first access key by using the first encryption key to obtain an encrypted ciphertext;
    密文及随机数提供模块,用于将所述加密密文以及所述第一随机数,提供给所述物联网设备;a ciphertext and random number providing module, configured to provide the encrypted ciphertext and the first random number to the IoT device;
    认证请求接收模块,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;The authentication request receiving module is configured to receive an access authentication request sent by the Internet of Things device, the access authentication request includes a second access key, and the second access key is the Internet of Things device according to generated by the device key, the encrypted ciphertext and the first random number;
    接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。An access authentication module, configured to perform access authentication on the IoT device according to the first access key and the second access key.
  38. 根据权利要求37所述的装置,其特征在于,所述接入认证模块,用于根据所述第一接入密钥与所述第二接入密钥,通过TLS/DTLS预共享密钥PSK方式对所述物联网设备进行数据连接建立认证。The apparatus according to claim 37, wherein the access authentication module is configured to, according to the first access key and the second access key, use a TLS/DTLS pre-shared key (PSK) In this way, the data connection establishment authentication is performed on the IoT device.
  39. 根据权利要求37所述的装置,其特征在于,所述装置还包括:The apparatus of claim 37, wherein the apparatus further comprises:
    设备注册码生成模块,用于在所述认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成设备注册码;a device registration code generating module, configured to generate a device registration code before the authentication request receiving module receives the access authentication request sent by the IoT device;
    设备注册码提供模块,用于将所述设备注册码提供给所述物联网设备;a device registration code providing module, configured to provide the device registration code to the IoT device;
    所述认证请求接收模块,用于接收携带有所述设备注册码的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the device registration code;
    所述接入认证模块,用于,The access authentication module is used for,
    根据所述接入认证请求中携带的所述设备注册码,通过TLS/DTLS预共享密钥PSK方式,与所述物联网设备建立安全数据连接;According to the device registration code carried in the access authentication request, through the TLS/DTLS pre-shared key PSK method, establish a secure data connection with the IoT device;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  40. 根据权利要求37所述的装置,其特征在于,所述接入认证模块,用于,The device according to claim 37, wherein the access authentication module is configured to:
    通过TLS/DTLS匿名方式与所述物联网设备建立安全数据连接;Establish a secure data connection with the IoT device anonymously through TLS/DTLS;
    根据所述第一接入密钥与所述第二接入密钥,进行单向或双向挑战认证。One-way or two-way challenge authentication is performed according to the first access key and the second access key.
  41. 根据权利要求37所述的装置,其特征在于,所述装置还包括:The apparatus of claim 37, wherein the apparatus further comprises:
    接入认证标识生成模块,用于在认证请求接收模块接收所述物联网设备发送的接入认证请求之前,生成所述物联网设备的接入认证标识;an access authentication identifier generating module, configured to generate an access authentication identifier of the IoT device before the authentication request receiving module receives the access authentication request sent by the IoT device;
    关联关系建立模块,用于建立所述接入认证标识与所述第一接入密钥之间的关联关系;an association relationship establishing module, configured to establish an association relationship between the access authentication identifier and the first access key;
    接入认证标识提供模块,用于将所述接入认证标识提供给所述物联网设备;an access authentication identifier providing module, configured to provide the access authentication identifier to the Internet of Things device;
    所述认证请求接收模块,用于接收携带有所述接入认证标识的所述接入认证请求;the authentication request receiving module, configured to receive the access authentication request carrying the access authentication identifier;
    所述接入认证模块,用于,The access authentication module is used for,
    根据所述接入认证请求中携带的所述接入认证标识查询所述关联关系,获得所述第一接入密钥;Query the association relationship according to the access authentication identifier carried in the access authentication request to obtain the first access key;
    根据查询到的所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。Perform access authentication on the Internet of Things device according to the first access key and the second access key obtained through the query.
  42. 一种物联网设备接入认证装置,其特征在于,所述装置用于物联网设备中,所述装置包括:An Internet of Things device access authentication device, characterized in that the device is used in Internet of Things devices, and the device includes:
    设备信息提供模块,用于向接入云平台提供所述物联网设备的设备信息;a device information providing module, configured to provide the device information of the IoT device to the access cloud platform;
    密文及随机数获取模块,用于获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The ciphertext and random number acquisition module is used to acquire the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the encrypted ciphertext is obtained by the access cloud platform through the first random number. An encrypted ciphertext obtained by encrypting the first access key with an encryption key; the first encryption key is generated by the device cloud platform of the IoT device encrypting the first random number with the device key The key of the device; the device key is set in the IoT device and the device cloud platform;
    第二加密密钥生成模块,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;The second encryption key generation module is used for encrypting the first random number by the device key to generate the second encryption key;
    第二接入密钥获取模块,用于通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;A second access key obtaining module, configured to decrypt the encrypted ciphertext by using the second encryption key to obtain a second access key;
    认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。an authentication request sending module, configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  43. 根据权利要求42所述的装置,其特征在于,所述装置还包括:The apparatus of claim 42, wherein the apparatus further comprises:
    设备注册码获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入 认证请求之前,获取所述接入云平台提供的设备注册码;a device registration code acquisition module, configured to acquire the device registration code provided by the access cloud platform before the authentication request sending module sends an access authentication request including the second access key to the access cloud platform;
    所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述设备注册码的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the device registration code to the access cloud platform.
  44. 根据权利要求42所述的装置,其特征在于,所述装置还包括:The apparatus of claim 42, wherein the apparatus further comprises:
    接入认证标识获取模块,用于在认证请求发送模块向所述接入云平台发送包含所述第二接入密钥的接入认证请求之前,获取所述接入云平台提供的,所述物联网设备的接入认证标识;an access authentication identification acquiring module, configured to acquire the access authentication provided by the access cloud platform before the authentication request sending module sends the access authentication request including the second access key to the access cloud platform, the The access authentication logo of the IoT device;
    所述认证请求发送模块,用于向所述接入云平台发送包含所述第二接入密钥以及所述接入认证标识的所述接入认证请求。The authentication request sending module is configured to send the access authentication request including the second access key and the access authentication identifier to the access cloud platform.
  45. 一种接入云平台设备,其特征在于,所述接入云平台设备包括:处理器和与所述处理器相连的收发器;其中,A device for accessing a cloud platform, characterized in that the device for accessing the cloud platform comprises: a processor and a transceiver connected to the processor; wherein,
    所述处理器,用于获取物联网设备的设备信息;生成第一随机数;The processor is used for acquiring device information of the IoT device; generating a first random number;
    所述收发器,用于根据所述物联网设备的设备信息,向所述设备云平台发送所述第一随机数;接收所述设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The transceiver is configured to send the first random number to the device cloud platform according to the device information of the Internet of Things device; receive the first random number generated by the device cloud platform through the device key and the first random number; a first access key; the device key is set in the IoT device and the device cloud platform;
    所述处理器,用于将所述第一随机数提供给所述物联网设备;the processor, configured to provide the first random number to the Internet of Things device;
    所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key and the first random number;
    所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  46. 一种物联网设备,其特征在于,所述物联网设备包括:处理器和与所述处理器相连的收发器;其中,An Internet of Things device, characterized in that the Internet of Things device comprises: a processor and a transceiver connected to the processor; wherein,
    所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的第一随机数,所述第一随机数是由所述接入云平台生成,且获取到所述物联网设备的设备云平台通过设备密钥以及所述第一随机数生成的第一接入密钥之后提供的;所述设备密钥设置在所述物联网设备以及所述设备云平台中;The processor is configured to provide device information of the Internet of Things device to the access cloud platform; obtain a first random number provided by the access cloud platform, where the first random number is generated by the access cloud platform generated and provided after obtaining the first access key generated by the device cloud platform of the IoT device through the device key and the first random number; the device key is set on the IoT device and in the device cloud platform;
    所述处理器,用于根据所述设备密钥以及所述第一随机数生成第二接入密钥;the processor, configured to generate a second access key according to the device key and the first random number;
    所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  47. 一种接入云平台设备,其特征在于,所述接入云平台设备包括:处理器和与所述处理器相连的收发器;其中,A device for accessing a cloud platform, characterized in that the device for accessing the cloud platform comprises: a processor and a transceiver connected to the processor; wherein,
    所述处理器,用于获取物联网设备的设备信息;生成第一随机数和第一接入密钥;the processor, for acquiring device information of the IoT device; generating a first random number and a first access key;
    所述收发器,用于根据所述物联网设备的设备信息,向所述物联网设备对应的设备云平台发送所述第一随机数;接收所述设备云平台通过所述设备密钥对所述第一随机数进行加密生成的第一加密密钥;The transceiver is configured to send the first random number to the device cloud platform corresponding to the Internet of Things device according to the device information of the Internet of Things device; the first encryption key generated by encrypting the first random number;
    所述处理器,用于通过所述第一加密密钥对所述第一接入密钥进行加密,获得加密密文;将所述加密密文以及所述第一随机数,提供给所述物联网设备;The processor is configured to encrypt the first access key by using the first encryption key to obtain encrypted ciphertext; provide the encrypted ciphertext and the first random number to the IoT devices;
    所述收发器,用于接收所述物联网设备发送的接入认证请求,所述接入认证请求中包含第二接入密钥,所述第二接入密钥是所述物联网设备根据所述设备密钥、所述加密密文以及所述第一随机数生成的;The transceiver is configured to receive an access authentication request sent by the Internet of Things device, where the access authentication request includes a second access key, and the second access key is based on the Internet of Things device. generated by the device key, the encrypted ciphertext and the first random number;
    所述处理器,用于根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The processor is configured to perform access authentication on the Internet of Things device according to the first access key and the second access key.
  48. 一种物联网设备,其特征在于,所述物联网设备包括:处理器和与所述处理器相连的收发器;其中,An Internet of Things device, characterized in that the Internet of Things device comprises: a processor and a transceiver connected to the processor; wherein,
    所述处理器,用于向接入云平台提供所述物联网设备的设备信息;获取所述接入云平台提供的加密密文以及所述接入云平台生成的第一随机数;所述加密密文是所述接入云平台通过第一加密密钥对第一接入密钥进行加密获得的加密密文;所述第一加密密钥是所述物联网设备的设备云平台通过设备密钥对所述第一随机数进行加密生成的密钥;所述设备密钥设置在所述物联网设备以及所述设备云平台中;the processor is configured to provide the device information of the Internet of Things device to the access cloud platform; obtain the encrypted ciphertext provided by the access cloud platform and the first random number generated by the access cloud platform; the The encrypted ciphertext is the encrypted ciphertext obtained by the access cloud platform using the first encryption key to encrypt the first access key; the first encryption key is the device cloud platform of the IoT device through the device A key generated by encrypting the first random number with a key; the device key is set in the IoT device and the device cloud platform;
    所述处理器,用于通过设备密钥对第一随机数进行加密,生成第二加密密钥;通过所述第二加密密钥对所述加密密文进行解密,获得第二接入密钥;The processor is configured to encrypt the first random number with a device key to generate a second encryption key; decrypt the encrypted ciphertext with the second encryption key to obtain a second access key ;
    所述收发器,用于向所述接入云平台发送包含所述第二接入密钥的接入认证请求,所述接入认证请求用于请求所述接入云平台根据所述第一接入密钥与所述第二接入密钥,对所述物联网设备进行接入认证。The transceiver is configured to send an access authentication request including the second access key to the access cloud platform, where the access authentication request is used to request the access cloud platform according to the first The access key and the second access key are used to perform access authentication on the IoT device.
  49. 一种计算机可读存储介质,其特征在于,所述可读存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现如权利要求1至22任一所述的物联网设备接入认证方法。A computer-readable storage medium, characterized in that a computer program is stored in the readable storage medium, and the computer program is loaded and executed by a processor to implement the Internet of Things device according to any one of claims 1 to 22 Access authentication method.
PCT/CN2020/134087 2020-12-04 2020-12-04 Internet of things device access authentication method and apparatus, device, and storage medium WO2022116209A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/134087 WO2022116209A1 (en) 2020-12-04 2020-12-04 Internet of things device access authentication method and apparatus, device, and storage medium
CN202080106961.4A CN116420338A (en) 2020-12-04 2020-12-04 Internet of things equipment access authentication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/134087 WO2022116209A1 (en) 2020-12-04 2020-12-04 Internet of things device access authentication method and apparatus, device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022116209A1 true WO2022116209A1 (en) 2022-06-09

Family

ID=81852872

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/134087 WO2022116209A1 (en) 2020-12-04 2020-12-04 Internet of things device access authentication method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN116420338A (en)
WO (1) WO2022116209A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115967735A (en) * 2022-12-30 2023-04-14 广东百德朗科技有限公司 Equipment management method and system based on Internet of things platform
WO2024128649A1 (en) * 2022-12-14 2024-06-20 삼성전자 주식회사 Electronic device for performing authentication and operation method thereof
CN118250103A (en) * 2024-05-29 2024-06-25 杭州政云数据技术有限公司 User authorization method, device, equipment and medium
WO2024139603A1 (en) * 2022-12-27 2024-07-04 中国银联股份有限公司 Bidirectional authentication method and system based on internet of things

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668203B (en) * 2023-08-02 2023-10-20 浙江大华技术股份有限公司 Device authentication method, internet of things device, authentication platform and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603234A (en) * 2015-10-14 2017-04-26 阿里巴巴集团控股有限公司 Method, device and system for device identity authentication
CN109167778A (en) * 2018-08-28 2019-01-08 南京邮电大学 Terminal device is without identity common authentication method in Internet of Things
US20190156019A1 (en) * 2017-11-22 2019-05-23 Aeris Communications, Inc. Secure authentication of devices for internet of things
CN110324287A (en) * 2018-03-31 2019-10-11 华为技术有限公司 Access authentication method, device and server
CN110636062A (en) * 2019-09-20 2019-12-31 百度在线网络技术(北京)有限公司 Method and device for controlling secure interaction of equipment, electronic equipment and storage medium
CN110995432A (en) * 2020-03-05 2020-04-10 杭州字节物联安全技术有限公司 Internet of things sensing node authentication method based on edge gateway
CN112019358A (en) * 2019-05-28 2020-12-01 阿里巴巴集团控股有限公司 Network configuration method, device, equipment and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603234A (en) * 2015-10-14 2017-04-26 阿里巴巴集团控股有限公司 Method, device and system for device identity authentication
US20190156019A1 (en) * 2017-11-22 2019-05-23 Aeris Communications, Inc. Secure authentication of devices for internet of things
CN110324287A (en) * 2018-03-31 2019-10-11 华为技术有限公司 Access authentication method, device and server
CN109167778A (en) * 2018-08-28 2019-01-08 南京邮电大学 Terminal device is without identity common authentication method in Internet of Things
CN112019358A (en) * 2019-05-28 2020-12-01 阿里巴巴集团控股有限公司 Network configuration method, device, equipment and system
CN110636062A (en) * 2019-09-20 2019-12-31 百度在线网络技术(北京)有限公司 Method and device for controlling secure interaction of equipment, electronic equipment and storage medium
CN110995432A (en) * 2020-03-05 2020-04-10 杭州字节物联安全技术有限公司 Internet of things sensing node authentication method based on edge gateway

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GONG CHUN-YAN, ZHU JIAN-YONG: "Study on authentication protocol and key agreement algorithm for IoT of industrial control", INTERNET OF THINGS TECHNOLOGIES, no. 3, 15 March 2013 (2013-03-15), pages 42 - 44, XP055937513, ISSN: 2095-1302, DOI: 10.16667/j.issn.2095-1302.2013.03.020 *
RONG XING, JIANG RONG, TIAN LIYE: "A Group Access Authentication Protocol for Things of Internet", COMPUTER ENGINEERING, vol. 41, no. 3, 15 March 2015 (2015-03-15), CN , pages 15 - 20, XP055937516, ISSN: 1000-3428, DOI: 10.3969/j.issn.1000-3428.2015.03.003 *
SAFKHANI MASOUMEH; BAGHERI NASOUR; KUMARI SARU; TAVAKOLI HAMIDREZA; KUMAR SACHIN; CHEN JIAHUI: "RESEAP: An ECC-Based Authentication and Key Agreement Scheme for IoT Applications", IEEE ACCESS, vol. 8, 28 October 2020 (2020-10-28), USA , pages 200851 - 200862, XP011820067, DOI: 10.1109/ACCESS.2020.3034447 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024128649A1 (en) * 2022-12-14 2024-06-20 삼성전자 주식회사 Electronic device for performing authentication and operation method thereof
WO2024139603A1 (en) * 2022-12-27 2024-07-04 中国银联股份有限公司 Bidirectional authentication method and system based on internet of things
CN115967735A (en) * 2022-12-30 2023-04-14 广东百德朗科技有限公司 Equipment management method and system based on Internet of things platform
CN115967735B (en) * 2022-12-30 2023-10-24 广东百德朗科技有限公司 Equipment management method and system based on Internet of things platform
CN118250103A (en) * 2024-05-29 2024-06-25 杭州政云数据技术有限公司 User authorization method, device, equipment and medium

Also Published As

Publication number Publication date
CN116420338A (en) 2023-07-11

Similar Documents

Publication Publication Date Title
US11178125B2 (en) Wireless network connection method, wireless access point, server, and system
WO2022116209A1 (en) Internet of things device access authentication method and apparatus, device, and storage medium
US10667131B2 (en) Method for connecting network access device to wireless network access point, network access device, and application server
US11496320B2 (en) Registration method and apparatus based on service-based architecture
US10027664B2 (en) Secure simple enrollment
CN102595404B (en) For storing and executing the method and device of access control clients
WO2018077232A1 (en) Network authentication method, and related device and system
CN110770695A (en) Internet of things (IOT) device management
TWI455559B (en) Virtual subscriber identity module
KR101265873B1 (en) Distributed single sign-on service
WO2019041802A1 (en) Discovery method and apparatus based on service-oriented architecture
US9699655B1 (en) Cellular device authentication
US9608971B2 (en) Method and apparatus for using a bootstrapping protocol to secure communication between a terminal and cooperating servers
EP4231680A1 (en) Identity authentication system, method and apparatus, device, and computer readable storage medium
US20160227412A1 (en) Wireless Terminal Configuration Method, Apparatus, and Wireless Terminal
US20190356485A1 (en) Secure methods and systems for identifying bluetooth connected devices with installed application
WO2023083170A1 (en) Key generation method and apparatus, terminal device, and server
JP2020078067A (en) System and method for securely enabling user with mobile device to access capabilities of standalone computing device
WO2013044766A1 (en) Service access method and device for cardless terminal
US11070546B2 (en) Two-user authentication
JP2020010099A (en) Device and method for mediating setting of authentication information
CN115868142A (en) Equipment verification method, equipment and cloud
KR101172876B1 (en) System and method for performing mutual authentication between user terminal and server
WO2022094936A1 (en) Access method, device, and cloud platform device
US12074972B2 (en) Method for updating a secret data in a credential container

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20964054

Country of ref document: EP

Kind code of ref document: A1