WO2024016124A1 - Device configuration methods and apparatuses, and communication device - Google Patents

Device configuration methods and apparatuses, and communication device Download PDF

Info

Publication number
WO2024016124A1
WO2024016124A1 PCT/CN2022/106311 CN2022106311W WO2024016124A1 WO 2024016124 A1 WO2024016124 A1 WO 2024016124A1 CN 2022106311 W CN2022106311 W CN 2022106311W WO 2024016124 A1 WO2024016124 A1 WO 2024016124A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
server
certificate
identification
access token
Prior art date
Application number
PCT/CN2022/106311
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/CN2022/106311 priority Critical patent/WO2024016124A1/en
Publication of WO2024016124A1 publication Critical patent/WO2024016124A1/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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • the embodiments of this application relate to the technical field of the Internet of Things, and specifically relate to a device configuration method and device, and communication equipment.
  • the device When a device wants to access the cloud platform, the device needs to use a preset certificate to access the cloud platform.
  • This method of accessing the cloud platform requires that the device and the cloud platform belong to the same application platform.
  • the device needs to preset a certificate belonging to the same application platform as the cloud platform in advance. Only in this way can the device use the preset certificate to access the cloud platform. .
  • the device and the cloud platform do not belong to the same application platform, the device cannot access the cloud platform. It can be seen that the current solution cannot enable devices to connect to the cloud platform across application platforms.
  • Embodiments of the present application provide an equipment configuration method and device, communication equipment, chips, computer-readable storage media, computer program products, and computer programs.
  • the first device obtains the first certificate and/or the first voucher from the server;
  • the first device configures the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
  • the first application of the second device obtains the first certificate and/or the first credential configured by the first device, the first certificate and/or the first credential being obtained by the first device from the server;
  • the first application establishes a secure connection with the server based on the first certificate and/or registers with the server based on the first credential.
  • the server generates a first certificate and/or a first credential, and sends the first certificate and/or a first credential to the first device; wherein the first certificate and/or the first credential are configured by the first device to The first application in the second device; wherein the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
  • the device configuration device provided by the embodiment of the present application is applied to the first device, and the device includes:
  • An acquisition unit used to acquire the first certificate and/or the first credential from the server
  • a configuration unit configured to configure the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
  • the device configuration device provided by the embodiment of the present application is applied to the second device, and the device includes:
  • An acquisition unit configured to acquire a first certificate and/or a first credential configured by the first device, the first certificate and/or a first credential being obtained by the first device from the server;
  • An access unit configured to establish a secure connection with the server based on the first certificate and/or register with the server based on the first certificate.
  • the device configuration device provided by the embodiment of this application is applied to the server, and the device includes:
  • a generating unit used to generate the first certificate and/or the first voucher
  • a communication unit configured for the first device to send the first certificate and/or the first voucher; wherein the first certificate and/or the first voucher are configured by the first device to the first application in the second device ;
  • the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
  • the communication device provided by the embodiment of the present application includes a processor and a memory.
  • the memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to execute the above device configuration method.
  • the chip provided by the embodiment of this application is used to implement the above device configuration method.
  • the chip includes: a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes the above device configuration method.
  • the computer-readable storage medium provided by the embodiment of the present application is used to store a computer program.
  • the computer program causes the computer to execute the above device configuration method.
  • the computer program product provided by the embodiment of the present application includes computer program instructions, which cause the computer to execute the above device configuration method.
  • the computer program provided by the embodiment of the present application when run on a computer, causes the computer to execute the above device configuration method.
  • the first device applies for the first certificate and/or the first credential from the server for the first application in the second device, and configures the applied first certificate and/or first credential to the first application in the second device.
  • the first application in this way, the first application in the second device can use the first certificate to establish a secure connection with the server and/or use the first credential to register with the server, thereby achieving access to the server. Since the first certificate and/or the first credential are issued by the server to the second device, the first application of the second device uses the first certificate and/or the first credential to access the server and does not require the second device It needs to belong to the same application platform as the server. That is to say, when the second device and the server do not belong to the same application platform, the technical solutions of the embodiments of the present application can be used to enable the second device to access the server and realize the cross-application platform of the device. Access the server.
  • Figure 1 is a schematic diagram of communication between devices provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of a communication architecture provided by an embodiment of the present application.
  • Figure 3 is a flow chart for a device to access the cloud platform
  • FIG. 4 is a schematic flowchart 1 of the device configuration method provided by the embodiment of the present application.
  • Figure 5 is a schematic flow chart 2 of the device configuration method provided by the embodiment of the present application.
  • Figure 6 is a flowchart three of the device configuration method provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart 4 of the device configuration method provided by the embodiment of the present application.
  • Figure 8 is a schematic structural diagram of the equipment configuration device provided by the embodiment of the present application.
  • Figure 9 is a schematic diagram 2 of the structural composition of the equipment configuration device provided by the embodiment of the present application.
  • Figure 10 is a schematic diagram 3 of the structural composition of the equipment configuration device provided by the embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • RESTful operations can be Create-Read-Update-Delete-Notify (Create-Retrieve-Update-Delete- Notify, CRUDN) operation.
  • CRUDN operation can be any one or more of the following operations: Create (Create), Read (Retrieve), Update (Update), Delete (Delete), Notify (Notify).
  • the client is the initiator of RESTful operations
  • the server is the responder of RESTful operations.
  • the client sends a resource operation request to the server, requesting operations on resources on the server.
  • the server performs resource operations and returns a response to the client. , the response carries the content and description information of the resource.
  • the client and server are logical functional entities, and a device can be a client, a server, or both a client and a server.
  • FIG. 1 is a schematic diagram of communication between devices provided by an embodiment of the present application.
  • device 1 serves as a client and device 2 serves as a server.
  • the resource model layer the interaction between the client and the server is implemented through CRUDN operations.
  • the transport protocol layer the interaction between device 1 and device 2 is implemented through request messages or response messages.
  • CRUDN operations are transformed into entity messages that are transmitted between devices, providing means for interconnection between devices.
  • the transmission protocol uses Constrained Application Protocol (CoAP) to carry CRUDN operations, and each CRUDN operation is mapped to a CoAP request message or response message.
  • CoAP Constrained Application Protocol
  • FIG. 2 is a schematic diagram of a communication architecture provided by an embodiment of the present application.
  • the communication architecture includes device 1, device 2 and an Internet of Things (IoT) cloud platform (hereinafter, the IoT cloud platform will be referred to as cloud for short). platform).
  • IoT Internet of Things
  • device 1 serves as the server
  • device 2 serves as the client
  • the interaction between device 1 and device 2 is realized through the cloud platform.
  • the cloud platform includes the following three entities:
  • Cloud interface is the anchor point on the cloud platform and is responsible for the access management of devices (such as device 1 and device 2), as well as message routing for remote communication between devices (such as between device 1 and device 2); cloud interface Provide an address to the outside world, that is, the address of the cloud platform.
  • the address of the cloud platform can be a Uniform Resource Locator (URL).
  • the authorization server is responsible for the registration and authentication of devices (such as device 1 and device 2).
  • Resource directory The resource directory includes the resource index of the server; the client can obtain the resources of the server by searching the resource directory.
  • authorization server can be implemented as an entity in the cloud platform, or as a separate entity independent of the cloud platform.
  • FIG. 3 is a flow chart for device access to the cloud platform, as shown in Figure 3, including the following steps:
  • Step 301 The user applies to the authorization server to create the user's cloud platform account through the configurator in device 2, and the authorization server returns access token (Access Token) 1 to the configurator.
  • access token Access Token
  • the user can select the create account option in the configurator in device 2, enter the username and password, and configure the user's username and password in the configurator.
  • the address of the cloud platform is also configured in the configurator.
  • the configurator can send the user's username and password to the authorization server based on the address of the cloud platform, so that the authorization server can authenticate the user.
  • the authorization server After the authorization server authenticates the user, it generates access token 1 for the user based on the user's user name and password, and sends the access token 1 to the configurator.
  • Step 302 The configurator uses access token 1 to register with the cloud platform.
  • the configurator provides access token 1 to the cloud platform. After the cloud platform verifies that access token 1 is passed, it allocates a user ID (User ID) to the configurator. This user ID is used to identify the user corresponding to the configurator.
  • User ID User ID
  • the authorization server will provide different access tokens, but any configurator used by the same user corresponds to the same user ID.
  • Step 303 The configurator configures the cloud configuration resources in device 1.
  • the configurator connects to device 1 through the device discovery process and then requests access token 2 for device 1 from the cloud platform.
  • the configurator configures access token 2, the address of the cloud platform, and the identity of the cloud platform into the cloud configuration resource in device 1.
  • the cloud configuration resource in device 1 could be the "oic.r.coapcloudconf" resource.
  • Step 304 Device 1 uses the preset certificate to establish a secure connection with the cloud platform.
  • device 1 establishes a physical connection (that is, the underlying connection) with the cloud platform based on the address of the cloud platform and the identity of the cloud platform; device 1 uses a preset certificate to perform mutual authentication with the cloud platform based on the physical connection. After the authentication is completed, the device 1 and the cloud platform obtain each other's public keys, and then generate a shared key based on their own private key and the other party's public key, thereby completing the establishment of a secure connection.
  • a physical connection that is, the underlying connection
  • device 1 uses a preset certificate to perform mutual authentication with the cloud platform based on the physical connection. After the authentication is completed, the device 1 and the cloud platform obtain each other's public keys, and then generate a shared key based on their own private key and the other party's public key, thereby completing the establishment of a secure connection.
  • a secure connection can be a Transport Layer Security (TLS) connection.
  • TLS Transport Layer Security
  • Step 305 Device 1 uses access token 2 to register with the cloud platform based on a secure connection, and publishes the resources of device 1 to the cloud platform.
  • device 1 sends an update operation request to the account resource on the cloud platform.
  • the update operation request includes the access token 2 of device 1.
  • it may also include the device identification (Device ID) of device 1.
  • the cloud platform maintains a unique instance of account resources for each device.
  • the instance corresponding to device 1 includes access token 2 (for example, A0001), the device identification of device 1 (for example, 0xA71CE), and the user identification corresponding to device 1 (for example, is u001).
  • the account resource on the cloud platform can be the "/oic/sec/account” resource.
  • Device 1 After device 1 is registered to the cloud platform, it needs to log in to the cloud platform to publish the resources of device 1 to the cloud platform.
  • Device 1 can log in to the cloud platform in the following ways: Device 1 sends an update operation request to the session resource on the cloud platform. After the cloud platform successfully verifies the update operation request, Device 1 logs in to the cloud platform.
  • the session resource on the cloud platform can be the "/oic/sec/session” resource.
  • device 1 After device 1 logs in to the cloud platform, it exposes the resources it carries in the resource directory of the cloud platform, so that other devices (such as device 2) can remotely access these resources.
  • the cloud platform When device 2 performs a CRUDN operation on a resource referenced by a resource index (such as a resource link) in the resource directory of the cloud platform, the cloud platform forwards the CRUDN operation request to device 1, which actually carries the resource, and device 1 sends the request to the cloud platform. CRUDN operation response, the cloud platform then forwards the CRUDN operation response to device 2, that is, the communication path between device 2 and device 1 is: device 2 ⁇ cloud platform ⁇ device 1 ⁇ cloud platform ⁇ device 2.
  • a resource index such as a resource link
  • device 1 as the server.
  • device 1 can also be registered to the cloud platform through the above process.
  • the authorization server is implemented as a separate entity independent of the cloud platform, after the cloud platform authenticates device 1, the cloud platform shares the authentication result of device 1 with the authorization server.
  • step 304 above if device 1 wants to access the cloud platform, device 1 needs to use a preset certificate to establish a secure connection with the cloud platform.
  • This method of accessing the cloud platform requires that device 1 and the cloud platform belong to the same application platform. In this way, device 1 can use the preset certificate to access the cloud platform.
  • device 1 and the cloud platform do not belong to the same application platform, device 1 cannot access the cloud platform. It can be seen that the current solution cannot enable devices to connect to the cloud platform across application platforms. To this end, the following technical solutions of the embodiments of the present application are proposed.
  • the description of the server can also be replaced by a cloud platform, and the cloud platform can also be referred to as a cloud for short.
  • the first device has a configurator, and the first device can configure other devices (such as a second device) to access the server through the configurator, and the first device with the configurator serves as a client.
  • the description of "first device” can also be replaced by "configuration device”.
  • This application does not limit the name of the first device.
  • the first device may be a terminal device such as a mobile phone or a tablet computer.
  • the first device and the server belong to the same application platform.
  • both the first device and the server belong to the application platform developed by manufacturer A.
  • the second device has a first application, and the second device can control some Internet of Things (IoT) devices that belong to the same application platform as itself through the first application.
  • the second device has the first application.
  • the device acts as a client.
  • the second device may be an IoT device, such as a car.
  • the second device and the server belong to different application platforms.
  • the server belongs to the application platform developed by manufacturer A, and the second device belongs to the application platform developed by manufacturer B.
  • the second device can control another part of IoT devices belonging to the same application platform as the first device through its first application.
  • the first application in the second device may be a smart home application (SmartHome APP). This application does not limit the name of the first application in the second device.
  • the communication between the first device and the second device refers to the communication between the communication module of the first device and the communication module of the second device.
  • the communication module can be a Bluetooth module or a Bluetooth module. WiFi module etc.
  • the communication between the first device and the second device refers to the communication between the configurator of the first device and the first application of the second device.
  • both the configurator and the first application belong to the application. (APP) category, where the configurator of the first device can be a system application of the first device or a third-party application, and the first application of the second device can be a system application of the second device or a third-party application. application.
  • the configurator of the first device and the first application of the second device respectively call respective communication modules to implement communication with each other. Before the first device communicates with the second device, the first device needs to establish a connection with the second device.
  • establishing a connection between the first device and the second device means that the communication module of the first device establishes a connection with the communication module of the second device.
  • the configurator of the first device may also be described as a second application relative to the first application of the second device.
  • interaction between the first device and the first application of the second device described in the following embodiments refers to the interaction between the configurator of the first device and the first application of the second device.
  • the technical solution of the embodiment of the present application is explained with the first device configuring the first application access server in the second device (that is, the second device serves as the client), when the second device serves as the service In the case of the terminal, the technical solutions of the embodiments of the present application can also enable the first device to configure the second device to access the server.
  • FIG. 4 is a schematic flow chart of a device configuration method provided by an embodiment of the present application. As shown in Figure 4, the device configuration method includes the following steps:
  • Step 401 The server generates a first certificate and/or a first voucher, and sends the first certificate and/or a first voucher to the first device; the first device obtains the first certificate and/or the first voucher from the server.
  • the first application of the second device generates a second certificate request (Certificate Signing Request, CSR) message and sends the second certificate request message to the first device; the first device receives the second certificate sent by the first application request message, the first device determines the first certificate request message based on the second certificate request message.
  • CSR Certificate Signing Request
  • the first device may directly use the second certificate request message as the first certificate request message, or may modify the second certificate request message.
  • the first device sends a first certificate request message and/or a certificate application message to the server, where the first certificate request message is used to request the server to be the first
  • the application generates the first certificate, and the certificate application message is used to apply to the server to allocate the first certificate to the first application;
  • the server receives the first certificate request message and/or the certificate application message sent by the first device, and the server generates the first certificate and/or
  • the first certificate sends the first certificate and/or the first voucher to the first device;
  • the first device receives the first certificate and/or the first voucher sent by the server.
  • the first certificate and/or the first credential are carried in the CSR response (CSRResponse) message, that is, the server provides the first certificate and/or the first credential to the first device through the CSR response message.
  • the first device may determine that the first application of the second device wants to access the server.
  • the prerequisites for the first application of the second device to access the server are: Condition 1: The first application establishes a secure connection with the server; Condition 2: The first application registers with the server.
  • the first device needs to apply for a certificate (i.e., first certificate) from the server for the first application, so that the first application can establish a secure connection with the server based on the certificate;
  • the first device needs to The first application applies for a certificate (ie, the first certificate) from the server, so that the first application can register with the server based on the certificate.
  • the first device and the second device need to establish a connection first, and the first application in the second device needs to be started.
  • the first device and the second device may establish a connection through Bluetooth or WiFi.
  • the method of starting the first application in the second device may be, but is not limited to, the following methods:
  • Method 1 The first device sends a startup instruction to the second device, and the startup instruction is used to trigger the second device to start the first application; the second device receives the startup instruction sent by the first device, and starts the first application when triggered by the startup instruction.
  • the startup instruction can be a CSR startup instruction.
  • the first device before the first device sends the startup instruction to the second device, the first device outputs first prompt information, and the first prompt information is used to prompt the user whether to agree to launch the first application; the first device obtains user input for the first application. After confirming the prompt message, a start command is sent to the second device.
  • the first device determines that the second device supports the ability to control the IoT device.
  • the first device can query the capabilities of the second device and determine that the second device supports the capability of controlling the IoT device.
  • the second device reports its own capabilities (ie, the ability to support controlling IoT devices) to the first device, so that the first device determines that the second device supports the ability to control IoT devices.
  • the "ability to control IoT devices" is supported by the first application in the second device, and the "ability to control IoT devices" can also be called the first application capability, such as smart home application capabilities.
  • Method 2 The second device starts the first application based on the obtained startup operation.
  • the first application of the second device determines that the first device supports the ability to configure the IoT device, and outputs the second prompt information, and the second prompt information is used to prompt the user Whether to connect the IoT device configured by the first device; after obtaining the confirmation operation for the second prompt information input by the user, the first application performs the step of sending a second certificate request message to the first device.
  • the "ability to configure IoT devices" is supported by the configurator in the first device, and the "ability to configure IoT devices" can also be called configurator capabilities.
  • the first application after the first application in the second device is started, the first application generates a key pair, that is, a public key and a private key pair, for subsequent use.
  • the first certificate request message and the second certificate request message (hereinafter collectively referred to as the certificate request message) in the above solution conform to the CSR data format defined by PKCS#10 and follow the following principles: the certificate request message carries the certificate request information and the first signature, the first signature is obtained by signing the certificate request information based on the private key of the first application; where,
  • the certificate request information includes version information, subject information and public key information.
  • the version information includes a version number of the certificate request information.
  • the subject information includes feature information of the second device.
  • the public key information includes the public key of the first application. .
  • the characteristic information of the second device includes at least one of the following: a manufacturer identification (Vendor ID) of the second device, a product identification (Product ID) of the second device, a device serial number (Device Serial Number or Device ID) of the second device. ).
  • the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application.
  • the server obtains the public key of the first application based on the first certificate request information (that is, obtains the public key of the first application from the certificate request information in the first certificate request message), based on The public key of the first application verifies the first signature, and after the signature verification is successful, the step of generating the first certificate is performed.
  • the server generates the first certificate based on the public key of the first application; or, the server generates the first certificate based on the public key of the first application and the first application identifier, and the first application identifier is the identifier of the first application.
  • the first application identification is generated by the server, or the first application identification is generated by the first device.
  • the first application identifier is generated by the server. Specifically, after receiving the first certificate request message sent by the first device, the server generates the first application identification for the first application.
  • the first application identifier is generated by the first device. Specifically, after receiving the second certificate request message sent by the first application, the first device generates a first application identification for the first application, and the first device sends the generated first application identification to the server; the server receives the first application identification generated by the first device. The first application identifier.
  • the server after receiving the certificate application message, the server generates the first certificate for the first application.
  • the server allocates a first access token to the first application as the first credential.
  • the first credential is a first access token
  • the first access token is allocated by the server for the first application.
  • the server allocates a first access token to the first application, and encrypts the first access token based on the public key of the first application to obtain a first encryption token as the first certificate.
  • the first credential is a first encryption token.
  • the first encryption token is obtained by the server encrypting the first access token based on the public key of the first application.
  • the first access token is allocated by the server to the first application.
  • the server after the server generates the first access token for the first application, the server establishes a first binding relationship between the first user identification, the first access token and the first application identification, and the first user identification is The user ID corresponding to the first device,
  • the first application identifier is the identifier of the first application; wherein the first binding relationship is used by the server to determine whether to accept registration and/or login of the first application.
  • the first user identification is assigned by the server to the first device when the first device registers with the server.
  • the first device will provide the application identification (called application identification) corresponding to the first device to the server.
  • the second application identifier which can be understood as the identifier of the configurator in the first device
  • the server can determine the user identifier corresponding to the first device based on the application identifier corresponding to the first device.
  • the certificate application message and the first certificate request message in the above solution may be the same message, or they may be two different messages.
  • the certificate request message is used to request the server to generate a first certificate for the first application and/or allocate a first certificate to the first application. certificate.
  • Step 402 The first device configures the first certificate and/or the first credential to the first application in the second device, and the first application of the second device obtains the first certificate and/or the first credential configured by the first device.
  • the first device sends a configuration command to the first application in the second device, and the configuration command carries the first certificate and/or the first credential; after receiving the configuration command, the first application sends the configuration command carried in the configuration command.
  • the first certificate and/or the first credential are configured locally.
  • the configuration command may be an AddCloudRequest command.
  • the first device configures the address of the server to the first application in the second device; wherein the address of the server is used for the first application to establish a physical connection with the server, and the first certificate is used to establish a third application based on the physical connection.
  • a secure connection between an application and the server may be a TLS connection.
  • the address of the server can be a URL or a URI.
  • the first device can also configure the server's identity to the first application in the second device; wherein the server's address and server's identity are used for the first application to establish a physical connection with the server.
  • the first device when the first device does not obtain the first credential from the server, the first device configures the second application identification to the first application; the second application identification is the application identification corresponding to the first device, and the second application The identification is used for the first application to register with the server.
  • the second application identifier is assigned by the server to the first device when the first device registers with the server.
  • the reasons why the first device does not obtain the first credential from the server may be: 1.
  • the first device does not apply to the server to allocate the first credential to the first application; 2.
  • the server is incapable of allocating the first credential to the first application; 3.
  • Step 403 The first application establishes a secure connection with the server based on the first certificate and/or registers with the server based on the first credential.
  • the first application after obtaining the first certificate, the first application establishes a secure connection with the server based on the first certificate.
  • the first application exchanges respective certificates with the server. After the certificate is authenticated by the certificate receiving end, the certificate receiving end obtains the public key of the certificate sending end and generates a share based on the private key of the certificate receiving end and the public key of the certificate sending end. key to complete the establishment of a secure connection; wherein the certificate of the first application is the first certificate.
  • the first application sends the first certificate to the server. Since the first certificate is generated based on the public key of the first application, after the server obtains the first certificate and authenticates the first certificate, it can obtain the first certificate from the first certificate. Obtain the public key of the first application. Similarly, the server will also send its own certificate (hereinafter referred to as the second certificate) to the first application. Since the second certificate is generated based on the server's public key, the first application obtains the second certificate and authenticates the second certificate. After passing, the server's public key can be obtained from the second certificate.
  • the first application uses its own private key and the public key of the server to generate a first shared key, and uses the first shared key to encrypt the data sent to the server and to encrypt the data received from the server. Data is decrypted.
  • the server uses its own private key and the public key of the first application to generate a second shared key, and uses the second shared key to encrypt the data sent to the first application and to encrypt the data received from the first application.
  • the first application data is decrypted.
  • the first application before the first application interacts with the server for respective certificates, the first application obtains the address of the server configured by the first device; the first application establishes a physical connection with the server based on the address of the server, and interacts with the server based on the physical connection. respective certificates.
  • the first application after the first application establishes a secure connection with the server, it can safely interact with the server based on the secure connection.
  • the first application can initiate registration and/or login to the server based on a secure connection, or in other words, the data interacted with the server when the first application registers and/or logs in to the server is encrypted by a shared key.
  • the first application after obtaining the first credential, the first application registers with the server based on the first credential.
  • the first application uses the first access token to register with the server.
  • the first application decrypts the first encryption token based on the private key of the first application to obtain the first access token, and the first application uses The first access token is registered to the server.
  • the first application also obtains a first application identity, and the first application can register with the server using the first application identity and the first credential.
  • the first application obtains the first application identification based on the first certificate.
  • the server receives a registration request message sent by the first application, and the registration request message carries the first application identifier and the first access token; the server determines the first application identifier, the first access token, and the first binding relationship based on the first application identifier, the first access token, and the first binding relationship.
  • the user ID corresponding to an application is the first user ID, and the registration of the first application is accepted.
  • the first application uses the first application identification and the first access token to register with the server
  • the first application uses the first application identification and the first access token to log in to the server.
  • the server receives a login request message sent by the first application, and the login request message carries the first application identifier and the first access token; the server determines the first application identifier based on the first application identifier, the first access token, and the first binding relationship.
  • the user ID corresponding to the application is the first user ID, and the login of the first application is accepted.
  • the first application receives the second access token sent by the server and uses the first application identification and the second access token.
  • Log in to the server Specifically, the server generates a second access token and updates the first access token in the first binding relationship to the second access token; the server sends the second access token to the first application; the server receives the second access token sent by the first application.
  • the login request message carries the first application identification and the second access token; the server determines that the user identification corresponding to the first application is the first user based on the first application identification, the second access token and the first binding relationship. Identifies the first application to accept login.
  • the first application of the second device when the first application of the second device does not obtain the first credential configured by the first device, the first application obtains the second application identification configured by the first device, and the second application identification corresponds to the first device.
  • the application identifier that is, the identifier of the configurator of the second device
  • the first application registers with the server based on the second application identifier.
  • the first application also obtains a first application identification, and the first application can register with the server using the first application identification and the second application identification.
  • the first application obtains the first application identification based on the first certificate.
  • the server receives a registration request message sent by the first application.
  • the registration request message carries a first application identifier and a second application identifier; the first application identifier is the identifier of the first application; the second application identifier is the application corresponding to the first device.
  • the identification is provided by the first device to the first application; the server determines the first user identification corresponding to the second application identification and accepts the registration of the first application.
  • the server after the first application registers with the server using the first application identifier and the second application identifier, the server generates a second access token and sends the second access token to the first application; the first application receives the server Send the second access token to log in to the server using the first application ID and the second access token.
  • the server after the server generates the second access token for the first application, the server establishes a second binding relationship between the first user identification, the second access token and the first application identification, and the first application identification is The identification of the first application; wherein the second binding relationship is used by the server to determine whether to accept the login of the first application.
  • the server receives a login request message sent by the first application, and the login request message carries the first application identifier and the second access token; the server determines the first application identifier based on the first application identifier, the second access token, and the second binding relationship.
  • the user identification corresponding to the application is the first user identification, and the login of the first application is authorized.
  • the first device can be configured to configure the first application access server of the second device.
  • the second device can control some IoT devices belonging to the same application platform as the first device through its first application.
  • IoT devices can be, but are not limited to, smart home devices.
  • the first device is a mobile phone as an example
  • the second device is a car as an example
  • the first application in the second device is a smart home application as an example
  • the server implements a cloud platform as an example.
  • the car as the second device refers to the vehicle-mounted terminal.
  • FIG. 5 is a flow diagram 2 of the device configuration method provided by the embodiment of the present application. As shown in Figure 5, the device configuration method includes the following steps:
  • Step 501 The car establishes a connection with the mobile phone, and the mobile phone obtains the car's ability to support smart home applications.
  • the car and the mobile phone can be connected through Bluetooth or WiFi.
  • the mobile phone can query the car's capabilities and discover that the car supports smart home application capabilities. Or, the car reports its smart home application capabilities to the mobile phone.
  • smart home application capabilities refer to the capabilities supported by smart home applications, that is, the ability to support the control of smart home devices.
  • Step 502 The user confirms using the car to control the smart home device on the mobile phone.
  • a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
  • Step 503 The mobile phone sends a start command to the car, triggering the car to start the smart home application.
  • the mobile phone After the mobile phone obtains the user's confirmation operation of using the car to control the smart home device, it sends a start command to the car, triggering the car to start the smart home application.
  • Step 504 After the car's smart home application is started, a key pair is generated.
  • the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
  • Step 505 The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
  • the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 504)
  • the certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information.
  • the version information includes the version number of the certificate request information.
  • the subject information includes the car’s characteristic information and the public key information.
  • the information includes the public key of the smart home application (ie, the public key generated in step 504).
  • the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
  • Step 506 The mobile phone forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
  • an access token Access Token
  • Step 507 The cloud platform assigns an application identification (APPID) to the smart home application, and uses the application identification and the public key of the smart home application to generate a certificate for the smart home application, and generates an access token for the smart home application, and uses the public key of the smart home application. Encrypt the access token to get the encryption token (CToken).
  • APPID application identification
  • CToken encryption token
  • the mobile phone may also assign an application identification (APPID) to the smart home application and send the application identification to the cloud platform.
  • APPID application identification
  • the cloud platform After the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 507 after the verification passes.
  • the way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
  • Step 508 The cloud platform establishes the binding relationship between the user ID (userID), the application ID (APPID) and the access token (AccessToken).
  • Step 509 The cloud platform returns the certificate and encryption token of the smart home application to the mobile phone.
  • the certificate chain includes at least level 2 certificates.
  • the certificate chain includes a root certificate and a target certificate.
  • the target certificate is the certificate of the smart home application, and the target certificate is signed by the root certificate.
  • the certificate chain includes a root certificate, one or more intermediate certificates, and a target certificate.
  • the target certificate is the certificate of the smart home application.
  • the target certificate is signed by one or more intermediate certificates, and the intermediate certificate is signed by the root certificate.
  • each level of the certificate in the certificate chain needs to be authenticated. After the authentication is passed, it can be determined that the identity of the certificate owner is legal.
  • Step 510 The mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application.
  • the mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application through configuration instructions.
  • the configuration parameters carried by the configuration instructions are shown in Table 2 below, including: Smart Home Application Certificate (SmartHomeAPPCert) , intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), encryption token (CToken), and token validity period (TokenExpiration).
  • SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
  • Step 511 The car's smart home application uses the private key to decrypt the encrypted token, obtain the access token, and complete the configuration.
  • Step 512 The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
  • Step 513 The car's smart home application is registered to the cloud platform using the application ID and access token based on the secure connection.
  • the cloud platform returns a new access token to the car's smart home application.
  • the cloud platform will propose a registration interface.
  • the description of the registration interface is shown in Table 3 below.
  • the HTTP Method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account”.
  • the parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters.
  • the registration request interface parameters are located in the body (Body) of the POST request message, including the access token (AccessToken) and the application identification (APPID).
  • the description of the registration response interface parameters is shown in Table 5 below.
  • the registration response interface parameters are located in the Body of the POST response message, including the access token (AccessToken) and the token validity period (TokenExpiration).
  • Step 514 The car's smart home application uses the application identification and access token (use a new access token if there is a new access token) to log in to the cloud platform.
  • the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
  • FIG. 6 is a schematic flowchart three of the device configuration method provided by the embodiment of the present application. As shown in Figure 6, the device configuration method includes the following steps:
  • Step 601 The car establishes a connection with the mobile phone.
  • the car and the mobile phone can be connected through Bluetooth or WiFi.
  • Step 602 The user starts the smart home application in the car.
  • Step 603 The car's smart home application discovers the configurator capability of the mobile phone, displays a prompt message on its interface, and uses the prompt message to prompt the user whether to connect to the smart home device registered to the cloud platform.
  • Step 604 The user enters a confirmation connection operation on the interface of the car's smart home application.
  • Step 605 The car's smart home application generates a key pair.
  • the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
  • Step 606 The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
  • the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries the certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 604)
  • the certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information.
  • the version information includes the version number of the certificate request information.
  • the subject information includes the car’s characteristic information and the public key information.
  • the information includes the public key of the smart home application (ie, the public key generated in step 604).
  • the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
  • Step 607 The user confirms using the car to control the smart home device on the mobile phone.
  • a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
  • Step 608 The mobile phone forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
  • an access token Access Token
  • the mobile phone After the mobile phone obtains the confirmation operation of the user's consent to use the car to control the smart home device, it forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
  • an access token Access Token
  • Step 609 The cloud platform assigns an application identification (APPID) to the smart home application, and uses the application identification and the public key of the smart home application to generate a certificate for the smart home application, and generates an access token for the smart home application, and uses the public key of the smart home application. Encrypt the access token to get the encryption token (CToken).
  • APPID application identification
  • CToken encryption token
  • the mobile phone may also assign an application identification (APPID) to the smart home application and send the application identification to the cloud platform.
  • APPID application identification
  • the cloud platform After the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 609 after the verification passes.
  • the way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
  • Step 610 The cloud platform establishes the binding relationship between the user ID (userID), the application ID (APPID) and the access token (AccessToken).
  • Step 611 The cloud platform returns the certificate and encryption token of the smart home application to the mobile phone.
  • the parameters returned by the cloud platform to the mobile phone are shown in Table 1 above, including: encryption token (CToken), certificate chain (CertChain), and token validity period (TokenExpiration).
  • Step 612 The mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application.
  • the mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application through configuration instructions.
  • the configuration parameters carried by the configuration instructions are shown in Table 2 above, including: Smart Home Application Certificate (SmartHomeAPPCert) , intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), encryption token (CToken), and token validity period (TokenExpiration).
  • SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
  • Step 613 The car's smart home application uses the private key to decrypt the encrypted token, obtain the access token, and complete the configuration.
  • Step 614 The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
  • Step 615 The car's smart home application is registered to the cloud platform using the application identification and access token based on the secure connection.
  • the cloud platform returns a new access token to the car's smart home application.
  • the cloud platform will propose a registration interface.
  • the description of the registration interface is shown in Table 3 above.
  • the HTTP method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account”.
  • the parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters.
  • the registration request interface parameters are located in the body (Body) of the POST request message, including the access token (AccessToken) and the application identification (APPID).
  • the description of the registration response interface parameters is shown in Table 5 above.
  • the registration response interface parameters are located in the Body of the POST response message, including the access token (AccessToken) and the token validity period (TokenExpiration).
  • Step 616 The car's smart home application uses the application identification and access token (use a new access token if there is a new access token) to log in to the cloud platform.
  • the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
  • FIG. 7 is a schematic flow chart 4 of a device configuration method provided by an embodiment of the present application. As shown in Figure 7, the device configuration method includes the following steps:
  • Step 701 The car establishes a connection with the mobile phone, and the mobile phone obtains the car's ability to support smart home applications.
  • the car and the mobile phone can be connected through Bluetooth or WiFi.
  • the mobile phone can query the car's capabilities and discover that the car supports smart home application capabilities. Or, the car reports its smart home application capabilities to the mobile phone.
  • smart home application capabilities refer to the capabilities supported by smart home applications, that is, the ability to support the control of smart home devices.
  • Step 702 The user confirms using the car to control the smart home device on the mobile phone.
  • a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
  • Step 703 The mobile phone sends a start command to the car, triggering the car to start the smart home application.
  • the mobile phone After the mobile phone obtains the user's confirmation operation of using the car to control the smart home device, it sends a start command to the car, triggering the car to start the smart home application.
  • Step 704 After the car's smart home application is started, a key pair is generated.
  • the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
  • Step 705 The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
  • the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 704)
  • the certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information.
  • the version information includes the version number of the certificate request information.
  • the subject information includes the car’s characteristic information and the public key information.
  • the information includes the public key of the smart home application (ie, the public key generated in step 704).
  • the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
  • Step 706 The mobile phone forwards the CSR message to the cloud platform.
  • Step 707 The cloud platform assigns application identification 1 (APPID1) to the smart home application, and uses application identification 1 and the public key of the smart home application to generate a certificate for the smart home application.
  • APPID1 application identification 1
  • the mobile phone may also allocate application identification 1 (clientID1) to the smart home application, and send the application identification 1 to the cloud platform.
  • clientID1 application identification 1
  • the cloud platform After the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 707 after the verification passes.
  • the way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
  • Step 708 The cloud platform returns the certificate of the smart home application to the mobile phone.
  • the certificate chain includes at least level 2 certificates.
  • the certificate chain includes a root certificate and a target certificate.
  • the target certificate is the certificate of the smart home application, and the target certificate is signed by the root certificate.
  • the certificate chain includes a root certificate, one or more intermediate certificates, and a target certificate.
  • the target certificate is the certificate of the smart home application.
  • the target certificate is signed by one or more intermediate certificates, and the intermediate certificate is signed by the root certificate.
  • each level of the certificate in the certificate chain needs to be authenticated. After the authentication is passed, it can be determined that the identity of the certificate owner is legal.
  • Step 709 The mobile phone configures the certificate of the smart home application, the application identification 2 (APPID2) of the mobile phone, and the address of the cloud platform to the smart home application.
  • APPID2 application identification 2
  • the mobile phone configures the certificate of the smart home application, the application identification 2 of the mobile phone, and the address of the cloud platform to the smart home application through the configuration command.
  • the configuration parameters carried by the configuration command are shown in Table 7 below, including: smart home application certificate ( SmartHomeAPPCert), intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), application identification 2 (APPID2).
  • SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
  • Step 710 The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
  • Step 711 The car's smart home application is registered to the cloud platform using application identification 1 and the mobile phone's application identification 2 based on a secure connection.
  • the cloud platform will propose a registration interface.
  • the description of the registration interface is shown in Table 3 above.
  • the HTTP method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account”.
  • the parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters.
  • the description of the registration request interface parameters is shown in Table 8 below.
  • the registration request interface parameters are located in the body (Body) of the POST request message, including application identification 2 (APPID2) and application identification 1 (APPID1).
  • the description of the registration response interface parameters is shown in Table 9 below.
  • the registration response interface parameters are located in the header (Header) and Body in the POST response message.
  • the header includes the content type (Content-Type), and the body includes the access token (AccessToken) and token. Validity duration (TokenExpiration).
  • Step 712 The cloud platform finds the corresponding user ID (userID) based on the mobile phone's application ID 2, and allocates an access token to the car's smart home application.
  • Step 713 The cloud platform establishes the binding relationship between user ID (userID), application ID 1 (APPID1) and access token (AccessToken).
  • userID user ID
  • APPID1 application ID 1
  • AccessToken access token
  • Step 714 The cloud platform issues an access token to the car's smart home application.
  • Step 715 The car's smart home application uses the application identification 1 and the access token to log in to the cloud platform.
  • the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be used in this application.
  • the implementation of the examples does not constitute any limitations.
  • Figure 8 is a schematic structural diagram of a device configuration device provided by an embodiment of the present application. It is applied to the first device. As shown in Figure 8, it includes:
  • Obtaining unit 801 used to obtain the first certificate and/or first voucher from the server;
  • Configuration unit 802 configured to configure the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used for the first application to establish a relationship with the server. Secure connection, the first credential is used for the first application to register with the server.
  • the device further includes: a communication unit 803; the obtaining unit 801 obtains the first certificate and/or the first voucher through the communication unit 803.
  • the communication unit 803 is used to send a first certificate request message and/or a credential application message to the server.
  • the first certificate request message is used to request the server to generate a first certificate for the first application.
  • the credential application message is used to apply to the server for the first application.
  • the application allocates the first credential; receives the first certificate and/or the first credential sent by the server.
  • the communication unit 803 is also configured to receive a second certificate request message sent by the first application.
  • the second certificate request message is generated by the first application, and the first certificate request message is based on the second certificate request.
  • the news is confirmed.
  • the first certificate request message carries certificate request information and a first signature
  • the second certificate request message carries certificate request information and a first signature
  • the first signature is based on the private key of the first application Obtained by signing the certificate request information
  • the certificate request information includes version information, subject information and public key information
  • the version information includes the version number of the certificate request information
  • the subject information includes feature information of the second device
  • the public key information includes the first application public key
  • the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
  • the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application.
  • the first certificate is generated by the server based on the public key of the first application; or the first certificate is generated by the server based on the public key of the first application and the first application identifier, and the first application identifier is the first application's public key. logo.
  • the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
  • the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application.
  • the communication unit 803 is also configured to send the generated first application identification to server.
  • the first credential is a first access token, and the first access token is allocated by the server for the first application; or the first credential is a first encryption token, and the first encryption token is allocated by the server based on the first application.
  • the first access token is obtained by encrypting the public key of an application, and the first access token is allocated by the server to the first application.
  • the configuration unit 802 when the first device does not obtain the first credential from the server, the configuration unit 802 is also configured to configure the second application identifier to the first application; the second application identifier is the application identifier corresponding to the first device. , the second application identifier is used for the first application to register with the server.
  • the configuration unit 802 is also used to configure the address of the server to the first application in the second device; wherein the address of the server is used for the first application to establish a physical connection with the server, and the first certificate is used for establishing a physical connection with the server based on The physical connection establishes a secure connection between the first application and the server.
  • the communication unit 803 is also used to send a startup instruction to the second device, and the startup instruction is used to trigger the second device to start the first application.
  • the device further includes: a human-computer interaction unit configured to output first prompt information, the first prompt information being used to prompt the user whether to agree to launch the first application; after obtaining user input for the first prompt information After the confirmation operation, a start command is sent to the second device.
  • a human-computer interaction unit configured to output first prompt information, the first prompt information being used to prompt the user whether to agree to launch the first application
  • the apparatus further includes: a determining unit configured to determine that the second device supports the ability to control the IoT device.
  • the second device before the first device receives the certificate request message sent by the first application, the second device starts the first application based on the obtained startup operation.
  • the first device and the server belong to the same application platform, and the second device and the server belong to different application platforms.
  • Figure 9 is a schematic diagram 2 of the structural composition of a device configuration device provided by an embodiment of the present application. It is applied to the second device (specifically, the first application of the second device). As shown in Figure 9, it includes:
  • Obtaining unit 901 configured to obtain the first certificate and/or the first credential configured by the first device, the first certificate and/or the first credential being obtained by the first device from the server;
  • Access unit 902 configured to establish a secure connection with the server based on the first certificate and/or register with the server based on the first certificate.
  • the apparatus further includes: a generating unit 903 and a communication unit 904; the generating unit 903 is used to generate a second certificate request message; the communication unit 904 is used to send the second certificate request message to the first device; The second certificate request message is used by the first device to determine the first certificate request message.
  • the first certificate request message is forwarded by the first device to the server and used to request the server to generate a first certificate for the first application.
  • the first certificate request message carries certificate request information and the first signature
  • the second certificate request message carries the certificate request information and the first signature
  • the first signature is based on the private key pair certificate of the first application
  • the request information is obtained by signing;
  • the certificate request information includes version information, subject information and public key information.
  • the version information includes the version number of the certificate request information.
  • the subject information includes the characteristic information of the second device.
  • the public key information includes the public key of the first application. .
  • the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
  • the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application.
  • the first certificate is generated by the server based on the public key of the first application; or the first certificate is generated by the server based on the public key of the first application and the first application identifier, and the first application identifier is the first application's public key. logo.
  • the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
  • the first application identifier is generated by the first device for the first application after receiving the second certificate request message sent by the first application, and is sent by the first device to the server.
  • the access unit 902 is used to exchange respective certificates with the server. After the certificate is authenticated by the certificate receiving end, the certificate receiving end obtains the public key of the certificate sending end and based on the private key of the certificate receiving end and the certificate sending end. The public key generates a shared key to complete the establishment of a secure connection; the certificate of the first application is the first certificate.
  • the obtaining unit 901 is also used to obtain the address of the server configured by the first device; the access unit 902 is used to establish a physical connection with the server based on the address of the server, and exchange respective certificates with the server based on the physical connection. .
  • the obtaining unit 901 is further configured to obtain the first application identification based on the first certificate, and the first application identification is Register the first application to the server.
  • the first credential is a first access token, and the first access token is allocated by the server for the first application; or the first credential is a first encryption token, and the first encryption token is allocated by the server based on the first application.
  • the first access token is obtained by encrypting the public key of an application, and the first access token is allocated by the server to the first application.
  • the access unit 902 is used to register with the server using the first access token when the first credential is a first access token; or, when the first credential is a first encryption token , decrypt the first encryption token based on the private key of the first application to obtain the first access token, and use the first access token to register with the server.
  • the access unit 902 is configured to register with the server using a first application identification and a first access token, and the first application identification is obtained based on the first certificate.
  • the access unit 902 is used to log in to the server using the first application identification and the first access token; or, to receive the second access token sent by the server and use the first application identification and the second access token. Log in to the server.
  • the obtaining unit 901 is also used to obtain the second application identification of the first device configuration when the first credential configured by the first device is not obtained.
  • the second application identification is the application identification corresponding to the first device.
  • the access unit 902 is configured to register with the server using a first application identification and a second application identification, and the first application identification is obtained based on the first certificate.
  • the communication unit 904 is used to receive the second access token sent by the server; the access unit 902 is used to log in to the server using the first application identification and the second access token.
  • the startup unit is configured to receive a startup instruction sent by the first device, start the first application when triggered by the startup instruction, or start the first application based on the obtained startup operation.
  • the device further includes: a human-computer interaction unit, used to determine the ability of the first device to support the configuration of the IoT device, and to output second prompt information.
  • the second prompt information is used to prompt the user whether to connect to the first device to configure the device.
  • IoT device after obtaining the confirmation operation input by the user for the second prompt information, trigger the communication unit 904 to perform the step of sending a certificate request message to the first device.
  • the first device and the server belong to different application platforms, and the first device and the server belong to the same application platform.
  • Figure 10 is a schematic diagram 3 of the structure of a device configuration device provided by an embodiment of the present application. It is applied to a server. As shown in Figure 10, it includes:
  • Generating unit 1001 used to generate a first certificate and/or a first voucher
  • the communication unit 1002 is configured to send the first certificate and/or first voucher; wherein the first certificate and/or first voucher are configured by the first device to the first application in the second device; wherein , the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
  • the communication unit 1002 is also configured to receive a first certificate request message and/or a certificate application message sent by the first device.
  • the first certificate request message is used to request the server to generate a first certificate for the first application.
  • the certificate The application message is used to apply to the server to allocate the first credential to the first application.
  • the first certificate request message carries certificate request information and a first signature.
  • the first signature is obtained by signing the certificate request information based on the private key of the first application; the certificate request information includes version information, subject information and public key. information, the version information includes the version number of the certificate request information, the subject information includes the characteristic information of the second device, and the public key information includes the public key of the first application.
  • the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
  • the device further includes: a verification unit 1003, configured to obtain the public key of the first application based on the first certificate request information, verify the first signature based on the public key of the first application, and verify After the signature is successful, the generation unit 1001 is triggered to execute the step of generating the first certificate.
  • a verification unit 1003 configured to obtain the public key of the first application based on the first certificate request information, verify the first signature based on the public key of the first application, and verify After the signature is successful, the generation unit 1001 is triggered to execute the step of generating the first certificate.
  • the generating unit 1001 is configured to generate a first certificate based on the public key of the first application; or, generate the first certificate based on the public key of the first application and the first application identifier, and the first application identifier is the first The identification of the application.
  • the generating unit 1001 is further configured to generate a first application identifier for the first application after receiving the first certificate request message sent by the first device.
  • the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application.
  • the communication unit 1002 is also configured to receive the first application generated by the first device. logo.
  • the generating unit 1001 is configured to allocate a first access token to the first application as the first credential; or to allocate the first access token to the first application based on the public key of the first application.
  • An access token is encrypted to obtain the first encrypted token, which serves as the first credential.
  • the apparatus further includes: an establishing unit, configured to establish a first binding relationship between the first user identification, the first access token and the first application identification, and the first user identification is the first device.
  • the corresponding user identification, the first application identification is the identification of the first application; wherein, the first binding relationship is used by the server to determine whether to accept the registration and/or login of the first application.
  • the communication unit 1002 is also configured to receive a registration request message sent by the first application, where the registration request message carries the first application identifier and the first access token; the verification unit 1003 is also configured to based on the first application identifier , the first access token and the first binding relationship, determine the user identification corresponding to the first application as the first user identification, and accept the registration of the first application.
  • the communication unit 1002 is also configured to receive a login request message sent by the first application, where the login request message carries the first application identifier and the first access token; the verification unit 1003 is also configured to based on the first application identifier , the first access token and the first binding relationship determine that the user identification corresponding to the first application is the first user identification, and accept the login of the first application.
  • the generation unit 1001 is also configured to generate a second access token and update the first access token in the first binding relationship to the second access token; the communication unit 1002 is also configured to provide the first access token to the second access token.
  • An application sends a second access token; receives a login request message sent by the first application, the login request message carries the first application identifier and the second access token; the verification unit 1003 is also used to based on the first application identifier, the second access token
  • the token and the first binding relationship determine that the user identification corresponding to the first application is the first user identification, and the login of the first application is accepted.
  • the communication unit 1002 is also configured to receive a registration request message sent by the first application.
  • the registration request message carries the first application identifier and the second application identifier; the first application identifier is the identifier of the first application;
  • the application identification is an application identification corresponding to the first device, and is provided by the first device to the first application; the verification unit 1003 is also configured to determine the first user identification corresponding to the second application identification based on the second application identification, and accept the registration of the first application.
  • the generation unit 1001 is also used to generate a second access token; the communication unit 1002 is also used to send the second access token to the first application; the second access token is used for the first application to log in to server.
  • the establishment unit is also configured to establish a second binding relationship between the first user identification, the second access token and the first application identification, where the first application identification is the identification of the first application; wherein, The second binding relationship is used by the server to determine whether to accept the login of the first application.
  • the communication unit 1002 is also configured to receive a login request message sent by the first application, where the login request message carries the first application identifier and the second access token; the verification unit 1003 is also configured to based on the first application identifier , the second access token and the second binding relationship determine that the user identification corresponding to the first application is the first user identification, and authorize the login of the first application.
  • the server and the first device belong to the same application platform, and the server and the second device belong to different application platforms.
  • Figure 11 is a schematic structural diagram of a communication device 1100 provided by an embodiment of the present application.
  • the communication device can be a first device or a second device or a server.
  • the communication device 1100 shown in Figure 11 includes a processor 1110.
  • the processor 1110 can call and run a computer program from the memory to implement the method in the embodiment of the present application. .
  • the communication device 1100 may further include a memory 1120.
  • the processor 1110 can call and run the computer program from the memory 1120 to implement the method in the embodiment of the present application.
  • the memory 1120 may be a separate device independent of the processor 1110, or may be integrated into the processor 1110.
  • the communication device 1100 may also include a transceiver 1130.
  • the processor 1110 may control the transceiver 1130 to communicate with other devices. Specifically, it may send information or data to other devices, or receive other devices. Information or data sent by the device.
  • the transceiver 1130 may include a transmitter and a receiver.
  • the transceiver 1130 may further include an antenna, and the number of antennas may be one or more.
  • the communication device 1100 may specifically be the first device in the embodiment of the present application, and the communication device 1100 may implement the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For the sake of brevity, they are not mentioned here. Again.
  • the communication device 1100 may specifically be the second device in the embodiment of the present application, and the communication device 1100 may implement the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of brevity, they are not mentioned here. Again.
  • the communication device 1100 can be specifically a server in the embodiment of the present application, and the communication device 1100 can implement the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, details will not be repeated here.
  • Figure 12 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the chip 1200 shown in Figure 12 includes a processor 1210.
  • the processor 1210 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
  • the chip 1200 may also include a memory 1220.
  • the processor 1210 can call and run the computer program from the memory 1220 to implement the method in the embodiment of the present application.
  • the memory 1220 may be a separate device independent of the processor 1210, or may be integrated into the processor 1210.
  • the chip 1200 may also include an input interface 1230.
  • the processor 1210 can control the input interface 1230 to communicate with other devices or chips. Specifically, it can obtain information or data sent by other devices or chips.
  • the chip 1200 may also include an output interface 1240.
  • the processor 1210 can control the output interface 1240 to communicate with other devices or chips. Specifically, it can output information or data to other devices or chips.
  • the chip can be applied to the first device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the first device in the various methods of the embodiment of the present application.
  • the details will not be described again.
  • the chip can be applied to the second device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the second device in the various methods of the embodiment of the present application.
  • the details will not be described again.
  • the chip can be applied to the server in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the server in the various methods of the embodiment of the present application.
  • the details will not be described again.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-chip or system-on-chip, etc.
  • the processor in the embodiment of the present application may be an integrated circuit chip and has signal processing capabilities.
  • each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available processors.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache.
  • RAM Random Access Memory
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • Synchlink DRAM SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the memory in the embodiment of the present application can also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, memories in embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
  • Embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
  • the computer-readable storage medium can be applied to the first device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the first device in the various methods of the embodiment of the present application.
  • I won’t go into details here.
  • the computer-readable storage medium can be applied to the second device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application.
  • I won’t go into details here.
  • the computer-readable storage medium can be applied to the server in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, they will not be described here. Repeat.
  • An embodiment of the present application also provides a computer program product, including computer program instructions.
  • the computer program product can be applied to the first device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
  • the computer program product can be applied to the second device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
  • the computer program product can be applied to the server in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, they will not be described again here. .
  • An embodiment of the present application also provides a computer program.
  • the computer program can be applied to the first device in the embodiment of the present application.
  • the computer program When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the first device in each method of the embodiment of the present application.
  • the computer program When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the first device in each method of the embodiment of the present application.
  • the computer program can be applied to the second device in the embodiment of the present application.
  • the computer program When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application.
  • the computer program When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application.
  • the computer program For the sake of brevity, no further details will be given here.
  • the computer program can be applied to the server in the embodiment of the present application.
  • the computer program When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory,) ROM, random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Abstract

