WO2022006825A1 - 物联网中的设备接入方法、装置、计算机设备及存储介质 - Google Patents

物联网中的设备接入方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022006825A1
WO2022006825A1 PCT/CN2020/101162 CN2020101162W WO2022006825A1 WO 2022006825 A1 WO2022006825 A1 WO 2022006825A1 CN 2020101162 W CN2020101162 W CN 2020101162W WO 2022006825 A1 WO2022006825 A1 WO 2022006825A1
Authority
WO
WIPO (PCT)
Prior art keywords
access token
access
user
account
server
Prior art date
Application number
PCT/CN2020/101162
Other languages
English (en)
French (fr)
Inventor
张军
茹昭
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/101162 priority Critical patent/WO2022006825A1/zh
Priority to CN202080100570.1A priority patent/CN115486033A/zh
Publication of WO2022006825A1 publication Critical patent/WO2022006825A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security

Definitions

  • the present application relates to the technical field of the Internet of Things, and in particular, to a device access method, apparatus, computer equipment and storage medium in the Internet of Things.
  • IOT Internet of Things
  • the cloud platform performs a verification operation during the access process of the server device.
  • the access verification process is as follows: the configuration device initiates the first registration to the cloud platform, and the cloud platform Allocate the first access token and return it to the configuration device.
  • the configuration device initiates a second registration to the cloud platform based on the first access token.
  • the second access token is allocated and returned to the A configuration device
  • the configuration device configures the second access token to the server device to be accessed
  • the server device requests access to the cloud platform based on the second access token
  • a new third access token is allocated to the server device, and the third access token is bound with the device identification of the server device, thereby completing the access process of the server device.
  • the above solution requires the cloud platform to perform multiple access token allocation operations for the configuration device and the server device.
  • the configuration device also needs to request an access token from the cloud platform for the server device.
  • the above allocation of access tokens and The acquisition process consumes a certain amount of processing time, which affects the efficiency of the server device accessing the cloud platform.
  • Embodiments of the present application provide a device access method, apparatus, computer device, and storage medium in the Internet of Things.
  • the technical solution is as follows:
  • an embodiment of the present application provides a device access method in the Internet of Things, the method is executed by a cloud platform, and the method includes:
  • a second user identification corresponding to the first user identification is allocated; the first user identification is allocated by the account server for the user account;
  • the device identification of the server device is bound to the second user identification.
  • an embodiment of the present application provides a device access method in the Internet of Things, the method is performed by a configuration device, and the method includes:
  • the user account is the account logged in the configuration device;
  • a registration request is sent to the cloud platform based on the access token, where the registration request is used to trigger the cloud platform to successfully verify the access token with the account server and assign a second user corresponding to the first user ID identifier; the first user identifier is allocated by the account server for the user account;
  • the access request is used to trigger the cloud platform to bind the device identification of the server device with the second user identification when the access token is successfully verified again.
  • an embodiment of the present application provides a device access device in the Internet of Things, the device is used in a cloud platform, and the device includes:
  • a registration request receiving module configured to receive a registration request sent by the configuration device based on an access token of a user account, where the user account is an account logged in the configuration device, and the access token is the configuration device from the account server obtained;
  • An identification allocation module configured to allocate a second user identification corresponding to the first user identification when the access token is successfully verified to the account server; the first user identification is the account server for the user account assigned;
  • an access request receiving module configured to receive an access request sent by the server device, where the access request includes the access token and the device identifier of the server device; Triggered by updating the access configuration resource containing the access token for the server device;
  • a binding module configured to bind the device identification of the server device with the second user identification when the access token is successfully verified again.
  • an embodiment of the present application provides an apparatus for accessing a device in the Internet of Things.
  • the apparatus is used for configuring a device, and the apparatus includes:
  • an access token acquisition module used for acquiring an access token of a user account from an account server; the user account is an account logged in the configuration device;
  • a registration module configured to send a registration request to the cloud platform based on the access token, where the registration request is used to trigger the cloud platform to verify the access token to the account server successfully, assigning a registration corresponding to the first user ID a corresponding second user identifier; the first user identifier is allocated by the account server for the user account;
  • an access resource configuration module configured to update the access configuration resource containing the access token for the server device, so as to trigger the server device to send the access token and the server device to the cloud platform
  • the access request of the device identification is used to trigger the cloud platform to re-verify the access token successfully, and bind the device identification of the server device with the second user identification.
  • an embodiment of the present application provides a computer device, the computer device includes a processor, a memory, and a transceiver, the memory stores a computer program, and the computer program is configured to be executed by the processor to The device access method in the above-mentioned Internet of Things is implemented.
  • an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned device access method in the Internet of Things .
  • a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the device access in the Internet of Things.
  • the configuration device obtains the access token of the currently logged-in user account from the account server.
  • the configuration device and the server device respectively initiate registration and access to the cloud platform through the access token, and the cloud platform verifies the access token to the account server.
  • the user ID can be allocated to the user corresponding to the server device, and the server device can be bound with the assigned user ID to realize the access of the server device; in the above process, the cloud platform uses the account server It implements authentication for the access token allocated by the user account logged in the configuration device, and does not need to generate an access token for the configuration device and the server device separately, which reduces the process of allocating and obtaining access tokens and shortens the access process. Therefore, the access efficiency of the server device is improved under the condition of ensuring the security of the access process.
  • FIG. 1 is a schematic diagram of a network architecture of the Internet of Things provided by an embodiment of the present application.
  • Fig. 2 is a kind of remote control schematic diagram involved in the embodiment shown in Fig. 1;
  • FIG. 3 is a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of a device access method in the Internet of Things related to the embodiment shown in FIG. 5;
  • FIG. 7 is a flowchart of another device access method in the Internet of Things related to the embodiment shown in FIG. 5;
  • FIG. 8 is a flowchart of another device access method in the Internet of Things related to the embodiment shown in FIG. 5;
  • FIG. 9 is a block diagram of a device access apparatus in the Internet of Things provided by an embodiment of the present application.
  • FIG. 10 is a block diagram of a device access apparatus in the Internet of Things provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the network architecture and service scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application.
  • the evolution of new business scenarios and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
  • FIG. 1 shows a schematic diagram of a network architecture of the Internet of Things provided by an embodiment of the present application.
  • the network architecture of the Internet of Things may include: a server device 110, a configuration device 120, a cloud platform 130, and an account server 140;
  • the server device 110 may be a device for providing Internet of Things functional services.
  • the server device 110 may be a smart home device, such as a smart TV, a smart air conditioner, a smart refrigerator, a smart microwave oven, a smart rice cooker, a cleaning robot, and the like.
  • the server device 110 may be an industrial production device such as a lathe, an industrial robot, a solar panel, a wind turbine, and the like.
  • the server device 110 may be a commercial service device, such as a vending machine or the like.
  • the server device 110 may be an intelligent monitoring device, such as a monitoring camera, an infrared sensor, a sound sensor, a temperature sensor, and the like.
  • the configuration device 120 is a device that assists the server device 110 to access the cloud platform 130 .
  • configuration device 120 is a computer device with a built-in configurator, eg, a smartphone, tablet, smart watch, personal computer, such as a desktop computer, a laptop computer, a personal workstation, and the like.
  • the configurator is a tool that provides configuration information for accessing the cloud platform for the server device.
  • the above-mentioned configurator is configuration software installed in the configuration device 120, such as a third-party application (Application, APP).
  • a third-party application Application, APP
  • the cloud platform 130 is a cloud service platform deployed on the network side.
  • the cloud platform 130 may be a cloud service platform implemented based on a single or multiple servers.
  • the account server 140 is a cloud server that provides account management and verification services.
  • the account server 140 is a server corresponding to the cloud platform 130 , or the account server 140 is a server outside the cloud platform 130 that provides third-party account services.
  • the server device 110 and the configuration device 120 are connected through a wired or wireless network, and the server device 110 and the account server 140 are connected through a wired or wireless network; the cloud platform 130 is respectively connected with the server device 110, the configuration device 120 and the account server. 140 are connected by wired or wireless network.
  • the above wired or wireless network uses standard communication technologies and/or protocols.
  • the above wired or wireless network may be a communication network based on the IoT protocol of the Internet of Things.
  • the above-mentioned server device 110, configuration device 120, and cloud platform 130 may be IoT devices that meet industry specifications, for example, may be IoT devices that meet Open Connectivity Foundation (OCF) specifications equipment.
  • OCF Open Connectivity Foundation
  • OCF is an emerging IoT application layer technical standard organization. OCF formulates a RESTful (a design style and development method for network applications) service framework for the interconnection between IoT devices.
  • RESTful a design style and development method for network applications
  • the IoT terminal device that provides resources is the OCF server (that is, the above-mentioned server-side device), and the control terminal that accesses resources is the OCF client (that is, the above-mentioned client). end device).
  • control terminal that obtains the indoor environment state data is the client device
  • the sensor device that monitors the indoor environment state data is the server device
  • the business interaction between the client device and the server device is through the creation, reading, updating, It is implemented by deleting or notifying these resource operation methods.
  • FIG. 2 shows a schematic diagram of a remote control involved in an embodiment of the present application.
  • the client device 210 sends a request to the server device 230 through the cloud platform 220 to operate the resources on the server device 230 , the server device 230 performs resource operations, and sends a request to the client through the cloud platform 220
  • the end device 210 returns a response, which carries the representation of the resource.
  • the resource's Uniform Resource Identifier is /environmentTemperature
  • the resource type is oic.r.temperature
  • the request indicates that the resource operation request is an update Operation UPDATE.
  • the request and response between the client and the server carry the representation of the resource, and the representation of the resource includes various attribute information of the resource.
  • the information of the update resource request is:
  • targetTemperature represents the target temperature attribute of the temperature resource, which represents the request to adjust the temperature to 25 degrees.
  • the representation of the resource in the update resource response returned by the server device is:
  • currentTemperature represents the current temperature attribute of the temperature resource
  • temperatureRange represents the temperature range attribute of the temperature resource
  • FIG. 3 shows a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • the method may be executed by a cloud platform, wherein the cloud platform may be the network architecture shown in FIG. 1 . 130 in the cloud platform.
  • the method may include the following steps:
  • Step 301 Receive a registration request sent by a configuration device based on an access token of a user account, where the user account is an account logged in the configuration device, and the access token is obtained by the configuration device from an account server.
  • the above registration request carries the access token of the user account obtained by the configuration device from the account server.
  • the access token of the above user account is the access token allocated by the account server for the user account.
  • Step 302 When verifying the access token to the account server successfully, assign a second user identification corresponding to the first user identification; the first user identification is allocated by the account server for the user account.
  • the cloud platform since the access token is allocated by the account server, the cloud platform initiates verification to the account server when verifying the access token.
  • the cloud platform after receiving the registration request, the cloud platform initiates verification of the access token carried in the registration request to the account server, and after the cloud platform successfully verifies the access token to the account server, based on the For the first user identifier, a second user identifier is allocated to the user of the server device to be accessed, and the second user identifier is stored in correspondence with the first user identifier.
  • Step 303 Receive an access request sent by the server device, where the access request includes the access token and the device identifier of the server device; the access request is that the configuration device updates the server device to include the access token. Triggered by the access configuration resource of the card.
  • the configuration device after the configuration device sends the above registration request, it also updates the access configuration resource including the access token for the server device. After the server device obtains the updated access configuration resource, it can send the The platform initiates an access request, and the access request includes the access token and the device identifier of the server device.
  • Step 304 when the access token is successfully verified again, the device identification of the server device is bound to the second user identification.
  • the cloud platform after receiving the access request, the cloud platform verifies the access token carried in the access request again, and after re-verifying the access token successfully, the device identifier of the server device is matched with the access token.
  • the second user identity is bound to complete the access process of the server device.
  • the configuration device obtains the access token of the currently logged-in user account from the account server, and in the subsequent process, the configuration device and the server device respectively initiate the cloud platform through the access token
  • the cloud platform After the cloud platform successfully verifies the access token to the account server, it can assign a user ID to the user corresponding to the server device, and bind the server device to the assigned user ID to realize the server device
  • the cloud platform implements authentication through the access token allocated by the account server for the user account logged in the configuration device, and does not need to generate access tokens for the configuration device and the server device separately, reducing access
  • the process of token allocation and acquisition shortens the time consumed by the access process, thereby improving the access efficiency of the server device while ensuring the security of the access process.
  • FIG. 4 shows a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • the method may be performed by a configuration device, where the configuration device may be the network architecture shown in FIG. 1 .
  • the method may include the following steps:
  • Step 401 Obtain an access token for a user account from an account server; the user account is an account logged in the configuration device.
  • Step 402 sending a registration request to the cloud platform based on the access token, where the registration request is used to trigger the cloud platform to successfully verify the access token to the account server, and assign a second user ID corresponding to the first user ID;
  • the first user identifier is allocated by the account server for the user account.
  • Step 403 update the access configuration resource including the access token for the server device, so as to trigger the server device to send an access request including the access token and the device identity of the server device to the cloud platform, the access token.
  • the device identification of the server device is bound to the second user identification.
  • the configuration device obtains the access token of the currently logged-in user account from the account server, and in the subsequent process, the configuration device and the server device respectively initiate the cloud platform through the access token
  • the cloud platform After the cloud platform successfully verifies the access token to the account server, it can assign a user ID to the user corresponding to the server device, and bind the server device to the assigned user ID to realize the server device
  • the cloud platform implements authentication through the access token allocated by the account server for the user account logged in the configuration device, and does not need to generate access tokens for the configuration device and the server device separately, reducing access
  • the process of token allocation and acquisition shortens the time consumed by the access process, thereby improving the access efficiency of the server device while ensuring the security of the access process.
  • FIG. 5 shows a flowchart of a device access method in the Internet of Things provided by an embodiment of the present application.
  • the method can be interactively executed by a server device, a configuration device, a cloud platform, and an account server, wherein the above
  • the server device, the configuration device, the cloud platform and the account server may be the server device 110 , the configuration device 120 , the cloud platform 130 and the account server 140 in the network architecture shown in FIG. 1 .
  • the method may include the following steps:
  • Step 501 the configuration device obtains the access token of the user account from the account server.
  • the user account is an account logged in the configuration device.
  • the configuration device obtains the access token from the account server when logging in to the account server through the user account.
  • the configuration device obtains the access token from the account server when performing open authorization authentication through the user account.
  • the configurator For example, taking the configuration device as the user's smartphone as an example, after the user uses the smartphone to download the configurator (APP) and activate it, register the above-mentioned user account with the account server, and log in the newly registered user account on the configurator, or , log in the user account of the third-party authorization provider on the configurator, after that, the configurator requests the account server to assign the access token, the account server assigns the access token to the user account, and returns the assigned access token to the configurator.
  • APP configurator
  • the account server stores the access token after allocating the access token to the user account logged in the configuration device, so as to improve the verification service of the access token for the cloud platform later.
  • the account server in addition to allocating an access token to the user account, the account server also allocates a first user identifier to the user account, and stores the first user identifier corresponding to the access token.
  • the account server not only returns the access token to the configuration device, but also returns the first user identifier to the configuration device, that is, the configuration device obtains the first user identifier from the account server.
  • Step 502 the configuration device sends a registration request to the cloud platform, and the cloud platform receives the registration request.
  • the registration request includes the above-mentioned access token.
  • the registration request is a request for registering the user identity corresponding to the server device to be accessed to the cloud platform.
  • the registration request when the configuration device obtains the first user identifier from the account server, the registration request further includes the first user identifier. That is, the cloud platform receives the registration request including the first user identifier and the access token.
  • the registration request when the account server is the account server of an authorization provider of a third party, the registration request further includes the identifier of the authorization provider of the third party.
  • Step 503 When the cloud platform successfully verifies the access token to the account server, it allocates a second user identifier corresponding to the first user identifier.
  • the cloud platform after receiving the registration request, the cloud platform initiates verification of the access token carried in the registration request to the account server, and after successfully verifying the access token to the account server, the cloud platform can assign and The second user identification corresponding to the first user identification.
  • the cloud platform allocates a second user identification corresponding to the first user identification according to a preset account assignment rule.
  • the cloud platform generates the above-mentioned second user identifier according to the first user identifier and the timestamp of the registration request.
  • the second user identifier is a splicing result of the first user identifier and the timestamp.
  • the cloud platform generates the second user identifier according to the first user identifier and the number of user identifiers that have been allocated in the cloud platform. For example, assuming that the second user identifier is the Nth user identifier allocated by the cloud platform, the second user identifier is the splicing result of the first user identifier and N. This embodiment of the present application does not limit the manner in which the cloud platform allocates the second user identifier.
  • the cloud platform when the registration request includes the first user ID, extracts the first user ID from the registration request, and when verifying the access token to the account server successfully, assigns the first user ID with the first user ID.
  • a second user identification corresponding to a user identification.
  • the cloud platform when the registration request does not contain the first user identifier, the cloud platform requests the first user identifier from the account server according to the access token.
  • the cloud platform sends a first verification request to the account server, and the first verification request includes the access token; when receiving a valid indication returned by the account server, it is determined that the access token is successfully verified to the account server, And receive the first user identifier sent by the account server after verifying that the access token is valid; wherein, the valid indication is used to indicate that the access token is valid.
  • receiving the first user identifier sent by the account server after verifying that the access token is valid refers to extracting the first user identifier included in the valid indication.
  • the cloud platform when the registration request includes the first user identifier, the cloud platform sends a verification request including the first user identifier and the access token to the account server, and after the account server receives the verification request , according to the pre-stored correspondence between the first user ID and the access token, after verifying that the first user ID matches the access token, a successful verification response is returned to the cloud platform. After the cloud platform receives the successful verification response , you can confirm that the access token is successfully authenticated to the account server.
  • Step 504 the cloud platform returns a registration success response to the configuration device, and the configuration device receives the registration success response.
  • the cloud platform when the cloud platform successfully verifies the access token to the account server, it sends the second user identifier to the configuration device; in response, the configuration device receives the second user identifier returned by the cloud platform .
  • Step 505 the configuration device updates the access configuration resource including the access token for the server device, and the server device receives the updated access configuration resource.
  • the configuration device updates the access configuration resources for the server device, which can trigger the server device to send an access request to the cloud platform to request access to the cloud platform.
  • the configuration device when the configuration device obtains the first user identifier from the account server, the configuration device updates the access token and the first user identifier for the server device in this step. Configure resources to trigger the server device to send an access request to the cloud platform that includes the access token, the first user identity, and the device identity of the server device.
  • the configuration device when the configuration device receives the second user identifier returned by the cloud platform, the configuration device in this step updates the server device including the access token and the second user identifier to trigger the server device to send an access request including the access token, the second user ID and the device ID of the server device to the cloud platform.
  • the configuration device generates derivative data of the access token when updating the access configuration resource containing the access token for the server device; and updates the access token containing the access token for the server device. Access configuration resources for derived data.
  • the configuration device when the derivative data of the access token is generated, performs encryption processing on the access token to obtain the derivative data of the access token.
  • the access token of the user account is not directly provided, but the derivative data of the access token of the user account is provided, for example, the configuration device provides the user account access token.
  • the access token is encrypted to obtain the encrypted user access token (for example, the hash value of the access token is generated by the Hash algorithm), and the subsequent cloud platform can restore the user account access token corresponding to the derived data and verify it (for example, restore the hash value of the access token). value), in this way, it can prevent illegal server devices from obtaining the access token of the user account and pretending to be a configuration device for registration, thereby further improving the security of access.
  • the update of the access configuration resource including the access token for the server device includes:
  • the entry information includes at least one of an identifier of the access platform and an address of the access platform.
  • the access configuration resource when the account server is an account server of an authorization provider of a third party, the access configuration resource further includes an identifier of the authorization provider.
  • Step 506 the server device sends an access request including the access token and the device identification of the server device to the cloud platform, and the cloud platform receives the access request.
  • the server device when the configuration device updates the access configuration resource containing the access token and the first user identifier for the server device, the server device sends the access token, the first user ID, and the access token to the cloud platform.
  • the access request of the user ID and the device ID of the server device when the configuration device updates the access configuration resource containing the access token and the first user identifier for the server device, the server device sends the access token, the first user ID, and the access token to the cloud platform.
  • the server device when the configuration device updates the access configuration resource including the access token and the second user identity for the server device, the server device sends a message to the cloud platform that includes the access token and the first user ID. 2. An access request for the user ID and the device ID of the server device.
  • Step 507 when the cloud platform successfully verifies the access token again, binds the device identification of the server device with the second user identification.
  • the cloud platform After receiving the access request, the cloud platform can re-verify the access token carried in the access request.
  • the manner in which the cloud platform verifies the access token again is similar to the manner in which the access token is verified in the foregoing step 503, and details are not described herein again.
  • the cloud platform can query the first user ID according to the second user ID, and send the first user ID and the access token to the account server. card verification request.
  • the cloud platform when the cloud platform verifies the access token again, it locally queries the verification success record of the access token according to the access token, and the verification success record is the last verification of the access token to the account server. It is stored after the access token is successful; when the verification success record is queried, it is determined that the access token is successfully verified again; when the verification success record is not queried, the verification of the access token is initiated to the account server.
  • the cloud platform in order to reduce the steps of initiating verification to the account server, in the embodiment of the present application, after the cloud platform successfully verifies an access token to the account server, it can locally store the verification success record of the access token, and subsequently initiate the verification of the access token again.
  • verifying the access token first check locally whether there is a successful verification record of the access token. If there is a successful verification record, it means that the access token has been verified, and the access token that has been verified successfully can be directly It is determined that the access token verification is successful. If the verification success record is not queried, further verification needs to be initiated to the account server, which can reduce unnecessary interactions with the account server, further reduce the access time, and improve access efficiency. , and save network resources. Especially in the case of needing to access multiple server devices in a short period of time, the effect will be more obvious.
  • the verification success record is deleted.
  • the above-mentioned verification success record is incorrectly indicated to indicate the access token.
  • the cloud platform After the cloud platform generates the above verification success record, when the storage duration of the verification success record reaches the preset duration, the verification success record can be deleted, and the access request containing the access token is subsequently received. , and re-initiate authentication to the account server to avoid errors in the authentication process.
  • the cloud platform when the access request includes the first user identifier, the cloud platform queries the second user identifier according to the first user identifier; and compares the device identifier of the server device with the query obtained. is bound to the second user ID.
  • the cloud platform when the access request includes the first user identifier, the cloud platform further sends the second user identifier to the server device.
  • the cloud platform when the access request includes the second user identifier, extracts the second user identifier included in the access request; and combines the device identifier of the server device with the extracted bound to the second user ID.
  • the cloud platform binds the device ID of the server device with the second user ID Previously, the derived data for the access token was also restored to the access token.
  • the configuration device obtains the access token of the currently logged-in user account from the account server, and in the subsequent process, the configuration device and the server device respectively initiate the cloud platform through the access token
  • the cloud platform After the cloud platform successfully verifies the access token to the account server, it can assign a user ID to the user corresponding to the server device, and bind the server device to the assigned user ID to realize the server device
  • the cloud platform implements authentication through the access token allocated by the account server for the user account logged in the configuration device, and does not need to generate access tokens for the configuration device and the server device separately, reducing access
  • the process of token allocation and acquisition shortens the time consumed by the access process, thereby improving the access efficiency of the server device while ensuring the security of the access process.
  • the cloud platform realizes the access of the server device by binding the second user ID with the device ID of the server device. Since the second user ID has no time limit, it does not It needs to be updated regularly, therefore, the steps of updating and publishing the information bound with the device identification are reduced, thereby saving processing resources and network resources in the process of maintaining the binding relationship.
  • the cloud platform after receiving the access request, when the cloud platform verifies the access token carried in the access request, it firstly queries whether there is a successful verification record of the access token locally. , directly determine that the access token verification is successful, or initiate verification to the account server, which improves the access efficiency and saves network resources.
  • FIG. 6 shows a flowchart of a device access method in the Internet of Things involved in the embodiment shown in FIG. 5, as shown in FIG. 6,
  • the method may include the following steps:
  • S61 configure the device to log in to the user account or perform open authorization (open Authorization, oAuth), and after success, obtain the access token of the user account and the user ID of the user account provided by the account server (that is, the above-mentioned first user ID).
  • the user account access token is associated with the identity or permission information related to the user account, and can replace the user name and password for user identity and permission verification. If the access token of the user account has a validity period, the configuration device can be used when the access token expires. before renewing the token.
  • the user ID of the user account uniquely corresponds to the user account.
  • the user ID is invisible to the user, and is managed by the account server after allocating the user account.
  • the configuration device requests to register with the cloud platform, and the registration request includes the access token of the user account and the user ID of the user account.
  • the cloud platform verifies the access token of the user account to the account server.
  • the cloud platform allocates the user identifier of the cloud platform (ie, the second user identifier above) according to the user identifier of the user account, and associates the two.
  • the cloud platform sends a registration success response to the configuration device.
  • the message of the successful registration response does not include the user ID of the cloud platform.
  • the configuration device updates the access configuration resources of the server device, and provides configuration information for accessing the cloud platform for the server device, including the access token of the user account and the user ID of the user account.
  • the above examples include the following:
  • auid the user ID of the user account
  • sid the identity of the cloud platform
  • apn Authorization provider name (carried when the account server is the server of a third-party authorization provider).
  • the server device requests to update the account resource of the cloud platform to carry out device registration (i.e. send an access request), wherein the request message includes the device identifier of the server, the access token of the user account and the user identifier of the user account.
  • An example of the update request of the account resource sent by the server device to the cloud platform is as follows:
  • the above example includes the following:
  • accesstoken user account access token
  • auid the user ID of the user account
  • Authorized provider name (carried when the account server is the server of a third-party authorized provider);
  • the cloud platform verifies the user account access token to the account server.
  • the cloud platform determines the user ID of the cloud platform associated with the user ID of the user account, and associates (ie binds) the device ID of the server with the user ID of the cloud platform.
  • the cloud platform accepts the account resource update request of the server device, and returns the user identifier of the cloud platform to the server device.
  • the account server will return the access token of the user account and the user ID of the user account to the configurator.
  • the configurator performs cloud platform registration and provides the user account.
  • the access token of the user account and the user ID of the user account the cloud platform allocates the user ID of the cloud platform according to the user ID of the user account.
  • the configurator configures the server device, provides the server device with the access token of the user account and the user ID of the user account, the server device registers with the cloud platform, and provides the cloud platform with the device ID, the access token of the user account and the user ID of the user account.
  • User ID after the cloud platform verifies the access token of the user account, determines the user ID of the cloud platform through the user ID of the user account, associates the device ID of the server device with the user ID of the cloud platform, and returns the cloud platform to the server device user ID.
  • FIG. 7 shows a flowchart of another device access method in the Internet of Things involved in the embodiment shown in FIG. 5 , as shown in FIG. 7 .
  • the method may include the following steps:
  • S71 to S74 are the same as the above-mentioned S61 to S64.
  • the cloud platform sends a registration success message to the configuration device, including the user ID of the cloud platform.
  • the configuration device updates the access configuration resources of the server device, and provides configuration information for accessing the cloud platform for the server device, including the access token of the user account and the user ID of the cloud platform.
  • An example of an access configuration resource updated by the configurator is as follows:
  • the above example includes the following:
  • uid User ID of the cloud platform
  • sid the identity of the cloud platform
  • the server device requests to update the account resources of the cloud platform for device registration, including the device identifier of the server, the access token of the user account, and the user identifier of the cloud platform.
  • An example of an update request for account resources sent by the server to the cloud platform is as follows:
  • the above example includes the following:
  • accesstoken The access token of the user account
  • uid User ID of the cloud platform
  • the cloud platform verifies the user account access token to the account server.
  • the cloud platform associates the device identification of the server device with the user identification of the cloud platform.
  • the cloud platform accepts the account resource update request of the server device.
  • the cloud platform since the configuration device has provided the user identifier of the cloud platform to the server device in step S76, the cloud platform does not need to return the user identifier of the cloud platform to the server device here.
  • the account server will return the access token of the user account and the user ID of the user account to the configurator.
  • the configurator performs cloud platform registration and provides the user account.
  • the access token of the user account and the user ID of the user account the cloud platform allocates the user ID of the cloud platform according to the user ID of the user account, and provides the user ID of the cloud platform to the configurator.
  • the configurator configures the server device, provides the server device with the access token of the user account and the user ID of the cloud platform, the server device registers with the cloud platform, and provides the cloud platform with the device ID, the access token of the user account and the user ID of the cloud platform User ID.
  • the cloud platform verifies the access token of the user account, it associates the device ID of the server with the user ID of the cloud platform.
  • FIG. 8 shows a flowchart of another device access method in the Internet of Things involved in the embodiment shown in FIG. 5 , as shown in FIG. 8 .
  • the method may include the following steps:
  • the configuration device requests to register with the cloud platform, and the access token of the user account is provided in the registration message.
  • the cloud platform requests the account server to obtain the user ID of the user account, and the cloud platform provides the access token of the user account to obtain the user ID of the corresponding user account.
  • the account server verifies the validity of the user account access token, and after the verification is valid, the account server returns the user ID of the corresponding user account to the cloud platform.
  • the cloud platform allocates the user identifier of the cloud platform according to the user identifier of the user account, and associates the two.
  • the cloud platform sends a registration success message to the configuration device.
  • step S86 If the user identifier of the cloud platform is not included in step S86, the subsequent process is the same as steps S66 to S610 in FIG. 6 .
  • step S86 If the user identifier of the cloud platform is included in step S86, the subsequent process is the same as steps S76 to S710 in FIG. 7 .
  • the account server returns the access token of the user account to the configurator, and the configurator performs cloud platform registration and provides the access token of the user account.
  • the access token of the user account requests to obtain the user ID of the user account from the account server, and the cloud platform allocates the user ID of the cloud platform according to the user ID of the user account.
  • the subsequent scheme is similar to the scheme in FIG. 6 or FIG. 7 , and will not be repeated here. .
  • FIG. 9 shows a block diagram of a device access apparatus in the Internet of Things provided by an embodiment of the present application.
  • the device has the function of implementing the steps performed by the cloud platform in the above-mentioned device access method in the Internet of Things.
  • the apparatus may include:
  • a registration request receiving module 901 is configured to receive a registration request sent by a configuration device based on an access token of a user account, where the user account is an account logged in the configuration device, and the access token is a slave account of the configuration device. obtained by the server;
  • An identification allocation module 902 configured to allocate a second user identification corresponding to the first user identification when the access token is successfully verified to the account server; the first user identification is the account server for the assigned by the user account;
  • An access request receiving module 903 configured to receive an access request sent by a server device, where the access request includes the access token and the device identifier of the server device; the access request is the configuration device Triggered by updating the access configuration resource containing the access token for the server device;
  • the binding module 904 is configured to bind the device identification of the server device with the second user identification when the access token is successfully verified again.
  • the apparatus further includes:
  • a verification request sending module is configured to send the first user identification to the account server before assigning the second user identification corresponding to the first user identification when the identification allocation module successfully verifies the access token to the account server. a verification request, where the first verification request includes the access token;
  • the first access success determination module is configured to, when receiving a valid indication returned by the account server, determine that the access token is successfully verified to the account server; the valid indication is used to indicate that the access token is valid.
  • the apparatus further includes:
  • a first identification receiving module configured to receive the first user identification sent by the account server after verifying that the access token is valid before the identification allocation module assigns the second user identification corresponding to the first user identification .
  • the registration request receiving module is configured to receive the registration request including the first user identifier and the access token
  • the device also includes:
  • a first identification extraction module configured to extract the first user identification from the registration request before the identification allocation module assigns a second user identification corresponding to the first user identification.
  • the access request further includes the first user identifier
  • the apparatus further includes:
  • a first identifier sending module configured to send the second user identifier to the server device.
  • the apparatus further includes:
  • the second identifier sending module is configured to send the configuration device to the configuration device when the access token is successfully verified to the account server before the access request receiving module receives the access request sent by the server device.
  • the device identification of the server device is bound with the extracted second user identification.
  • the access token included in the access request is derived data of the access token
  • the device also includes:
  • a restoration module configured to, when the binding module successfully verifies the access token again, before binding the device identification of the server device with the second user identification, the derived data of the access token Revert to said access token.
  • the apparatus further includes:
  • a record query module configured to, when the binding module successfully verifies the access token again, before binding the device identification of the server device with the second user identification, according to the access token in the local query the verification success record of the access token, where the verification success record is stored after successfully verifying the access token to the account server last time;
  • the second access success determination module is configured to determine that the access token is successfully verified again when the verification success record is queried.
  • the apparatus further includes:
  • a record deletion module configured to delete the verification success record when the storage duration of the verification success record reaches a preset duration.
  • the configuration device obtains the access token of the currently logged-in user account from the account server, and in the subsequent process, the configuration device and the server device respectively initiate the cloud platform through the access token
  • the cloud platform After the cloud platform successfully verifies the access token to the account server, it can assign a user ID to the user corresponding to the server device, and bind the server device to the assigned user ID to realize the server device
  • the cloud platform implements authentication through the access token allocated by the account server for the user account logged in the configuration device, and it does not need to generate access tokens for the configuration device and the server device separately, reducing access.
  • the process of token allocation and acquisition shortens the time consumed by the access process, thereby improving the access efficiency of the server device under the condition of ensuring the security of the access process.
  • FIG. 10 shows a block diagram of a device access apparatus in the Internet of Things provided by an embodiment of the present application.
  • the device has the function of implementing the steps performed by the configuration device in the device access method in the Internet of Things.
  • the apparatus may include:
  • An access token obtaining module 1001 configured to obtain an access token of a user account from an account server; the user account is an account logged in the configuration device;
  • a registration module 1002 is configured to send a registration request to the cloud platform based on the access token, where the registration request is used to trigger the cloud platform to verify the access token to the account server successfully, and assign a first user identifier A corresponding second user identifier; the first user identifier is allocated by the account server for the user account;
  • An access resource configuration module 1003 configured to update the access configuration resource containing the access token for the server device, so as to trigger the server device to send the access token and the server to the cloud platform An access request for the device identification of the device, where the access request is used to trigger the cloud platform to re-verify the access token successfully, and bind the device identification of the server device to the second user identification.
  • the apparatus further includes:
  • a first identity acquisition module configured to acquire the first user identity from the account server before the registration module sends a registration request to the cloud platform based on the access token
  • the registration module is configured to send the registration request including the first user ID and the access token to the cloud platform.
  • the access resource configuration module is configured to update the access configuration resource including the access token and the first user identifier for the server device, so as to trigger the service
  • the terminal device sends an access request including the access token, the first user identifier and the device identifier of the server device to the cloud platform.
  • the apparatus further includes:
  • a second identity acquisition module configured to receive the second user identity returned by the cloud platform before the access resource configuration module updates the access configuration resource including the access token for the server device;
  • the access resource configuration module is configured to update the access configuration resource including the access token and the second user identifier for the server device, so as to trigger the server device to send a message containing the access token to the cloud platform.
  • the access resource configuration module includes:
  • a data generating unit for generating derivative data of the access token
  • An update unit configured to update the access configuration resource containing the derived data of the access token for the server device.
  • the data generating unit is configured to perform encryption processing on the access token to obtain derived data of the access token.
  • the access token obtaining module is used to:
  • the access token is obtained from the account server during open authorization authentication through the user account.
  • the device provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated to different functional modules according to actual needs. That is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • FIG. 11 shows a schematic structural diagram of a computer device 1100 provided by an embodiment of the present application.
  • the computer device 1100 may include: a processor 1101 , a receiver 1102 , a transmitter 1103 , a memory 1104 and a bus 1105 .
  • the processor 1101 includes one or more processing cores, and the processor 1101 executes various functional applications and information processing by running software programs and modules.
  • the receiver 1102 and the transmitter 1103 may be implemented as a communication component, which may be a communication chip.
  • the communication chip may also be referred to as a transceiver.
  • the memory 1104 is connected to the processor 1101 through the bus 1105 .
  • the memory 1104 can be used to store a computer program, and the processor 1101 is used to execute the computer program to implement various steps performed by the server device, configuration device, cloud platform, or account server in the above method embodiments.
  • memory 1104 may be implemented by any type or combination of volatile or non-volatile storage devices including, but not limited to, magnetic or optical disks, electrically erasable and programmable Read Only Memory, Erasable Programmable Read Only Memory, Static Anytime Access Memory, Read Only Memory, Magnetic Memory, Flash Memory, Programmable Read Only Memory.
  • the computer device includes a processor, a memory, and a transceiver (the transceiver may include a receiver for receiving information and a transmitter for transmitting information) and a transmitter.
  • the transceiver may include a receiver for receiving information and a transmitter for transmitting information
  • the transceiver is configured to receive a registration request sent by the configuration device based on an access token of a user account, where the user account is an account logged in the configuration device, and the access token is the configuration device from the account server. obtained;
  • the processor is configured to allocate a second user identification corresponding to the first user identification when the access token is successfully verified to the account server; the first user identification is the account server for the assigned by the user account;
  • the transceiver is configured to receive an access request sent by the server device, where the access request includes the access token and the device identifier of the server device; the access request is the configuration device through the Triggered by the server device updating the access configuration resource containing the access token;
  • the processor is configured to bind the device identification of the server device with the second user identification when the access token is successfully verified again.
  • the processor and transceiver in the computer device involved in the embodiments of the present application may execute the method shown in FIG. 3 , FIG. 5 , FIG. 6 , FIG. 7 , or FIG. The steps performed by the platform will not be repeated here.
  • the transceiver is used to obtain the access token of the user account from the account server; the user account is the account logged in the configuration device;
  • the transceiver is configured to send a registration request to the cloud platform based on the access token, where the registration request is used to trigger the cloud platform to verify the access token to the account server successfully, and assign the first user
  • the second user identifier corresponding to the identifier; the first user identifier is allocated by the account server for the user account;
  • the transceiver is configured to update the access configuration resource including the access token for the server device, so as to trigger the server device to send an information including the access token and the server device to the cloud platform.
  • An access request for a device identification where the access request is used to trigger the cloud platform to bind the device identification of the server device with the second user identification when the access token is successfully verified again.
  • the processor and transceiver in the computer device involved in the embodiments of the present application may perform the method shown in FIG. 4 , FIG. 5 , FIG. 6 , FIG. 7 , or FIG. The steps performed by the device are not repeated here.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the Internet of Things shown in FIG. 3 to FIG. 8 . Each step in the device access method.
  • the present application also provides a computer program product or computer program, the computer program product or computer program comprising computer instructions stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs each step in the device access method in the Internet of Things shown in the above 3 to FIG. 8 .
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.

Landscapes

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

Abstract

本申请公开了一种物联网中的设备接入方法、装置、计算机设备及存储介质,属于物联网技术领域。方法包括:云平台接收配置设备基于用户账号的访问令牌发送的注册请求,当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;接收服务端设备发送的接入请求,接入请求包含访问令牌;当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定,上述方案在保证接入过程的安全性的情况下,提高服务端设备的接入效率。

Description

物联网中的设备接入方法、装置、计算机设备及存储介质 技术领域
本申请涉及物联网技术领域,特别涉及一种物联网中的设备接入方法、装置、计算机设备及存储介质。
背景技术
在物联网(Internet of Things,IOT)中,要实现通过客户端设备远程控制服务端设备的功能操作,需要预先将服务端设备接入云平台。
在相关技术中,为了保证接入过程的安全性,云平台在服务端设备接入过程中执行验证操作,其接入验证的过程如下:配置设备向云平台发起第一次注册,由云平台分配第一访问令牌并返回给配置设备,配置设备基于该第一访问令牌向云平台发起第二次注册,云平台验证第一访问令牌成功后,分配第二访问令牌并返回给配置设备,配置设备将该第二访问令牌配置给待接入的服务端设备,服务端设备基于该第二访问令牌请求接入云平台,云平台验证该第一访问令牌成功后,为服务端设备分配新的第三访问令牌,并将第三访问令牌与服务端设备的设备标识绑定,从而完成服务端设备的接入过程。
然而,上述方案需要云平台针对配置设备和服务端设备执行多次访问令牌的分配操作,相应的,配置设备也需要从云平台为服务端设备请求访问令牌,上述访问令牌的分配和获取过程需要消耗一定的处理时间,影响服务端设备接入云平台的效率。
发明内容
本申请实施例提供了一种物联网中的设备接入方法、装置、计算机设备及存储介质。所述技术方案如下:
一方面,本申请实施例提供了一种物联网中的设备接入方法,所述方法由云平台执行,所述方法包括:
接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
一方面,本申请实施例提供了一种物联网中的设备接入方法,所述方法由配置设备执行,所述方法包括:
从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
另一方面,本申请实施例提供了一种物联网中的设备接入装置,所述装置用于云平台中,所述装置包括:
注册请求接收模块,用于接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
标识分配模块,用于当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
接入请求接收模块,用于接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
绑定模块,用于当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
另一方面,本申请实施例提供了一种物联网中的设备接入装置,所述装置用于配置设备中,所述装置包括:
访问令牌获取模块,用于从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
注册模块,用于基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
接入资源配置模块,用于为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
再一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器、存储器和收发器,所述存储器存储有计算机程序,所述计算机程序用于被所述处理器执行,以实现上述物联网中的设备接入方法。
又一方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现上述物联网中的设备接入方法。
另一方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述物联网中的设备接入。
本申请实施例提供的技术方案可以带来如下有益效果:
配置设备从账号服务器获取当前登录的用户账号的访问令牌,后续过程中,配置设备和服务端设备分别通过该访问令牌向云平台发起注册和接入,云平台向账号服务器验证该访问令牌成功后,即可以为服务端设备对应的用户分配用户标识,并将服务端设备与分配的用户标识进行绑定,以实现服务端设备的接入;在上述过程中,云平台通过账号服务器为配置设备中登录的用户账号分配的访问令牌实现鉴权,自己不需要为配置设备和服务端设备分别生成访问令牌,减少了访问令牌的分配和获取的过程,缩短了接入过程消耗的时间,从而在保证接入过程的安全性的情况下,提高服务端设备的接入效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例提供的物联网的网络架构的示意图;
图2是图1所示实施例涉及的一种远程控制示意图;
图3是本申请一个实施例提供的物联网中的设备接入方法的流程图;
图4是本申请一个实施例提供的物联网中的设备接入方法的流程图;
图5是本申请一个实施例提供的物联网中的设备接入方法的流程图;
图6是图5所示实施例涉及的一种物联网中的设备接入方法的流程图;
图7是图5所示实施例涉及的另一种物联网中的设备接入方法的流程图;
图8是图5所示实施例涉及的另一种物联网中的设备接入方法的流程图;
图9是本申请一个实施例提供的物联网中的设备接入装置的框图;
图10是本申请一个实施例提供的物联网中的设备接入装置的框图;
图11是本申请一个实施例提供的计算机设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
本申请实施例描述的网络架构以及业务场景是为了更加清楚地说明本申请实施例的技术方案,并不构成对本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
请参考图1,其示出了本申请一个实施例提供的物联网的网络架构的示意图。该物联网的网络架构可以包括:服务端设备110、配置设备120、云平台130以及账号服务器140;
服务端设备110可以是用于提供物联网功能服务的设备。
比如,服务端设备110可以是智能家居设备,例如,智能电视、智能空调、智能冰箱、智能微波炉、智能电饭煲、扫地机器人等等。
或者,服务端设备110可以是工业生产设备,例如,车床、工业机器人、太阳能面板、风力发电机等等。
或者,服务端设备110可以是商业服务设备,例如,无人售货机等等。
或者,服务端设备110可以是智能监控设备,例如,监控摄像头、红外传感器、声音传感器、温度传感器等等。
配置设备120是辅助服务端设备110接入云平台130的设备。比如,配置设备120是内置有配置器的计算机设备,例如,智能手机、平板电脑、智能手表、个人电脑、比如台式电脑、便携式计算机、个人工作站等等。
其中,配置器是为服务端设备提供接入云平台的配置信息的工具。
在一种可能的实现方式中,上述配置器是安装在配置设备120中的配置软件,比如第三方应用程序(Application,APP)。
云平台130是部署在网络侧的云端服务平台。比如,云平台130可以是基于单台或者多台服务器实现的云端服务平台。
账号服务器140是提供账号管理和验证服务的云端服务器。
其中,账号服务器140是与云平台130相对应的服务器,或者,账号服务器140是云平台130之外,提供第三方账号服务的服务器。
服务端设备110与配置设备120之间通过有线或者无线网络相连,服务端设备110与账号服务器140之间通过有线或者无线网络相连;云平台130分别与服务端设备110、配置设备120和账号服务器140之间通过有线或者无线网络相连。
可选的,上述的有线或者无线网络使用标准通信技术和/或协议。比如,上述有线或者无线网络可以是基于物联网IoT协议的通信网络。
在本申请实施例中,上述服务端设备110、配置设备120、云平台130可以是满足业内规范的物联网设备,比如,可以是满足开放连接基金会(Open Connectivity Foundation,OCF)规范的物联网设备。
OCF是新兴的物联网应用层技术标准组织,OCF为物联网设备之间实现互联互通制定RESTful(一种网络应用程序的设计风格和开发方式)服务框架,在OCF服务框架中,通过设备资源模型来描述物联网设备,以及设备的功能服务和设备的状态等信息,提供资源的物联网终端设备是OCF服务端(即上述服务端设备),访问资源的控制终端是OCF客户端(即上述客户端设备)。
例如,获取室内环境状态数据的控制终端是客户端设备,监测室内环境状态数据的传感器设备是服务端设备,客户端设备和服务端设备的业务交互是通过对资源的创建、读取、更新、删除或者通知这些资源操作方法而实现。
在物联网系统中,客户端设备对服务端设备的远程访问通常是通过云平台进行中转和控制。请参考图2,其示出了本申请实施例涉及的一种远程控制示意图。如图2所示,客户端设备210,经过平云平台220向服务端设备230发送请求,对服务端设备230上的资源进行操作,服务端设备230执行资源操作,并经过云平台220向客户端设备210返回响应,响应中携带资源的表述。
例如,在上述图2中,服务端上有环境温度资源,资源的统一资源标识符(Uniform Resource Identifier,URI)为/environmentTemperature、资源类型为oic.r.temperature,请求中指示资源操作请求是更新操作UPDATE。客户端和服务端之间的请求和响应中携带资源的表述,资源的表述包括资源的各种属性信息。比如,以图2为例,更新资源请求的信息为:
UPDATE/environmentTemperature
{
“targetTemperature":25,
}
上述请求的资源表述中,targetTemperature表示温度资源的目标温度属性,表示请求将温度调整至25度。
相应的,服务端设备返回的更新资源响应中的资源的表述为:
Figure PCTCN2020101162-appb-000001
其中,currentTemperature表示温度资源的当前温度属性,temperatureRange表示温度资源的温度范围属性。
在物联网系统中,客户端设备对服务端设备的远程访问通常是通过云平台进行中转和控制。而在实现远程访问之前,需要将服务端设备接入至云平台。请参考图3,其示出了本申请一个实施例提供的物联网中的设备接入方法的流程图,该方法可以由云平台执行,其中,上述云平台可以是图1所示的网络架构中的云平台130。该方法可以包括如下几个步骤:
步骤301,接收配置设备基于用户账号的访问令牌发送的注册请求,该用户账号是在该配置设备中登录的账号,该访问令牌是该配置设备从账号服务器获取的。
上述注册请求中携带有配置设备从账号服务器获取到的,该用户账号的访问令牌。
上述用户账号的访问令牌是账号服务器为该用户账号分配的访问令牌。
步骤302,当向该账号服务器验证该访问令牌成功时,分配与第一用户标识相对应的第 二用户标识;该第一用户标识是该账号服务器为该用户账号分配的。
在本申请实施例中,由于访问令牌是账号服务器分配的,因此,云平台在验证该访问令牌时,向该账号服务器发起验证。
在本申请实施例中,云平台接收到该注册请求后,向账号服务器发起针对该注册请求中携带的访问令牌的验证,当云平台向该账号服务器验证该访问令牌成功后,基于该第一用户标识,为待接入的服务端设备的用户分配第二用户标识,并将该第二用户标识与第一用户标识对应存储。
步骤303,接收服务端设备发送的接入请求,该接入请求包含该访问令牌以及该服务端设备的设备标识;该接入请求是该配置设备通过为该服务端设备更新包含该访问令牌的接入配置资源触发的。
在本申请实施例中,配置设备发送上述注册请求后,还为该服务端设备更新包含该访问令牌的接入配置资源,服务端设备获取到更新的接入配置资源后,即可以向云平台发起接入请求,该接入请求中包含上述访问令牌,以及服务端设备的设备标识。
步骤304,当再次验证该访问令牌成功时,将该服务端设备的设备标识与该第二用户标识绑定。
在本申请实施例中,云平台接收到接入请求后,对该接入请求中携带的访问令牌再次进行验证,当再次验证该访问令牌成功后,将服务端设备的设备标识与该第二用户标识绑定,以完成该服务端设备的接入流程。
综上所述,本申请实施例所示的方案,配置设备从账号服务器获取当前登录的用户账号的访问令牌,后续过程中,配置设备和服务端设备分别通过该访问令牌向云平台发起注册和接入,云平台向账号服务器验证该访问令牌成功后,即可以为服务端设备对应的用户分配用户标识,并将服务端设备与分配的用户标识进行绑定,以实现服务端设备的接入;在上述过程中,云平台通过账号服务器为配置设备中登录的用户账号分配的访问令牌实现鉴权,自己不需要为配置设备和服务端设备分别生成访问令牌,减少了访问令牌的分配和获取的过程,缩短了接入过程消耗的时间,从而在保证接入过程的安全性的情况下,提高服务端设备的接入效率。
请参考图4,其示出了本申请一个实施例提供的物联网中的设备接入方法的流程图,该方法可以由配置设备执行,其中,上述配置设备可以是图1所示的网络架构中的配置设备120。该方法可以包括如下几个步骤:
步骤401,从账号服务器获取用户账号的访问令牌;该用户账号是在该配置设备中登录的账号。
步骤402,基于该访问令牌向云平台发送注册请求,该注册请求用于触发该云平台向该账号服务器验证该访问令牌成功时,分配与第一用户标识相对应的第二用户标识;该第一用户标识是该账号服务器为该用户账号分配的。
步骤403,为服务端设备更新包含该访问令牌的接入配置资源,以触发该服务端设备向该云平台发送包含该访问令牌以及该服务端设备的设备标识的接入请求,该接入请求用于触发该云平台再次验证该访问令牌成功时,将该服务端设备的设备标识与该第二用户标识绑定。
综上所述,本申请实施例所示的方案,配置设备从账号服务器获取当前登录的用户账号的访问令牌,后续过程中,配置设备和服务端设备分别通过该访问令牌向云平台发起注册和接入,云平台向账号服务器验证该访问令牌成功后,即可以为服务端设备对应的用户分配用户标识,并将服务端设备与分配的用户标识进行绑定,以实现服务端设备的接入;在上述过程中,云平台通过账号服务器为配置设备中登录的用户账号分配的访问令牌实现鉴权,自己不需要为配置设备和服务端设备分别生成访问令牌,减少了访问令牌的分配和获取的过程,缩短了接入过程消耗的时间,从而在保证接入过程的安全性的情况下,提高服务端设备的接入效率。
请参考图5,其示出了本申请一个实施例提供的物联网中的设备接入方法的流程图,该方法可以由服务端设备、配置设备、云平台以及账号服务器交互执行,其中,上述服务端设备、配置设备、云平台以及账号服务器可以是图1所示的网络架构中的服务端设备110、配置设备120、云平台130以及账号服务器140。该方法可以包括如下几个步骤:
步骤501,配置设备从账号服务器获取用户账号的访问令牌。
其中,该用户账号是在配置设备中登录的账号。
在一种可能的实现方式中,配置设备在通过该用户账号登录该账号服务器时,从该账号服务器获取该访问令牌。
在另一种可能的实现方式中,配置设备在通过该用户账号进行开放授权认证时,从该账号服务器获取该访问令牌。
比如,以配置设备是用户的智能手机为例,用户使用该智能手机下载配置器(APP)并启动后,向账号服务器注册上述用户账号,并在配置器上登录新注册的该用户账号,或者,在该配置器上登录第三方的授权提供方的用户账号,之后,配置器向账号服务器请求分配上述访问令牌,账号服务器针对该用户账号分配访问令牌,并将分配的访问令牌返回给配置器。
在本申请实施例中,账号服务器为配置设备中登录的用户账号分配访问令牌后,存储该访问令牌,以便后续为云平台提高该访问令牌的验证服务。
在一种可能的实现方式中,账号服务器除了为用户账号分配访问令牌之外,还为该用户账号分配第一用户标识,并将该第一用户标识对应该访问令牌进行存储。
在一种可能的实现方式中,账号服务器除了向配置设备返回上述访问令牌,还向配置设备返回给第一用户标识,也就是说,配置设备从该账号服务器获取该第一用户标识。
步骤502,配置设备向云平台发送注册请求,云平台接收到注册请求。其中,该注册请求中包含上述访问令牌。
其中,该注册请求是用于向云平台注册待接入的服务端设备对应的用户标识的请求。
在一种可能的实现方式中,当配置设备从账号服务器获取了第一用户标识时,该注册请求中还包含该第一用户标识。也就是说,云平台接收包含该第一用户标识以及该访问令牌的注册请求。
在一种可能的实现方式中,当账号服务器是第三方的授权提供方的账号服务器时,该注册请求中还包含该第三方的授权提供方的标识。
步骤503,云平台向账号服务器验证该访问令牌成功时,分配与第一用户标识相对应的第二用户标识。
在本申请实施例中,云平台接收到注册请求后,向账号服务器发起针对该注册请求中携带的访问令牌的验证,当向账号服务器验证该访问令牌成功后,云平台即可以分配与第一用户标识相对应的第二用户标识。
在一种可能的实现方式中,云平台按照预设的账号分配规则,分配与第一用户标识相对应的第二用户标识。
例如,在一示例性的方案中,云平台根据该第一用户标识以及该注册请求的时间戳,生成上述第二用户标识。比如,该第二用户标识是第一用户标识与时间戳的拼接结果。再例如,在一示例性的方案中,云平台根据该第一用户标识以及云平台中已经分配的用户标识的数量,生成上述第二用户标识。比如,假设该第二用户标识是云平台分配的第N个用户标识,则第二用户标识是第一用户标识与N的拼接结果。本申请实施例对于云平台分配第二用户标识的方式不做限定。
在一种可能的实现方式中,当注册请求中包含第一用户标识时,云平台从该注册请求中提取该第一用户标识,并在向账号服务器验证该访问令牌成功时,分配与第一用户标识相对应的第二用户标识。
在另一种可能的实现方式中,当注册请求中未包含第一用户标识时,云平台根据该访问 令牌,向账号服务器请求该第一用户标识。
比如,云平台向该账号服务器发送第一验证请求,该第一验证请求中包含该访问令牌;当接收到该账号服务器返回的有效指示时,确定向该账号服务器验证该访问令牌成功,并接收该账号服务器验证该访问令牌有效后发送的该第一用户标识;其中,该有效指示用于指示该访问令牌有效。
在一种可能的实现方式中,上述接收该账号服务器验证该访问令牌有效后发送的该第一用户标识,是指提取该有效指示中包含的第一用户标识。
在另一种可能的实现方式中,当注册请求中包含第一用户标识时,云平台向账号服务器发送包含该第一用户标识和上述访问令牌的验证请求,账号服务器接收到该验证请求后,根据预先存储的第一用户标识与访问令牌之间的对应关系,验证该第一用户标识与该访问令牌匹配后,向云平台返回验证成功响应,云平台接收到该验证成功响应后,即可以确定向账号服务器验证该访问令牌成功。
步骤504,云平台向配置设备返回注册成功响应,配置设备接收该注册成功响应。
在一种可能的实现方式中,云平台向该账号服务器验证该访问令牌成功时,向该配置设备发送该第二用户标识;响应的,配置设备接收该云平台返回的该第二用户标识。
步骤505,配置设备为服务端设备更新包含该访问令牌的接入配置资源,服务端设备接收更新的该接入配置资源。
在本申请实施例中,该配置设备为服务端设备更新接入配置资源,可以触发该服务端设备向该云平台发送接入请求,以请求接入该云平台。
在一种可能的实现方式中,当配置设备从账号服务器获取到第一用户标识时,配置设备在该步骤中,为该服务端设备更新包含该访问令牌以及该第一用户标识的接入配置资源,以触发该服务端设备向该云平台发送包含该访问令牌、该第一用户标识以及该服务端设备的设备标识的接入请求。
在一种可能的实现方式中,当配置设备接收到该云平台返回的该第二用户标识时,配置设备在该步骤中,为该服务端设备更新包含该访问令牌以及该第二用户标识的接入配置资源,以触发该服务端设备向该云平台发送包含该访问令牌、该第二用户标识以及该服务端设备的设备标识的接入请求。
在一种可能的实现方式中,配置设备为服务端设备更新包含该访问令牌的接入配置资源时,生成该访问令牌的衍生数据;并为该服务端设备更新包含该访问令牌的衍生数据的接入配置资源。
在一种可能的实现方式中,在生成该访问令牌的衍生数据时,配置设备对该访问令牌进行加密处理,获得该访问令牌的衍生数据。
在本申请实施例中,配置设备配置服务端设备的云平台接入配置资源时,不直接提供用户账号的访问令牌,而是提供用户账号访问令牌的衍生数据,例如配置设备对用户账号访问令牌进行加密运算,得到加密后的用户访问令牌(例如通过Hash算法产生访问令牌的哈希值),后续云平台可以还原衍生数据对应的用户账号访问令牌并验证(例如还原哈希值),这样可以避免不合法的服务端设备拿到用户账号的访问令牌后,冒充配置设备进行注册,从而进一步提高接入的安全性。
在本申请实施例中,该为服务端设备更新包含该访问令牌的接入配置资源,包括:
为该服务端设备更新包含该云平台的入口信息、以及该访问令牌的接入配置资源,以触发该服务端设备基于该入口信息向该云平台发送该接入请求;
该入口信息包括该接入平台的标识以及该接入平台的地址中的至少一项。
在本申请实施例中,当该账号服务器是第三方的授权提供方的账号服务器时,该接入配置资源中还包含该授权提供方的标识。
步骤506,服务端设备向该云平台发送包含该访问令牌以及该服务端设备的设备标识的接入请求,云平台接收该接入请求。
在一种可能的实现方式中,当配置设备为该服务端设备更新包含该访问令牌以及该第一用户标识的接入配置资源时,服务端设备向云平台发送包含访问令牌、第一用户标识以及服务端设备的设备标识的接入请求。
在另一种可能的实现方式中,当配置设备为该服务端设备更新包含该访问令牌以及该第二用户标识的接入配置资源时,服务端设备向云平台发送包含访问令牌、第二用户标识以及服务端设备的设备标识的接入请求。
步骤507,云平台再次验证该访问令牌成功时,将该服务端设备的设备标识与该第二用户标识绑定。
云平台接收到该接入请求后,可以对该接入请求中携带的访问令牌进行再次验证。
在一种可能的实现方式中,云平台再次验证该访问令牌的方式,与上述步骤503中对该访问令牌的验证方式类似,此处不再赘述。
其中,当接入请求中包含第二用户标识,而未包含第一用户标识时,云平台可以根据第二用户标识查询该第一用户标识,并向账号服务器发送包含第一用户标识以及访问令牌的验证请求。
在另一种可能的实现方式中,云平台再次验证该访问令牌时,根据该访问令牌在本地查询该访问令牌的验证成功记录,该验证成功记录是上一次向该账号服务器验证该访问令牌成功后存储的;当查询到该验证成功记录时,确定再次验证该访问令牌成功;当未查询到该验证成功记录时,向账号服务器发起对该访问令牌的验证。
其中,为了减少向账号服务器发起验证的步骤,在本申请实施例中,云平台向账号服务器验证一个访问令牌成功后,可以在本地存储该访问令牌的验证成功记录,后续再次发起对该访问令牌的验证时,首先在本地查询是否具有该访问令牌的验证成功记录,如果存在该验证成功记录,则说明该访问令牌时已经验证过,且验证成功的访问令牌,可以直接确定该访问令牌验证成功,如果未查询到该验证成功记录,则需要进一步向账号服务器发起验证,这样可以减少与账号服务器之间不必要的交互,进一步减少接入的时长,提高接入效率,并节约网络资源。尤其是在需要短时间内接入多个服务端设备的情况下,该效果将更加明显。
在一种可能的实现方式中,当该验证成功记录的存储时长达到预设时长时,删除该验证成功记录。
由于上述访问令牌时账号服务器分配的,且访问令牌通常存在时间限制,在本申请实施例中,为了避免访问令牌在账号服务器侧失效,而导致上述验证成功记录错误的指示该访问令牌的有效性,云平台在生成上述验证成功记录之后,当验证成功记录的存储时长达到预设时长时,可以将该验证成功记录删除,后续再接收到包含该访问令牌的接入请求时,重新向账号服务器发起验证,避免验证过程出错。
在一种可能的实现方式中,当接入请求中包含该第一用户标识时,云平台根据该第一用户标识查询该第二用户标识;并将该服务端设备的设备标识,与查询到的该第二用户标识绑定。
在一种可能的实现方式中,当接入请求中包含该第一用户标识时,云平台还向该服务端设备发送该第二用户标识。
在一种可能的实现方式中,当该接入请求中包含第二用户标识时,云平台提取该接入请求中包含的该第二用户标识;并将该服务端设备的设备标识,与提取到的该第二用户标识绑定。
在一种可能的实现方式中,当该接入请求包含的该访问令牌,是该访问令牌的衍生数据时,云平台在将该服务端设备的设备标识与该第二用户标识绑定之前,还将该访问令牌的衍生数据还原为该访问令牌。
综上所述,本申请实施例所示的方案,配置设备从账号服务器获取当前登录的用户账号的访问令牌,后续过程中,配置设备和服务端设备分别通过该访问令牌向云平台发起注册和接入,云平台向账号服务器验证该访问令牌成功后,即可以为服务端设备对应的用户分配用 户标识,并将服务端设备与分配的用户标识进行绑定,以实现服务端设备的接入;在上述过程中,云平台通过账号服务器为配置设备中登录的用户账号分配的访问令牌实现鉴权,自己不需要为配置设备和服务端设备分别生成访问令牌,减少了访问令牌的分配和获取的过程,缩短了接入过程消耗的时间,从而在保证接入过程的安全性的情况下,提高服务端设备的接入效率。
此外,本申请实施例所示的方案,云平台通过将第二用户标识与服务端设备的设备标识进行绑定,以实现服务端设备的接入,由于第二用户标识没有时限的限制,不需要定期进行更新,因此,减少了后续对与设备标识绑定的信息进行更新和发布的步骤,从而节约对绑定关系的维护过程中的处理资源和网络资源。
另外,本申请实施例所示的方案,云平台接收到接入请求后,在对接入请求中携带的访问令牌进行验证时,首先查询本地是否存在该访问令牌的验证成功记录,若是,直接确定对该访问令牌验证成功,否则向账号服务器发起验证,提高了接入效率,并节约了网络资源。
基于上述图5所示的实施例中的方案,请参考图6,其示出了图5所示实施例涉及的一种物联网中的设备接入方法的流程图,如图6所示,该方法可以包括如下步骤:
S61、配置设备登录用户账号或进行开放授权(open Authorization,oAuth),成功后获得账号服务器提供的该用户账号的访问令牌和用户账号的用户标识(即上述第一用户标识)。
其中,用户账号访问令牌与该用户账号相关的身份或权限信息进行关联,可以代替用户名和密码进行用户身份和权限验证,如果用户账号的访问令牌具有有效期,配置设备可以在访问令牌过期前更新令牌。
在本申请实施例中,用户账号的用户标识与用户账号唯一对应,通常情况下,该用户标识对用户是隐形的,由账号服务器针对用户账号分配后管理。
S62、配置设备请求向云平台注册,注册请求中包含用户账号的访问令牌和用户账号的用户标识。
S63、云平台向账号服务器验证该用户账号的访问令牌。
S64、验证通过后,云平台根据用户账号的用户标识分配云平台的用户标识(即上述第二用户标识),并将二者进行关联。
S65、云平台向配置设备发送注册成功响应。
其中,该注册成功响应的消息中不包括云平台的用户标识。
S66、配置设备更新服务端设备的接入配置资源,为服务端设备提供接入云平台的配置信息,其中包括用户账号的访问令牌和用户账号的用户标识。
配置设备更新的接入配置资源的示例如下:
UPDATE/oic/coapcloudconfURI
{
"at":"Aliz3DUe4vuNAlSblExfbGxmp",
"auid":"2ufd34tvc",
"cis":"coaps+tcp://example.com:443",
"sid":"987e6543-a21f-10d1-a112-421345746237",
"apn":"github"
}
其中,上述示例中包括以下内容:
at:用户账号的访问令牌;
auid:用户账号的用户标识;
cis:云平台的接入URI;
sid:云平台的标识;
apn:授权提供方名称(账号服务器是第三方的授权提供方的服务器时携带)。
S67、服务端设备请求更新云平台的账号资源,以进行设备注册(即发送接入请求),其 中,请求消息中包括服务端的设备标识、用户账号的访问令牌和用户账号的用户标识。
服务端设备发送给云平台的账号资源的更新请求示例如下:
Figure PCTCN2020101162-appb-000002
上述示例中包括以下内容:
di:服务端的设备标识;
accesstoken:用户账号访问令牌;
auid:用户账号的用户标识;
apn:授权提供方名称(账号服务器是第三方的授权提供方的服务器时携带);
S68、云平台向账号服务器验证用户账号访问令牌。
S69、验证通过后,云平台确定用户账号的用户标识关联的云平台的用户标识,将服务端的设备标识和云平台的用户标识进行关联(即绑定)。
S610、云平台接受服务端设备的账号资源更新请求,向服务端设备返回云平台的用户标识。
在上述方案中,配置设备中的配置器登录用户账号或开放授权成功后,账号服务器会向配置器返回用户账号的访问令牌和用户账号的用户标识,配置器进行云平台注册,提供用户账号的访问令牌和用户账号的用户标识,云平台根据用户账号的用户标识分配云平台的用户标识。配置器配置服务端设备,向服务端设备提供用户账号的访问令牌和用户账号的用户标识,服务端设备向云平台注册,向云平台提供设备标识、用户账号的访问令牌和用户账号的用户标识,云平台验证用户账号的访问令牌后,通过用户账号的用户标识确定云平台的用户标识,将服务端设备的设备标识和云平台的用户标识关联,并向服务端设备返回云平台的用户标识。
基于上述图5所示的实施例中的方案,请参考图7,其示出了图5所示实施例涉及的另一种物联网中的设备接入方法的流程图,如图7所示,该方法可以包括如下步骤:
S71至S74,同上述S61至S64。
S75、云平台向配置设备发送注册成功消息,其中包括云平台的用户标识。
S76、配置设备更新服务端设备的接入配置资源,为服务端设备提供接入云平台的配置信息,其中包括用户账号的访问令牌和云平台的用户标识。
配置器更新的接入配置资源的示例如下:
UPDATE/oic/coapcloudconfURI
{
"at":"Aliz3DUe4vuNAlSblExfbGxmp",
"uid":"1erfs8837kd",
"cis":"coaps+tcp://example.com:443",
"sid":"987e6543-a21f-10d1-a112-421345746237",
"apn":"github"
}
上述示例中包括以下内容:
at:用户账号访问令牌;
uid:云平台的用户标识;
cis:云平台接入URI;
sid:云平台的标识;
apn:授权提供方名称。
S77、服务端设备请求更新云平台的账号资源,以进行设备注册,其中包括服务端的设备标识、用户账号的访问令牌和云平台的用户标识。
服务端发送给云平台的账号资源的更新请求示例如下:
Figure PCTCN2020101162-appb-000003
上述示例中包括以下内容:
di:服务端的设备标识;
accesstoken:用户账号的访问令牌;
uid:云平台的用户标识;
apn:授权提供方名称。
S78、云平台向账号服务器验证用户账号访问令牌。
S79、验证通过后,云平台将服务端设备的设备标识和云平台的用户标识进行关联。
S710、云平台接受服务端设备的账号资源更新请求。
其中,由于步骤S76中配置设备已经向服务端设备提供了云平台的用户标识,因此这里云平台可以不必向服务端设备返回云平台的用户标识。
在上述方案中,配置设备中的配置器登录用户账号或开放授权成功后,账号服务器会向配置器返回用户账号的访问令牌和用户账号的用户标识,配置器进行云平台注册,提供用户账号的访问令牌和用户账号的用户标识,云平台根据用户账号的用户标识分配云平台的用户标识,并将云平台的用户标识提供给配置器。配置器配置服务端设备,向服务端设备提供用户账号的访问令牌和云平台的用户标识,服务端设备向云平台注册,向云平台提供设备标识、用户账号的访问令牌和云平台的用户标识,云平台验证用户账号的访问令牌后,将服务端的设备标识和云平台的用户标识关联。
基于上述图5所示的实施例中的方案,请参考图8,其示出了图5所示实施例涉及的另一种物联网中的设备接入方法的流程图,如图8所示,该方法可以包括如下步骤:
S81、配置设备登录用户账号或进行开放授权,成功后获得账号服务器提供的用户账号的访问令牌。
S82、配置设备请求向云平台注册,注册消息中提供用户账号的访问令牌。
S83、云平台向账号服务器请求获取用户账号的用户标识,云平台提供用户账号的访问令牌以获取对应的用户账号的用户标识。
S84、账号服务器校验用户账号访问令牌的有效性,校验有效后,账号服务器向云平台返回对应的用户账号的用户标识。
S85、云平台根据用户账号的用户标识分配云平台的用户标识,并将二者进行关联。
S86、云平台向配置设备发送注册成功消息。
如果步骤S86中不包括云平台的用户标识,后续流程同图6中的步骤S66至S610。
如果步骤S86中包括云平台的用户标识,后续流程同图7中的步骤S76至S710。
在上述方案,配置设备中的配置器登录用户账号或开放授权成功后,账号服务器向配置器返回用户账号的访问令牌,配置器进行云平台注册,提供用户账号的访问令牌,云平台根据用户账号的访问令牌从账号服务器请求获取用户账号的用户标识,云平台根据用户账号的用户标识分配云平台的用户标识,后续方案与图6或图7中的方案类似,此处不再赘述。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图9,其示出了本申请一个实施例提供的物联网中的设备接入装置的框图。该装置具有实现上述物联网中的设备接入方法中,由云平台执行的步骤的功能。如图9所示,该装置可以包括:
注册请求接收模块901,用于接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
标识分配模块902,用于当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
接入请求接收模块903,用于接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
绑定模块904,用于当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
在一种可能的实现方式中,所述装置还包括:
验证请求发送模块,用于在所述标识分配模块向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识之前,向所述账号服务器发送第一验证请求,所述第一验证请求中包含所述访问令牌;
第一访问成功确定模块,用于在接收到所述账号服务器返回的有效指示时,确定向所述账号服务器验证所述访问令牌成功;所述有效指示用于指示所述访问令牌有效。
在一种可能的实现方式中,所述装置还包括:
第一标识接收模块,用于在所述标识分配模块分配与第一用户标识相对应的第二用户标识之前,接收所述账号服务器验证所述访问令牌有效后发送的所述第一用户标识。
在一种可能的实现方式中,所述注册请求接收模块,用于接收包含所述第一用户标识以及所述访问令牌的所述注册请求;
所述装置还包括:
第一标识提取模块,用于在所述标识分配模块分配与第一用户标识相对应的第二用户标识之前,从所述注册请求中提取所述第一用户标识。
在一种可能的实现方式中,所述接入请求中还包含所述第一用户标识;
所述绑定模块,用于,
根据所述第一用户标识查询所述第二用户标识;
将所述服务端设备的设备标识,与查询到的所述第二用户标识绑定。
在一种可能的实现方式中,所述装置还包括:
第一标识发送模块,用于向所述服务端设备发送所述第二用户标识。
在一种可能的实现方式中,所述装置还包括:
第二标识发送模块,用于在所述接入请求接收模块接收服务端设备发送的接入请求之前,在向所述账号服务器验证所述访问令牌成功时,向所述配置设备发送所述第二用户标识;
所述绑定模块,用于,
提取所述接入请求中包含的所述第二用户标识;
将所述服务端设备的设备标识,与提取到的所述第二用户标识绑定。
在一种可能的实现方式中,所述接入请求包含的所述访问令牌,是所述访问令牌的衍生数据;
所述装置还包括:
还原模块,用于在所述绑定模块再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定之前,将所述访问令牌的衍生数据还原为所述访问令牌。
在一种可能的实现方式中,所述装置还包括:
记录查询模块,用于在所述绑定模块再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定之前,根据所述访问令牌在本地查询所述访问令牌的验证成功记录,所述验证成功记录是上一次向所述账号服务器验证所述访问令牌成功后存储的;
第二访问成功确定模块,用于在查询到所述验证成功记录时,确定再次验证所述访问令牌成功。
在一种可能的实现方式中,所述装置还包括:
记录删除模块,用于在所述验证成功记录的存储时长达到预设时长时,删除所述验证成功记录。
综上所述,本申请实施例所示的方案,配置设备从账号服务器获取当前登录的用户账号的访问令牌,后续过程中,配置设备和服务端设备分别通过该访问令牌向云平台发起注册和接入,云平台向账号服务器验证该访问令牌成功后,即可以为服务端设备对应的用户分配用户标识,并将服务端设备与分配的用户标识进行绑定,以实现服务端设备的接入;在上述过程中,云平台通过账号服务器为配置设备中登录的用户账号分配的访问令牌实现鉴权,自己不需要为配置设备和服务端设备分别生成访问令牌,减少了访问令牌的分配和获取的过程,缩短了接入过程消耗的时间,从而在保证接入过程的安全性的情况下,提高服务端设备的接入效率。
请参考图10,其示出了本申请一个实施例提供的物联网中的设备接入装置的框图。该装置具有实现上述物联网中的设备接入方法中,由配置设备执行的步骤的功能。如图10所示,该装置可以包括:
访问令牌获取模块1001,用于从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
注册模块1002,用于基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
接入资源配置模块1003,用于为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
在一种可能的实现方式中,所述装置还包括:
第一标识获取模块,用于在所述注册模块基于所述访问令牌向云平台发送注册请求之前,从所述账号服务器获取所述第一用户标识;
所述注册模块,用于向所述云平台发送包含所述第一用户标识,以及所述访问令牌的所述注册请求。
在一种可能的实现方式中,所述接入资源配置模块,用于为所述服务端设备更新包含所述访问令牌以及所述第一用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第一用户标识以及所述服务端设备的设备标识的接入请求。
在一种可能的实现方式中,所述装置还包括:
第二标识获取模块,用于在所述接入资源配置模块为服务端设备更新包含所述访问令牌的接入配置资源之前,接收所述云平台返回的所述第二用户标识;
所述接入资源配置模块,用于为所述服务端设备更新包含所述访问令牌以及所述第二用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第二用户标识以及所述服务端设备的设备标识的接入请求。
在一种可能的实现方式中,所述接入资源配置模块,包括:
数据生成单元,用于生成所述访问令牌的衍生数据;
更新单元,用于为所述服务端设备更新包含所述访问令牌的衍生数据的接入配置资源。
在一种可能的实现方式中,所述数据生成单元,用于对所述访问令牌进行加密处理,获得所述访问令牌的衍生数据。
在一种可能的实现方式中,所述访问令牌获取模块,用于,
在通过所述用户账号登录所述账号服务器时,从所述账号服务器获取所述访问令牌;
或者,
在通过所述用户账号进行开放授权认证时,从所述账号服务器获取所述访问令牌。
需要说明的一点是,上述实施例提供的装置在实现其功能时,仅以上述各个功能模块的划分进行举例说明,实际应用中,可以根据实际需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
请参考图11,其示出了本申请一个实施例提供的计算机设备1100的结构示意图。该计算机设备1100可以包括:处理器1101、接收器1102、发射器1103、存储器1104和总线1105。
处理器1101包括一个或者一个以上处理核心,处理器1101通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。
接收器1102和发射器1103可以实现为一个通信组件,该通信组件可以是一块通信芯片。该通信芯片也可以称为收发器。
存储器1104通过总线1105与处理器1101相连。
存储器1104可用于存储计算机程序,处理器1101用于执行该计算机程序,以实现上述方法实施例中的服务端设备、配置设备、云平台或者账号服务器执行的各个步骤。
此外,存储器1104可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器,可擦除可编程只读存储器,静态随时存取存储器,只读存储器,磁存储器,快闪存储器,可编程只读存储器。
在示例性实施例中,所述计算机设备包括处理器、存储器和收发器(该收发器可以包括接收器和发射器,接收器用于接收信息,发射器用于发送信息)。
在一种可能的实现方式中,当计算机设备实现为云平台时,
所述收发器,用于接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
所述处理器,用于在向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
所述收发器,用于接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
所述处理器,用于再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
当计算机设备实现为云平台时,本申请实施例涉及的计算机设备中的处理器和收发器,可以执行上述图3、图5、图6、图7或者图8所示的方法中,由云平台执行的步骤,此处不再赘述。
在另一种可能的实现方式中,当计算机设备实现为配置设备时,
所述收发器,用于从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
所述收发器,用于基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所 述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
所述收发器,用于为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
当计算机设备实现为配置设备时,本申请实施例涉及的计算机设备中的处理器和收发器,可以执行上述图4、图5、图6、图7或者图8所示的方法中,由配置设备执行的步骤,此处不再赘述。
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现上述图3至图8所示的物联网中的设备接入方法中的各个步骤。
本申请还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述3至图8所示的物联网中的设备接入方法中的各个步骤。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (35)

  1. 一种物联网中的设备接入方法,其特征在于,所述方法由云平台执行,所述方法包括:
    接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
    当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
    当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  2. 根据权利要求1所述的方法,其特征在于,所述当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识之前,还包括:
    向所述账号服务器发送第一验证请求,所述第一验证请求中包含所述访问令牌;
    接收所述账号服务器验证所述访问令牌有效后发送的所述第一用户标识。
  3. 根据权利要求1所述的方法,其特征在于,所述接收配置设备基于用户账号的访问令牌发送的注册请求,包括:
    接收包含所述第一用户标识以及所述访问令牌的所述注册请求;
    所述分配与第一用户标识相对应的第二用户标识之前,还包括:
    从所述注册请求中提取所述第一用户标识。
  4. 根据权利要求1所述的方法,其特征在于,所述接入请求中还包含所述第一用户标识;
    所述将所述服务端设备的设备标识与所述第二用户标识绑定,包括:
    根据所述第一用户标识查询所述第二用户标识;
    将所述服务端设备的设备标识,与查询到的所述第二用户标识绑定。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    向所述服务端设备发送所述第二用户标识。
  6. 根据权利要求1所述的方法,其特征在于,所述接收服务端设备发送的接入请求之前,还包括:
    当向所述账号服务器验证所述访问令牌成功时,向所述配置设备发送所述第二用户标识;
    所述将所述服务端设备的设备标识与所述第二用户标识绑定,包括:
    提取所述接入请求中包含的所述第二用户标识;
    将所述服务端设备的设备标识,与提取到的所述第二用户标识绑定。
  7. 根据权利要求1所述的方法,其特征在于,所述接入请求包含的所述访问令牌,是所述访问令牌的衍生数据;
    所述当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定之前,还包括:
    将所述访问令牌的衍生数据还原为所述访问令牌。
  8. 根据权利要求1所述的方法,其特征在于,所述当再次验证所述访问令牌成功时,将 所述服务端设备的设备标识与所述第二用户标识绑定之前,还包括:
    根据所述访问令牌在本地查询所述访问令牌的验证成功记录,所述验证成功记录是上一次向所述账号服务器验证所述访问令牌成功后存储的;
    当查询到所述验证成功记录时,确定再次验证所述访问令牌成功。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    当所述验证成功记录的存储时长达到预设时长时,删除所述验证成功记录。
  10. 一种物联网中的设备接入方法,其特征在于,所述方法由配置设备执行,所述方法包括:
    从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
    基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  11. 根据权利要求10所述的方法,其特征在于,所述基于所述访问令牌向云平台发送注册请求之前,还包括:
    从所述账号服务器获取所述第一用户标识;
    所述基于所述访问令牌向云平台发送注册请求,包括:
    向所述云平台发送包含所述第一用户标识,以及所述访问令牌的所述注册请求。
  12. 根据权利要求10所述的方法,其特征在于,所述为服务端设备更新包含所述访问令牌的接入配置资源,包括:
    为所述服务端设备更新包含所述访问令牌以及所述第一用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第一用户标识以及所述服务端设备的设备标识的接入请求。
  13. 根据权利要求10所述的方法,其特征在于,所述为服务端设备更新包含所述访问令牌的接入配置资源之前,还包括:
    接收所述云平台返回的所述第二用户标识;
    所述为服务端设备更新包含所述访问令牌的接入配置资源,包括:
    为所述服务端设备更新包含所述访问令牌以及所述第二用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第二用户标识以及所述服务端设备的设备标识的接入请求。
  14. 根据权利要求10所述的方法,其特征在于,所述为服务端设备更新包含所述访问令牌的接入配置资源,包括:
    生成所述访问令牌的衍生数据;
    为所述服务端设备更新包含所述访问令牌的衍生数据的接入配置资源。
  15. 根据权利要求14所述的方法,其特征在于,所述生成所述访问令牌的衍生数据,包括:
    对所述访问令牌进行加密处理,获得所述访问令牌的衍生数据。
  16. 根据权利要求10所述的方法,其特征在于,所述从账号服务器获取用户账号的访问令牌,包括:
    在通过所述用户账号登录所述账号服务器时,从所述账号服务器获取所述访问令牌;
    或者,
    在通过所述用户账号进行开放授权认证时,从所述账号服务器获取所述访问令牌。
  17. 一种物联网中的设备接入装置,其特征在于,所述装置用于云平台中,所述装置包括:
    注册请求接收模块,用于接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
    标识分配模块,用于当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    接入请求接收模块,用于接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
    绑定模块,用于当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:
    验证请求发送模块,用于在所述标识分配模块向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识之前,向所述账号服务器发送第一验证请求,所述第一验证请求中包含所述访问令牌;
    第一标识接收模块,用于接收所述账号服务器验证所述访问令牌有效后发送的所述第一用户标识。
  19. 根据权利要求17所述的装置,其特征在于,
    所述注册请求接收模块,用于接收包含所述第一用户标识以及所述访问令牌的所述注册请求;
    所述装置还包括:
    第一标识提取模块,用于在所述标识分配模块分配与第一用户标识相对应的第二用户标识之前,从所述注册请求中提取所述第一用户标识。
  20. 根据权利要求17所述的装置,其特征在于,所述接入请求中还包含所述第一用户标识;
    所述绑定模块,用于,
    根据所述第一用户标识查询所述第二用户标识;
    将所述服务端设备的设备标识,与查询到的所述第二用户标识绑定。
  21. 根据权利要求20所述的装置,其特征在于,所述装置还包括:
    第一标识发送模块,用于向所述服务端设备发送所述第二用户标识。
  22. 根据权利要求17所述的装置,其特征在于,所述装置还包括:
    第二标识发送模块,用于在所述接入请求接收模块接收服务端设备发送的接入请求之前, 当向所述账号服务器验证所述访问令牌成功时,向所述配置设备发送所述第二用户标识;
    所述绑定模块,用于,
    提取所述接入请求中包含的所述第二用户标识;
    将所述服务端设备的设备标识,与提取到的所述第二用户标识绑定。
  23. 根据权利要求17所述的装置,其特征在于,所述接入请求包含的所述访问令牌,是所述访问令牌的衍生数据;
    所述装置还包括:
    还原模块,用于在所述绑定模块再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定之前,将所述访问令牌的衍生数据还原为所述访问令牌。
  24. 根据权利要求17所述的装置,其特征在于,所述装置还包括:
    记录查询模块,用于在所述绑定模块再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定之前,根据所述访问令牌在本地查询所述访问令牌的验证成功记录,所述验证成功记录是上一次向所述账号服务器验证所述访问令牌成功后存储的;
    第二访问成功确定模块,用于当查询到所述验证成功记录时,确定再次验证所述访问令牌成功。
  25. 根据权利要求24所述的装置,其特征在于,所述装置还包括:
    记录删除模块,用于当所述验证成功记录的存储时长达到预设时长时,删除所述验证成功记录。
  26. 一种物联网中的设备接入装置,其特征在于,所述装置用于配置设备中,所述装置包括:
    访问令牌获取模块,用于从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
    注册模块,用于基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    接入资源配置模块,用于为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  27. 根据权利要求26所述的装置,其特征在于,所述装置还包括:
    第一标识获取模块,用于在所述注册模块基于所述访问令牌向云平台发送注册请求之前,从所述账号服务器获取所述第一用户标识;
    所述注册模块,用于向所述云平台发送包含所述第一用户标识,以及所述访问令牌的所述注册请求。
  28. 根据权利要求26所述的装置,其特征在于,
    所述接入资源配置模块,用于为所述服务端设备更新包含所述访问令牌以及所述第一用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第一用户标识以及所述服务端设备的设备标识的接入请求。
  29. 根据权利要求26所述的装置,其特征在于,所述装置还包括:
    第二标识获取模块,用于在所述接入资源配置模块为服务端设备更新包含所述访问令牌的接入配置资源之前,接收所述云平台返回的所述第二用户标识;
    所述接入资源配置模块,用于为所述服务端设备更新包含所述访问令牌以及所述第二用户标识的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌、所述第二用户标识以及所述服务端设备的设备标识的接入请求。
  30. 根据权利要求26所述的装置,其特征在于,所述接入资源配置模块,包括:
    数据生成单元,用于生成所述访问令牌的衍生数据;
    更新单元,用于为所述服务端设备更新包含所述访问令牌的衍生数据的接入配置资源。
  31. 根据权利要求30所述的装置,其特征在于,
    所述数据生成单元,用于对所述访问令牌进行加密处理,获得所述访问令牌的衍生数据。
  32. 根据权利要求26所述的装置,其特征在于,所述访问令牌获取模块,用于,
    在通过所述用户账号登录所述账号服务器时,从所述账号服务器获取所述访问令牌;
    或者,
    在通过所述用户账号进行开放授权认证时,从所述账号服务器获取所述访问令牌。
  33. 一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器和收发器;
    所述收发器,用于接收配置设备基于用户账号的访问令牌发送的注册请求,所述用户账号是在所述配置设备中登录的账号,所述访问令牌是所述配置设备从账号服务器获取的;
    所述处理器,用于当向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    所述收发器,用于接收服务端设备发送的接入请求,所述接入请求包含所述访问令牌以及所述服务端设备的设备标识;所述接入请求是所述配置设备通过为所述服务端设备更新包含所述访问令牌的接入配置资源触发的;
    所述处理器,用于当再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  34. 一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器和收发器;
    所述收发器,用于从账号服务器获取用户账号的访问令牌;所述用户账号是在所述配置设备中登录的账号;
    所述收发器,用于基于所述访问令牌向云平台发送注册请求,所述注册请求用于触发所述云平台向所述账号服务器验证所述访问令牌成功时,分配与第一用户标识相对应的第二用户标识;所述第一用户标识是所述账号服务器为所述用户账号分配的;
    所述收发器,用于为服务端设备更新包含所述访问令牌的接入配置资源,以触发所述服务端设备向所述云平台发送包含所述访问令牌以及所述服务端设备的设备标识的接入请求,所述接入请求用于触发所述云平台再次验证所述访问令牌成功时,将所述服务端设备的设备标识与所述第二用户标识绑定。
  35. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如权利要求1至16任一项所述的物联网中的设备接入方法。