Provided in the embodiments of the present application are a device configuration method and apparatus, and a communication device. The method comprises: a first device acquiring a first certificate and/or a first credential from a server; and the first device configuring a first application in a second device with the first certificate and/or the first credential, wherein the first certificate is used by the first application to establish a secure connection with the server, and the first credential is used by the first application to register to the server.

Description

一种设备配置方法及装置、通信设备Equipment configuration method and device, communication equipment 技术领域Technical field
本申请实施例涉及物联网技术领域,具体涉及一种设备配置方法及装置、通信设备。The embodiments of this application relate to the technical field of the Internet of Things, and specifically relate to a device configuration method and device, and communication equipment.
背景技术Background technique
当一台设备想要接入云平台时,设备需要使用预置的证书来接入云平台。这种接入云平台的方式,就要求设备与云平台属于同一应用平台,设备需要提前预置与云平台属于同一应用平台的证书,如此,设备才能够使用预置的证书来接入云平台。When a device wants to access the cloud platform, the device needs to use a preset certificate to access the cloud platform. This method of accessing the cloud platform requires that the device and the cloud platform belong to the same application platform. The device needs to preset a certificate belonging to the same application platform as the cloud platform in advance. Only in this way can the device use the preset certificate to access the cloud platform. .
然而,在设备与云平台不属于同一应用平台的情况下,该设备是无法接入该云平台的。可见,目前的方案无法做到设备跨应用平台来接入云平台。However, if the device and the cloud platform do not belong to the same application platform, the device cannot access the cloud platform. It can be seen that the current solution cannot enable devices to connect to the cloud platform across application platforms.
发明内容Contents of the invention
本申请实施例提供一种设备配置方法及装置、通信设备、芯片、计算机可读存储介质、计算机程序产品、计算机程序。Embodiments of the present application provide an equipment configuration method and device, communication equipment, chips, computer-readable storage media, computer program products, and computer programs.
本申请实施例提供的设备配置方法,包括:The device configuration method provided by the embodiment of this application includes:
第一设备从服务器获取第一证书和/或第一凭证;The first device obtains the first certificate and/or the first voucher from the server;
所述第一设备将所述第一证书和/或所述第一凭证配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。The first device configures the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
本申请实施例提供的设备配置方法,包括:The device configuration method provided by the embodiment of this application includes:
第二设备的第一应用获取第一设备配置的第一证书和/或第一凭证,所述第一证书和/或第一凭证由所述第一设备从服务器获得;The first application of the second device obtains the first certificate and/or the first credential configured by the first device, the first certificate and/or the first credential being obtained by the first device from the server;
所述第一应用基于所述第一证书与所述服务器建立安全连接和/或基于所述第一凭证注册至所述服务器。The first application establishes a secure connection with the server based on the first certificate and/or registers with the server based on the first credential.
本申请实施例提供的设备配置方法,包括:The device configuration method provided by the embodiment of this application includes:
服务器生成第一证书和/或第一凭证,向第一设备发送所述第一证书和/或第一凭证;其中,所述第一证书和/或第一凭证由所述第一设备配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。The server generates a first certificate and/or a first credential, and sends the first certificate and/or a first credential to the first device; wherein the first certificate and/or the first credential are configured by the first device to The first application in the second device; wherein the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
本申请实施例提供的设备配置装置,应用于第一设备,所述装置包括:The device configuration device provided by the embodiment of the present application is applied to the first device, and the device includes:
获取单元,用于从服务器获取第一证书和/或第一凭证;An acquisition unit, used to acquire the first certificate and/or the first credential from the server;
配置单元,用于将所述第一证书和/或所述第一凭证配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。A configuration unit configured to configure the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
本申请实施例提供的设备配置装置,应用于第二设备,所述装置包括:The device configuration device provided by the embodiment of the present application is applied to the second device, and the device includes:
获取单元,用于获取第一设备配置的第一证书和/或第一凭证,所述第一证书和/或第一凭证由所述第一设备从服务器获得;An acquisition unit, configured to acquire a first certificate and/or a first credential configured by the first device, the first certificate and/or a first credential being obtained by the first device from the server;
接入单元,用于基于所述第一证书与所述服务器建立安全连接和/或基于所述第一凭证注册至所述服务器。An access unit configured to establish a secure connection with the server based on the first certificate and/or register with the server based on the first certificate.
本申请实施例提供的设备配置装置,应用于服务器,所述装置包括:The device configuration device provided by the embodiment of this application is applied to the server, and the device includes:
生成单元,用于生成第一证书和/或第一凭证;A generating unit, used to generate the first certificate and/or the first voucher;
通信单元,用于第一设备发送所述第一证书和/或第一凭证;其中,所述第一证书和/或第一凭证由所述第一设备配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。a communication unit configured for the first device to send the first certificate and/or the first voucher; wherein the first certificate and/or the first voucher are configured by the first device to the first application in the second device ; Wherein, the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
本申请实施例提供的通信设备,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,执行上述的设备配置方法。The communication device provided by the embodiment of the present application includes a processor and a memory. The memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to execute the above device configuration method.
本申请实施例提供的芯片,用于实现上述的设备配置方法。The chip provided by the embodiment of this application is used to implement the above device configuration method.
具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行上述的设备配置方法。Specifically, the chip includes: a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes the above device configuration method.
本申请实施例提供的计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述的设备配置方法。The computer-readable storage medium provided by the embodiment of the present application is used to store a computer program. The computer program causes the computer to execute the above device configuration method.
本申请实施例提供的计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述的设备配置方法。The computer program product provided by the embodiment of the present application includes computer program instructions, which cause the computer to execute the above device configuration method.
本申请实施例提供的计算机程序,当其在计算机上运行时,使得计算机执行上述的设备配置方法。The computer program provided by the embodiment of the present application, when run on a computer, causes the computer to execute the above device configuration method.
通过上述技术方案,第一设备从服务器为第二设备中的第一应用申请第一证书和/或第一凭证,将申请到的第一证书和/或第一凭证配置给第二设备中的第一应用,如此,第二设备中的第一应用可以使用第一证书与服务器建立安全连接和/或使用第一凭证注册至服务器,从而实现接入服务器。由于第一证书和/或第一凭证是由服务器颁发给第二设备的,因此,第二设备的第一应用使用第一证书和/或第一凭证接入服务器,并不会要求第二设备与服务器需要属于同一应用平台,也就是说,在第二设备与服务器不属于同一应用平台的情况下,采用本申请实施例的技术方案能够实现第二设备接入服务器,实现了设备跨应用平台接入服务器。Through the above technical solution, the first device applies for the first certificate and/or the first credential from the server for the first application in the second device, and configures the applied first certificate and/or first credential to the first application in the second device. The first application, in this way, the first application in the second device can use the first certificate to establish a secure connection with the server and/or use the first credential to register with the server, thereby achieving access to the server. Since the first certificate and/or the first credential are issued by the server to the second device, the first application of the second device uses the first certificate and/or the first credential to access the server and does not require the second device It needs to belong to the same application platform as the server. That is to say, when the second device and the server do not belong to the same application platform, the technical solutions of the embodiments of the present application can be used to enable the second device to access the server and realize the cross-application platform of the device. Access the server.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the attached picture:
图1是本申请实施例提供的一种设备之间通信的示意图;Figure 1 is a schematic diagram of communication between devices provided by an embodiment of the present application;
图2是本申请实施例提供的一种通信架构示意图;Figure 2 is a schematic diagram of a communication architecture provided by an embodiment of the present application;
图3是一种设备接入云平台的流程图;Figure 3 is a flow chart for a device to access the cloud platform;
图4是本申请实施例提供的设备配置方法的流程示意图一;Figure 4 is a schematic flowchart 1 of the device configuration method provided by the embodiment of the present application;
图5是本申请实施例提供的设备配置方法的流程示意图二;Figure 5 is a schematic flow chart 2 of the device configuration method provided by the embodiment of the present application;
图6是本申请实施例提供的设备配置方法的流程示意图三;Figure 6 is a flowchart three of the device configuration method provided by the embodiment of the present application;
图7是本申请实施例提供的设备配置方法的流程示意图四;Figure 7 is a schematic flowchart 4 of the device configuration method provided by the embodiment of the present application;
图8是本申请实施例提供的设备配置装置的结构组成示意图一;Figure 8 is a schematic structural diagram of the equipment configuration device provided by the embodiment of the present application;
图9是本申请实施例提供的设备配置装置的结构组成示意图二;Figure 9 is a schematic diagram 2 of the structural composition of the equipment configuration device provided by the embodiment of the present application;
图10是本申请实施例提供的设备配置装置的结构组成示意图三;Figure 10 is a schematic diagram 3 of the structural composition of the equipment configuration device provided by the embodiment of the present application;
图11是本申请实施例提供的一种通信设备示意性结构图;Figure 11 is a schematic structural diagram of a communication device provided by an embodiment of the present application;
图12是本申请实施例的芯片的示意性结构图。Figure 12 is a schematic structural diagram of a chip according to an embodiment of the present application.
具体实施方式Detailed ways
为便于理解本申请实施例的技术方案,以下对本申请实施例的相关技术进行说明,以下相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。In order to facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following related technologies can be optionally combined with the technical solutions of the embodiments of the present application, and they all belong to the embodiments of the present application. protected range.
客户端和服务端的业务交互是通过对资源进行表述状态转移(Representational State Transfer,RESTful)操作来实现的,RESTful操作可以是创建-读取-更新-删除-通知(Create-Retrieve-Update-Delete-Notify,CRUDN)操作,显然,CRUDN操作可以是以下任意一种或多种操作:创建(Create)、 读取(Retrieve)、更新(Update)、删除(Delete)、通知(Notify)。客户端是RESTful操作的发起方,服务端是RESTful操作的响应方,客户端向服务端发送资源操作请求,请求对服务端上的资源进行操作,服务端执行资源操作,并向客户端返回响应,响应中携带资源的内容及描述信息。需要说明的是,客户端和服务端是逻辑功能实体,一个设备可以是客户端、或服务端、或既是客户端又是服务端。The business interaction between the client and the server is realized by performing Representational State Transfer (RESTful) operations on resources. RESTful operations can be Create-Read-Update-Delete-Notify (Create-Retrieve-Update-Delete- Notify, CRUDN) operation. Obviously, the CRUDN operation can be any one or more of the following operations: Create (Create), Read (Retrieve), Update (Update), Delete (Delete), Notify (Notify). The client is the initiator of RESTful operations, and the server is the responder of RESTful operations. The client sends a resource operation request to the server, requesting operations on resources on the server. The server performs resource operations and returns a response to the client. , the response carries the content and description information of the resource. It should be noted that the client and server are logical functional entities, and a device can be a client, a server, or both a client and a server.
图1是本申请实施例提供的一种设备之间通信的示意图,如图1所示,设备1作为客户端,设备2作为服务端。在资源模型层,客户端与服务端之间的交互通过CRUDN操作来实现。在传输协议层,设备1与设备2之间的交互通过请求消息或响应消息来实现。在资源模型层和传输协议层之间,通过把CRUDN操作映射到具体的传输协议中,使CRUDN操作转变为实体消息在设备间传递,为设备间的互联互通提供手段。其中,传输协议采用受限应用协议(Constrained Application Protocol,CoAP)承载CRUDN操作,每个CRUDN操作都映射为CoAP的请求消息或响应消息。Figure 1 is a schematic diagram of communication between devices provided by an embodiment of the present application. As shown in Figure 1, device 1 serves as a client and device 2 serves as a server. At the resource model layer, the interaction between the client and the server is implemented through CRUDN operations. At the transport protocol layer, the interaction between device 1 and device 2 is implemented through request messages or response messages. Between the resource model layer and the transport protocol layer, by mapping CRUDN operations to specific transport protocols, CRUDN operations are transformed into entity messages that are transmitted between devices, providing means for interconnection between devices. Among them, the transmission protocol uses Constrained Application Protocol (CoAP) to carry CRUDN operations, and each CRUDN operation is mapped to a CoAP request message or response message.
图2是本申请实施例提供的一种通信架构示意图,如图2所示,通信架构包括设备1、设备2和物联网(Internet of Things,IoT)云平台(以下将IoT云平台简称为云平台)。其中,设备1作为服务端,设备2作为客户端,设备1和设备2之间通过云平台实现交互。云平台包括以下三个实体:Figure 2 is a schematic diagram of a communication architecture provided by an embodiment of the present application. As shown in Figure 2, the communication architecture includes device 1, device 2 and an Internet of Things (IoT) cloud platform (hereinafter, the IoT cloud platform will be referred to as cloud for short). platform). Among them, device 1 serves as the server, device 2 serves as the client, and the interaction between device 1 and device 2 is realized through the cloud platform. The cloud platform includes the following three entities:
云端接口:云端接口是云平台上的锚点,负责设备(如设备1、设备2)的接入管理,以及设备之间(如设备1和设备2之间)远程通信的消息路由;云端接口对外提供一个地址,即云平台的地址。作为示例:云平台的地址可以是一个统一资源定位符(Uniform Resource Locator,URL)。Cloud interface: The cloud interface is the anchor point on the cloud platform and is responsible for the access management of devices (such as device 1 and device 2), as well as message routing for remote communication between devices (such as between device 1 and device 2); cloud interface Provide an address to the outside world, that is, the address of the cloud platform. As an example: the address of the cloud platform can be a Uniform Resource Locator (URL).
授权服务器:授权服务器负责设备(如设备1、设备2)的注册、鉴权等。Authorization server: The authorization server is responsible for the registration and authentication of devices (such as device 1 and device 2).
资源目录:资源目录包括服务端的资源索引;客户端可以通过检索资源目录获取服务端的资源。Resource directory: The resource directory includes the resource index of the server; the client can obtain the resources of the server by searching the resource directory.
需要说明的是,授权服务器可以作为云平台中的一个实体来实现,也可以独立于云平台作为一个单独的实体来实现。It should be noted that the authorization server can be implemented as an entity in the cloud platform, or as a separate entity independent of the cloud platform.
在设备1和设备2之间通过云平台实现交互之前,设备1和设备2需要接入云平台,图3是一种设备接入云平台的流程图,如图3所示,包括以下步骤:Before interaction between device 1 and device 2 can be achieved through the cloud platform, device 1 and device 2 need to access the cloud platform. Figure 3 is a flow chart for device access to the cloud platform, as shown in Figure 3, including the following steps:
步骤301:用户通过设备2中的配置器向授权服务器申请创建该用户的云平台账户,授权服务器向配置器返回访问令牌(Access Token)1。Step 301: The user applies to the authorization server to create the user's cloud platform account through the configurator in device 2, and the authorization server returns access token (Access Token) 1 to the configurator.
这里,用户可以在设备2中的配置器中选择创建账户选项,并输入用户名和密码,将该用户的用户名和密码配置在配置器中,此外,配置器中还配置了云平台的地址。如此,配置器可以基于云平台的地址将该用户的用户名和密码发送给授权服务器,使得授权服务器可以对该用户进行鉴权。授权服务器对该用户进行鉴权通过后,基于该用户的用户名和密码为该用户生成访问令牌1,将该访问令牌1发送给配置器。Here, the user can select the create account option in the configurator in device 2, enter the username and password, and configure the user's username and password in the configurator. In addition, the address of the cloud platform is also configured in the configurator. In this way, the configurator can send the user's username and password to the authorization server based on the address of the cloud platform, so that the authorization server can authenticate the user. After the authorization server authenticates the user, it generates access token 1 for the user based on the user's user name and password, and sends the access token 1 to the configurator.
步骤302:配置器使用访问令牌1注册至云平台。Step 302: The configurator uses access token 1 to register with the cloud platform.
这里,配置器向云平台提供访问令牌1,云平台验证访问令牌1通过后为配置器分配一个用户标识(User ID),该用户标识用于标识配置器对应的用户。Here, the configurator provides access token 1 to the cloud platform. After the cloud platform verifies that access token 1 is passed, it allocates a user ID (User ID) to the configurator. This user ID is used to identify the user corresponding to the configurator.
这里,同一个用户用不同的配置器时,授权服务器会提供不同的访问令牌,但同一个用户使用的任何配置器都对应同一个用户标识。Here, when the same user uses different configurators, the authorization server will provide different access tokens, but any configurator used by the same user corresponds to the same user ID.
步骤303:配置器配置设备1中的云配置资源。Step 303: The configurator configures the cloud configuration resources in device 1.
这里,配置器通过设备发现流程连接到设备1,然后从云平台为设备1请求访问令牌2。配置器将访问令牌2、云平台的地址和云平台的标识配置到设备1中的云配置资源中。作为示例:设备1中的云配置资源可以是“oic.r.coapcloudconf”资源。Here, the configurator connects to device 1 through the device discovery process and then requests access token 2 for device 1 from the cloud platform. The configurator configures access token 2, the address of the cloud platform, and the identity of the cloud platform into the cloud configuration resource in device 1. As an example: the cloud configuration resource in device 1 could be the "oic.r.coapcloudconf" resource.
步骤304:设备1使用预置的证书与云平台建立安全连接。Step 304: Device 1 uses the preset certificate to establish a secure connection with the cloud platform.
这里,设备1基于云平台的地址和云平台的标识与云平台建立物理连接(也即底层连接);设备1基于物理连接使用预置的证书与云平台进行相互认证,在认证完成后,设备1和云平台之间获得彼此的公钥,进而基于自身的私钥和对方的公钥生成共享密钥,从而完成安全连接的建立。Here, device 1 establishes a physical connection (that is, the underlying connection) with the cloud platform based on the address of the cloud platform and the identity of the cloud platform; device 1 uses a preset certificate to perform mutual authentication with the cloud platform based on the physical connection. After the authentication is completed, the device 1 and the cloud platform obtain each other's public keys, and then generate a shared key based on their own private key and the other party's public key, thereby completing the establishment of a secure connection.
作为示例:安全连接可以是安全传输层协议(Transport Layer Security,TLS)连接。As an example: a secure connection can be a Transport Layer Security (TLS) connection.
步骤305:设备1基于安全连接使用访问令牌2注册至云平台,并向云平台发布设备1的资源。Step 305: Device 1 uses access token 2 to register with the cloud platform based on a secure connection, and publishes the resources of device 1 to the cloud platform.
这里,设备1向云平台上的账号资源发送更新操作请求,该更新操作请求包括设备1的访问令 牌2,此外,还可以包括设备1的设备标识(Device ID)。云平台上为每个设备维护账号资源的唯一实例,例如设备1对应的实例包括访问令牌2(例如是A0001)、设备1的设备标识(例如是0xA71CE)、设备1对应的用户标识(例如是u001)。Here, device 1 sends an update operation request to the account resource on the cloud platform. The update operation request includes the access token 2 of device 1. In addition, it may also include the device identification (Device ID) of device 1. The cloud platform maintains a unique instance of account resources for each device. For example, the instance corresponding to device 1 includes access token 2 (for example, A0001), the device identification of device 1 (for example, 0xA71CE), and the user identification corresponding to device 1 (for example, is u001).
作为示例:云平台上的账号资源可以是“/oic/sec/account”资源。As an example: the account resource on the cloud platform can be the "/oic/sec/account" resource.
这里,设备1注册至云平台后,需要登录至云平台才能向云平台发布设备1的资源。设备1登录至云平台可以通过以下方式实现:设备1向云平台上的会话资源发送更新操作请求,云平台成功验证该更新操作请求后,便实现了设备1登录至云平台。Here, after device 1 is registered to the cloud platform, it needs to log in to the cloud platform to publish the resources of device 1 to the cloud platform. Device 1 can log in to the cloud platform in the following ways: Device 1 sends an update operation request to the session resource on the cloud platform. After the cloud platform successfully verifies the update operation request, Device 1 logs in to the cloud platform.
作为示例:云平台上的会话资源可以是“/oic/sec/session”资源。As an example: the session resource on the cloud platform can be the "/oic/sec/session" resource.
设备1登录至云平台后,在云平台的资源目录中公开其承载的资源,以便于其他设备(如设备2)对这些资源进行远程访问。After device 1 logs in to the cloud platform, it exposes the resources it carries in the resource directory of the cloud platform, so that other devices (such as device 2) can remotely access these resources.
当设备2向云平台的资源目录中的某个资源索引(如资源链接)引用的资源请求执行CRUDN操作时,云平台将CRUDN操作请求转发给实际承载资源的设备1,设备1向云平台发送CRUDN操作响应,云平台再将CRUDN操作响应转发给设备2,即设备2与设备1之间的通信路径是:设备2→云平台→设备1→云平台→设备2。When device 2 performs a CRUDN operation on a resource referenced by a resource index (such as a resource link) in the resource directory of the cloud platform, the cloud platform forwards the CRUDN operation request to device 1, which actually carries the resource, and device 1 sends the request to the cloud platform. CRUDN operation response, the cloud platform then forwards the CRUDN operation response to device 2, that is, the communication path between device 2 and device 1 is: device 2 → cloud platform → device 1 → cloud platform → device 2.
上述流程是以设备1作为服务端进行说明的,当然,设备1作为客户端时,也可以通过上述流程实现将设备1注册至云平台。The above process is explained with device 1 as the server. Of course, when device 1 serves as the client, device 1 can also be registered to the cloud platform through the above process.
需要说明的是,授权服务器如果独立于云平台作为一个单独的实体来实现,云平台在认证完设备1之后,云平台向授权服务器共享设备1的认证结果。It should be noted that if the authorization server is implemented as a separate entity independent of the cloud platform, after the cloud platform authenticates device 1, the cloud platform shares the authentication result of device 1 with the authorization server.
上述流程中,设备1想要接入云平台,需要设备1使用预置的证书与云平台建立安全连接(即上述步骤304)。这种接入云平台的方式,就要求设备1与云平台属于同一应用平台,如此,设备1才能够使用预置的证书来接入云平台。然而,在设备1与云平台不属于同一应用平台的情况下,设备1是无法接入该云平台的。可见,目前的方案无法做到设备跨应用平台来接入云平台。为此,提出了本申请实施例的以下技术方案。In the above process, if device 1 wants to access the cloud platform, device 1 needs to use a preset certificate to establish a secure connection with the cloud platform (ie, step 304 above). This method of accessing the cloud platform requires that device 1 and the cloud platform belong to the same application platform. In this way, device 1 can use the preset certificate to access the cloud platform. However, when device 1 and the cloud platform do not belong to the same application platform, device 1 cannot access the cloud platform. It can be seen that the current solution cannot enable devices to connect to the cloud platform across application platforms. To this end, the following technical solutions of the embodiments of the present application are proposed.
为便于理解本申请实施例的技术方案,以下通过具体实施例详述本申请的技术方案。以上相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。本申请实施例包括以下内容中的至少部分内容。In order to facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application. The embodiments of this application include at least part of the following contents.
本申请实施例中,关于服务器的描述也可以替换为云平台,云平台也可以简称为云。In the embodiment of this application, the description of the server can also be replaced by a cloud platform, and the cloud platform can also be referred to as a cloud for short.
本申请实施例中,第一设备具有配置器,第一设备可以通过该配置器配置其他设备(如第二设备)接入服务器,具有配置器的第一设备作为客户端。关于“第一设备”的描述也可以替换为“配置设备”,本申请对第一设备的名称不做限定。作为示例:第一设备可以是手机、平板电脑等终端设备。第一设备与服务器属于同一应用平台。作为示例:第一设备与服务器均属于A厂家开发的应用平台。In this embodiment of the present application, the first device has a configurator, and the first device can configure other devices (such as a second device) to access the server through the configurator, and the first device with the configurator serves as a client. The description of "first device" can also be replaced by "configuration device". This application does not limit the name of the first device. As an example: the first device may be a terminal device such as a mobile phone or a tablet computer. The first device and the server belong to the same application platform. As an example: both the first device and the server belong to the application platform developed by manufacturer A.
本申请实施例中,第二设备具有第一应用,第二设备可以通过该第一应用控制与自身属于同一应用平台的一部分物联网(Internet of Things,IoT)设备,具有第一应用的第二设备作为客户端。作为示例:第二设备可以是IoT设备,例如车。第二设备与服务器属于不同的应用平台。作为示例:服务器属于A厂家开发的应用平台,第二设备属于B厂家开发的应用平台。当第一设备通过其配置器配置第二设备的第一应用接入服务器后,第二设备可以通过其第一应用控制与第一设备属于同一应用平台的另一部分IoT设备。作为示例:第二设备中的第一应用可以是智能家居应用(SmartHome APP)。本申请对第二设备中的第一应用的名称不做限定。In the embodiment of this application, the second device has a first application, and the second device can control some Internet of Things (IoT) devices that belong to the same application platform as itself through the first application. The second device has the first application. The device acts as a client. As an example: the second device may be an IoT device, such as a car. The second device and the server belong to different application platforms. As an example: the server belongs to the application platform developed by manufacturer A, and the second device belongs to the application platform developed by manufacturer B. After the first device configures the first application of the second device to access the server through its configurator, the second device can control another part of IoT devices belonging to the same application platform as the first device through its first application. As an example: the first application in the second device may be a smart home application (SmartHome APP). This application does not limit the name of the first application in the second device.
本申请实施例中,从底层通信来说,第一设备与第二设备之间的通信是指第一设备的通信模块与第二设备的通信模块之间的通信,通信模块可以是蓝牙模块或者WiFi模块等。从应用层通信来说,第一设备与第二设备之间的通信是指第一设备的配置器与第二设备的第一应用之间的通信,这里,配置器和第一应用都属于应用(APP)范畴,其中,第一设备的配置器可以是第一设备的系统应用或者也可以是第三方应用,第二设备的第一应用可以是第二设备的系统应用或者也可以是第三方应用。第一设备的配置器和第二设备的第一应用分别调用各自的通信模块实现相互之间的通信。第一设备与第二设备进行通信之前,第一设备需要与第二设备建立连接,这里,第一设备与第二设备建立连接是指第一设备的通信模块与第二设备的通信模块建立连接。相对于第二设备的第一应用来说,第一设备的配置器也可以被描述为第二应用。In the embodiment of this application, from the perspective of bottom-level communication, the communication between the first device and the second device refers to the communication between the communication module of the first device and the communication module of the second device. The communication module can be a Bluetooth module or a Bluetooth module. WiFi module etc. In terms of application layer communication, the communication between the first device and the second device refers to the communication between the configurator of the first device and the first application of the second device. Here, both the configurator and the first application belong to the application. (APP) category, where the configurator of the first device can be a system application of the first device or a third-party application, and the first application of the second device can be a system application of the second device or a third-party application. application. The configurator of the first device and the first application of the second device respectively call respective communication modules to implement communication with each other. Before the first device communicates with the second device, the first device needs to establish a connection with the second device. Here, establishing a connection between the first device and the second device means that the communication module of the first device establishes a connection with the communication module of the second device. . The configurator of the first device may also be described as a second application relative to the first application of the second device.
需要说明的是,以下实施例中描述的第一设备与第二设备的第一应用之间的交互是指第一设备 的配置器与第二设备的第一应用之间的交互。It should be noted that the interaction between the first device and the first application of the second device described in the following embodiments refers to the interaction between the configurator of the first device and the first application of the second device.
需要说明的是,本申请实施例的技术方案虽然是以第一设备配置第二设备中的第一应用接入服务器(即第二设备作为客户端)进行说明的,但在第二设备作为服务端的情况下,本申请实施例的技术方案同样可以实现第一设备配置第二设备接入服务器。It should be noted that although the technical solution of the embodiment of the present application is explained with the first device configuring the first application access server in the second device (that is, the second device serves as the client), when the second device serves as the service In the case of the terminal, the technical solutions of the embodiments of the present application can also enable the first device to configure the second device to access the server.
图4是本申请实施例提供的设备配置方法的流程示意图一,如图4所示,该设备配置方法包括以下步骤:Figure 4 is a schematic flow chart of a device configuration method provided by an embodiment of the present application. As shown in Figure 4, the device configuration method includes the following steps:
步骤401:服务器生成第一证书和/或第一凭证,向第一设备发送第一证书和/或第一凭证;第一设备从服务器获取第一证书和/或第一凭证。Step 401: The server generates a first certificate and/or a first voucher, and sends the first certificate and/or a first voucher to the first device; the first device obtains the first certificate and/or the first voucher from the server.
在一些实施方式中,第二设备的第一应用生成第二证书请求(Certificate Signing Request,CSR)消息,向第一设备发送第二证书请求消息;第一设备接收第一应用发送的第二证书请求消息,第一设备基于第二证书请求消息确定第一证书请求消息,这里,第一设备可以直接将第二证书请求消息作为第一证书请求消息,或者也可以对第二证书请求消息进行修改(例如添加第一设备的相关信息)从而生成第一证书请求消息;第一设备向服务器发送第一证书请求消息和/或凭证申请消息,其中,第一证书请求消息用于请求服务器为第一应用生成第一证书,凭证申请消息用于向服务器申请为第一应用分配第一凭证;服务器接收第一设备发送的第一证书请求消息和/或凭证申请消息,服务器生成第一证书和/或第一凭证,向第一设备发送第一证书和/或第一凭证;第一设备接收服务器发送的第一证书和/或第一凭证。这里,第一证书和/或第一凭证携带在CSR响应(CSRResponse)消息中,即服务器通过CSR响应消息向第一设备提供第一证书和/或第一凭证。In some implementations, the first application of the second device generates a second certificate request (Certificate Signing Request, CSR) message and sends the second certificate request message to the first device; the first device receives the second certificate sent by the first application request message, the first device determines the first certificate request message based on the second certificate request message. Here, the first device may directly use the second certificate request message as the first certificate request message, or may modify the second certificate request message. (For example, adding relevant information of the first device) thereby generating a first certificate request message; the first device sends a first certificate request message and/or a certificate application message to the server, where the first certificate request message is used to request the server to be the first The application generates the first certificate, and the certificate application message is used to apply to the server to allocate the first certificate to the first application; the server receives the first certificate request message and/or the certificate application message sent by the first device, and the server generates the first certificate and/or The first certificate sends the first certificate and/or the first voucher to the first device; the first device receives the first certificate and/or the first voucher sent by the server. Here, the first certificate and/or the first credential are carried in the CSR response (CSRResponse) message, that is, the server provides the first certificate and/or the first credential to the first device through the CSR response message.
这里,第一设备接收到第二设备的第一应用发送的第二证书请求消息后,可以确定第二设备的第一应用想要接入服务器。考虑到第二设备的第一应用接入服务器的前提条件有:条件1:第一应用与服务器建立安全连接;条件2:第一应用注册至服务器。为此,针对条件1,第一设备需要为第一应用向服务器申请一个证书(即第一证书),从而第一应用可以基于该证书与服务器建立安全连接;针对条件2,第一设备需要为第一应用向服务器申请一个凭证(即第一凭证),从而第一应用可以基于该凭证注册至服务器。Here, after receiving the second certificate request message sent by the first application of the second device, the first device may determine that the first application of the second device wants to access the server. Considering that the prerequisites for the first application of the second device to access the server are: Condition 1: The first application establishes a secure connection with the server; Condition 2: The first application registers with the server. To this end, for condition 1, the first device needs to apply for a certificate (i.e., first certificate) from the server for the first application, so that the first application can establish a secure connection with the server based on the certificate; for condition 2, the first device needs to The first application applies for a certificate (ie, the first certificate) from the server, so that the first application can register with the server based on the certificate.
第一设备与第二设备中的第一应用进行交互之前,第一设备与第二设备需要先建立连接,并且第二设备中的第一应用需要被启动。Before the first device interacts with the first application in the second device, the first device and the second device need to establish a connection first, and the first application in the second device needs to be started.
在一些实施方式中,第一设备与第二设备可以通过蓝牙或者WiFi等方式建立连接。In some implementations, the first device and the second device may establish a connection through Bluetooth or WiFi.
在一些实施方式中,启动第二设备中的第一应用的方式可以但不局限于以下方式:In some implementations, the method of starting the first application in the second device may be, but is not limited to, the following methods:
方式一:第一设备向第二设备发送启动指令,启动指令用于触发第二设备启动第一应用;第二设备接收第一设备发送的启动指令,在启动指令的触发下启动第一应用。Method 1: The first device sends a startup instruction to the second device, and the startup instruction is used to trigger the second device to start the first application; the second device receives the startup instruction sent by the first device, and starts the first application when triggered by the startup instruction.
作为示例:启动指令可以是CSR启动指令。As an example: the startup instruction can be a CSR startup instruction.
可选地,第一设备向第二设备发送启动指令之前,第一设备输出第一提示信息,第一提示信息用于提示用户是否同意启动第一应用;第一设备在获得用户输入的针对第一提示信息的确认操作后,向第二设备发送启动指令。Optionally, before the first device sends the startup instruction to the second device, the first device outputs first prompt information, and the first prompt information is used to prompt the user whether to agree to launch the first application; the first device obtains user input for the first application. After confirming the prompt message, a start command is sent to the second device.
可选地,第一设备向第二设备发送启动指令之前,第一设备确定第二设备支持控制IoT设备的能力。这里,第一设备可以查询第二设备的能力,确定第二设备支持控制IoT设备的能力。或者,第二设备将自身的能力(即支持控制IoT设备的能力)上报给第一设备,从而第一设备确定第二设备支持控制IoT设备的能力。需要指出的是,“控制IoT设备的能力”由第二设备中的第一应用支持,“控制IoT设备的能力”也可以称为第一应用能力,如智能家居应用能力。Optionally, before the first device sends the startup instruction to the second device, the first device determines that the second device supports the ability to control the IoT device. Here, the first device can query the capabilities of the second device and determine that the second device supports the capability of controlling the IoT device. Alternatively, the second device reports its own capabilities (ie, the ability to support controlling IoT devices) to the first device, so that the first device determines that the second device supports the ability to control IoT devices. It should be noted that the "ability to control IoT devices" is supported by the first application in the second device, and the "ability to control IoT devices" can also be called the first application capability, such as smart home application capabilities.
方式二:第二设备基于获得的启动操作启动第一应用。Method 2: The second device starts the first application based on the obtained startup operation.
可选地,第二设备基于获得的启动操作启动第一应用之后,第二设备的第一应用确定第一设备支持配置IoT设备的能力,输出第二提示信息,第二提示信息用于提示用户是否连接第一设备配置的IoT设备;第一应用获得用户输入的针对第二提示信息的确认操作后,执行向第一设备发送第二证书请求消息的步骤。需要指出的是,“配置IoT设备的能力”由第一设备中的配置器支持,“配置IoT设备的能力”也可以称为配置器能力。Optionally, after the second device starts the first application based on the obtained startup operation, the first application of the second device determines that the first device supports the ability to configure the IoT device, and outputs the second prompt information, and the second prompt information is used to prompt the user Whether to connect the IoT device configured by the first device; after obtaining the confirmation operation for the second prompt information input by the user, the first application performs the step of sending a second certificate request message to the first device. It should be noted that the "ability to configure IoT devices" is supported by the configurator in the first device, and the "ability to configure IoT devices" can also be called configurator capabilities.
在一些实施方式中,第二设备中的第一应用被启动后,第一应用生成密钥对,即公钥和私钥对,以便后续使用。In some implementations, after the first application in the second device is started, the first application generates a key pair, that is, a public key and a private key pair, for subsequent use.
在一些实施方式中,上述方案中的第一证书请求消息和第二证书请求消息(以下统称为证书请求消息)符合PKCS#10定义的CSR数据格式,并遵循以下原则:证书请求消息携带证书请求信息和第一签名,第一签名基于第一应用的私钥对证书请求信息进行签名得到;其中,In some implementations, the first certificate request message and the second certificate request message (hereinafter collectively referred to as the certificate request message) in the above solution conform to the CSR data format defined by PKCS#10 and follow the following principles: the certificate request message carries the certificate request information and the first signature, the first signature is obtained by signing the certificate request information based on the private key of the first application; where,
证书请求信息包括版本(version)信息、主题(subject)信息和公钥信息,版本信息包括证书 请求信息的版本号,主题信息包括第二设备的特征信息,公钥信息包括第一应用的公钥。The certificate request information includes version information, subject information and public key information. The version information includes a version number of the certificate request information. The subject information includes feature information of the second device. The public key information includes the public key of the first application. .
这里,第二设备的特征信息包括以下至少之一:第二设备的厂家标识(Vendor ID)、第二设备的产品标识(Product ID)、第二设备的设备序列号(Device Serial Number或者Device ID)。Here, the characteristic information of the second device includes at least one of the following: a manufacturer identification (Vendor ID) of the second device, a product identification (Product ID) of the second device, a device serial number (Device Serial Number or Device ID) of the second device. ).
这里,第一应用的公钥用于服务器对第一签名进行验签,并在验签成功后为第一应用生成第一证书。具体地,服务器收到第一证书请求消息后,基于第一证书请求信息获取第一应用的公钥(即从第一证书请求消息中的证书请求信息中获取第一应用的公钥),基于第一应用的公钥对第一签名进行验签,并在验签成功后执行生成第一证书的步骤。Here, the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application. Specifically, after receiving the first certificate request message, the server obtains the public key of the first application based on the first certificate request information (that is, obtains the public key of the first application from the certificate request information in the first certificate request message), based on The public key of the first application verifies the first signature, and after the signature verification is successful, the step of generating the first certificate is performed.
本申请实施例中,服务器基于第一应用的公钥生成第一证书;或者,服务器基于第一应用的公钥和第一应用标识生成第一证书,第一应用标识为第一应用的标识。In the embodiment of this application, the server generates the first certificate based on the public key of the first application; or, the server generates the first certificate based on the public key of the first application and the first application identifier, and the first application identifier is the identifier of the first application.
这里,第一应用标识由服务器生成,或者第一应用标识由第一设备生成。Here, the first application identification is generated by the server, or the first application identification is generated by the first device.
作为一种实现方式,第一应用标识由服务器生成。具体地,服务器在接收到第一设备发送的第一证书请求消息后为第一应用生成第一应用标识。As an implementation manner, the first application identifier is generated by the server. Specifically, after receiving the first certificate request message sent by the first device, the server generates the first application identification for the first application.
作为另一种实现方式,第一应用标识由第一设备生成。具体地,第一设备在接收到第一应用发送的第二证书请求消息后为第一应用生成第一应用标识,第一设备将生成的第一应用标识发送给服务器;服务器接收第一设备生成的第一应用标识。As another implementation manner, the first application identifier is generated by the first device. Specifically, after receiving the second certificate request message sent by the first application, the first device generates a first application identification for the first application, and the first device sends the generated first application identification to the server; the server receives the first application identification generated by the first device. The first application identifier.
本申请实施例中,服务器接收到凭证申请消息后,为第一应用生成第一凭证。In this embodiment of the present application, after receiving the certificate application message, the server generates the first certificate for the first application.
作为一种实现方式,服务器为第一应用分配第一访问令牌,作为第一凭证。这里,第一凭证为第一访问令牌,第一访问令牌由服务器为第一应用分配。As an implementation manner, the server allocates a first access token to the first application as the first credential. Here, the first credential is a first access token, and the first access token is allocated by the server for the first application.
作为另一种实现方式,服务器为第一应用分配第一访问令牌,基于第一应用的公钥对第一访问令牌进行加密得到第一加密令牌,作为第一凭证。这里,第一凭证为第一加密令牌,第一加密令牌由服务器基于第一应用的公钥对第一访问令牌进行加密得到,第一访问令牌由服务器为第一应用分配。As another implementation manner, the server allocates a first access token to the first application, and encrypts the first access token based on the public key of the first application to obtain a first encryption token as the first certificate. Here, the first credential is a first encryption token. The first encryption token is obtained by the server encrypting the first access token based on the public key of the first application. The first access token is allocated by the server to the first application.
在一些实施方式中,服务器为第一应用生成第一访问令牌后,服务器建立第一用户标识、第一访问令牌以及第一应用标识之间的第一绑定关系,第一用户标识为第一设备对应的用户标识,In some embodiments, after the server generates the first access token for the first application, the server establishes a first binding relationship between the first user identification, the first access token and the first application identification, and the first user identification is The user ID corresponding to the first device,
第一应用标识为第一应用的标识;其中,第一绑定关系用于服务器确定是否接受第一应用的注册和/或登录。这里,第一用户标识是在第一设备注册至服务器的时候由服务器为第一设备分配,当第一设备与服务器进行交互时,第一设备会向服务器提供第一设备对应的应用标识(称为第二应用标识,第二应用标识可以理解为是第一设备中的配置器的标识),服务器根据第一设备对应的应用标识便可以确定第一设备对应的用户标识。The first application identifier is the identifier of the first application; wherein the first binding relationship is used by the server to determine whether to accept registration and/or login of the first application. Here, the first user identification is assigned by the server to the first device when the first device registers with the server. When the first device interacts with the server, the first device will provide the application identification (called application identification) corresponding to the first device to the server. is the second application identifier, which can be understood as the identifier of the configurator in the first device), and the server can determine the user identifier corresponding to the first device based on the application identifier corresponding to the first device.
需要说明的是,上述方案中的凭证申请消息和第一证书请求消息可以是同一个消息,或者也可以是两个不同的消息。在凭证申请消息和第一证书请求消息是同一个消息的情况下,可以统称为证书请求消息,证书请求消息用于请求服务器为第一应用生成第一证书和/或为第一应用分配第一凭证。It should be noted that the certificate application message and the first certificate request message in the above solution may be the same message, or they may be two different messages. When the certificate application message and the first certificate request message are the same message, they may be collectively referred to as the certificate request message. The certificate request message is used to request the server to generate a first certificate for the first application and/or allocate a first certificate to the first application. certificate.
步骤402:第一设备将第一证书和/或第一凭证配置给第二设备中的第一应用,第二设备的第一应用获取第一设备配置的第一证书和/或第一凭证。Step 402: The first device configures the first certificate and/or the first credential to the first application in the second device, and the first application of the second device obtains the first certificate and/or the first credential configured by the first device.
本申请实施例中,第一设备向第二设备中的第一应用发送配置命令,配置命令携带第一证书和/或第一凭证;第一应用接收到配置命令后,将配置命令中携带的第一证书和/或第一凭证配置到本地。在一些实施方式中,配置命令可以是添加云请求(AddCloudRequest)命令。In this embodiment of the present application, the first device sends a configuration command to the first application in the second device, and the configuration command carries the first certificate and/or the first credential; after receiving the configuration command, the first application sends the configuration command carried in the configuration command. The first certificate and/or the first credential are configured locally. In some implementations, the configuration command may be an AddCloudRequest command.
在一些实施方式中,第一设备将服务器的地址配置给第二设备中的第一应用;其中,服务器的地址用于第一应用与服务器建立物理连接,第一证书用于基于物理连接建立第一应用与服务器之间的安全连接。作为示例,安全连接可以是TLS连接。作为示例:服务器的地址可以是URL或者URI。In some implementations, the first device configures the address of the server to the first application in the second device; wherein the address of the server is used for the first application to establish a physical connection with the server, and the first certificate is used to establish a third application based on the physical connection. A secure connection between an application and the server. As an example, the secure connection may be a TLS connection. As an example: the address of the server can be a URL or a URI.
这里,可选地,第一设备还可以将服务器的标识配置给第二设备中的第一应用;其中,服务器的地址和服务器的标识用于第一应用与服务器建立物理连接。Here, optionally, the first device can also configure the server's identity to the first application in the second device; wherein the server's address and server's identity are used for the first application to establish a physical connection with the server.
在一些实施方式中,第一设备未从服务器获取第一凭证的情况下,第一设备将第二应用标识配置给第一应用;第二应用标识为第一设备对应的应用标识,第二应用标识用于第一应用注册至服务器。这里,第二应用标识是在第一设备注册至服务器的时候由服务器为第一设备分配。In some implementations, when the first device does not obtain the first credential from the server, the first device configures the second application identification to the first application; the second application identification is the application identification corresponding to the first device, and the second application The identification is used for the first application to register with the server. Here, the second application identifier is assigned by the server to the first device when the first device registers with the server.
这里,第一设备未从服务器获取第一凭证的原因可能有:1、第一设备未向服务器申请为第 一应用分配第一凭证;2、服务器没有能力为第一应用分配第一凭证;3、服务器为第一应用分配了第一凭证,但未成功下发给第一设备。Here, the reasons why the first device does not obtain the first credential from the server may be: 1. The first device does not apply to the server to allocate the first credential to the first application; 2. The server is incapable of allocating the first credential to the first application; 3. , the server allocated the first credential to the first application, but failed to successfully deliver it to the first device.
步骤403:第一应用基于第一证书与服务器建立安全连接和/或基于第一凭证注册至服务器。Step 403: The first application establishes a secure connection with the server based on the first certificate and/or registers with the server based on the first credential.
本申请实施例中,第一应用获得第一证书后,基于第一证书与服务器建立安全连接。In the embodiment of this application, after obtaining the first certificate, the first application establishes a secure connection with the server based on the first certificate.
在一些实施方式中,第一应用与服务器交互各自的证书,证书被证书接收端认证通过后用于证书接收端获取证书发送端的公钥并基于证书接收端的私钥和证书发送端的公钥生成共享密钥,以完成安全连接的建立;其中,第一应用的证书为第一证书。In some implementations, the first application exchanges respective certificates with the server. After the certificate is authenticated by the certificate receiving end, the certificate receiving end obtains the public key of the certificate sending end and generates a share based on the private key of the certificate receiving end and the public key of the certificate sending end. key to complete the establishment of a secure connection; wherein the certificate of the first application is the first certificate.
具体地,第一应用向服务器发送第一证书,由于第一证书是基于第一应用的公钥生成的,因此服务器在获得第一证书并对第一证书认证通过后,可以从第一证书中获得第一应用的公钥。同样,服务器也会向第一应用发送自身的证书(以下称为第二证书),由于第二证书是基于服务器的公钥生成的,因此第一应用在获得第二证书并对第二证书认证通过后,可以从第二证书中获得服务器的公钥。对于第一应用来说,第一应用利用自己的私钥和服务器的公钥生成第一共享密钥,利用该第一共享密钥对向服务器发送的数据进行加密以及对接收到的来自服务器的数据进行解密。同样,对于服务器来说,服务器利用自己的私钥和第一应用的公钥生成第二共享密钥,利用该第二共享密钥对向第一应用发送的数据进行加密以及对接收到的来自第一应用的数据进行解密。Specifically, the first application sends the first certificate to the server. Since the first certificate is generated based on the public key of the first application, after the server obtains the first certificate and authenticates the first certificate, it can obtain the first certificate from the first certificate. Obtain the public key of the first application. Similarly, the server will also send its own certificate (hereinafter referred to as the second certificate) to the first application. Since the second certificate is generated based on the server's public key, the first application obtains the second certificate and authenticates the second certificate. After passing, the server's public key can be obtained from the second certificate. For the first application, the first application uses its own private key and the public key of the server to generate a first shared key, and uses the first shared key to encrypt the data sent to the server and to encrypt the data received from the server. Data is decrypted. Similarly, for the server, the server uses its own private key and the public key of the first application to generate a second shared key, and uses the second shared key to encrypt the data sent to the first application and to encrypt the data received from the first application. The first application data is decrypted.
在一些实施方式中,第一应用与服务器交互各自的证书之前,第一应用获取第一设备配置的服务器的地址;第一应用基于服务器的地址与服务器建立物理连接,并基于物理连接与服务器交互各自的证书。In some embodiments, before the first application interacts with the server for respective certificates, the first application obtains the address of the server configured by the first device; the first application establishes a physical connection with the server based on the address of the server, and interacts with the server based on the physical connection. respective certificates.
本申请实施例中,第一应用与服务器建立安全连接后,便可以基于安全连接与服务器进行安全交互。例如第一应用可以基于安全连接向服务器发起注册和/或登录,或者说,第一应用向服务器进行注册和/或登录时与服务器之间交互的数据是经过共享密钥加密的。In this embodiment of the present application, after the first application establishes a secure connection with the server, it can safely interact with the server based on the secure connection. For example, the first application can initiate registration and/or login to the server based on a secure connection, or in other words, the data interacted with the server when the first application registers and/or logs in to the server is encrypted by a shared key.
本申请实施例中,第一应用获得第一凭证后,基于第一凭证注册至服务器。In this embodiment of the present application, after obtaining the first credential, the first application registers with the server based on the first credential.
作为一种实现方式,第一凭证为第一访问令牌的情况下,第一应用使用第一访问令牌注册至服务器。As an implementation manner, when the first credential is a first access token, the first application uses the first access token to register with the server.
作为另一种实现方式,第一凭证为第一加密令牌的情况下,第一应用基于第一应用的私钥对第一加密令牌进行解密,得到第一访问令牌,第一应用使用第一访问令牌注册至服务器。As another implementation manner, when the first credential is the first encryption token, the first application decrypts the first encryption token based on the private key of the first application to obtain the first access token, and the first application uses The first access token is registered to the server.
在一些实施方式中,第一应用还获得第一应用标识,第一应用可以使用第一应用标识和第一凭证注册至服务器。这里,第一证书由服务器基于第一应用的公钥和第一应用标识生成的情况下,第一应用基于第一证书获取第一应用标识。具体地,服务器接收第一应用发送的注册请求消息,注册请求消息携带第一应用标识和第一访问令牌;服务器基于第一应用标识、第一访问令牌以及第一绑定关系,确定第一应用对应的用户标识为第一用户标识,接受第一应用的注册。In some implementations, the first application also obtains a first application identity, and the first application can register with the server using the first application identity and the first credential. Here, when the first certificate is generated by the server based on the public key of the first application and the first application identification, the first application obtains the first application identification based on the first certificate. Specifically, the server receives a registration request message sent by the first application, and the registration request message carries the first application identifier and the first access token; the server determines the first application identifier, the first access token, and the first binding relationship based on the first application identifier, the first access token, and the first binding relationship. The user ID corresponding to an application is the first user ID, and the registration of the first application is accepted.
进一步,在一些实施方式中,第一应用使用第一应用标识和第一访问令牌注册至服务器之后,第一应用使用第一应用标识和第一访问令牌登录至服务器。具体地,服务器接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第一访问令牌;服务器基于第一应用标识、第一访问令牌以及第一绑定关系确定第一应用对应的用户标识为第一用户标识,接受第一应用的登录。Further, in some implementations, after the first application uses the first application identification and the first access token to register with the server, the first application uses the first application identification and the first access token to log in to the server. Specifically, the server receives a login request message sent by the first application, and the login request message carries the first application identifier and the first access token; the server determines the first application identifier based on the first application identifier, the first access token, and the first binding relationship. The user ID corresponding to the application is the first user ID, and the login of the first application is accepted.
进一步,在一些实施方式中,第一应用使用第一应用标识和第一访问令牌注册至服务器之后,第一应用接收服务器发送的第二访问令牌,使用第一应用标识和第二访问令牌登录至服务器。具体地,服务器生成第二访问令牌并将第一绑定关系中的第一访问令牌更新为第二访问令牌;服务器向第一应用发送第二访问令牌;服务器接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第二访问令牌;服务器基于第一应用标识、第二访问令牌以及第一绑定关系确定第一应用对应的用户标识为第一用户标识,接受第一应用的登录。Further, in some embodiments, after the first application uses the first application identification and the first access token to register with the server, the first application receives the second access token sent by the server and uses the first application identification and the second access token. Log in to the server. Specifically, the server generates a second access token and updates the first access token in the first binding relationship to the second access token; the server sends the second access token to the first application; the server receives the second access token sent by the first application. The login request message carries the first application identification and the second access token; the server determines that the user identification corresponding to the first application is the first user based on the first application identification, the second access token and the first binding relationship. Identifies the first application to accept login.
在一些实施方式中,第二设备的第一应用未获取第一设备配置的第一凭证的情况下,第一应用获取第一设备配置的第二应用标识,第二应用标识为第一设备对应的应用标识(即第二设备的配置器的标识);第一应用基于第二应用标识注册至服务器。In some embodiments, when the first application of the second device does not obtain the first credential configured by the first device, the first application obtains the second application identification configured by the first device, and the second application identification corresponds to the first device. The application identifier (that is, the identifier of the configurator of the second device); the first application registers with the server based on the second application identifier.
在一些实施方式中,第一应用还获得第一应用标识,第一应用可以使用第一应用标识和第二应用标识注册至服务器。这里,第一证书由服务器基于第一应用的公钥和第一应用标识生成的情况下,第一应用基于第一证书获取第一应用标识。具体地,服务器接收第一应用发送的注册请求消息,注册请求消息携带第一应用标识和第二应用标识;第一应用标识为第一应用的标识;第二应用标识为第一设备对应的应用标识,由第一设备提供给第一应用;服务器基于第二应用标识确定与之对应的第一用户标识,接受第一应用的注册。In some implementations, the first application also obtains a first application identification, and the first application can register with the server using the first application identification and the second application identification. Here, when the first certificate is generated by the server based on the public key of the first application and the first application identification, the first application obtains the first application identification based on the first certificate. Specifically, the server receives a registration request message sent by the first application. The registration request message carries a first application identifier and a second application identifier; the first application identifier is the identifier of the first application; the second application identifier is the application corresponding to the first device. The identification is provided by the first device to the first application; the server determines the first user identification corresponding to the second application identification and accepts the registration of the first application.
进一步,在一些实施方式中,第一应用使用第一应用标识和第二应用标识注册至服务器之后,服务器生成第二访问令牌,向第一应用发送第二访问令牌;第一应用接收服务器发送的第二访问令牌,使用第一应用标识和第二访问令牌登录至服务器。Further, in some embodiments, after the first application registers with the server using the first application identifier and the second application identifier, the server generates a second access token and sends the second access token to the first application; the first application receives the server Send the second access token to log in to the server using the first application ID and the second access token.
在一些实施方式中,服务器为第一应用生成第二访问令牌后,服务器建立第一用户标识、第二访问令牌以及第一应用标识之间的第二绑定关系,第一应用标识为第一应用的标识;其中,第二绑定关系用于服务器确定是否接受第一应用的登录。具体地,服务器接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第二访问令牌;服务器基于第一应用标识、第二访问令牌以及第二绑定关系确定第一应用对应的用户标识为第一用户标识,授权第一应用的登录。In some embodiments, after the server generates the second access token for the first application, the server establishes a second binding relationship between the first user identification, the second access token and the first application identification, and the first application identification is The identification of the first application; wherein the second binding relationship is used by the server to determine whether to accept the login of the first application. Specifically, the server receives a login request message sent by the first application, and the login request message carries the first application identifier and the second access token; the server determines the first application identifier based on the first application identifier, the second access token, and the second binding relationship. The user identification corresponding to the application is the first user identification, and the login of the first application is authorized.
通过上述方案,可以实现第一设备配置第二设备的第一应用接入服务器。当第二设备的第一应用接入服务器后,第二设备可以通过其第一应用控制与第一设备属于同一应用平台的一部分IoT设备。Through the above solution, the first device can be configured to configure the first application access server of the second device. When the first application of the second device accesses the server, the second device can control some IoT devices belonging to the same application platform as the first device through its first application.
上述方案中,IoT设备可以但不局限于智能家居设备。In the above solution, IoT devices can be, but are not limited to, smart home devices.
以下结合具体应用实例对本申请实施例的技术方案进行举例说明。以下应用实例中,以第一设备为手机为例,以第二设备为车为例,以第二设备中的第一应用为智能家居应用为例,以服务器实现云平台为例进行说明。需要说明的是,车作为第二设备指的是车载终端。The technical solutions of the embodiments of the present application are illustrated below with reference to specific application examples. In the following application examples, the first device is a mobile phone as an example, the second device is a car as an example, the first application in the second device is a smart home application as an example, and the server implements a cloud platform as an example. It should be noted that the car as the second device refers to the vehicle-mounted terminal.
应用实例一Application example one
图5是本申请实施例提供的设备配置方法的流程示意图二,如图5所示,该设备配置方法包括以下步骤:Figure 5 is a flow diagram 2 of the device configuration method provided by the embodiment of the present application. As shown in Figure 5, the device configuration method includes the following steps:
步骤501:车与手机建立连接,手机获取车支持智能家居应用能力。Step 501: The car establishes a connection with the mobile phone, and the mobile phone obtains the car's ability to support smart home applications.
这里,车与手机可以通过蓝牙或者WiFi建立连接。Here, the car and the mobile phone can be connected through Bluetooth or WiFi.
这里,手机可以查询车的能力,发现车支持智能家居应用能力。或者,车将自身的智能家居应用能力上报给手机。这里,智能家居应用能力是指智能家居应用支持的能力,即支持控制智能家居设备的能力。Here, the mobile phone can query the car's capabilities and discover that the car supports smart home application capabilities. Or, the car reports its smart home application capabilities to the mobile phone. Here, smart home application capabilities refer to the capabilities supported by smart home applications, that is, the ability to support the control of smart home devices.
步骤502:用户在手机上确认用车控制智能家居设备。Step 502: The user confirms using the car to control the smart home device on the mobile phone.
这里,手机弹出对话界面,提示用户是否同意用车控制智能家居设备。Here, a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
步骤503:手机向车发送启动指令,触发车启动智能家居应用。Step 503: The mobile phone sends a start command to the car, triggering the car to start the smart home application.
这里,手机获得用户同意用车控制智能家居设备的确认操作后,向车发送启动指令,触发车启动智能家居应用。Here, after the mobile phone obtains the user's confirmation operation of using the car to control the smart home device, it sends a start command to the car, triggering the car to start the smart home application.
步骤504:车的智能家居应用启动后,生成密钥对。Step 504: After the car's smart home application is started, a key pair is generated.
这里,密钥对是指公钥和私钥对。智能家居应用将自身的私钥存储在安全区。Here, the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
步骤505:车的智能家居应用生成CSR消息,向手机发送CSR消息。Step 505: The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
这里,CSR消息符合PKCS#10定义的CSR数据格式,并遵循以下原则:CSR消息携带证书请求信息和第一签名,第一签名基于智能家居应用的私钥(即步骤504中生成的私钥)对证书请求信息进行签名得到;其中,证书请求信息包括版本(version)信息、主题(subject)信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括车的特征信息,公钥信息包括智能家居应用的公钥(即步骤504中生成的公钥)。可选地,主题信息包括以下至少一种车的特征信息:车的厂家标识(Vendor ID)、车的产品标识(Product ID)、车的设备序列号(Device Serial Number或者Device ID)。Here, the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 504) The certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information. The version information includes the version number of the certificate request information. The subject information includes the car’s characteristic information and the public key information. The information includes the public key of the smart home application (ie, the public key generated in step 504). Optionally, the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
步骤506:手机将CSR消息转发给云平台,并为智能家居应用申请用于注册至云平台的访问令牌(Access Token)。Step 506: The mobile phone forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
步骤507:云平台为智能家居应用分配应用标识(APPID),并用应用标识和智能家居应用的公钥生成智能家居应用的证书,以及生成智能家居应用的访问令牌,并用智能家居应用的公钥加密访问令牌得到加密令牌(CToken)。Step 507: The cloud platform assigns an application identification (APPID) to the smart home application, and uses the application identification and the public key of the smart home application to generate a certificate for the smart home application, and generates an access token for the smart home application, and uses the public key of the smart home application. Encrypt the access token to get the encryption token (CToken).
这里,也可以在步骤506中由手机为智能家居应用分配应用标识(APPID),并将该应用标识发送给云平台。Here, in step 506, the mobile phone may also assign an application identification (APPID) to the smart home application and send the application identification to the cloud platform.
这里,云平台获得CSR消息后,会对该CSR消息进行验证,并在验证通过后执行步骤507。云平台对CSR消息进行验证的方式是:云平台从CSR消息中的证书请求信息中获取智能家居应用的公钥,用智能家居应用的公钥对第一签名进行验签,验签成功则表示验证通过。Here, after the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 507 after the verification passes. The way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
步骤508:云平台建立用户标识(userID)、应用标识(APPID)和访问令牌(AccessToken)的绑定关系。Step 508: The cloud platform establishes the binding relationship between the user ID (userID), the application ID (APPID) and the access token (AccessToken).
步骤509:云平台将智能家居应用的证书和加密令牌返回给手机。Step 509: The cloud platform returns the certificate and encryption token of the smart home application to the mobile phone.
这里,云平台向手机返回的参数参照以下表1所示,包括:加密令牌(CToken)、证书链(CertChain)、令牌有效时长(TokenExpiration)。其中,证书链包括至少2级证书,例如证书链包括根证书和目标证书,目标证书即为智能家居应用的证书,目标证书由根证书签发。例如证书链包括根证书、一个或多个中间证书、以及目标证书,目标证书即为智能家居应用的证书,目标证书由一个或多个中间证书签发,中间证书由根证书签发。在基于证书的认证过程中,需要对证书链中的每级证书进行认证,认证通过后,便可以确定证书的拥有者的身份是合法的。Here, the parameters returned by the cloud platform to the mobile phone are shown in Table 1 below, including: encryption token (CToken), certificate chain (CertChain), and token validity period (TokenExpiration). Among them, the certificate chain includes at least level 2 certificates. For example, the certificate chain includes a root certificate and a target certificate. The target certificate is the certificate of the smart home application, and the target certificate is signed by the root certificate. For example, the certificate chain includes a root certificate, one or more intermediate certificates, and a target certificate. The target certificate is the certificate of the smart home application. The target certificate is signed by one or more intermediate certificates, and the intermediate certificate is signed by the root certificate. In the certificate-based authentication process, each level of the certificate in the certificate chain needs to be authenticated. After the authentication is passed, it can be determined that the identity of the certificate owner is legal.
Figure PCTCN2022106311-appb-000001
Figure PCTCN2022106311-appb-000001
表1Table 1
步骤510:手机将智能家居应用的证书和加密令牌、以及云平台的地址配置给智能家居应用。Step 510: The mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application.
这里,手机通过配置指令将智能家居应用的证书和加密令牌、以及云平台的地址配置给智能家居应用,配置指令携带的配置参数参照以下表2所示,包括:智能家居应用证书(SmartHomeAPPCert)、中间证书(IntermediateCert)、根证书(RootCert)、云平台地址(CloudAddress)、加密令牌(CToken)、令牌有效时长(TokenExpiration)。其中,SmartHomeAPPCert、IntermediateCert和RootCert组成了证书链(CertChain)。Here, the mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application through configuration instructions. The configuration parameters carried by the configuration instructions are shown in Table 2 below, including: Smart Home Application Certificate (SmartHomeAPPCert) , intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), encryption token (CToken), and token validity period (TokenExpiration). Among them, SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
Figure PCTCN2022106311-appb-000002
Figure PCTCN2022106311-appb-000002
表2Table 2
步骤511:车的智能家居应用用私钥解密加密令牌,得到访问令牌,完成配置。Step 511: The car's smart home application uses the private key to decrypt the encrypted token, obtain the access token, and complete the configuration.
步骤512:车的智能家居应用基于配置的云平台的地址与云平台建立物理连接,并基于物理连接使用配置的证书与云平台建立安全连接。Step 512: The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
步骤513:车的智能家居应用基于安全连接使用应用标识和访问令牌注册到云平台。Step 513: The car's smart home application is registered to the cloud platform using the application ID and access token based on the secure connection.
可选地,云平台会向车的智能家居应用返回一个新的访问令牌。Optionally, the cloud platform returns a new access token to the car's smart home application.
这里,云平台会提出注册接口,注册接口的说明如下表3所示,注册接口使用的HTTP方法(HTTP Method)为POST,注册接口对应的接口访问地址为“/account”。Here, the cloud platform will propose a registration interface. The description of the registration interface is shown in Table 3 below. The HTTP Method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account".
HTTP方法HTTP method 接口访问地址Interface access address
POSTPOST /account/account
表3table 3
云平台的注册接口涉及到的参数有注册请求接口参数和注册响应接口参数。其中,注册请求接口参数的说明如下表4所示,注册请求接口参数位于POST请求消息中的体(Body)中,包括访问令牌(AccessToken)和应用标识(APPID)。注册响应接口参数的说明如下表5所示,注册响应接口参数位于POST响应消息中的Body,包括访问令牌(AccessToken)和令牌有效时长(TokenExpiration)。The parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters. Among them, the description of the registration request interface parameters is shown in Table 4 below. The registration request interface parameters are located in the body (Body) of the POST request message, including the access token (AccessToken) and the application identification (APPID). The description of the registration response interface parameters is shown in Table 5 below. The registration response interface parameters are located in the Body of the POST response message, including the access token (AccessToken) and the token validity period (TokenExpiration).
位置Location 参数parameter 值类型value type 必填Required 说明illustrate
BodyBody AccessTokenAccessToken 字符串string yes 智能家居应用的访问令牌Access token for smart home applications
BodyBody APPIDAPPID 字符串string yes 智能家居应用的应用标识Application ID for smart home applications
表4Table 4
Figure PCTCN2022106311-appb-000003
Figure PCTCN2022106311-appb-000003
表5table 5
步骤514:车的智能家居应用用应用标识和访问令牌(如果有新的访问令牌则用新的访问令牌)登录云平台。Step 514: The car's smart home application uses the application identification and access token (use a new access token if there is a new access token) to log in to the cloud platform.
这里,车的智能家居应用登录云平台后,用户可使用车的智能家居应用通过云平台控制接入云平台的智能家居设备。Here, after the Che's smart home application logs into the cloud platform, the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
应用实例二Application example two
图6是本申请实施例提供的设备配置方法的流程示意图三,如图6所示,该设备配置方法包括以下步骤:Figure 6 is a schematic flowchart three of the device configuration method provided by the embodiment of the present application. As shown in Figure 6, the device configuration method includes the following steps:
步骤601:车与手机建立连接。Step 601: The car establishes a connection with the mobile phone.
这里,车与手机可以通过蓝牙或者WiFi建立连接。Here, the car and the mobile phone can be connected through Bluetooth or WiFi.
步骤602:用户在车上启动智能家居应用。Step 602: The user starts the smart home application in the car.
步骤603:车的智能家居应用发现手机的配置器能力,在其界面上显示提示信息,通过提示信息提示用户是否连接注册至云平台的智能家居设备。Step 603: The car's smart home application discovers the configurator capability of the mobile phone, displays a prompt message on its interface, and uses the prompt message to prompt the user whether to connect to the smart home device registered to the cloud platform.
步骤604:用户在车的智能家居应用的界面上输入确认连接操作。Step 604: The user enters a confirmation connection operation on the interface of the car's smart home application.
步骤605:车的智能家居应用生成密钥对。Step 605: The car's smart home application generates a key pair.
这里,密钥对是指公钥和私钥对。智能家居应用将自身的私钥存储在安全区。Here, the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
步骤606:车的智能家居应用生成CSR消息,向手机发送CSR消息。Step 606: The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
这里,CSR消息符合PKCS#10定义的CSR数据格式,并遵循以下原则:CSR消息携带证书请求信息和第一签名,第一签名基于智能家居应用的私钥(即步骤604中生成的私钥)对证书请求信息进行签名得到;其中,证书请求信息包括版本(version)信息、主题(subject)信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括车的特征信息,公钥信息包括智能家居应用的公钥(即步骤604中生成的公钥)。可选地,主题信息包括以下至少一种车的特征信息:车的厂家标识(Vendor ID)、车的产品标识(Product ID)、车的设备序列号(Device Serial Number或者Device ID)。Here, the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries the certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 604) The certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information. The version information includes the version number of the certificate request information. The subject information includes the car’s characteristic information and the public key information. The information includes the public key of the smart home application (ie, the public key generated in step 604). Optionally, the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
步骤607:用户在手机上确认用车控制智能家居设备。Step 607: The user confirms using the car to control the smart home device on the mobile phone.
这里,手机弹出对话界面,提示用户是否同意用车控制智能家居设备。Here, a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
步骤608:手机将CSR消息转发给云平台,并为智能家居应用申请用于注册至云平台的访问令牌(Access Token)。Step 608: The mobile phone forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
这里,手机获得用户同意用车控制智能家居设备的确认操作后,将CSR消息转发给云平台,并为智能家居应用申请用于注册至云平台的访问令牌(Access Token)。Here, after the mobile phone obtains the confirmation operation of the user's consent to use the car to control the smart home device, it forwards the CSR message to the cloud platform and applies for an access token (Access Token) for the smart home application to register with the cloud platform.
步骤609:云平台为智能家居应用分配应用标识(APPID),并用应用标识和智能家居应用的公钥生成智能家居应用的证书,以及生成智能家居应用的访问令牌,并用智能家居应用的公钥加密访问令牌得到加密令牌(CToken)。Step 609: The cloud platform assigns an application identification (APPID) to the smart home application, and uses the application identification and the public key of the smart home application to generate a certificate for the smart home application, and generates an access token for the smart home application, and uses the public key of the smart home application. Encrypt the access token to get the encryption token (CToken).
这里,也可以在步骤608中由手机为智能家居应用分配应用标识(APPID),并将该应用标识发送给云平台。Here, in step 608, the mobile phone may also assign an application identification (APPID) to the smart home application and send the application identification to the cloud platform.
这里,云平台获得CSR消息后,会对该CSR消息进行验证,并在验证通过后执行步骤609。云平台对CSR消息进行验证的方式是:云平台从CSR消息中的证书请求信息中获取智能家居应用的公钥,用智能家居应用的公钥对第一签名进行验签,验签成功则表示验证通过。Here, after the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 609 after the verification passes. The way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
步骤610:云平台建立用户标识(userID)、应用标识(APPID)和访问令牌(AccessToken)的绑定关系。Step 610: The cloud platform establishes the binding relationship between the user ID (userID), the application ID (APPID) and the access token (AccessToken).
步骤611:云平台将智能家居应用的证书和加密令牌返回给手机。Step 611: The cloud platform returns the certificate and encryption token of the smart home application to the mobile phone.
这里,云平台向手机返回的参数参照以上表1所示,包括:加密令牌(CToken)、证书链(CertChain)、令牌有效时长(TokenExpiration)。Here, the parameters returned by the cloud platform to the mobile phone are shown in Table 1 above, including: encryption token (CToken), certificate chain (CertChain), and token validity period (TokenExpiration).
步骤612:手机将智能家居应用的证书和加密令牌、以及云平台的地址配置给智能家居应用。Step 612: The mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application.
这里,手机通过配置指令将智能家居应用的证书和加密令牌、以及云平台的地址配置给智能家居应用,配置指令携带的配置参数参照以上表2所示,包括:智能家居应用证书(SmartHomeAPPCert)、中间证书(IntermediateCert)、根证书(RootCert)、云平台地址(CloudAddress)、加密令牌(CToken)、令牌有效时长(TokenExpiration)。其中,SmartHomeAPPCert、IntermediateCert和RootCert组成了证书链(CertChain)。Here, the mobile phone configures the certificate and encryption token of the smart home application, and the address of the cloud platform to the smart home application through configuration instructions. The configuration parameters carried by the configuration instructions are shown in Table 2 above, including: Smart Home Application Certificate (SmartHomeAPPCert) , intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), encryption token (CToken), and token validity period (TokenExpiration). Among them, SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
步骤613:车的智能家居应用用私钥解密加密令牌,得到访问令牌,完成配置。Step 613: The car's smart home application uses the private key to decrypt the encrypted token, obtain the access token, and complete the configuration.
步骤614:车的智能家居应用基于配置的云平台的地址与云平台建立物理连接,并基于物理连接使用配置的证书与云平台建立安全连接。Step 614: The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
步骤615:车的智能家居应用基于安全连接使用应用标识和访问令牌注册到云平台。Step 615: The car's smart home application is registered to the cloud platform using the application identification and access token based on the secure connection.
可选地,云平台会向车的智能家居应用返回一个新的访问令牌。Optionally, the cloud platform returns a new access token to the car's smart home application.
这里,云平台会提出注册接口,注册接口的说明如上表3所示,注册接口使用的HTTP方法(HTTP Method)为POST,注册接口对应的接口访问地址为“/account”。Here, the cloud platform will propose a registration interface. The description of the registration interface is shown in Table 3 above. The HTTP method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account".
云平台的注册接口涉及到的参数有注册请求接口参数和注册响应接口参数。其中,注册请求接口参数的说明如上表4所示,注册请求接口参数位于POST请求消息中的体(Body)中,包括访问令牌(AccessToken)和应用标识(APPID)。注册响应接口参数的说明如上表5所示,注册响应接口参数位于POST响应消息中的Body,包括访问令牌(AccessToken)和令牌有效时长(TokenExpiration)。The parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters. Among them, the description of the registration request interface parameters is shown in Table 4 above. The registration request interface parameters are located in the body (Body) of the POST request message, including the access token (AccessToken) and the application identification (APPID). The description of the registration response interface parameters is shown in Table 5 above. The registration response interface parameters are located in the Body of the POST response message, including the access token (AccessToken) and the token validity period (TokenExpiration).
步骤616:车的智能家居应用用应用标识和访问令牌(如果有新的访问令牌则用新的访问令牌)登录云平台。Step 616: The car's smart home application uses the application identification and access token (use a new access token if there is a new access token) to log in to the cloud platform.
这里,车的智能家居应用登录云平台后,用户可使用车的智能家居应用通过云平台控制接入云平台的智能家居设备。Here, after the Che's smart home application logs into the cloud platform, the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
应用实例三Application example three
图7是本申请实施例提供的设备配置方法的流程示意图四,如图7所示,该设备配置方法包括以下步骤:Figure 7 is a schematic flow chart 4 of a device configuration method provided by an embodiment of the present application. As shown in Figure 7, the device configuration method includes the following steps:
步骤701:车与手机建立连接,手机获取车支持智能家居应用能力。Step 701: The car establishes a connection with the mobile phone, and the mobile phone obtains the car's ability to support smart home applications.
这里,车与手机可以通过蓝牙或者WiFi建立连接。Here, the car and the mobile phone can be connected through Bluetooth or WiFi.
这里,手机可以查询车的能力,发现车支持智能家居应用能力。或者,车将自身的智能家居应用能力上报给手机。这里,智能家居应用能力是指智能家居应用支持的能力,即支持控制智能家居设备的能力。Here, the mobile phone can query the car's capabilities and discover that the car supports smart home application capabilities. Or, the car reports its smart home application capabilities to the mobile phone. Here, smart home application capabilities refer to the capabilities supported by smart home applications, that is, the ability to support the control of smart home devices.
步骤702:用户在手机上确认用车控制智能家居设备。Step 702: The user confirms using the car to control the smart home device on the mobile phone.
这里,手机弹出对话界面,提示用户是否同意用车控制智能家居设备。Here, a dialogue interface pops up on the phone, prompting the user whether he agrees to use the car to control smart home devices.
步骤703:手机向车发送启动指令,触发车启动智能家居应用。Step 703: The mobile phone sends a start command to the car, triggering the car to start the smart home application.
这里,手机获得用户同意用车控制智能家居设备的确认操作后,向车发送启动指令,触发车启动智能家居应用。Here, after the mobile phone obtains the user's confirmation operation of using the car to control the smart home device, it sends a start command to the car, triggering the car to start the smart home application.
步骤704:车的智能家居应用启动后,生成密钥对。Step 704: After the car's smart home application is started, a key pair is generated.
这里,密钥对是指公钥和私钥对。智能家居应用将自身的私钥存储在安全区。Here, the key pair refers to the public key and private key pair. Smart home applications store their own private keys in secure areas.
步骤705:车的智能家居应用生成CSR消息,向手机发送CSR消息。Step 705: The car's smart home application generates a CSR message and sends the CSR message to the mobile phone.
这里,CSR消息符合PKCS#10定义的CSR数据格式,并遵循以下原则:CSR消息携带证书请求信息和第一签名,第一签名基于智能家居应用的私钥(即步骤704中生成的私钥)对证书请求信息进行签名得到;其中,证书请求信息包括版本(version)信息、主题(subject)信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括车的特征信息,公钥信息包括智能家居应用的公钥(即步骤704中生成的公钥)。可选地,主题信息包括以下至少一种车的特征信息:车的厂家标识(Vendor ID)、车的产品标识(Product ID)、车的设备序列号(Device Serial Number或者Device ID)。Here, the CSR message conforms to the CSR data format defined by PKCS#10 and follows the following principles: the CSR message carries certificate request information and the first signature, and the first signature is based on the private key of the smart home application (that is, the private key generated in step 704) The certificate request information is obtained by signing; among them, the certificate request information includes version information, subject information and public key information. The version information includes the version number of the certificate request information. The subject information includes the car’s characteristic information and the public key information. The information includes the public key of the smart home application (ie, the public key generated in step 704). Optionally, the subject information includes at least one of the following vehicle characteristic information: the vehicle's manufacturer identification (Vendor ID), the vehicle's product identification (Product ID), and the vehicle's device serial number (Device Serial Number or Device ID).
步骤706:手机将CSR消息转发给云平台。Step 706: The mobile phone forwards the CSR message to the cloud platform.
步骤707:云平台为智能家居应用分配应用标识1(APPID1),并用应用标识1和智能家居应用的公钥生成智能家居应用的证书。Step 707: The cloud platform assigns application identification 1 (APPID1) to the smart home application, and uses application identification 1 and the public key of the smart home application to generate a certificate for the smart home application.
这里,也可以在步骤706中由手机为智能家居应用分配应用标识1(clientID1),并将该应用标识1发送给云平台。Here, in step 706, the mobile phone may also allocate application identification 1 (clientID1) to the smart home application, and send the application identification 1 to the cloud platform.
这里,云平台获得CSR消息后,会对该CSR消息进行验证,并在验证通过后执行步骤707。云平台对CSR消息进行验证的方式是:云平台从CSR消息中的证书请求信息中获取智能家居应用的公钥,用智能家居应用的公钥对第一签名进行验签,验签成功则表示验证通过。Here, after the cloud platform obtains the CSR message, it will verify the CSR message, and execute step 707 after the verification passes. The way the cloud platform verifies the CSR message is: the cloud platform obtains the public key of the smart home application from the certificate request information in the CSR message, and uses the public key of the smart home application to verify the first signature. If the verification is successful, it means Verification passed.
步骤708:云平台将智能家居应用的证书返回给手机。Step 708: The cloud platform returns the certificate of the smart home application to the mobile phone.
这里,云平台向手机返回的参数参照以下表6所示,包括:证书链(CertChain)。其中,证书链包括至少2级证书,例如证书链包括根证书和目标证书,目标证书即为智能家居应用的证书,目标证书由根证书签发。例如证书链包括根证书、一个或多个中间证书、以及目标证书,目标证书即为智能家居应用的证书,目标证书由一个或多个中间证书签发,中间证书由根证书签发。在基于证书的认证过程中,需要对证书链中的每级证书进行认证,认证通过后,便可以确定证书的拥有者的身份是合法的。Here, the parameters returned by the cloud platform to the mobile phone are shown in Table 6 below, including: Certificate Chain (CertChain). Among them, the certificate chain includes at least level 2 certificates. For example, the certificate chain includes a root certificate and a target certificate. The target certificate is the certificate of the smart home application, and the target certificate is signed by the root certificate. For example, the certificate chain includes a root certificate, one or more intermediate certificates, and a target certificate. The target certificate is the certificate of the smart home application. The target certificate is signed by one or more intermediate certificates, and the intermediate certificate is signed by the root certificate. In the certificate-based authentication process, each level of the certificate in the certificate chain needs to be authenticated. After the authentication is passed, it can be determined that the identity of the certificate owner is legal.
Figure PCTCN2022106311-appb-000004
Figure PCTCN2022106311-appb-000004
表6Table 6
步骤709:手机将智能家居应用的证书和手机的应用标识2(APPID2)、以及云平台的地址配置给智能家居应用。Step 709: The mobile phone configures the certificate of the smart home application, the application identification 2 (APPID2) of the mobile phone, and the address of the cloud platform to the smart home application.
这里,手机通过配置指令将智能家居应用的证书和手机的应用标识2、以及云平台的地址配置给智能家居应用,配置指令携带的配置参数参照以下表7所示,包括:智能家居应用证书(SmartHomeAPPCert)、中间证书(IntermediateCert)、根证书(RootCert)、云平台地址(CloudAddress)、应用标识2(APPID2)。其中,SmartHomeAPPCert、IntermediateCert和RootCert组成了证书链(CertChain)。Here, the mobile phone configures the certificate of the smart home application, the application identification 2 of the mobile phone, and the address of the cloud platform to the smart home application through the configuration command. The configuration parameters carried by the configuration command are shown in Table 7 below, including: smart home application certificate ( SmartHomeAPPCert), intermediate certificate (IntermediateCert), root certificate (RootCert), cloud platform address (CloudAddress), application identification 2 (APPID2). Among them, SmartHomeAPPCert, IntermediateCert and RootCert form the certificate chain (CertChain).
Figure PCTCN2022106311-appb-000005
Figure PCTCN2022106311-appb-000005
Figure PCTCN2022106311-appb-000006
Figure PCTCN2022106311-appb-000006
表7Table 7
步骤710:车的智能家居应用基于配置的云平台的地址与云平台建立物理连接,并基于物理连接使用配置的证书与云平台建立安全连接。Step 710: The car's smart home application establishes a physical connection with the cloud platform based on the configured address of the cloud platform, and uses the configured certificate to establish a secure connection with the cloud platform based on the physical connection.
步骤711:车的智能家居应用基于安全连接使用应用标识1和手机的应用标识2注册到云平台。Step 711: The car's smart home application is registered to the cloud platform using application identification 1 and the mobile phone's application identification 2 based on a secure connection.
这里,云平台会提出注册接口,注册接口的说明如上表3所示,注册接口使用的HTTP方法(HTTP Method)为POST,注册接口对应的接口访问地址为“/account”。Here, the cloud platform will propose a registration interface. The description of the registration interface is shown in Table 3 above. The HTTP method used by the registration interface is POST, and the interface access address corresponding to the registration interface is "/account".
云平台的注册接口涉及到的参数有注册请求接口参数和注册响应接口参数。其中,注册请求接口参数的说明如下表8所示,注册请求接口参数位于POST请求消息中的体(Body)中,包括应用标识2(APPID2)和应用标识1(APPID1)。注册响应接口参数的说明如下表9所示,注册响应接口参数位于POST响应消息中的头(Header)和Body,Header包括内容类型(Content-Type),Body包括访问令牌(AccessToken)和令牌有效时长(TokenExpiration)。The parameters involved in the registration interface of the cloud platform include registration request interface parameters and registration response interface parameters. The description of the registration request interface parameters is shown in Table 8 below. The registration request interface parameters are located in the body (Body) of the POST request message, including application identification 2 (APPID2) and application identification 1 (APPID1). The description of the registration response interface parameters is shown in Table 9 below. The registration response interface parameters are located in the header (Header) and Body in the POST response message. The header includes the content type (Content-Type), and the body includes the access token (AccessToken) and token. Validity duration (TokenExpiration).
位置Location 参数parameter 值类型value type 必填Required 说明illustrate
BodyBody APPID2APPID2 字符串string yes 手机的配置器的应用标识The application ID of the phone's configurator
BodyBody APPID1APPID1 字符串string yes 智能家居应用的应用标识Application ID for smart home applications
表8Table 8
Figure PCTCN2022106311-appb-000007
Figure PCTCN2022106311-appb-000007
表9Table 9
步骤712:云平台根据手机的应用标识2找到对应的用户标识(userID),为车的智能家居应用分配访问令牌。Step 712: The cloud platform finds the corresponding user ID (userID) based on the mobile phone's application ID 2, and allocates an access token to the car's smart home application.
步骤713:云平台建立用户标识(userID)、应用标识1(APPID1)和访问令牌(AccessToken)的绑定关系。Step 713: The cloud platform establishes the binding relationship between user ID (userID), application ID 1 (APPID1) and access token (AccessToken).
步骤714:云平台向车的智能家居应用下发访问令牌。Step 714: The cloud platform issues an access token to the car's smart home application.
步骤715:车的智能家居应用用应用标识1和访问令牌登录云平台。Step 715: The car's smart home application uses the application identification 1 and the access token to log in to the cloud platform.
这里,车的智能家居应用登录云平台后,用户可使用车的智能家居应用通过云平台控制接入云平台的智能家居设备。Here, after the Che's smart home application logs into the cloud platform, the user can use the Che's smart home application to control the smart home devices connected to the cloud platform through the cloud platform.
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。又例如,在不冲突的前提下,本申请描述的各个实施例和/或各个实施例中的技术特征可以和现有技术任意的相互组合,组合之后得到的技术方案也应落入本申请的保护范围。The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings. However, the present application is not limited to the specific details of the above-mentioned embodiments. Within the scope of the technical concept of the present application, various simple modifications can be made to the technical solutions of the present application. These simple modifications all belong to the protection scope of this application. For example, each of the specific technical features described in the above-mentioned specific embodiments can be combined in any suitable manner without conflict. In order to avoid unnecessary repetition, this application will no longer describe various possible combinations. Specify otherwise. As another example, any combination of various embodiments of the present application can be carried out. As long as they do not violate the idea of the present application, they should also be regarded as the contents disclosed in the present application. For another example, on the premise of no conflict, the various embodiments described in this application and/or the technical features in each embodiment can be arbitrarily combined with the existing technology, and the technical solution obtained after the combination shall also fall within the scope of this application. protected range.
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that in the various method embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be used in this application. The implementation of the examples does not constitute any limitations.
图8是本申请实施例提供的设备配置装置的结构组成示意图一,应用于第一设备,如图8所示,包括:Figure 8 is a schematic structural diagram of a device configuration device provided by an embodiment of the present application. It is applied to the first device. As shown in Figure 8, it includes:
获取单元801,用于从服务器获取第一证书和/或第一凭证;Obtaining unit 801, used to obtain the first certificate and/or first voucher from the server;
配置单元802,用于将所述第一证书和/或所述第一凭证配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。Configuration unit 802, configured to configure the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used for the first application to establish a relationship with the server. Secure connection, the first credential is used for the first application to register with the server.
在一些实施方式中,所述装置还包括:通信单元803;获取单元801通过通信单元803获取第一证书和/或第一凭证。通信单元803,用于向服务器发送第一证书请求消息和/或凭证申请消息,第一证书请求消息用于请求服务器为第一应用生成第一证书,凭证申请消息用于向服务器申请为第一应用分配第一凭证;接收服务器发送的第一证书和/或第一凭证。In some implementations, the device further includes: a communication unit 803; the obtaining unit 801 obtains the first certificate and/or the first voucher through the communication unit 803. The communication unit 803 is used to send a first certificate request message and/or a credential application message to the server. The first certificate request message is used to request the server to generate a first certificate for the first application. The credential application message is used to apply to the server for the first application. The application allocates the first credential; receives the first certificate and/or the first credential sent by the server.
在一些实施方式中,通信单元803,还用于接收第一应用发送的第二证书请求消息,第二证书请求消息由第一应用生成,所述第一证书请求消息基于所述第二证书请求消息确定。In some implementations, the communication unit 803 is also configured to receive a second certificate request message sent by the first application. The second certificate request message is generated by the first application, and the first certificate request message is based on the second certificate request. The news is confirmed.
在一些实施方式中,第一证书请求消息携带证书请求信息和第一签名,和/或,所述第二证书请求消息携带证书请求信息和第一签名;第一签名基于第一应用的私钥对证书请求信息进行签名得到;证书请求信息包括版本信息、主题信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括第二设备的特征信息,公钥信息包括第一应用的公钥。In some embodiments, the first certificate request message carries certificate request information and a first signature, and/or the second certificate request message carries certificate request information and a first signature; the first signature is based on the private key of the first application Obtained by signing the certificate request information; the certificate request information includes version information, subject information and public key information, the version information includes the version number of the certificate request information, the subject information includes feature information of the second device, and the public key information includes the first application public key.
在一些实施方式中,第二设备的特征信息包括以下至少之一:第二设备的厂家标识、第二设备的产品标识、第二设备的设备序列号。In some implementations, the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
在一些实施方式中,第一应用的公钥用于服务器对第一签名进行验签,并在验签成功后为第一应用生成第一证书。In some implementations, the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application.
在一些实施方式中,第一证书由服务器基于第一应用的公钥生成;或者,第一证书由服务器基于第一应用的公钥和第一应用标识生成,第一应用标识为第一应用的标识。In some embodiments, the first certificate is generated by the server based on the public key of the first application; or the first certificate is generated by the server based on the public key of the first application and the first application identifier, and the first application identifier is the first application's public key. logo.
在一些实施方式中,第一应用标识由服务器在接收到第一设备发送的第一证书请求消息后为第一应用生成。In some implementations, the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
在一些实施方式中,第一应用标识由第一设备在接收到第一应用发送的第二证书请求消息后为第一应用生成,通信单元803,还用于将生成的第一应用标识发送给服务器。In some implementations, the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application. The communication unit 803 is also configured to send the generated first application identification to server.
在一些实施方式中,第一凭证为第一访问令牌,第一访问令牌由服务器为第一应用分配;或者,第一凭证为第一加密令牌,第一加密令牌由服务器基于第一应用的公钥对第一访问令牌进行加密得到,第一访问令牌由服务器为第一应用分配。In some implementations, the first credential is a first access token, and the first access token is allocated by the server for the first application; or the first credential is a first encryption token, and the first encryption token is allocated by the server based on the first application. The first access token is obtained by encrypting the public key of an application, and the first access token is allocated by the server to the first application.
在一些实施方式中,第一设备未从服务器获取第一凭证的情况下,配置单元802,还用于将第二应用标识配置给第一应用;第二应用标识为第一设备对应的应用标识,第二应用标识用于第一应用注册至服务器。In some embodiments, when the first device does not obtain the first credential from the server, the configuration unit 802 is also configured to configure the second application identifier to the first application; the second application identifier is the application identifier corresponding to the first device. , the second application identifier is used for the first application to register with the server.
在一些实施方式中,配置单元802,还用于将服务器的地址配置给第二设备中的第一应用;其中,服务器的地址用于第一应用与服务器建立物理连接,第一证书用于基于物理连接建立第一应用与服务器之间的安全连接。In some embodiments, the configuration unit 802 is also used to configure the address of the server to the first application in the second device; wherein the address of the server is used for the first application to establish a physical connection with the server, and the first certificate is used for establishing a physical connection with the server based on The physical connection establishes a secure connection between the first application and the server.
在一些实施方式中,通信单元803,还用于向第二设备发送启动指令,启动指令用于触发第二设备启动第一应用。In some implementations, the communication unit 803 is also used to send a startup instruction to the second device, and the startup instruction is used to trigger the second device to start the first application.
在一些实施方式中,所述装置还包括:人机交互单元,用于输出第一提示信息,第一提示信息用于提示用户是否同意启动第一应用;在获得用户输入的针对第一提示信息的确认操作后,向第二设备发送启动指令。In some embodiments, the device further includes: a human-computer interaction unit configured to output first prompt information, the first prompt information being used to prompt the user whether to agree to launch the first application; after obtaining user input for the first prompt information After the confirmation operation, a start command is sent to the second device.
在一些实施方式中,所述装置还包括:确定单元,用于确定第二设备支持控制IoT设备的能力。In some implementations, the apparatus further includes: a determining unit configured to determine that the second device supports the ability to control the IoT device.
在一些实施方式中,第一设备接收第一应用发送的证书请求消息之前,第二设备基于获得的启动操作启动第一应用。In some implementations, before the first device receives the certificate request message sent by the first application, the second device starts the first application based on the obtained startup operation.
在一些实施方式中,第一设备与服务器属于同一应用平台,第二设备与服务器属于不同的应用平台。In some implementations, the first device and the server belong to the same application platform, and the second device and the server belong to different application platforms.
本领域技术人员应当理解,本申请实施例的上述设备配置装置的相关描述可以参照本申请实施例的设备配置方法的相关描述进行理解。Persons skilled in the art should understand that the relevant description of the above device configuration apparatus in the embodiment of the present application can be understood with reference to the relevant description of the device configuration method in the embodiment of the present application.
图9是本申请实施例提供的设备配置装置的结构组成示意图二,应用于第二设备(具体为第二设备的第一应用),如图9所示,包括:Figure 9 is a schematic diagram 2 of the structural composition of a device configuration device provided by an embodiment of the present application. It is applied to the second device (specifically, the first application of the second device). As shown in Figure 9, it includes:
获取单元901,用于获取第一设备配置的第一证书和/或第一凭证,所述第一证书和/或第一凭证由所述第一设备从服务器获得;Obtaining unit 901, configured to obtain the first certificate and/or the first credential configured by the first device, the first certificate and/or the first credential being obtained by the first device from the server;
接入单元902,用于基于所述第一证书与所述服务器建立安全连接和/或基于所述第一凭证注册至所述服务器。Access unit 902, configured to establish a secure connection with the server based on the first certificate and/or register with the server based on the first certificate.
在一些实施方式中,所述装置还包括:生成单元903和通信单元904;生成单元903,用于生成第二证书请求消息;通信单元904,用于向第一设备发送第二证书请求消息;所述第二证书请求消息用于所述第一设备确定第一证书请求消息,第一证书请求消息由第一设备转发至服务器,用于请求服务器为第一应用生成第一证书。In some implementations, the apparatus further includes: a generating unit 903 and a communication unit 904; the generating unit 903 is used to generate a second certificate request message; the communication unit 904 is used to send the second certificate request message to the first device; The second certificate request message is used by the first device to determine the first certificate request message. The first certificate request message is forwarded by the first device to the server and used to request the server to generate a first certificate for the first application.
在一些实施方式中,第一证书请求消息携带证书请求信息和第一签名,和/或,第二证书请求消息携带证书请求信息和第一签名;第一签名基于第一应用的私钥对证书请求信息进行签名得到;证书请求信息包括版本信息、主题信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括第二设备的特征信息,公钥信息包括第一应用的公钥。In some embodiments, the first certificate request message carries certificate request information and the first signature, and/or the second certificate request message carries the certificate request information and the first signature; the first signature is based on the private key pair certificate of the first application The request information is obtained by signing; the certificate request information includes version information, subject information and public key information. The version information includes the version number of the certificate request information. The subject information includes the characteristic information of the second device. The public key information includes the public key of the first application. .
在一些实施方式中,第二设备的特征信息包括以下至少之一:第二设备的厂家标识、第二设备的产品标识、第二设备的设备序列号。In some implementations, the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
在一些实施方式中,第一应用的公钥用于服务器对第一签名进行验签,并在验签成功后为第一应用生成第一证书。In some implementations, the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the first certificate is generated for the first application.
在一些实施方式中,第一证书由服务器基于第一应用的公钥生成;或者,第一证书由服务器基于第一应用的公钥和第一应用标识生成,第一应用标识为第一应用的标识。In some embodiments, the first certificate is generated by the server based on the public key of the first application; or the first certificate is generated by the server based on the public key of the first application and the first application identifier, and the first application identifier is the first application's public key. logo.
在一些实施方式中,第一应用标识由服务器在接收到第一设备发送的第一证书请求消息后为第一应用生成。In some implementations, the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
在一些实施方式中,第一应用标识由第一设备在接收到第一应用发送的第二证书请求消息后为第一应用生成,并由第一设备发送给服务器。In some implementations, the first application identifier is generated by the first device for the first application after receiving the second certificate request message sent by the first application, and is sent by the first device to the server.
在一些实施方式中,接入单元902,用于与服务器交互各自的证书,证书被证书接收端认证通过后用于证书接收端获取证书发送端的公钥并基于证书接收端的私钥和证书发送端的公钥生成共享密钥,以完成安全连接的建立;其中,第一应用的证书为第一证书。In some embodiments, the access unit 902 is used to exchange respective certificates with the server. After the certificate is authenticated by the certificate receiving end, the certificate receiving end obtains the public key of the certificate sending end and based on the private key of the certificate receiving end and the certificate sending end. The public key generates a shared key to complete the establishment of a secure connection; the certificate of the first application is the first certificate.
在一些实施方式中,获取单元901,还用于获取第一设备配置的服务器的地址;接入单元902,用于基于服务器的地址与服务器建立物理连接,并基于物理连接与服务器交互各自的证书。In some embodiments, the obtaining unit 901 is also used to obtain the address of the server configured by the first device; the access unit 902 is used to establish a physical connection with the server based on the address of the server, and exchange respective certificates with the server based on the physical connection. .
在一些实施方式中,第一证书由服务器基于第一应用的公钥和第一应用标识生成的情况下,获取单元901,还用于基于第一证书获取第一应用标识,第一应用标识用于第一应用注册至服务器。In some embodiments, when the first certificate is generated by the server based on the public key of the first application and the first application identification, the obtaining unit 901 is further configured to obtain the first application identification based on the first certificate, and the first application identification is Register the first application to the server.
在一些实施方式中,第一凭证为第一访问令牌,第一访问令牌由服务器为第一应用分配;或者,第一凭证为第一加密令牌,第一加密令牌由服务器基于第一应用的公钥对第一访问令牌进行加密得到,第一访问令牌由服务器为第一应用分配。In some implementations, the first credential is a first access token, and the first access token is allocated by the server for the first application; or the first credential is a first encryption token, and the first encryption token is allocated by the server based on the first application. The first access token is obtained by encrypting the public key of an application, and the first access token is allocated by the server to the first application.
在一些实施方式中,接入单元902,用于第一凭证为第一访问令牌的情况下,使用第一访问令牌注册至服务器;或者,第一凭证为第一加密令牌的情况下,基于第一应用的私钥对第一加密令牌进行解密,得到第一访问令牌,使用第一访问令牌注册至服务器。In some implementations, the access unit 902 is used to register with the server using the first access token when the first credential is a first access token; or, when the first credential is a first encryption token , decrypt the first encryption token based on the private key of the first application to obtain the first access token, and use the first access token to register with the server.
在一些实施方式中,接入单元902,用于使用第一应用标识和第一访问令牌注册至服务器,第一应用标识基于第一证书获得。In some implementations, the access unit 902 is configured to register with the server using a first application identification and a first access token, and the first application identification is obtained based on the first certificate.
在一些实施方式中,接入单元902,用于使用第一应用标识和第一访问令牌登录至服务器;或者,接收服务器发送的第二访问令牌,使用第一应用标识和第二访问令牌登录至服务器。In some embodiments, the access unit 902 is used to log in to the server using the first application identification and the first access token; or, to receive the second access token sent by the server and use the first application identification and the second access token. Log in to the server.
在一些实施方式中,获取单元901,未获取第一设备配置的第一凭证的情况下,还用于获取第一设备配置的第二应用标识,第二应用标识为第一设备对应的应用标识;接入单元902,用于还用于基于第二应用标识注册至服务器。In some embodiments, the obtaining unit 901 is also used to obtain the second application identification of the first device configuration when the first credential configured by the first device is not obtained. The second application identification is the application identification corresponding to the first device. ; Access unit 902, configured to register with the server based on the second application identification.
在一些实施方式中,接入单元902,用于使用第一应用标识和第二应用标识注册至服务器,第一应用标识基于第一证书获得。In some implementations, the access unit 902 is configured to register with the server using a first application identification and a second application identification, and the first application identification is obtained based on the first certificate.
在一些实施方式中,通信单元904,用于接收服务器发送的第二访问令牌;接入单元902,用于使用第一应用标识和第二访问令牌登录至服务器。In some implementations, the communication unit 904 is used to receive the second access token sent by the server; the access unit 902 is used to log in to the server using the first application identification and the second access token.
在一些实施方式中,启动单元,用于接收第一设备发送的启动指令,在启动指令的触发下启动第一应用,或者,基于获得的启动操作启动第一应用。In some embodiments, the startup unit is configured to receive a startup instruction sent by the first device, start the first application when triggered by the startup instruction, or start the first application based on the obtained startup operation.
在一些实施方式中,所述装置还包括:人机交互单元,用于确定第一设备支持配置IoT设备的能力,输出第二提示信息,第二提示信息用于提示用户是否连接第一设备配置的IoT设备;获得用户输入的针对第二提示信息的确认操作后,触发通信单元904执行向第一设备发送证书请求消息的步骤。In some embodiments, the device further includes: a human-computer interaction unit, used to determine the ability of the first device to support the configuration of the IoT device, and to output second prompt information. The second prompt information is used to prompt the user whether to connect to the first device to configure the device. IoT device; after obtaining the confirmation operation input by the user for the second prompt information, trigger the communication unit 904 to perform the step of sending a certificate request message to the first device.
在一些实施方式中,第一设备与服务器属于不同的应用平台,第一设备与服务器属于同一应用 平台。In some implementations, the first device and the server belong to different application platforms, and the first device and the server belong to the same application platform.
本领域技术人员应当理解,本申请实施例的上述设备配置装置的相关描述可以参照本申请实施例的设备配置方法的相关描述进行理解。Persons skilled in the art should understand that the relevant description of the above device configuration apparatus in the embodiment of the present application can be understood with reference to the relevant description of the device configuration method in the embodiment of the present application.
图10是本申请实施例提供的设备配置装置的结构组成示意图三,应用于服务器,如图10所示,包括:Figure 10 is a schematic diagram 3 of the structure of a device configuration device provided by an embodiment of the present application. It is applied to a server. As shown in Figure 10, it includes:
生成单元1001,用于生成第一证书和/或第一凭证;Generating unit 1001, used to generate a first certificate and/or a first voucher;
通信单元1002,用于发送所述第一证书和/或第一凭证;其中,所述第一证书和/或第一凭证由所述第一设备配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。The communication unit 1002 is configured to send the first certificate and/or first voucher; wherein the first certificate and/or first voucher are configured by the first device to the first application in the second device; wherein , the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
在一些实施方式中,通信单元1002,还用于接收第一设备发送的第一证书请求消息和/或凭证申请消息,第一证书请求消息用于请求服务器为第一应用生成第一证书,凭证申请消息用于向服务器申请为第一应用分配第一凭证。In some implementations, the communication unit 1002 is also configured to receive a first certificate request message and/or a certificate application message sent by the first device. The first certificate request message is used to request the server to generate a first certificate for the first application. The certificate The application message is used to apply to the server to allocate the first credential to the first application.
在一些实施方式中,第一证书请求消息携带证书请求信息和第一签名,第一签名基于第一应用的私钥对证书请求信息进行签名得到;证书请求信息包括版本信息、主题信息和公钥信息,版本信息包括证书请求信息的版本号,主题信息包括第二设备的特征信息,公钥信息包括第一应用的公钥。In some embodiments, the first certificate request message carries certificate request information and a first signature. The first signature is obtained by signing the certificate request information based on the private key of the first application; the certificate request information includes version information, subject information and public key. information, the version information includes the version number of the certificate request information, the subject information includes the characteristic information of the second device, and the public key information includes the public key of the first application.
在一些实施方式中,第二设备的特征信息包括以下至少之一:第二设备的厂家标识、第二设备的产品标识、第二设备的设备序列号。In some implementations, the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, and a device serial number of the second device.
在一些实施方式中,所述装置还包括:验证单元1003,用于基于第一证书请求信息获取第一应用的公钥,基于第一应用的公钥对第一签名进行验签,并在验签成功后触发生成单元1001执行生成第一证书的步骤。In some embodiments, the device further includes: a verification unit 1003, configured to obtain the public key of the first application based on the first certificate request information, verify the first signature based on the public key of the first application, and verify After the signature is successful, the generation unit 1001 is triggered to execute the step of generating the first certificate.
在一些实施方式中,生成单元1001,用于基于第一应用的公钥生成第一证书;或者,基于第一应用的公钥和第一应用标识生成第一证书,第一应用标识为第一应用的标识。In some implementations, the generating unit 1001 is configured to generate a first certificate based on the public key of the first application; or, generate the first certificate based on the public key of the first application and the first application identifier, and the first application identifier is the first The identification of the application.
在一些实施方式中,生成单元1001,还用于在接收到第一设备发送的第一证书请求消息后为第一应用生成第一应用标识。In some implementations, the generating unit 1001 is further configured to generate a first application identifier for the first application after receiving the first certificate request message sent by the first device.
在一些实施方式中,第一应用标识由第一设备在接收到第一应用发送的第二证书请求消息后为第一应用生成,通信单元1002,还用于接收第一设备生成的第一应用标识。In some embodiments, the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application. The communication unit 1002 is also configured to receive the first application generated by the first device. logo.
在一些实施方式中,生成单元1001,用于为第一应用分配第一访问令牌,作为第一凭证;或者,为第一应用分配第一访问令牌,基于第一应用的公钥对第一访问令牌进行加密得到第一加密令牌,作为第一凭证。In some implementations, the generating unit 1001 is configured to allocate a first access token to the first application as the first credential; or to allocate the first access token to the first application based on the public key of the first application. An access token is encrypted to obtain the first encrypted token, which serves as the first credential.
在一些实施方式中,所述装置还包括:建立单元,用于建立第一用户标识、第一访问令牌以及第一应用标识之间的第一绑定关系,第一用户标识为第一设备对应的用户标识,第一应用标识为第一应用的标识;其中,第一绑定关系用于服务器确定是否接受第一应用的注册和/或登录。In some implementations, the apparatus further includes: an establishing unit, configured to establish a first binding relationship between the first user identification, the first access token and the first application identification, and the first user identification is the first device. The corresponding user identification, the first application identification is the identification of the first application; wherein, the first binding relationship is used by the server to determine whether to accept the registration and/or login of the first application.
在一些实施方式中,通信单元1002,还用于接收第一应用发送的注册请求消息,注册请求消息携带第一应用标识和第一访问令牌;验证单元1003,还用于基于第一应用标识、第一访问令牌以及第一绑定关系,确定第一应用对应的用户标识为第一用户标识,接受第一应用的注册。In some implementations, the communication unit 1002 is also configured to receive a registration request message sent by the first application, where the registration request message carries the first application identifier and the first access token; the verification unit 1003 is also configured to based on the first application identifier , the first access token and the first binding relationship, determine the user identification corresponding to the first application as the first user identification, and accept the registration of the first application.
在一些实施方式中,通信单元1002,还用于接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第一访问令牌;验证单元1003,还用于基于第一应用标识、第一访问令牌以及第一绑定关系确定第一应用对应的用户标识为第一用户标识,接受第一应用的登录。In some implementations, the communication unit 1002 is also configured to receive a login request message sent by the first application, where the login request message carries the first application identifier and the first access token; the verification unit 1003 is also configured to based on the first application identifier , the first access token and the first binding relationship determine that the user identification corresponding to the first application is the first user identification, and accept the login of the first application.
在一些实施方式中,生成单元1001,还用于生成第二访问令牌并将第一绑定关系中的第一访问令牌更新为第二访问令牌;通信单元1002,还用于向第一应用发送第二访问令牌;接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第二访问令牌;验证单元1003,还用于基于第一应用标识、第二访问令牌以及第一绑定关系确定第一应用对应的用户标识为第一用户标识,接受第一应用的登录。In some implementations, the generation unit 1001 is also configured to generate a second access token and update the first access token in the first binding relationship to the second access token; the communication unit 1002 is also configured to provide the first access token to the second access token. An application sends a second access token; receives a login request message sent by the first application, the login request message carries the first application identifier and the second access token; the verification unit 1003 is also used to based on the first application identifier, the second access token The token and the first binding relationship determine that the user identification corresponding to the first application is the first user identification, and the login of the first application is accepted.
在一些实施方式中,通信单元1002,还用于接收第一应用发送的注册请求消息,注册请求消息携带第一应用标识和第二应用标识;第一应用标识为第一应用的标识;第二应用标识为第一设备对应的应用标识,由第一设备提供给第一应用;验证单元1003,还用于基于第二应用标识确定与之对应的第一用户标识,接受第一应用的注册。In some implementations, the communication unit 1002 is also configured to receive a registration request message sent by the first application. The registration request message carries the first application identifier and the second application identifier; the first application identifier is the identifier of the first application; The application identification is an application identification corresponding to the first device, and is provided by the first device to the first application; the verification unit 1003 is also configured to determine the first user identification corresponding to the second application identification based on the second application identification, and accept the registration of the first application.
在一些实施方式中,生成单元1001,还用于生成第二访问令牌;通信单元1002,还用于向第一应用发送第二访问令牌;第二访问令牌用于第一应用登录至服务器。In some implementations, the generation unit 1001 is also used to generate a second access token; the communication unit 1002 is also used to send the second access token to the first application; the second access token is used for the first application to log in to server.
在一些实施方式中,建立单元,还用于建立第一用户标识、第二访问令牌以及第一应用标识之间的第二绑定关系,第一应用标识为第一应用的标识;其中,第二绑定关系用于服务器确定是否接 受第一应用的登录。In some embodiments, the establishment unit is also configured to establish a second binding relationship between the first user identification, the second access token and the first application identification, where the first application identification is the identification of the first application; wherein, The second binding relationship is used by the server to determine whether to accept the login of the first application.
在一些实施方式中,通信单元1002,还用于接收第一应用发送的登录请求消息,登录请求消息携带第一应用标识和第二访问令牌;验证单元1003,还用于基于第一应用标识、第二访问令牌以及第二绑定关系确定第一应用对应的用户标识为第一用户标识,授权第一应用的登录。In some implementations, the communication unit 1002 is also configured to receive a login request message sent by the first application, where the login request message carries the first application identifier and the second access token; the verification unit 1003 is also configured to based on the first application identifier , the second access token and the second binding relationship determine that the user identification corresponding to the first application is the first user identification, and authorize the login of the first application.
在一些实施方式中,服务器与第一设备属于同一应用平台,服务器与第二设备属于不同的应用平台。In some implementations, the server and the first device belong to the same application platform, and the server and the second device belong to different application platforms.
本领域技术人员应当理解,本申请实施例的上述设备配置装置的相关描述可以参照本申请实施例的设备配置方法的相关描述进行理解。Persons skilled in the art should understand that the relevant description of the above device configuration apparatus in the embodiment of the present application can be understood with reference to the relevant description of the device configuration method in the embodiment of the present application.
图11是本申请实施例提供的一种通信设备1100示意性结构图。该通信设备可以是第一设备或者第二设备或服务器,图11所示的通信设备1100包括处理器1110,处理器1110可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。Figure 11 is a schematic structural diagram of a communication device 1100 provided by an embodiment of the present application. The communication device can be a first device or a second device or a server. The communication device 1100 shown in Figure 11 includes a processor 1110. The processor 1110 can call and run a computer program from the memory to implement the method in the embodiment of the present application. .
可选地,如图11所示,通信设备1100还可以包括存储器1120。其中,处理器1110可以从存储器1120中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in Figure 11, the communication device 1100 may further include a memory 1120. The processor 1110 can call and run the computer program from the memory 1120 to implement the method in the embodiment of the present application.
其中,存储器1120可以是独立于处理器1110的一个单独的器件,也可以集成在处理器1110中。The memory 1120 may be a separate device independent of the processor 1110, or may be integrated into the processor 1110.
可选地,如图11所示,通信设备1100还可以包括收发器1130,处理器1110可以控制该收发器1130与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。Optionally, as shown in Figure 11, the communication device 1100 may also include a transceiver 1130. The processor 1110 may control the transceiver 1130 to communicate with other devices. Specifically, it may send information or data to other devices, or receive other devices. Information or data sent by the device.
其中,收发器1130可以包括发射机和接收机。收发器1130还可以进一步包括天线,天线的数量可以为一个或多个。Among them, the transceiver 1130 may include a transmitter and a receiver. The transceiver 1130 may further include an antenna, and the number of antennas may be one or more.
可选地,该通信设备1100具体可为本申请实施例的第一设备,并且该通信设备1100可以实现本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 1100 may specifically be the first device in the embodiment of the present application, and the communication device 1100 may implement the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For the sake of brevity, they are not mentioned here. Again.
可选地,该通信设备1100具体可为本申请实施例的第二设备,并且该通信设备1100可以实现本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 1100 may specifically be the second device in the embodiment of the present application, and the communication device 1100 may implement the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of brevity, they are not mentioned here. Again.
可选地,该通信设备1100具体可为本申请实施例的服务器,并且该通信设备1100可以实现本申请实施例的各个方法中由服务器实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 1100 can be specifically a server in the embodiment of the present application, and the communication device 1100 can implement the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, details will not be repeated here.
图12是本申请实施例的芯片的示意性结构图。图12所示的芯片1200包括处理器1210,处理器1210可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。Figure 12 is a schematic structural diagram of a chip according to an embodiment of the present application. The chip 1200 shown in Figure 12 includes a processor 1210. The processor 1210 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
可选地,如图12所示,芯片1200还可以包括存储器1220。其中,处理器1210可以从存储器1220中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in Figure 12, the chip 1200 may also include a memory 1220. The processor 1210 can call and run the computer program from the memory 1220 to implement the method in the embodiment of the present application.
其中,存储器1220可以是独立于处理器1210的一个单独的器件,也可以集成在处理器1210中。The memory 1220 may be a separate device independent of the processor 1210, or may be integrated into the processor 1210.
可选地,该芯片1200还可以包括输入接口1230。其中,处理器1210可以控制该输入接口1230与其他设备或芯片进行通信,具体地,可以获取其他设备或芯片发送的信息或数据。Optionally, the chip 1200 may also include an input interface 1230. The processor 1210 can control the input interface 1230 to communicate with other devices or chips. Specifically, it can obtain information or data sent by other devices or chips.
可选地,该芯片1200还可以包括输出接口1240。其中,处理器1210可以控制该输出接口1240与其他设备或芯片进行通信,具体地,可以向其他设备或芯片输出信息或数据。Optionally, the chip 1200 may also include an output interface 1240. The processor 1210 can control the output interface 1240 to communicate with other devices or chips. Specifically, it can output information or data to other devices or chips.
可选地,该芯片可应用于本申请实施例中的第一设备,并且该芯片可以实现本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the first device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For the sake of brevity, the details will not be described again.
可选地,该芯片可应用于本申请实施例中的第二设备,并且该芯片可以实现本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the second device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of brevity, the details will not be described again.
可选地,该芯片可应用于本申请实施例中的服务器,并且该芯片可以实现本申请实施例的各个方法中由服务器实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the server in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, the details will not be described again.
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-chip or system-on-chip, etc.
应理解,本申请实施例的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行 本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in the embodiment of the present application may be an integrated circuit chip and has signal processing capabilities. During the implementation process, each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available processors. Programmed logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step, and logical block diagram disclosed in the embodiments of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the above memory is an exemplary but not restrictive description. For example, the memory in the embodiment of the present application can also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, memories in embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。Embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
可选的,该计算机可读存储介质可应用于本申请实施例中的第一设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the first device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For the sake of simplicity, I won’t go into details here.
可选地,该计算机可读存储介质可应用于本申请实施例中的第二设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the second device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of simplicity, I won’t go into details here.
可选地,该计算机可读存储介质可应用于本申请实施例中的服务器,并且该计算机程序使得计算机执行本申请实施例的各个方法中由服务器实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the server in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, they will not be described here. Repeat.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。An embodiment of the present application also provides a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的第一设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the first device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
可选地,该计算机程序产品可应用于本申请实施例中的第二设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the second device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
可选地,该计算机程序产品可应用于本申请实施例中的服务器,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由服务器实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the server in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For the sake of brevity, they will not be described again here. .
本申请实施例还提供了一种计算机程序。An embodiment of the present application also provides a computer program.
可选的,该计算机程序可应用于本申请实施例中的第一设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the first device in the embodiment of the present application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the first device in each method of the embodiment of the present application. For the sake of brevity, no further details will be given here.
可选地,该计算机程序可应用于本申请实施例中的第二设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the second device in the embodiment of the present application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of brevity, no further details will be given here.
可选地,该计算机程序可应用于本申请实施例中的服务器,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由服务器实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the server in the embodiment of the present application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiment of the present application. For simplicity, in This will not be described again.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,)ROM、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory,) ROM, random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims (65)

  1. 一种设备配置方法,所述方法包括:A device configuration method, the method includes:
    第一设备从服务器获取第一证书和/或第一凭证;The first device obtains the first certificate and/or the first voucher from the server;
    所述第一设备将所述第一证书和/或所述第一凭证配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。The first device configures the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
  2. 根据权利要求1所述的方法,其中,所述第一设备从服务器获取第一证书和/或第一凭证,包括:The method according to claim 1, wherein the first device obtains the first certificate and/or the first voucher from the server, including:
    第一设备向服务器发送第一证书请求消息和/或凭证申请消息,所述第一证书请求消息用于请求所述服务器为第一应用生成第一证书,所述凭证申请消息用于向所述服务器申请为第一应用分配第一凭证;The first device sends a first certificate request message and/or a credential application message to the server. The first certificate request message is used to request the server to generate a first certificate for the first application. The credential application message is used to request the server to generate a first certificate for the first application. The server applies to allocate the first credential to the first application;
    所述第一设备接收所述服务器发送的第一证书和/或第一凭证。The first device receives the first certificate and/or the first voucher sent by the server.
  3. 根据权利要求2所述的方法,其中,所述第一设备向服务器发送第一证书请求消息和/或凭证请求消息之前,所述方法还包括:The method according to claim 2, wherein before the first device sends the first certificate request message and/or the credential request message to the server, the method further includes:
    所述第一设备接收所述第一应用发送的第二证书请求消息,所述第二证书请求消息由所述第一应用生成,所述第一证书请求消息基于所述第二证书请求消息确定。The first device receives a second certificate request message sent by the first application, the second certificate request message is generated by the first application, and the first certificate request message is determined based on the second certificate request message. .
  4. 根据权利要求3所述的方法,其中,所述第一证书请求消息携带证书请求信息和第一签名,和/或,所述第二证书请求消息携带证书请求信息和第一签名;所述第一签名基于所述第一应用的私钥对所述证书请求信息进行签名得到;所述证书请求信息包括版本信息、主题信息和公钥信息,所述版本信息包括所述证书请求信息的版本号,所述主题信息包括所述第二设备的特征信息,所述公钥信息包括所述第一应用的公钥。The method according to claim 3, wherein the first certificate request message carries certificate request information and a first signature, and/or the second certificate request message carries certificate request information and a first signature; A signature is obtained by signing the certificate request information based on the private key of the first application; the certificate request information includes version information, subject information and public key information, and the version information includes the version number of the certificate request information , the subject information includes characteristic information of the second device, and the public key information includes the public key of the first application.
  5. 根据权利要求4所述的方法,其中,所述第二设备的特征信息包括以下至少之一:所述第二设备的厂家标识、所述第二设备的产品标识、所述第二设备的设备序列号。The method of claim 4, wherein the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, a device name of the second device serial number.
  6. 根据权利要求4或5所述的方法,其中,所述第一应用的公钥用于所述服务器对所述第一签名进行验签,并在验签成功后为所述第一应用生成所述第一证书。The method according to claim 4 or 5, wherein the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the public key is generated for the first application. Describe the first certificate.
  7. 根据权利要求4至6中任一项所述的方法,其中,The method according to any one of claims 4 to 6, wherein,
    所述第一证书由所述服务器基于所述第一应用的公钥生成;或者,The first certificate is generated by the server based on the public key of the first application; or,
    所述第一证书由所述服务器基于所述第一应用的公钥和第一应用标识生成,所述第一应用标识为所述第一应用的标识。The first certificate is generated by the server based on the public key of the first application and a first application identifier, where the first application identifier is the identifier of the first application.
  8. 根据权利要求7所述的方法,其中,所述第一应用标识由所述服务器在接收到所述第一设备发送的所述第一证书请求消息后为所述第一应用生成。The method of claim 7, wherein the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
  9. 根据权利要求7所述的方法,其中,所述第一应用标识由所述第一设备在接收到所述第一应用发送的所述第二证书请求消息后为所述第一应用生成,所述方法还包括:The method of claim 7, wherein the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application, so The above methods also include:
    所述第一设备将生成的所述第一应用标识发送给所述服务器。The first device sends the generated first application identification to the server.
  10. 根据权利要求1至9中任一项所述的方法,其中,The method according to any one of claims 1 to 9, wherein,
    所述第一凭证为第一访问令牌,所述第一访问令牌由所述服务器为所述第一应用分配;或者,The first credential is a first access token, and the first access token is allocated by the server for the first application; or,
    所述第一凭证为第一加密令牌,所述第一加密令牌由所述服务器基于所述第一应用的公钥对第一访问令牌进行加密得到,所述第一访问令牌由所述服务器为所述第一应用分配。The first credential is a first encryption token. The first encryption token is obtained by encrypting a first access token by the server based on the public key of the first application. The first access token is obtained by The server assigns the first application.
  11. 根据权利要求1至9中任一项所述的方法,其中,所述第一设备未从所述服务器获取所述第一凭证的情况下,所述方法还包括:The method according to any one of claims 1 to 9, wherein if the first device does not obtain the first credential from the server, the method further includes:
    所述第一设备将第二应用标识配置给所述第一应用;所述第二应用标识为所述第一设备对应的应用标识,所述第二应用标识用于所述第一应用注册至所述服务器。The first device configures a second application identification to the first application; the second application identification is an application identification corresponding to the first device, and the second application identification is used for the first application to register to the server.
  12. 根据权利要求1至11中任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 11, wherein the method further comprises:
    所述第一设备将所述服务器的地址配置给第二设备中的第一应用;其中,所述服务器的地址 用于所述第一应用与所述服务器建立物理连接,所述第一证书用于基于所述物理连接建立所述第一应用与所述服务器之间的安全连接。The first device configures the address of the server to the first application in the second device; wherein the address of the server is used for the first application to establish a physical connection with the server, and the first certificate is used for Establishing a secure connection between the first application and the server based on the physical connection.
  13. 根据权利要求3所述的方法,其中,所述第一设备接收所述第一应用发送的所述证书请求消息之前,所述方法还包括:The method according to claim 3, wherein before the first device receives the certificate request message sent by the first application, the method further includes:
    所述第一设备向所述第二设备发送启动指令,所述启动指令用于触发所述第二设备启动所述第一应用。The first device sends a startup instruction to the second device, and the startup instruction is used to trigger the second device to start the first application.
  14. 根据权利要求13所述的方法,其中,The method of claim 13, wherein:
    所述第一设备向所述第二设备发送启动指令之前,所述方法还包括:所述第一设备输出第一提示信息,所述第一提示信息用于提示用户是否同意启动所述第一应用;Before the first device sends a startup instruction to the second device, the method further includes: the first device outputs first prompt information, and the first prompt information is used to prompt the user whether to agree to start the first device. application;
    所述第一设备向所述第二设备发送启动指令,包括:所述第一设备在获得用户输入的针对所述第一提示信息的确认操作后,向所述第二设备发送启动指令。The first device sending a startup instruction to the second device includes: the first device sending a startup instruction to the second device after obtaining a user input confirmation operation for the first prompt information.
  15. 根据权利要求13或14所述的方法,其中,所述第一设备向所述第二设备发送启动指令之前,所述方法还包括:The method according to claim 13 or 14, wherein before the first device sends a startup instruction to the second device, the method further includes:
    所述第一设备确定所述第二设备支持控制物联网IoT设备的能力。The first device determines that the second device supports the ability to control Internet of Things (IoT) devices.
  16. 根据权利要求3所述的方法,其中,所述第一设备接收所述第一应用发送的所述证书请求消息之前,所述第二设备基于获得的启动操作启动所述第一应用。The method of claim 3, wherein before the first device receives the certificate request message sent by the first application, the second device starts the first application based on the obtained start operation.
  17. 根据权利要求1至16中任一项所述的方法,其中,所述第一设备与所述服务器属于同一应用平台,所述第二设备与所述服务器属于不同的应用平台。The method according to any one of claims 1 to 16, wherein the first device and the server belong to the same application platform, and the second device and the server belong to different application platforms.
  18. 一种设备配置方法,所述方法包括:A device configuration method, the method includes:
    第二设备的第一应用获取第一设备配置的第一证书和/或第一凭证,所述第一证书和/或第一凭证由所述第一设备从服务器获得;The first application of the second device obtains the first certificate and/or the first credential configured by the first device, the first certificate and/or the first credential being obtained by the first device from the server;
    所述第一应用基于所述第一证书与所述服务器建立安全连接和/或基于所述第一凭证注册至所述服务器。The first application establishes a secure connection with the server based on the first certificate and/or registers with the server based on the first credential.
  19. 根据权利要求18所述的方法,其中,所述第二设备的第一应用获取第一设备配置的第一证书和/或第一凭证之前,所述方法还包括:The method according to claim 18, wherein before the first application of the second device obtains the first certificate and/or the first credential configured by the first device, the method further includes:
    所述第一应用生成第二证书请求消息,向所述第一设备发送所述第二证书请求消息;所述第二证书请求消息用于所述第一设备确定第一证书请求消息,所述第一证书请求消息由所述第一设备发送至所述服务器,用于请求所述服务器为第一应用生成第一证书。The first application generates a second certificate request message and sends the second certificate request message to the first device; the second certificate request message is used by the first device to determine the first certificate request message, and the A first certificate request message is sent by the first device to the server for requesting the server to generate a first certificate for the first application.
  20. 根据权利要求19所述的方法,其中,所述第一证书请求消息携带证书请求信息和第一签名,和/或,所述第二证书请求消息携带证书请求信息和第一签名;所述第一签名基于所述第一应用的私钥对所述证书请求信息进行签名得到;所述证书请求信息包括版本信息、主题信息和公钥信息,所述版本信息包括所述证书请求信息的版本号,所述主题信息包括所述第二设备的特征信息,所述公钥信息包括所述第一应用的公钥。The method according to claim 19, wherein the first certificate request message carries certificate request information and a first signature, and/or the second certificate request message carries certificate request information and a first signature; A signature is obtained by signing the certificate request information based on the private key of the first application; the certificate request information includes version information, subject information and public key information, and the version information includes the version number of the certificate request information , the subject information includes characteristic information of the second device, and the public key information includes the public key of the first application.
  21. 根据权利要求20所述的方法,其中,所述第二设备的特征信息包括以下至少之一:所述第二设备的厂家标识、所述第二设备的产品标识、所述第二设备的设备序列号。The method according to claim 20, wherein the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, a device name of the second device. serial number.
  22. 根据权利要求20或21所述的方法,其中,所述第一应用的公钥用于所述服务器对所述第一签名进行验签,并在验签成功后为所述第一应用生成所述第一证书。The method according to claim 20 or 21, wherein the public key of the first application is used by the server to verify the first signature, and after the signature verification is successful, the public key is generated for the first application. Describe the first certificate.
  23. 根据权利要求20至22中任一项所述的方法,其中,The method according to any one of claims 20 to 22, wherein,
    所述第一证书由所述服务器基于所述第一应用的公钥生成;或者,The first certificate is generated by the server based on the public key of the first application; or,
    所述第一证书由所述服务器基于所述第一应用的公钥和第一应用标识生成,所述第一应用标识为所述第一应用的标识。The first certificate is generated by the server based on the public key of the first application and a first application identifier, where the first application identifier is the identifier of the first application.
  24. 根据权利要求23所述的方法,其中,所述第一应用标识由所述服务器在接收到所述第一设备发送的所述第一证书请求消息后为所述第一应用生成。The method of claim 23, wherein the first application identification is generated by the server for the first application after receiving the first certificate request message sent by the first device.
  25. 根据权利要求23所述的方法,其中,所述第一应用标识由所述第一设备在接收到所述第一应用发送的所述第二证书请求消息后为所述第一应用生成,并由所述第一设备发送给所述服务器。The method of claim 23, wherein the first application identification is generated by the first device for the first application after receiving the second certificate request message sent by the first application, and Sent by the first device to the server.
  26. 根据权利要求23至25中任一项所述的方法,其中,所述第一应用基于所述第一证书与所述服务器建立安全连接,包括:The method according to any one of claims 23 to 25, wherein the first application establishes a secure connection with the server based on the first certificate, comprising:
    所述第一应用与所述服务器交互各自的证书,所述证书被证书接收端认证通过后用于所述证书接收端获取证书发送端的公钥并基于所述证书接收端的私钥和所述证书发送端的公钥生成共享密钥,以完成安全连接的建立;其中,所述第一应用的证书为所述第一证书。The first application interacts with the server with respective certificates. After the certificate is authenticated by the certificate receiving end, the certificate receiving end obtains the public key of the certificate sending end based on the private key of the certificate receiving end and the certificate. The public key of the sending end generates a shared key to complete the establishment of a secure connection; wherein the certificate of the first application is the first certificate.
  27. 根据权利要求26所述的方法,其中,The method of claim 26, wherein:
    所述第一应用与所述服务器交互各自的证书之前,所述方法还包括:所述第一应用获取所述第一设备配置的所述服务器的地址;Before the first application and the server interact with respective certificates, the method further includes: the first application obtains the address of the server configured by the first device;
    所述第一应用与所述服务器交互各自的证书,包括:所述第一应用基于所述服务器的地址与所述服务器建立物理连接,并基于所述物理连接与所述服务器交互各自的证书。The first application and the server exchange respective certificates, including: the first application establishes a physical connection with the server based on the address of the server, and exchanges respective certificates with the server based on the physical connection.
  28. 根据权利要求23至27中任一项所述的方法,其中,所述第一证书由所述服务器基于所述第一应用的公钥和第一应用标识生成的情况下,所述方法还包括:The method according to any one of claims 23 to 27, wherein when the first certificate is generated by the server based on the public key of the first application and the first application identification, the method further includes :
    所述第一应用基于所述第一证书获取所述第一应用标识,所述第一应用标识用于所述第一应用注册至所述服务器。The first application obtains the first application identification based on the first certificate, and the first application identification is used for the first application to register with the server.
  29. 根据权利要求18至28中任一项所述的方法,其中,The method according to any one of claims 18 to 28, wherein,
    所述第一凭证为第一访问令牌,所述第一访问令牌由所述服务器为所述第一应用分配;或者,The first credential is a first access token, and the first access token is allocated by the server for the first application; or,
    所述第一凭证为第一加密令牌,所述第一加密令牌由所述服务器基于所述第一应用的公钥对第一访问令牌进行加密得到,所述第一访问令牌由所述服务器为所述第一应用分配。The first credential is a first encryption token. The first encryption token is obtained by encrypting a first access token by the server based on the public key of the first application. The first access token is obtained by The server assigns the first application.
  30. 根据权利要求29所述的方法,其中,所述第一应用基于所述第一凭证注册至所述服务器,包括:The method of claim 29, wherein the first application registers with the server based on the first credential, comprising:
    所述第一凭证为第一访问令牌的情况下,所述第一应用使用所述第一访问令牌注册至所述服务器;或者,If the first credential is a first access token, the first application uses the first access token to register with the server; or,
    所述第一凭证为第一加密令牌的情况下,所述第一应用基于所述第一应用的私钥对所述第一加密令牌进行解密,得到所述第一访问令牌,所述第一应用使用所述第一访问令牌注册至所述服务器。When the first credential is a first encrypted token, the first application decrypts the first encrypted token based on the private key of the first application to obtain the first access token, so The first application uses the first access token to register with the server.
  31. 根据权利要求30所述的方法,其中,所述第一应用使用所述第一访问令牌注册至所述服务器,包括:The method of claim 30, wherein the first application registers with the server using the first access token, comprising:
    所述第一应用使用第一应用标识和所述第一访问令牌注册至所述服务器,所述第一应用标识基于所述第一证书获得。The first application registers with the server using a first application identification and the first access token, the first application identification being obtained based on the first certificate.
  32. 根据权利要求31所述的方法,其中,所述第一应用使用第一应用标识和所述第一访问令牌注册至所述服务器之后,所述方法还包括:The method of claim 31, wherein after the first application registers with the server using the first application identification and the first access token, the method further includes:
    所述第一应用使用所述第一应用标识和所述第一访问令牌登录至所述服务器;或者,The first application uses the first application identification and the first access token to log in to the server; or,
    所述第一应用接收所述服务器发送的第二访问令牌,使用所述第一应用标识和所述第二访问令牌登录至所述服务器。The first application receives the second access token sent by the server, and logs in to the server using the first application identification and the second access token.
  33. 根据权利要求18至28中任一项所述方法,其中,所述第二设备的第一应用未获取第一设备配置的所述第一凭证的情况下,所述方法还包括:The method according to any one of claims 18 to 28, wherein if the first application of the second device does not obtain the first credential configured by the first device, the method further includes:
    所述第一应用获取所述第一设备配置的第二应用标识,所述第二应用标识为所述第一设备对应的应用标识;The first application obtains a second application identifier configured by the first device, and the second application identifier is an application identifier corresponding to the first device;
    所述第一应用基于所述第二应用标识注册至所述服务器。The first application is registered with the server based on the second application identification.
  34. 根据权利要求33所述方法,其中,所述第一应用基于所述第二应用标识注册至所述服务器,包括:The method of claim 33, wherein the first application registers with the server based on the second application identification, comprising:
    所述第一应用使用第一应用标识和所述第二应用标识注册至所述服务器,所述第一应用标识基于所述第一证书获得。The first application registers with the server using a first application identification and a second application identification, and the first application identification is obtained based on the first certificate.
  35. 根据权利要求34所述方法,其中,所述第一应用使用第一应用标识和所述第二应用标识注册至所述服务器之后,所述方法还包括:The method according to claim 34, wherein after the first application is registered with the server using the first application identification and the second application identification, the method further includes:
    所述第一应用接收所述服务器发送的第二访问令牌,使用所述第一应用标识和所述第二访问 令牌登录至所述服务器。The first application receives the second access token sent by the server, and logs in to the server using the first application identification and the second access token.
  36. 根据权利要求19至28中任一项所述方法,其中,所述向所述第一设备发送所述证书请求消息之前,所述方法还包括:The method according to any one of claims 19 to 28, wherein before sending the certificate request message to the first device, the method further includes:
    所述第二设备接收所述第一设备发送的启动指令,在所述启动指令的触发下启动所述第一应用。The second device receives a startup instruction sent by the first device, and starts the first application when triggered by the startup instruction.
  37. 根据权利要求19至28中任一项所述方法,其中,所述向所述第一设备发送所述证书请求消息之前,所述方法还包括:The method according to any one of claims 19 to 28, wherein before sending the certificate request message to the first device, the method further includes:
    所述第二设备基于获得的启动操作启动所述第一应用。The second device launches the first application based on the obtained launch operation.
  38. 根据权利要求37所述方法,其中,所述第二设备基于获得的启动操作启动所述第一应用之后,所述方法还包括:The method according to claim 37, wherein after the second device starts the first application based on the obtained startup operation, the method further includes:
    所述第二设备的第一应用确定所述第一设备支持配置IoT设备的能力,输出第二提示信息,所述第二提示信息用于提示用户是否连接所述第一设备配置的IoT设备;The first application of the second device determines that the first device supports the ability to configure an IoT device, and outputs second prompt information. The second prompt information is used to prompt the user whether to connect the IoT device configured by the first device;
    所述第一应用获得用户输入的针对所述第二提示信息的确认操作后,执行所述向所述第一设备发送所述证书请求消息的步骤。After the first application obtains the confirmation operation input by the user for the second prompt information, it performs the step of sending the certificate request message to the first device.
  39. 根据权利要求18至38中任一项所述方法,其中,所述第一设备与所述服务器属于不同的应用平台,所述第一设备与所述服务器属于同一应用平台。The method according to any one of claims 18 to 38, wherein the first device and the server belong to different application platforms, and the first device and the server belong to the same application platform.
  40. 一种设备配置方法,所述方法包括:A device configuration method, the method includes:
    服务器生成第一证书和/或第一凭证,向第一设备发送所述第一证书和/或第一凭证;其中,所述第一证书和/或第一凭证由所述第一设备配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。The server generates a first certificate and/or a first credential, and sends the first certificate and/or a first credential to the first device; wherein the first certificate and/or the first credential are configured by the first device to The first application in the second device; wherein the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
  41. 根据权利要求40所述的方法,其中,所述服务器生成第一证书和/或第一凭证之前,所述方法还包括:The method according to claim 40, wherein before the server generates the first certificate and/or the first voucher, the method further includes:
    所述服务器接收所述第一设备发送的第一证书请求消息和/或凭证申请消息,所述第一证书请求消息用于请求所述服务器为第一应用生成第一证书,所述凭证申请消息用于向所述服务器申请为第一应用分配第一凭证。The server receives a first certificate request message and/or a certificate application message sent by the first device. The first certificate request message is used to request the server to generate a first certificate for the first application. The certificate application message Used to apply to the server to allocate a first credential to the first application.
  42. 根据权利要求41所述的方法,其中,所述第一证书请求消息携带证书请求信息和第一签名,所述第一签名基于所述第一应用的私钥对所述证书请求信息进行签名得到;所述证书请求信息包括版本信息、主题信息和公钥信息,所述版本信息包括所述证书请求信息的版本号,所述主题信息包括所述第二设备的特征信息,所述公钥信息包括所述第一应用的公钥。The method of claim 41, wherein the first certificate request message carries certificate request information and a first signature, and the first signature is obtained by signing the certificate request information based on the private key of the first application. ; The certificate request information includes version information, subject information and public key information. The version information includes the version number of the certificate request information. The subject information includes feature information of the second device. The public key information Contains the public key of the first application.
  43. 根据权利要求42所述的方法,其中,所述第二设备的特征信息包括以下至少之一:所述第二设备的厂家标识、所述第二设备的产品标识、所述第二设备的设备序列号。The method according to claim 42, wherein the characteristic information of the second device includes at least one of the following: a manufacturer identification of the second device, a product identification of the second device, a device name of the second device. serial number.
  44. 根据权利要求42或43所述的方法,其中,所述方法还包括:The method of claim 42 or 43, wherein the method further comprises:
    所述服务器基于所述第一证书请求信息获取所述第一应用的公钥,基于所述第一应用的公钥对所述第一签名进行验签,并在验签成功后执行生成所述第一证书的步骤。The server obtains the public key of the first application based on the first certificate request information, verifies the first signature based on the public key of the first application, and generates the first signature after the verification is successful. Steps to First Certificate.
  45. 根据权利要求42至44中任一项所述的方法,其中,所述服务器生成第一证书,包括:The method according to any one of claims 42 to 44, wherein the server generates a first certificate, comprising:
    所述服务器基于所述第一应用的公钥生成所述第一证书;或者,The server generates the first certificate based on the public key of the first application; or,
    所述服务器基于所述第一应用的公钥和第一应用标识生成所述第一证书,所述第一应用标识为所述第一应用的标识。The server generates the first certificate based on the public key of the first application and a first application identifier, where the first application identifier is the identifier of the first application.
  46. 根据权利要求45所述的方法,其中,所述方法还包括:The method of claim 45, wherein the method further includes:
    所述服务器在接收到所述第一设备发送的所述第一证书请求消息后为所述第一应用生成所述第一应用标识。The server generates the first application identifier for the first application after receiving the first certificate request message sent by the first device.
  47. 根据权利要求45所述的方法,其中,所述第一应用标识由所述第一设备在接收到所述第一应用发送的第二证书请求消息后为所述第一应用生成,所述方法还包括:The method of claim 45, wherein the first application identifier is generated by the first device for the first application after receiving a second certificate request message sent by the first application. Also includes:
    所述服务器接收所述第一设备生成的所述第一应用标识。The server receives the first application identification generated by the first device.
  48. 根据权利要求40至47中任一项所述的方法,其中,所述服务器生成第一凭证,包括:The method according to any one of claims 40 to 47, wherein the server generates a first credential, including:
    所述服务器为所述第一应用分配第一访问令牌,作为所述第一凭证;或者,The server allocates a first access token to the first application as the first credential; or,
    所述服务器为所述第一应用分配第一访问令牌,基于所述第一应用的公钥对所述第一访问令牌进行加密得到第一加密令牌,作为所述第一凭证。The server allocates a first access token to the first application, and encrypts the first access token based on the public key of the first application to obtain a first encryption token as the first certificate.
  49. 根据权利要求48所述的方法,其中,所述方法还包括:The method of claim 48, wherein the method further includes:
    所述服务器建立第一用户标识、所述第一访问令牌以及第一应用标识之间的第一绑定关系,所述第一用户标识为所述第一设备对应的用户标识,所述第一应用标识为所述第一应用的标识;其中,所述第一绑定关系用于所述服务器确定是否接受所述第一应用的注册和/或登录。The server establishes a first binding relationship between a first user identification, the first access token, and a first application identification. The first user identification is the user identification corresponding to the first device, and the third user identification is the user identification corresponding to the first device. An application identifier is the identifier of the first application; wherein the first binding relationship is used by the server to determine whether to accept registration and/or login of the first application.
  50. 根据权利要求49所述的方法,其中,所述方法还包括:The method of claim 49, wherein the method further includes:
    所述服务器接收所述第一应用发送的注册请求消息,所述注册请求消息携带所述第一应用标识和所述第一访问令牌;The server receives a registration request message sent by the first application, where the registration request message carries the first application identifier and the first access token;
    所述服务器基于所述第一应用标识、所述第一访问令牌以及所述第一绑定关系,确定所述第一应用对应的用户标识为所述第一用户标识,接受所述第一应用的注册。The server determines that the user identification corresponding to the first application is the first user identification based on the first application identification, the first access token and the first binding relationship, and accepts the first user identification. Application registration.
  51. 根据权利要求50所述的方法,其中,所述方法还包括:The method of claim 50, wherein the method further includes:
    所述服务器接收所述第一应用发送的登录请求消息,所述登录请求消息携带所述第一应用标识和所述第一访问令牌;The server receives a login request message sent by the first application, where the login request message carries the first application identifier and the first access token;
    所述服务器基于所述第一应用标识、所述第一访问令牌以及所述第一绑定关系确定所述第一应用对应的用户标识为所述第一用户标识,接受所述第一应用的登录。The server determines that the user identification corresponding to the first application is the first user identification based on the first application identification, the first access token and the first binding relationship, and accepts the first application Login.
  52. 根据权利要求50所述的方法,其中,所述方法还包括:The method of claim 50, wherein the method further includes:
    所述服务器生成第二访问令牌并将所述第一绑定关系中的所述第一访问令牌更新为所述第二访问令牌;The server generates a second access token and updates the first access token in the first binding relationship to the second access token;
    所述服务器向所述第一应用发送所述第二访问令牌;The server sends the second access token to the first application;
    所述服务器接收所述第一应用发送的登录请求消息,所述登录请求消息携带所述第一应用标识和所述第二访问令牌;The server receives a login request message sent by the first application, where the login request message carries the first application identifier and the second access token;
    所述服务器基于所述第一应用标识、所述第二访问令牌以及所述第一绑定关系确定所述第一应用对应的用户标识为所述第一用户标识,接受所述第一应用的登录。The server determines that the user identification corresponding to the first application is the first user identification based on the first application identification, the second access token and the first binding relationship, and accepts the first application Login.
  53. 根据权利要求40至47中任一项所述的方法,其中,所述服务器未生成所述第一凭证的情况下,所述方法还包括:The method according to any one of claims 40 to 47, wherein when the server does not generate the first credential, the method further includes:
    所述服务器接收所述第一应用发送的注册请求消息,所述注册请求消息携带第一应用标识和第二应用标识;所述第一应用标识为所述第一应用的标识;所述第二应用标识为所述第一设备对应的应用标识,由所述第一设备提供给所述第一应用;The server receives a registration request message sent by the first application, the registration request message carries a first application identifier and a second application identifier; the first application identifier is the identifier of the first application; the second application identifier The application identifier is an application identifier corresponding to the first device, and is provided by the first device to the first application;
    所述服务器基于所述第二应用标识确定与之对应的第一用户标识,接受所述第一应用的注册。The server determines the first user identification corresponding to the second application identification and accepts the registration of the first application.
  54. 根据权利要求53所述的方法,其中,所述方法还包括:The method of claim 53, wherein the method further includes:
    所述服务器生成第二访问令牌,向所述第一应用发送所述第二访问令牌;所述第二访问令牌用于所述第一应用登录至所述服务器。The server generates a second access token and sends the second access token to the first application; the second access token is used by the first application to log in to the server.
  55. 根据权利要求54所述的方法,其中,所述方法还包括:The method of claim 54, wherein the method further includes:
    所述服务器建立所述第一用户标识、所述第二访问令牌以及第一应用标识之间的第二绑定关系,所述第一应用标识为所述第一应用的标识;其中,所述第二绑定关系用于所述服务器确定是否接受所述第一应用的登录。The server establishes a second binding relationship between the first user identification, the second access token and a first application identification, where the first application identification is an identification of the first application; wherein, The second binding relationship is used by the server to determine whether to accept the login of the first application.
  56. 根据权利要求55所述的方法,其中,所述方法还包括:The method of claim 55, wherein the method further includes:
    所述服务器接收所述第一应用发送的登录请求消息,所述登录请求消息携带所述第一应用标识和所述第二访问令牌;The server receives a login request message sent by the first application, where the login request message carries the first application identifier and the second access token;
    所述服务器基于所述第一应用标识、所述第二访问令牌以及所述第二绑定关系确定所述第一应用对应的用户标识为所述第一用户标识,授权所述第一应用的登录。The server determines that the user identification corresponding to the first application is the first user identification based on the first application identification, the second access token and the second binding relationship, and authorizes the first application Login.
  57. 根据权利要求40至56中任一项所述的方法,其中,所述服务器与所述第一设备属于同一应用平台,所述服务器与所述第二设备属于不同的应用平台。The method according to any one of claims 40 to 56, wherein the server and the first device belong to the same application platform, and the server and the second device belong to different application platforms.
  58. 一种设备配置装置,应用于第一设备,所述装置包括:An equipment configuration device, applied to a first device, the device includes:
    获取单元,用于从服务器获取第一证书和/或第一凭证;An acquisition unit, used to acquire the first certificate and/or the first credential from the server;
    配置单元,用于将所述第一证书和/或所述第一凭证配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。A configuration unit configured to configure the first certificate and/or the first credential to the first application in the second device; wherein the first certificate is used to establish security between the first application and the server. connection, the first credential is used for the first application to register with the server.
  59. 一种设备配置装置,应用于第二设备,所述装置包括:A device configuration device, applied to a second device, the device includes:
    获取单元,用于获取第一设备配置的第一证书和/或第一凭证,所述第一证书和/或第一凭证由所述第一设备从服务器获得;An acquisition unit, configured to acquire a first certificate and/or a first credential configured by the first device, the first certificate and/or a first credential being obtained by the first device from the server;
    接入单元,用于基于所述第一证书与所述服务器建立安全连接和/或基于所述第一凭证注册至所述服务器。An access unit configured to establish a secure connection with the server based on the first certificate and/or register with the server based on the first certificate.
  60. 一种设备配置装置,应用于服务器,所述装置包括:A device configuration device, applied to a server, the device includes:
    生成单元,用于生成第一证书和/或第一凭证;A generating unit, used to generate the first certificate and/or the first voucher;
    通信单元,用于第一设备发送所述第一证书和/或第一凭证;其中,所述第一证书和/或第一凭证由所述第一设备配置给第二设备中的第一应用;其中,所述第一证书用于所述第一应用与所述服务器建立安全连接,所述第一凭证用于所述第一应用注册至所述服务器。a communication unit configured for the first device to send the first certificate and/or the first voucher; wherein the first certificate and/or the first voucher are configured by the first device to the first application in the second device ; Wherein, the first certificate is used for the first application to establish a secure connection with the server, and the first credential is used for the first application to register with the server.
  61. 一种通信设备,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求1至17中任一项所述的方法,或者权利要求18至39中任一项所述的方法,或者权利要求40至57中任一项所述的方法。A communication device, including: a processor and a memory, the memory is used to store a computer program, the processor is used to call and run the computer program stored in the memory, and execute as described in any one of claims 1 to 17 The method, or the method described in any one of claims 18 to 39, or the method described in any one of claims 40 to 57.
  62. 一种芯片,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1至17中任一项所述的方法,或者权利要求18至39中任一项所述的方法,或者权利要求40至57中任一项所述的方法。A chip, including: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method according to any one of claims 1 to 17, or claims 18 to 39 The method of any one of claims 40 to 57.
  63. 一种计算机可读存储介质,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至17中任一项所述的方法,或者权利要求18至39中任一项所述的方法,或者权利要求40至57中任一项所述的方法。A computer-readable storage medium for storing a computer program, the computer program causing a computer to perform the method according to any one of claims 1 to 17, or the method according to any one of claims 18 to 39 , or the method of any one of claims 40 to 57.
  64. 一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行如权利要求1至17中任一项所述的方法,或者权利要求18至39中任一项所述的方法,或者权利要求40至57中任一项所述的方法。A computer program product comprising computer program instructions that cause a computer to perform the method as claimed in any one of claims 1 to 17, or the method as claimed in any one of claims 18 to 39, or the method as claimed in any one of claims 18 to 39, or The method of any one of claims 40 to 57.
  65. 一种计算机程序,所述计算机程序使得计算机执行如权利要求1至17中任一项所述的方法,或者权利要求18至39中任一项所述的方法,或者权利要求40至57中任一项所述的方法。A computer program that causes a computer to perform the method according to any one of claims 1 to 17, or the method according to any one of claims 18 to 39, or any one of claims 40 to 57. method described in one item.