PCT/CN2020/101162 2020-07-09 2020-07-09 物联网中的设备接入方法、装置、计算机设备及存储介质 WO2022006825A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/101162 WO2022006825A1 (zh) 2020-07-09 2020-07-09 物联网中的设备接入方法、装置、计算机设备及存储介质
CN202080100570.1A CN115486033A (zh) 2020-07-09 2020-07-09 物联网中的设备接入方法、装置、计算机设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/101162 WO2022006825A1 (zh) 2020-07-09 2020-07-09 物联网中的设备接入方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022006825A1 true WO2022006825A1 (zh) 2022-01-13

Family

ID=79553423

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/101162 WO2022006825A1 (zh) 2020-07-09 2020-07-09 物联网中的设备接入方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN115486033A (zh)
WO (1) WO2022006825A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277828A (zh) * 2021-10-27 2022-11-01 珠海奔图电子有限公司 一种智能设备的注册方法、装置和电子设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107819805A (zh) * 2016-09-14 2018-03-20 北京京东尚科信息技术有限公司 智能设备控制方法以及系统
CN107995215A (zh) * 2017-12-20 2018-05-04 青岛海信智慧家居系统股份有限公司 智能家居设备的控制方法、装置及云平台服务器
US20180288617A1 (en) * 2017-04-04 2018-10-04 Dell Products L.P. Transferable ownership tokens for discrete, identifiable devices
CN108881228A (zh) * 2018-06-20 2018-11-23 上海庆科信息技术有限公司 云端注册激活方法、装置、设备和存储介质
CN109936579A (zh) * 2019-03-21 2019-06-25 广东瑞恩科技有限公司 单点登录方法、装置、设备及计算机可读存储介质
US10382203B1 (en) * 2016-11-22 2019-08-13 Amazon Technologies, Inc. Associating applications with Internet-of-things (IoT) devices using three-way handshake
WO2019177207A1 (ko) * 2018-03-14 2019-09-19 인하대학교 산학협력단 IoT 기반 건강 처방 보조 및 보안 시스템 그리고 방법

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9813400B2 (en) * 2014-11-07 2017-11-07 Probaris Technologies, Inc. Computer-implemented systems and methods of device based, internet-centric, authentication
CN106960148B (zh) * 2016-01-12 2021-05-14 阿里巴巴集团控股有限公司 一种设备标识的分配方法和装置
CN105812491B (zh) * 2016-05-12 2020-06-16 腾讯科技(深圳)有限公司 设备远程绑定方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107819805A (zh) * 2016-09-14 2018-03-20 北京京东尚科信息技术有限公司 智能设备控制方法以及系统
US10382203B1 (en) * 2016-11-22 2019-08-13 Amazon Technologies, Inc. Associating applications with Internet-of-things (IoT) devices using three-way handshake
US20180288617A1 (en) * 2017-04-04 2018-10-04 Dell Products L.P. Transferable ownership tokens for discrete, identifiable devices
CN107995215A (zh) * 2017-12-20 2018-05-04 青岛海信智慧家居系统股份有限公司 智能家居设备的控制方法、装置及云平台服务器
WO2019177207A1 (ko) * 2018-03-14 2019-09-19 인하대학교 산학협력단 IoT 기반 건강 처방 보조 및 보안 시스템 그리고 방법
CN108881228A (zh) * 2018-06-20 2018-11-23 上海庆科信息技术有限公司 云端注册激活方法、装置、设备和存储介质
CN109936579A (zh) * 2019-03-21 2019-06-25 广东瑞恩科技有限公司 单点登录方法、装置、设备及计算机可读存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277828A (zh) * 2021-10-27 2022-11-01 珠海奔图电子有限公司 一种智能设备的注册方法、装置和电子设备