PCT/CN2022/106311 2022-07-18 2022-07-18 Device configuration methods and apparatuses, and communication device WO2024016124A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/106311 WO2024016124A1 (en) 2022-07-18 2022-07-18 Device configuration methods and apparatuses, and communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/106311 WO2024016124A1 (en) 2022-07-18 2022-07-18 Device configuration methods and apparatuses, and communication device

Publications (1)

Publication Number Publication Date
WO2024016124A1 true WO2024016124A1 (en) 2024-01-25

Family

ID=89616699

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106311 WO2024016124A1 (en) 2022-07-18 2022-07-18 Device configuration methods and apparatuses, and communication device

Country Status (1)

Country Link
WO (1) WO2024016124A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138562A (en) * 2018-02-09 2019-08-16 腾讯科技(北京)有限公司 The certificate issuance method, apparatus and system of smart machine
CN110770695A (en) * 2017-06-16 2020-02-07 密码研究公司 Internet of things (IOT) device management
CN111917810A (en) * 2019-05-09 2020-11-10 Oppo广东移动通信有限公司 Cloud communication method and device, user equipment and network equipment
US20210377047A1 (en) * 2020-05-29 2021-12-02 Comcast Cable Communications, Llc Systems, methods, and apparatuses for network management
CN113783829A (en) * 2020-11-26 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for realizing equipment access in cross-platform manner

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110770695A (en) * 2017-06-16 2020-02-07 密码研究公司 Internet of things (IOT) device management
CN110138562A (en) * 2018-02-09 2019-08-16 腾讯科技(北京)有限公司 The certificate issuance method, apparatus and system of smart machine
CN111917810A (en) * 2019-05-09 2020-11-10 Oppo广东移动通信有限公司 Cloud communication method and device, user equipment and network equipment
US20210377047A1 (en) * 2020-05-29 2021-12-02 Comcast Cable Communications, Llc Systems, methods, and apparatuses for network management
CN113783829A (en) * 2020-11-26 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for realizing equipment access in cross-platform manner

Similar Documents

Publication Publication Date Title
WO2017219860A1 (en) Offline payment method and device
US8532620B2 (en) Trusted mobile device based security
US9038138B2 (en) Device token protocol for authorization and persistent authentication shared across applications
WO2018145605A1 (en) Authentication method and server, and access control device
US10148651B2 (en) Authentication system
CN112714053B (en) Communication connection method and device
WO2013056674A1 (en) Centralized security management method and system for third party application and corresponding communication system
JP2008099267A (en) Method for securing session between wireless terminal and equipment in network
KR20170106515A (en) Multi-factor certificate authority
CN112543166B (en) Real name login method and device
WO2019033822A1 (en) Methods for generating and authenticating digital certificate, communication device, and storage medium
WO2021109967A1 (en) Initial configuration method and terminal device
WO2021109963A1 (en) Initial security configuration method, security module, and terminal
CN112311543B (en) GBA key generation method, terminal and NAF network element
WO2019056971A1 (en) Authentication method and device
WO2021120924A1 (en) Method and device for certificate application
WO2014201783A1 (en) Encryption and authentication method, system and terminal for ad hoc network
WO2024016124A1 (en) Device configuration methods and apparatuses, and communication device
WO2022094936A1 (en) Access method, device, and cloud platform device
CN112583599B (en) Communication method and device
WO2019184206A1 (en) Identity authentication method and apparatus
WO2023240587A1 (en) Device permission configuration method and apparatus, and terminal device
WO2021035740A1 (en) Access control method, server, access device and storage medium
US20230327869A1 (en) Authentication method and apparatus
TWI795148B (en) Device, method and system of handling access control

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22951403

Country of ref document: EP

Kind code of ref document: A1