Also Published As

Publication number Publication date
CN115486033A (zh) 2022-12-16

Similar Documents

Publication Publication Date Title
CN107018127B (zh) 一种兼容多种协议的物联网虚拟网关及节点接入认证方法
US11716390B2 (en) Systems and methods for remote management of appliances
CN107404544B (zh) 用于ip地址指派的方法和装置
WO2017024791A1 (zh) 一种处理授权的方法和设备
US20120011577A1 (en) Access authentication method and information processing apparatus
WO2023011016A1 (zh) 物联网设备绑定方法、装置、系统、云服务器和存储介质
CN112788031A (zh) 基于Envoy架构的微服务接口认证系统、方法及装置
CN114363165B (zh) 一种电子设备的配置方法、电子设备和服务器
US20220377556A1 (en) Internet-of-things device registration method and apparatus, device, and storage medium
CN113691646A (zh) 域名服务资源访问方法、装置、电子设备和介质
WO2019037603A1 (zh) 一种用于对用户设备进行无线连接预授权的方法与设备
US7558845B2 (en) Modifying a DHCP configuration for one system according to a request from another system
CN113765655A (zh) 访问控制方法、装置、设备及存储介质
WO2022006825A1 (zh) 物联网中的设备接入方法、装置、计算机设备及存储介质
WO2023231681A1 (zh) 账号创建方法、物联网多租户系统、设备、程序和介质
CN109150862B (zh) 一种实现token漫游的方法及服务端
JP6848275B2 (ja) プログラム、認証システム及び認証連携システム
CN112417403A (zh) 一种基于GitLab API的系统自动化认证和授权处理方法
WO2023115584A1 (zh) 连接配置方法、连接建立方法、装置、设备及存储介质
US11637822B2 (en) Onboarding for cloud-based management
WO2023015574A1 (zh) 用于账号关联的方法、装置、计算机设备及存储介质
US20240179142A1 (en) Method and apparatus for account association, and computer device and storage medium
CN113615140B (zh) 集合资源的访问方法、装置、设备及存储介质
US11366914B2 (en) Authenticating access of service of service entity to application of client device based on whether root certificate corresponding to application is installed in service entity
CN107276965B (zh) 服务发现组件的权限控制方法及装置

Legal Events

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

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20944297

Country of ref document: EP

Kind code of ref document: A1