WO2021102915A1 - Method and apparatus for configuring internet-of-things device, and storage medium - Google Patents

Method and apparatus for configuring internet-of-things device, and storage medium Download PDF

Info

Publication number
WO2021102915A1
WO2021102915A1 PCT/CN2019/121994 CN2019121994W WO2021102915A1 WO 2021102915 A1 WO2021102915 A1 WO 2021102915A1 CN 2019121994 W CN2019121994 W CN 2019121994W WO 2021102915 A1 WO2021102915 A1 WO 2021102915A1
Authority
WO
WIPO (PCT)
Prior art keywords
device instance
instance
internet
instruction
resource
Prior art date
Application number
PCT/CN2019/121994
Other languages
French (fr)
Chinese (zh)
Inventor
张军
吕小强
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2019/121994 priority Critical patent/WO2021102915A1/en
Priority to CN201980097430.0A priority patent/CN114009143A/en
Publication of WO2021102915A1 publication Critical patent/WO2021102915A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Definitions

  • a method for configuring an Internet of Things device is provided, the method is applied to the Internet of Things device, and the method includes:
  • Fig. 2 is a flowchart of a method for configuring an Internet of Things device provided by an embodiment of the present application.
  • the method can be applied to an Internet of Things device, and the application scenario corresponding to the method can be that the Internet of Things device enters the second security domain network from the first security domain network.
  • Both the first security domain network and the second security domain network are applicable to the implementation environment described in FIG. 1.
  • the Internet of Things device has been configured by an OBT device in another security domain network except the second security domain network, and the other security domain network may be the first security domain network or another security domain network.
  • the method can include:
  • Step 301 When the IoT device enters the second secure domain network from the first secure domain network, and when there is no second device instance in the IoT device, send a creation instruction.
  • an attribute used to indicate the creation of an initial device instance is newly extended in the original resources of the device instance.
  • the resource with the attribute used to instruct the creation of the initialization device instance is called the target resource, and the IoT device can create the initialization device instance according to the target resource; in the second method, a new application is added to the device instance.
  • the target resource may include the attribute indicating the creation of the initialization device instance.
  • the device can create an initial device instance based on the target resource.
  • the target resource can also include other attributes, for example, an attribute used to indicate whether to switch the device instance.
  • the "dos” attribute is used to indicate the activation status of the IoT device
  • the “isop” attribute is used to indicate whether the IoT device is operability
  • the "cm” attribute is used to indicate the current mode of the IoT device
  • the "tm” attribute is used to indicate the target mode of the IoT device
  • the "om” attribute is used to indicate the operation mode of the IoT device
  • the "sm” attribute is used to indicate the mode supported by the IoT device
  • the “onboardself” attribute is used to indicate whether the IoT device is used by itself
  • the “onboardas” attribute is used to indicate the role of the IoT device when it is configured
  • the “onboardnew” attribute is used to indicate whether to create an initial device instance
  • the "rowneruuid” attribute is used to indicate the ID of the resource owner.
  • the method may further include a process of obtaining the ID of the OBT device:
  • Step 407 When the target resource is stored in the Internet of Things device, the Internet of Things device triggers the first request.
  • the Internet of Things device may receive a creation instruction for retaining the first device instance for the user's selection, or may receive a creation instruction for resetting the first device instance.
  • Updating the device instance resource of the first device instance refers to updating the attribute value of the switching attribute in the device instance resource, so that the IoT device can switch from the currently running first device instance to the candidate device embodiment.
  • the attribute value of the "nextinstance" attribute is "true”, so it can be seen that the switching request can instruct the IoT device to trigger the switching device instance.
  • the reset instruction may also include instruction information for instructing the candidate device instance to join the second security domain network as a client. That is, the Internet of Things device joins the Internet of Things device to the second security domain network as a client.
  • Step D11 When receiving the reservation instruction, the Internet of Things device updates the target resource of the first device instance according to the reservation instruction.
  • the reservation instruction may include an update instruction for updating the target resource of the first device instance.
  • the update instruction may include:
  • the reservation instruction may include an update instruction for updating the target resource of the first device instance.
  • the update instruction may include:
  • Step D22 Obtain the updated target resource.
  • Step E7 When the application platform determines that there is no second device instance, it triggers the first device instance to send a second request to the user equipment.
  • Step E18 The application platform places the new device instance in an inactive state.
  • Step E23 The application platform monitors or subscribes to the pstat resource in the first device instance.
  • Step F16 The application platform obtains the resource collection of the first device instance.
  • the sending module 803 is configured to return the first successful creation response
  • the processing module 801 is configured to reset the first device instance to the initialization device instance according to the resource update instruction
  • FIG. 10 shows another device for configuring an Internet of Things device provided by an embodiment of the present application.
  • the device can be applied to user equipment.
  • the device 100 includes:
  • a sending module 101 which is used to send a creation instruction when an IoT device enters a second secure domain network from a first security domain network, and when there is no second device instance in the IoT device,
  • the reset instruction is used for instructing the Internet of Things device to create the initialization device instance by resetting the first device instance when there is no second device instance.
  • the new attribute is one of a first attribute value and a second attribute value
  • the first attribute value is used to indicate the creation of a new device instance
  • the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
  • the computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Abstract

The present application relates to the field of Internet of things, and provides a method and apparatus for configuring an Internet-of-things device, and a storage medium. In the method, when an Internet-of-things device enters a second security domain network from a first security domain network, and if the Internet-of-things device determines that there is no second device instance, that can be configured by the OBT device in the second security domain network, in the Internet-of-things device, a creation instruction is sent for creation. The creation instruction can be used by the Internet-of-things device to create an initialization device instance that can be configured as a second device instance by the OBT device in the second security domain network, so that the Internet-of-things device can be interconnected with other devices in the second security domain network.

Description

物联网设备的配置方法、装置及存储介质Configuration method, device and storage medium of Internet of things equipment 技术领域Technical field
本申请涉及物联网领域,特别涉及一种物联网设备的配置方法、装置及存储介质。This application relates to the field of Internet of Things, and in particular to a configuration method, device and storage medium of Internet of Things equipment.
背景技术Background technique
物联网(The Internet of Things,IoT)是一种基于信息承载体(例如互联网以及传统电信网等网络),使所有能够被独立寻址的普通物理对象实现互联互通的技术。The Internet of Things (IoT) is a technology based on information carriers (such as the Internet and traditional telecommunication networks) that enables all ordinary physical objects that can be independently addressed to achieve interconnection and intercommunication.
物联网中包括安全域网络。安全域网络指的是具有安全协议的物联网的网络,连接于该安全域网络中的多个物联网设备能够互联互通。激活工具(Onboarding Tool,OBT)是安全协议中用来配置该多个物联网设备的工具,每个安全域网络均可对应一个OBT。在每个安全域网络中,设置有OBT的物联网设备可以称为OBT设备,该OBT设备可以用来配置该安全域网络中的其他物联网设备。The Internet of Things includes secure domain networks. A secure domain network refers to a network of the Internet of Things with a security protocol, and multiple IoT devices connected to the secure domain network can be interconnected. An activation tool (Onboarding Tool, OBT) is a tool used to configure the multiple IoT devices in a security protocol, and each security domain network can correspond to an OBT. In each security domain network, an IoT device provided with an OBT can be referred to as an OBT device, and the OBT device can be used to configure other IoT devices in the security domain network.
但是在相关技术中,当第一安全域网络中被第一OBT设备配置后的其他物联网设备移动至第二安全域网络时,该第二安全域网络中的第二OBT设备则无法再对该其他物联网设备进行配置,导致该其他物联网设备无法与该第二安全域网络中的物联网设备进行互联互通。However, in the related art, when other IoT devices configured by the first OBT device in the first security domain network move to the second security domain network, the second OBT device in the second security domain network can no longer be used. The configuration of the other Internet of Things device causes the other Internet of Things device to fail to communicate with the Internet of Things device in the second security domain network.
发明内容Summary of the invention
本申请实施例提供了一种物联网设备的配置方法、装置及存储介质,可以用于解决已经被一个安全域网络中的OBT设备配置后的物联网设备在进入一个新的安全域网络时,无法与该安全域网络下的其他物联网设备互联互通的问题。所述技术方案如下:The embodiments of the present application provide a configuration method, device, and storage medium for IoT devices, which can be used to solve the problem of IoT devices that have been configured by OBT devices in a secure domain network when they enter a new secure domain network. The problem of not being able to interconnect with other IoT devices under the secure domain network. The technical solution is as follows:
一个方面,提供了一种物联网设备的配置方法,所述方法应用于物联网设备,所述方法包括:In one aspect, a method for configuring an Internet of Things device is provided, the method is applied to the Internet of Things device, and the method includes:
当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致;When the IoT device enters the second security domain network from the first security domain network, it is determined whether there is a second device instance in the IoT device, and the security domain information configured by the second device instance is identical to the first security domain information. 2. The security domain information possessed by the security domain network is consistent;
当不存在所述第二设备实例时,接收创建指令;When the second device instance does not exist, receive a creation instruction;
根据所述创建指令,创建初始化设备实例,所述初始化设备实例用于被所述第二安全域网络的激活工具OBT设备配置为所述第二设备实例。According to the creation instruction, an initialization device instance is created, and the initialization device instance is used to be configured as the second device instance by the activation tool OBT device of the second security domain network.
一方面,提供了一种物联网设备的配置方法,所述方法应用于用户设备,所述方法包括:In one aspect, a method for configuring an Internet of Things device is provided. The method is applied to a user equipment, and the method includes:
当物联网设备从第一安全域网络进入第二安全域网络时,且当所述物联网设备中不存在第二设备实例时,发送创建指令,When the IoT device enters the second secure domain network from the first secure domain network, and when there is no second device instance in the IoT device, send a creation instruction,
其中,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致,所述创建指令用于被所述物联网设备创建初始化设备实例,所述初始化设备实例用于配置为所述第二设备实例。Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device The instance is used to configure as the second device instance.
一方面,提供了一种物联网设备的配置装置,所述装置应用于物联网设备,所述装置包括:In one aspect, a device for configuring an Internet of Things device is provided. The device is applied to an Internet of Things device, and the device includes:
处理模块,所述处理模块用于当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致;Processing module, the processing module is used to determine whether there is a second device instance in the Internet of Things device when the Internet of Things device enters the second security domain network from the first security domain network. The configured security domain information is consistent with the security domain information possessed by the second security domain network;
接收模块,所述接收模块用于当不存在所述第二设备实例时,接收创建指令;A receiving module configured to receive a creation instruction when the second device instance does not exist;
所述处理模块用于根据所述创建指令,创建初始化设备实例,所述初始化设备实例用于被所述第二安全域网络的激活工具OBT设备配置为所述第二设备实例。The processing module is configured to create an initialization device instance according to the creation instruction, and the initialization device instance is used to be configured as the second device instance by an activation tool OBT device of the second security domain network.
一方面,提供了一种物联网设备的配置装置,所述装置应用于用户设备,所述装置包括:In one aspect, a device for configuring an Internet of Things device is provided, the device is applied to user equipment, and the device includes:
发送模块,所述发送模块用于当物联网设备从第一安全域网络进入第二安全域网络时,且当所述物联网设备中不存在第二设备实例时,发送创建指令,A sending module, which is used to send a creation instruction when the IoT device enters the second secure domain network from the first security domain network, and when there is no second device instance in the IoT device,
其中,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致,所述创建指令用于被所述物联网设备创建初始化设备实例,所述初始化设备实例用于配置为所述第二设备实例。Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device The instance is used to configure as the second device instance.
一方面,提供一种物联网设备,所述物联网设备包括处理器和存储器,所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现上述方面中任一所述的方法。In one aspect, an Internet of Things device is provided. The Internet of Things device includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement any of the above aspects. The method described.
一方面,提供一种用户设备,所述用户设备包括处理器和存储器,所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现上述方面中任一所述的方法。In one aspect, a user equipment is provided. The user equipment includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is configured to be executed by the processor to implement any one of the foregoing aspects. Methods.
一方面,提供一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,其特征在于,所述指令被处理器执行时实现上述方面中任一所述的方法。In one aspect, a computer-readable storage medium is provided, and instructions are stored on the computer-readable storage medium. The instructions are characterized in that, when the instructions are executed by a processor, the method in any one of the above aspects is implemented.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought about by the technical solutions provided by the embodiments of the present application include at least:
通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,根据接收到的创建指令创建能够被该第二安全域网络中的OBT设备配置为第二设备实例的初始化设备实例,使得该物联网设备能够与第二安全域网络中的其它设备互联互通。When the IoT device enters the second security domain network from the first security domain network, and when the IoT device determines that there is no second device instance that can be configured by the OBT device in the second security domain network, according to The received creation instruction creates an initialization device instance that can be configured by the OBT device in the second security domain network as the second device instance, so that the Internet of Things device can be interconnected with other devices in the second security domain network.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1是本申请一个示例性实施例提供的一种实施环境的示意图;Fig. 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
图2是本申请另一个示例性实施例提供的一种物联网设备的配置方法的流程图;Fig. 2 is a flowchart of a method for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图3是本申请一个示例性实施例提供的另一种物联网设备的配置方法的流程图;Fig. 3 is a flowchart of another method for configuring an Internet of Things device provided by an exemplary embodiment of the present application;
图4是本申请另一个示例性实施例提供的又一种物联网设备的配置方法的流程图;FIG. 4 is a flowchart of yet another method for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图5是本申请另一个示例性实施例提供的又一种物联网设备的配置方法的流程图;FIG. 5 is a flowchart of yet another method for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图6是本申请另一个示例性实施例提供的又一种物联网设备的配置方法的流程图;FIG. 6 is a flowchart of yet another method for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图7是本申请另一个示例性实施例提供的又一种物联网设备的配置方法的流程图;FIG. 7 is a flowchart of yet another method for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图8是本申请另一个示例性实施例提供的一种物联网设备的配置装置的框图;Fig. 8 is a block diagram of a device for configuring an Internet of Things device according to another exemplary embodiment of the present application;
图9是本申请另一个示例性实施例提供的又一种物联网设备的配置装置的框图;FIG. 9 is a block diagram of yet another device for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图10是本申请另一个示例性实施例提供的又一种物联网设备的配置装置的框图;FIG. 10 is a block diagram of another device for configuring an Internet of Things device provided by another exemplary embodiment of the present application;
图11是本申请另一个示例性实施例提供的又一种物联网设备的配置装置的框图;FIG. 11 is a block diagram of yet another device for configuring an Internet of Things device according to another exemplary embodiment of the present application;
图12是本申请另一个示例性实施例提供的一种设备的结构示意图。Fig. 12 is a schematic structural diagram of a device provided by another exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions, and advantages of the present application clearer, the implementation manners of the present application will be described in further detail below in conjunction with the accompanying drawings.
在对本申请实施例提供的物联网设备的配置方法进行详细介绍之前,先对本申请实施例涉及的名词和实施环境进行简单介绍。Before describing in detail the configuration method of the Internet of Things device provided in the embodiment of the present application, a brief introduction to the terms and implementation environment involved in the embodiment of the present application will be given first.
安全域网络:安全域网络指的是一个具体的物联网的网络,该安全域网络具有独立的安全协议(或安全机制),在该安全域网络中的物联网设备可以互联、互通、互相发现以及相互传输指令。在该安全域网络之外的设备,由于受到该安全域网络中的安全协议限制,因此无法访问该安全域网络内的其他物联网设备。安全域网络可以是局域网的子网络,局域网可以具有至少一个安全域网络,该至少一个安全域网络通过一个接入点设备设置于该局域网中,该至少一个安全域网络可以分别具有独立的安全协议。Security domain network: A security domain network refers to a specific Internet of Things network. The security domain network has an independent security protocol (or security mechanism). The IoT devices in the security domain network can interconnect, communicate, and discover each other And transfer instructions to each other. Devices outside the secure domain network are restricted by the security protocol in the secure domain network, and therefore cannot access other IoT devices in the secure domain network. The security domain network may be a sub-network of the local area network, the local area network may have at least one security domain network, the at least one security domain network is set in the local area network through an access point device, and the at least one security domain network may each have an independent security protocol .
OBT以及OBT设备:OBT是安全协议中的一个角色,是用于配置该安全协议所设置在的安全域网络中物联网设备的工具。OBT可以在安全域网络中的一个物联网设备上运行,设置有OBT的物联网设备可以称为OBT设备,该OBT设备可以用于配置其自身,也可以用于配置其所在的安全域网络中的其他物联网设备。该OBT设备配置的物联网设备可以组成一个安全域网络。OBT and OBT devices: OBT is a role in the security protocol, and is a tool for configuring IoT devices in the security domain network where the security protocol is set. OBT can run on an IoT device in a secure domain network. The IoT device set with OBT can be called an OBT device. The OBT device can be used to configure itself or in the secure domain network where it is located. Other IoT devices. The Internet of Things devices configured with the OBT device can form a secure domain network.
逻辑设备:每个物联网设备中均可以包括一个或多个逻辑设备(Device),每个逻辑设备可以具有多个设备实例(Device instance),每个逻辑设备中只有一个设备实例处于激活(active)态,该逻辑设备中的其他设备实例处于非激活(inactive)态。处于激活态的设备实例使其所在的逻辑设备能被安全域网络下的其他物联网设备的逻辑设备发现、配置以及访问,相反的,非激活态的设备实例所在的逻辑设备则无法被安全域网络下的其他物联网设备的逻辑设备发现、配置以及访问。Logical device: Each IoT device can include one or more logical devices (Device), and each logical device can have multiple device instances (Device instances), and only one device instance in each logical device is active (active). ) State, other device instances in the logical device are in an inactive state. An activated device instance enables its logical device to be discovered, configured, and accessed by the logical devices of other IoT devices under the security domain network. On the contrary, the logical device where an inactive device instance is located cannot be accessed by the security domain. Logical device discovery, configuration and access of other IoT devices under the network.
逻辑设备可以根据安全域的使用需求建立,在本申请实施例中,物联网设备(复合型的多功能设备或者单一功能设备)中的一个功能可以是一个逻辑设备,逻辑设备可以理解为控制物联网设备的软件的功能实体,一个物联网设备上可以具有至少一个功能实体。The logical device can be established according to the use requirements of the security domain. In the embodiment of the present application, one function in the IoT device (composite multi-function device or single-function device) can be a logical device, and the logical device can be understood as a control object. A functional entity of the software of a networked device. An IoT device may have at least one functional entity.
每个逻辑设备可以具有多种状态,例如出厂状态、配置状态以及工作状态。其中,出厂状态指的是新购买的物联网设备中的逻辑设备在加电之后所处的状态。配置状态指的是物联网设备在进入一个安全域网络之前,能够使用该安全域网络的OBT工具对该物联网设备中的逻辑设备进行配置的状态,配置状态可以为出厂状态。工作状态指的是物联网设备中的逻辑设备被该安全域网络的OBT配置好之后的状态,被OBT设备配置好的物联网设备能够进入该安全域网络,与该安全域网络中的物联网设备互联互通。处于工作状态的逻辑设备可以接收业务指令,以改变该逻辑设备对应的功能设置,例如,物联网设备为空调,空调可以对应多个逻辑设备,每个逻辑设备可以对应空调的一个功能,对应温度的逻辑设备可以接收温度指令来改变温度设置。处于配置状态的逻辑设备用于等待被OBT工具配置以使其进入工作状态。处于工作状态的逻辑设备可以通过重置(reset)来恢复配置状态,当处于配置状态的逻辑设备处于激活态的时候,其可以被OBT设备发现并可被该OBT设备配置,相反的,当处于配置状态的逻 辑设备处于非激活态的时候,其则无法被OBT设备发现并无法被该OBT设备配置。Each logical device can have multiple states, such as factory state, configuration state, and working state. Among them, the factory state refers to the state of the logical device in the newly purchased Internet of Things device after being powered on. The configuration state refers to the state in which the IoT device can use the OBT tool of the secure domain network to configure the logical device in the IoT device before entering a secure domain network. The configuration state can be the factory state. The working state refers to the state after the logical device in the IoT device is configured by the OBT of the security domain network, and the IoT device configured by the OBT device can enter the security domain network and interact with the IoT in the security domain network. Equipment interconnection. The logical device in the working state can receive business instructions to change the function settings corresponding to the logical device. For example, the Internet of Things device is an air conditioner, and the air conditioner can correspond to multiple logical devices. Each logical device can correspond to a function of the air conditioner and correspond to the temperature. The logic device can receive temperature commands to change temperature settings. The logical device in the configuration state is used to wait to be configured by the OBT tool to make it enter the working state. The logical device in the working state can be reset to restore the configuration state. When the logical device in the configuration state is in the active state, it can be discovered by the OBT device and configured by the OBT device. On the contrary, when in the active state, When the logical device in the configuration state is in the inactive state, it cannot be discovered by the OBT device and cannot be configured by the OBT device.
物联网设备中可以安装有应用平台(Application Platform),该应用平台可以控制该物联网设备中运行多个逻辑设备,应用平台以及其控制运行的多个逻辑设备可以理解为物联网设备中的应用程序。An application platform (Application Platform) can be installed in the IoT device, and the application platform can control multiple logical devices running in the IoT device. The application platform and multiple logical devices that control the operation can be understood as applications in the IoT device program.
逻辑设备可以为客户端(client)和/或服务端(server)。其中,提供资源的逻辑设备是服务端,访问资源的设备是客户端。逻辑设备是客户端还是服务端与该逻辑设备所在的物联网设备以及与该逻辑设备对应的功能有关。例如,仅能够实现某项最基本功能的设备(例如灯泡)可以只做服务端,提供给客户端进行查询和控制,该物联网设备本身无控制或者查询其他逻辑设备的需求。再例如,手机这种能够实现复合功能的物联网设备,该物联网设备中的逻辑设备可以包括客户端以及服务端,当手机采用某一逻辑设备控制其他物联网设备时,该逻辑设备为客户端,当手机中的某一功能被其他物联网设备控制时,该功能对应的逻辑设备为服务端。The logical device can be a client and/or a server. Among them, the logical device that provides the resource is the server, and the device that accesses the resource is the client. Whether a logical device is a client or a server is related to the IoT device where the logical device is located and the function corresponding to the logical device. For example, a device (such as a light bulb) that can only implement a certain basic function can only be used as a server and provided to the client for query and control. The Internet of Things device itself has no need to control or query other logical devices. For another example, a mobile phone is an IoT device that can realize composite functions. The logical device in the IoT device can include a client and a server. When the mobile phone uses a logical device to control other IoT devices, the logical device is the client When a function in the mobile phone is controlled by other IoT devices, the logical device corresponding to the function is the server.
需要说明的是,在本申请实施例中,可以使用设备实例来指代其所在的逻辑设备。逻辑设备也可以根据安全域的其他使用需求建立,本申请实施例在此不进行限制。设备实例以及逻辑设备也可以用来指代其所在的物联网设备。It should be noted that in the embodiments of the present application, a device instance may be used to refer to the logical device where it is located. The logical device can also be established according to other usage requirements of the security domain, which is not limited in the embodiment of the present application. Device instance and logical device can also be used to refer to the IoT device where it is located.
通常情况下,一个设备实例只能由一个OBT设备配置,也即是,每个设备实例仅具有一个设备主人(device owner),该设备实例具有的资源集合也只能具有一个资源主人(resource owner)。设备实例的设备主人具有配置该设备实例的权限,设备实例的资源主人具有配置该设备实例的资源的权限。对于一个安全域网络来说,该安全域网络中的OBT设备可以看做是该安全域网络的主人(Owner),即设备主人以及资源主人,可以配置安全域网络中的物联网设备互联互通。当某一物联网设备从第一安全域网络进入第二安全域网络中时,由于该物联网设备中的某一个设备实例已经被第一安全域网络中的OBT设备配置,当该物联网设备进入第二安全域网络中时,第二安全域网络中的OBT设备则无法再对该设备实例进行配置,导致第二安全域网络中的物联网设备无法与该第二安全域网络中的物联网设备进行互联互通。Normally, a device instance can only be configured by one OBT device, that is, each device instance has only one device owner (device owner), and the resource set possessed by the device instance can only have one resource owner (resource owner). ). The device owner of the device instance has the authority to configure the device instance, and the resource owner of the device instance has the authority to configure the resources of the device instance. For a secure area network, the OBT device in the secure area network can be regarded as the owner of the secure area network (Owner), that is, the device owner and the resource owner, and the Internet of Things devices in the secure area network can be configured to communicate with each other. When an IoT device enters the second security domain network from the first security domain network, because a certain device instance in the IoT device has been configured by the OBT device in the first security domain network, when the IoT device When entering the second security domain network, the OBT device in the second security domain network can no longer configure the device instance, causing the IoT devices in the second security domain network to be unable to communicate with the things in the second security domain network. Networked devices are interconnected.
以下以一个具体场景为例进行说明,第一安全域网络是家庭网络,第二安全域网络是办公室网络。家庭网络中的第一用户设备为OBT设备,其中安装有客户应用程序(Client APP),该客户应用程序用于发现并配置家庭网络中的物联网设备。办公室网络中的第二用户设备为OBT设备,其中也安装有客户应用程序,该客户应用程序用于发现并配置办公室网络中的物联网设备。The following takes a specific scenario as an example for description. The first security domain network is a home network, and the second security domain network is an office network. The first user equipment in the home network is an OBT device, in which a client application (Client APP) is installed, and the client application is used to discover and configure the Internet of Things devices in the home network. The second user device in the office network is an OBT device, in which a client application is also installed, and the client application is used to discover and configure the Internet of Things devices in the office network.
第三用户设备中可以安装有客户应用程序(未被配置的客户应用程序),当第三用户设备进入家庭网络时,第一用户设备可以发现第三用户设备并对其进行设置,使得第三用户设备可以控制家庭网络中的物联网设备。当该第三用户设备再进入办公室网络时,由于该第三用户设备已经被第一用户设备配置,则无法再被第二用户设备配置,导致该第三用户设备无法与办公室网络中的物联网设备互联互通。A client application (unconfigured client application) may be installed in the third user equipment. When the third user equipment enters the home network, the first user equipment can discover the third user equipment and set it so that the third user equipment The user equipment can control the Internet of Things devices in the home network. When the third user equipment re-enters the office network, since the third user equipment has been configured by the first user equipment, it cannot be configured by the second user equipment anymore. As a result, the third user equipment cannot communicate with the Internet of Things in the office network. Equipment interconnection.
本申请实施例提供的物联网设备的配置方法可以解决上述技术问题。图1是本申请实施例提供的一种实施环境10示意图。该实施环境包括至少一个物联网设备101、用户设备102以及接入网设备103。该至少一个物联网设备101以及用户设备102通过接入网设备103通信连接。图1示出的是以该是环境包括一个物联网设备101为例进行说明。The configuration method of the Internet of Things device provided by the embodiment of the present application can solve the above technical problem. FIG. 1 is a schematic diagram of an implementation environment 10 provided by an embodiment of the present application. The implementation environment includes at least one IoT device 101, user equipment 102, and access network device 103. The at least one Internet of Things device 101 and the user equipment 102 are communicatively connected through an access network device 103. FIG. 1 shows an example in which the environment includes an Internet of Things device 101 for explanation.
其中,物联网设备可以是指嵌入有通信感知技术的物理设备,通信感知技术可以包括智能感知、识别技术以及计算技术等,物理设备包括汽车、家用电器以及办公设备等。物联网设备上可以安装有用于实现物联网设备相应功能的应用程序。用户设备可以是移动终端等具有用户可操作界面的电子设备,该用户设备中安装有用于控制和管理物联网设备的客户应用程序。接入网设备可以是使用户设备和该至少一个物联网设备接入互联网或者电信网等网络的设备,例如接入网设备为路由器等。Among them, the Internet of Things device may refer to a physical device embedded with communication perception technology. The communication perception technology may include intelligent perception, recognition technology, and computing technology. The physical device includes automobiles, household appliances, and office equipment. An application program for realizing the corresponding function of the Internet of Things device may be installed on the Internet of Things device. The user equipment may be an electronic device with a user-operable interface such as a mobile terminal, and a client application program for controlling and managing the Internet of Things device is installed in the user equipment. The access network device may be a device that enables the user equipment and the at least one Internet of Things device to access the Internet or a telecommunication network, for example, the access network device is a router.
需要说明的是,在本申请实施例中,用户设备和物联网设备可以为同一设备,或者可以为不同设备,本申请实施例对此不进行限定。It should be noted that in the embodiments of the present application, the user equipment and the Internet of Things device may be the same device, or may be different devices, which is not limited in the embodiment of the present application.
还需要说明的是,在本申请实施例中涉及到获取设备实例的资源的步骤,获取设备实例的资源的过程实际上是获取设备实例的资源统一资源标识符(Uniform Resource Identifier,URI)的过程。资源URI由资源创建者在创建该资源时指定,资源可以通过该URI进行标识和寻址。每个资源可以具有固定的URI。It should also be noted that, in the embodiment of this application, the step of obtaining the resources of the device instance is involved, and the process of obtaining the resources of the device instance is actually the process of obtaining the uniform resource identifier (URI) of the device instance. . The resource URI is specified by the resource creator when creating the resource, and the resource can be identified and addressed through the URI. Each resource can have a fixed URI.
图2是本申请实施例提供的一种物联网设备的配置方法的流程图。该方法可以应用于物联网设备,该方法所对应的应用场景可以为该物联网设备从第一安全域网络进入第二安全域网络。该第一安全域网络和该第二安全域网络均可适用于图1所描述的实施环境。其中,该物联网设备已经被除第二安全域网络之外的其他安全域网络中的一个OBT设备进行配置,该其他安全域网络可以为第一安全域网络,或是其他安全域网络。该方法可以包括:Fig. 2 is a flowchart of a method for configuring an Internet of Things device provided by an embodiment of the present application. The method can be applied to an Internet of Things device, and the application scenario corresponding to the method can be that the Internet of Things device enters the second security domain network from the first security domain network. Both the first security domain network and the second security domain network are applicable to the implementation environment described in FIG. 1. Wherein, the Internet of Things device has been configured by an OBT device in another security domain network except the second security domain network, and the other security domain network may be the first security domain network or another security domain network. The method can include:
步骤201、当物联网设备从第一安全域网络进入第二安全域网络时,该物联网设备确定该物联网设备中是否存在第二设备实例。Step 201: When the Internet of Things device enters the second security domain network from the first security domain network, the Internet of Things device determines whether there is a second device instance in the Internet of Things device.
该第二设备实例所配置的安全域信息与第二安全域网络具有的安全域信息一致。其中,安全域网络具有的安全域信息指的是用于表征该安全域网络的信息,例如某一安全域网络的OBT设备的ID可以用于表征该安全域网络,由于该OBT设备的ID可以唯一对应一个安全域网络,因此,该OBT设备的ID可以用于表征该安全域网络。当然,也可以采用其他信息来表征安全域网络,本申请实施例对此不进行限制。The security domain information configured by the second device instance is consistent with the security domain information of the second security domain network. Among them, the security domain information possessed by the security domain network refers to the information used to characterize the security domain network. For example, the ID of the OBT device of a certain security domain network can be used to characterize the security domain network, because the ID of the OBT device can be used to characterize the security domain network. It uniquely corresponds to a secure domain network. Therefore, the ID of the OBT device can be used to characterize the secure domain network. Of course, other information can also be used to characterize the secure domain network, which is not limited in the embodiment of the present application.
设备实例所配置的安全域信息指的是该设备实例被某一安全域网络配置后生成的信息,例如,第一安全域网络通过该第一安全域网络的OBT设备配置某一设备实例之后,生成该设备实例的Owner ID(与该第一安全域网络的OBT设备的ID一致),该设备实例的Owner ID是该第一安全域网络为该设备实例所配置的安全域信息。The security domain information configured by the device instance refers to the information generated after the device instance is configured by a certain security domain network. For example, after the first security domain network configures a certain device instance through the OBT device of the first security domain network, The Owner ID of the device instance is generated (consistent with the ID of the OBT device of the first security domain network), and the Owner ID of the device instance is the security domain information configured by the first security domain network for the device instance.
步骤202、当不存在第二设备实例时,物联网设备接收创建指令。Step 202: When there is no second device instance, the Internet of Things device receives a creation instruction.
步骤203、物联网设备根据该创建指令,创建初始化设备实例。Step 203: The IoT device creates an initialization device instance according to the creation instruction.
该初始化设备实例处于配置状态,该初始化设备实例可以用于被第二安全域网络的OBT设备发现并配置为第二设备实例,如此使得该物联网设备中的第二设备实例在被第二安全域网络的OBT设备配置后,能够与第二安全域网络中的其它设备互联互通。The initialization device instance is in the configuration state, and the initialization device instance can be used to be discovered by the OBT device of the second security domain network and configured as a second device instance, so that the second device instance in the Internet of Things device is protected by the second security After the OBT device of the domain network is configured, it can be interconnected with other devices in the second secure domain network.
综上所述,本申请实施例提供的物联网设备的配置方法,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,根据接收到的创建指令创建能够被该第二安全域网络中的OBT设备配置为第二设备实例的初始化设备实例,使得该物联网设备能够与第二安全域网络中的其它设备互联互通。To sum up, the configuration method of the Internet of Things device provided in the embodiments of the present application is achieved when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such thing that can be used by the Internet of Things device. When the second device instance of the OBT device in the second security domain network is configured, according to the received creation instruction, an initialization device instance that can be configured by the OBT device in the second security domain network as the second device instance is created, so that the object The networked device can be interconnected with other devices in the second security domain network.
图3是本申请实施例提供的另一种物联网设备的配置方法的流程图。该方法可以应用于用户设备。该方法可以包括:Fig. 3 is a flowchart of another method for configuring an Internet of Things device provided by an embodiment of the present application. This method can be applied to user equipment. The method can include:
步骤301、当物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备中不存在第二设备实例时,发送创建指令。Step 301: When the IoT device enters the second secure domain network from the first secure domain network, and when there is no second device instance in the IoT device, send a creation instruction.
其中,该第二设备实例所配置的安全域信息与该第二安全域网络具有的安全域信息一致,该创建指令用于被该物联网设备创建初始化设备实例,该初始化设备实例用于配置为第二设备实例,Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device instance is used to configure as The second device instance,
综上所述,本申请实施例提供的物联网设备的配置方法,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。由于该创建指令能够用于被该物联网设备创建能够被第二安全域网络中的OBT设备配置为第二设备实例的初始化设备实例,使得该物联网设备能够与第二安全域网络中的其它设备互联互通。To sum up, the configuration method of the Internet of Things device provided in the embodiments of the present application is achieved when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such thing that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. Since the creation instruction can be used by the IoT device to create an initialization device instance that can be configured as a second device instance by the OBT device in the second security domain network, the IoT device can interact with other devices in the second security domain network. Equipment interconnection.
在本申请实施例中,提供了两种创建初始化设备实例的方法,在第一种方法中,在设备实例原有的资源中新扩展一种用于指示创建初始化设备实例的属性,在本申请实施例中,具有用于指示创建初始化设备实例的属性的资源称为目标资源,物联网设备可以根据该目标资源创建初始化设备实例;在第二种方法中,在设备实例中新扩展一种用于指示创建初始化设备实例的资源,在本申请实施例中,新扩展的且用于指示创建初始化设备实例的资源称为目标资源,该目标资源中可以包括指示创建初始化设备实例的属性,物联网设备可以根据该目标资源创建初始化设备实例,当然,该目标资源中也可以包括其他属性,例如包括用于指示是否切换设备实例的属性等。In the embodiment of this application, two methods for creating an initial device instance are provided. In the first method, an attribute used to indicate the creation of an initial device instance is newly extended in the original resources of the device instance. In the embodiment, the resource with the attribute used to instruct the creation of the initialization device instance is called the target resource, and the IoT device can create the initialization device instance according to the target resource; in the second method, a new application is added to the device instance. To indicate the creation of the resource of the initialization device instance, in the embodiments of the present application, the newly expanded resource used to indicate the creation of the initialization device instance is called the target resource. The target resource may include the attribute indicating the creation of the initialization device instance. The device can create an initial device instance based on the target resource. Of course, the target resource can also include other attributes, for example, an attribute used to indicate whether to switch the device instance.
在上述第一种方法中,设备实例原有的资源包括多种,例如配置状态资源、管理安全凭证资源(cred资源)以及配置设备主人的资源(doxm资源)等,目标资源可以为其中一种,本申请实施例以该目标资源包括配置状态资源为例进行说明。该配置状态资源包括上新属性。上新属性为第一属性值以及第二属性值中的一个,该第一属性值用于指示创建新的设备实例,该第二属性值用于指示将第一设备实例重置为初始化设备实例。In the first method above, the original resources of the device instance include multiple types, such as configuration state resources, management security credential resources (cred resources), and configuration device owner resources (doxm resources). The target resource can be one of them. In the embodiment of the present application, the target resource includes the configuration state resource as an example for description. The configuration state resource includes new attributes. The last new attribute is one of the first attribute value and the second attribute value. The first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance is reset to the initialization device instance .
在一些可选的实现方式中,配置状态资源称为pstat资源,该pstat资源在设备实例中存储路径可以为/oic/sec/pstat(该存储路径也为资源在该实例设备中的相对URI),当然,该存储路径仅为一种示意性说明,并未对该pstat其他可能存储路径进行限制。该上新属性称为onboardnew属性,该上新属性为布尔类型,也即是,该上新属性包括的第一属性值和第二属性值被赋为真值(true)或者假值(false)。在本申请实施例中,以第一属性值为“true”,以第二属性值为“false”为例进行说明。当该属性值并未赋值时,该上新属性的属性值可以默认为“false”。In some optional implementations, the configuration state resource is called pstat resource, and the storage path of the pstat resource in the device instance can be /oic/sec/pstat (the storage path is also the relative URI of the resource in the instance device) Of course, the storage path is only a schematic description, and there is no restriction on other possible storage paths of the pstat. The new attribute is called the onboardnew attribute, and the new attribute is of Boolean type, that is, the first attribute value and the second attribute value included in the new attribute are assigned a true value (true) or a false value (false) . In the embodiment of the present application, the first attribute value is "true" and the second attribute value is "false" as an example for description. When the attribute value is not assigned, the attribute value of the new attribute can be "false" by default.
此时,pstat资源的表示形式可以为:At this time, the representation of pstat resources can be:
Figure PCTCN2019121994-appb-000001
Figure PCTCN2019121994-appb-000001
Figure PCTCN2019121994-appb-000002
Figure PCTCN2019121994-appb-000002
其中,“dos”属性用于指示物联网设备激活状态,“isop”属性用于指示该物联网设备是否可操作性,“cm”属性用于指示物联网设备的当前模式,“tm”属性用于指示物联网设备的目标模式,“om”属性用于指示物联网设备的操作模式,“sm”属性用于指示物联网设备支持的模式,“onboardself”属性用于指示物联网设备是否被自己配置,“onboardas”属性用于指示物联网设备被配置时的角色,“onboardnew”属性用于指示是否创建初始化设备实例,“rowneruuid”属性用于指示资源主人的ID。Among them, the "dos" attribute is used to indicate the activation status of the IoT device, the "isop" attribute is used to indicate whether the IoT device is operability, the "cm" attribute is used to indicate the current mode of the IoT device, and the "tm" attribute is used To indicate the target mode of the IoT device, the "om" attribute is used to indicate the operation mode of the IoT device, the "sm" attribute is used to indicate the mode supported by the IoT device, and the "onboardself" attribute is used to indicate whether the IoT device is used by itself For configuration, the "onboardas" attribute is used to indicate the role of the IoT device when it is configured, the "onboardnew" attribute is used to indicate whether to create an initial device instance, and the "rowneruuid" attribute is used to indicate the ID of the resource owner.
图4是本申请实施例提供的又一种物联网设备的配置方法的流程图。该流程图描述的是物联网设备以及用户设备交互实现该物联网设备的配置方法,该物联网设备实例的配置方法包括上述第一种创建初始化设备实例的方法。该方法所对应的应用场景可以参考图2所描述的应用场景,本申请实施例在此不再赘述。该方法可以包括:Fig. 4 is a flowchart of yet another method for configuring an Internet of Things device provided by an embodiment of the present application. The flowchart describes a method for configuring the Internet of Things device by interacting with a user equipment to implement the Internet of Things device. The method for configuring the Internet of Things device instance includes the above-mentioned first method of creating an initialization device instance. For the application scenario corresponding to this method, reference may be made to the application scenario described in FIG. 2, and details are not described in the embodiment of the present application. The method can include:
步骤401、物联网设备确定该物联网设备中是否存在第二设备实例。Step 401: The Internet of Things device determines whether there is a second device instance in the Internet of Things device.
物联网设备可以通过判断是否存在设备实例的安全域信息与该第二安全域网络具有的安全域信息一致,来确定该物联网设备中是否存在第二设备实例。当存在某一设备实例所配置的安全域信息与该第二安全域网络具有的安全域信息一致时,将该设备实例确定为该第二设备实例;相反的,若不存在设备实例所配置的安全域信息与该第二安全域网络具有的安全域信息一致时,确定该物联网设备中不存在第二设备实例。The Internet of Things device may determine whether there is a second device instance in the Internet of Things device by determining whether the security domain information of the device instance is consistent with the security domain information of the second security domain network. When the security domain information configured by a certain device instance is consistent with the security domain information of the second security domain network, the device instance is determined as the second device instance; on the contrary, if there is no device instance configured When the security domain information is consistent with the security domain information of the second security domain network, it is determined that there is no second device instance in the Internet of Things device.
可选的,该第二设备实例所配置的安全域信息包括第二设备实例的所有者(或称为主人)Owner的识别符ID,第二安全域网络具有的安全域信息包括第二安全域网络的OBT设备的ID。则步骤401中,确定该物联网设备中是否存在第二设备实例的过程可以包括:确定该物联网设备包括的设备实例中是否存在Owner ID与OBT设备的ID一致的设备实例。当存在设备实例的Owner ID与该第二安全域网络的OBT设备的ID一致时,将该设备实例确定为第二设备实例,也即是,该物联网设备中存在第二设备实例;相反的,当不存在设备实例的Owner ID与该第二安全域网络的OBT设备的ID一致时,确定该物联网设备中不存在第二设备实例。Optionally, the security domain information configured by the second device instance includes the identifier ID of the owner (or referred to as the owner) Owner of the second device instance, and the security domain information possessed by the second security domain network includes the second security domain The ID of the OBT device of the network. Then in step 401, the process of determining whether there is a second device instance in the Internet of Things device may include: determining whether there is a device instance whose Owner ID is consistent with the ID of the OBT device among the device instances included in the Internet of Things device. When the Owner ID of the existing device instance is consistent with the ID of the OBT device of the second security domain network, the device instance is determined to be the second device instance, that is, the second device instance exists in the Internet of Things device; on the contrary When the Owner ID of the non-existent device instance is consistent with the ID of the OBT device of the second security domain network, it is determined that the second device instance does not exist in the Internet of Things device.
在步骤401之前,为了确定该物联网设备包括的设备实例中是否存在Owner ID与OBT设备的ID一致的设备实例,该方法还可以包括获取OBT设备的ID的过程:Before step 401, in order to determine whether there is a device instance whose Owner ID is consistent with the ID of the OBT device among the device instances included in the Internet of Things device, the method may further include a process of obtaining the ID of the OBT device:
步骤A1、当物联网设备从第一安全域网络进入第二安全域网络时,该物联网设备获取该第二安全域网络中,除该第一设备实例之外的其他设备实例的设备角色。Step A1. When the IoT device enters the second secure domain network from the first secure domain network, the IoT device acquires the device roles of other device instances in the second secure domain network except the first device instance.
可选的,物联网设备通过获取用于表示设备角色的属性值来获取每个设备实例的设备角色。例如,可以通过获取每个设备实例中pstat资源中的“onboardas”属性的属性值,来获取该每一个设备实例的设备角色。Optionally, the IoT device obtains the device role of each device instance by obtaining the attribute value used to represent the device role. For example, the device role of each device instance can be obtained by obtaining the attribute value of the "onboardas" attribute in the pstat resource of each device instance.
步骤A2、物联网设备将其他设备实例中,设备角色为obt的设备实例所在的物联网设备确定为该第二安全域网络的OBT设备。Step A2. The Internet of Things device determines, among other device instances, the Internet of Things device where the device instance with the device role of obt is located as the OBT device of the second security domain network.
示例的,当获取某一物联网设备中“onboardas”属性的属性值为obt,则可以确定该设备实例所在的物联网设备为OBT设备,当获取某一设备实例中“onboardas”属性的属性值为client,则可以确定该设备实例所在的物联网设备不为OBT设备,该设备实例是以客户端身份加入的该第二安全域网络。For example, when the property value of the "onboardas" attribute of a certain IoT device is obtained as obt, it can be determined that the IoT device where the device instance is located is an OBT device. When the property value of the "onboardas" attribute of a certain device instance is obtained If it is a client, it can be determined that the Internet of Things device where the device instance is located is not an OBT device, and the device instance is the second security domain network that has joined as a client.
步骤A3、物联网设备获取OBT设备的ID。Step A3: The Internet of Things device obtains the ID of the OBT device.
需要说明的是,在本申请实施例中,ID可以指通用唯一识别码(Universally Unique Identifier,UUID)。It should be noted that, in this embodiment of the application, the ID may refer to a universally unique identifier (UUID).
步骤402、当不存在第一设备实例时,物联网设备向用户设备触发第二请求。Step 402: When the first device instance does not exist, the Internet of Things device triggers a second request to the user equipment.
当不存在第一设备实例时,物联网设备通过向用户设备触发第二请求来向用户询问,是否将该物联网设备以客户端身份加入该第二安全域网络。When the first device instance does not exist, the Internet of Things device asks the user by triggering a second request to the user equipment whether to join the Internet of Things device to the second secure domain network as a client.
步骤403、用户设备接收该第二请求。Step 403: The user equipment receives the second request.
步骤404、用户设备针对该第二请求发送第二响应。Step 404: The user equipment sends a second response to the second request.
该第二响应用于确认将物联网设备以客户端身份加入第二安全域网络。可选的,用户设备接收到该第二请求之后,可以将该第二请求的内容呈现给用户,在接收到用户针对该第二请求的选择结果之后,发送第二响应,或者,用户设备也可以自动针对该第二请求向物联网设备发送第二响应。在本申请实施例中,以用户设备将第二请求的内容呈现给用户,由用户触发第二响应为例进行说明。The second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client. Optionally, after receiving the second request, the user equipment may present the content of the second request to the user, and after receiving the user's selection result for the second request, send a second response, or the user equipment may also A second response may be automatically sent to the Internet of Things device in response to the second request. In the embodiment of the present application, the user equipment presents the content of the second request to the user, and the user triggers the second response as an example for description.
用户设备向用户呈现第二请求的方式可以有多种,例如,用户设备可以通过用户接口(User Interface,UI)界面向用户呈现该第二请求,该种情况下,用户设备可以以弹出对话框或者弹出消息的方式提示用户是否以客户端身份加入第二安全域网络。可选的,在该第二请求中还可以包括物联网设备在该第二安全域网络中发现的OBT设备的设备标识,以辅助用户对是否以客户端身份加入第二安全域网络进行决策。The user equipment may present the second request to the user in many ways. For example, the user equipment may present the second request to the user through a user interface (UI) interface. In this case, the user equipment may pop up a dialog box Or a pop-up message prompts the user whether to join the second security domain network as a client. Optionally, the second request may also include the device identifier of the OBT device discovered by the IoT device in the second secure domain network to assist the user in making a decision on whether to join the second secure domain network as a client.
步骤405、物联网设备接收针对该第二请求的第二响应。Step 405: The Internet of Things device receives a second response to the second request.
当用户确认将该物联网设备以客户端身份加入第二安全域网络之后,用户设备可以向物联网设备发送第二响应,该第二响应可以用于确认将物联网设备以客户端身份加入第二安全域网络。当然,若用户确认不将该物联网设备以客户端身份加入第二安全域网络,则该第二响应用于确认不将物联网设备以客户端身份加入第二安全域网络,在该种情况下,物联网设备以及用户设备则将无法进行后续步骤。After the user confirms that the Internet of Things device is added to the second secure domain network as the client, the user equipment can send a second response to the Internet of Things device. The second response can be used to confirm that the Internet of Things device is added to the second security domain network as the client. 2. Security domain network. Of course, if the user confirms that the IoT device will not be added to the second secure domain network as the client, the second response is used to confirm that the IoT device will not be added to the second secure domain network as the client. In this case Next, IoT devices and user equipment will not be able to proceed with the next steps.
步骤406、物联网设备判断该物联网设备是否存储有目标资源。Step 406: The Internet of Things device judges whether the Internet of Things device stores target resources.
由于目标资源中设置有用于指示是否创建初始化设备实例的属性值,因此,物联网设备可以通过判断该物联网设备中是否存储有目标资源,即pstat资源,来确定该物联网设备中是否具有用于创建初始化设备实例的属性,即“onboardnew”属性。Since the target resource is set with an attribute value indicating whether to create an initialized device instance, the IoT device can determine whether the IoT device is useful by judging whether the target resource, that is, the pstat resource, is stored in the IoT device. The attribute used to create the initial device instance, that is, the "onboardnew" attribute.
步骤407、当物联网设备存储有目标资源时,物联网设备触发第一请求。Step 407: When the target resource is stored in the Internet of Things device, the Internet of Things device triggers the first request.
步骤407可以表述为,当物联网设备中存储的目标资源具有用于创建初始化设备实例的属性时,物联网设备触发第一请求,该第一请求可以用于询问保留或者重置第二设备实例。当然,若物联网设备未存储有目标资源,也即是,该物联网设备中不具有用于创建初始化设备实例的属性,则物联网设备则无法触发该第一请求。Step 407 can be expressed as: when the target resource stored in the IoT device has the attribute used to create an initial device instance, the IoT device triggers a first request, which can be used to inquire to reserve or reset the second device instance . Of course, if the Internet of Things device does not store the target resource, that is, the Internet of Things device does not have an attribute for creating an initial device instance, the Internet of Things device cannot trigger the first request.
步骤408、用户设备接收第一请求。Step 408: The user equipment receives the first request.
该第一请求用于询问用户保留或者重置该第一设备实例。The first request is used to ask the user to reserve or reset the first device instance.
步骤409、用户设备针对该第一请求发送创建指令。Step 409: The user equipment sends a creation instruction in response to the first request.
该创建指令用于创建初始化设备实例,该创建指令可以包括两种,一种创建指令为针对保留第一设备实例的创建指令,另一种创建指令为针对重置第一设备实例的创建指令。The creation instruction is used to create an initial device instance, and the creation instruction may include two types, one creation instruction is a creation instruction for retaining the first device instance, and the other creation instruction is a creation instruction for resetting the first device instance.
用户设备接收到该第一请求之后,可以将该第一请求的内容呈现给用户,在接收到用户针对该第一请求的内容的选择结果之后,发送创建指令,或者,用户设备也可以自动针对该第一请求向物联网设备发送默认的创建指令,该默认的创建指令可以为上述两种创建指令中的任意一种。After receiving the first request, the user equipment may present the content of the first request to the user, and after receiving the user's selection result for the content of the first request, send a creation instruction, or the user equipment may also automatically respond to The first request sends a default creation instruction to the Internet of Things device, and the default creation instruction may be any one of the above two creation instructions.
在本申请实施例中,以用户设备将第一请求的内容呈现给用户,由用户触发创建指令为例进行说明。该第一请求的内容可以包括询问用户保留或者重置该第一设备实例。与上述用户设备向用户呈现第二请求的方式类似,用户设备向用户呈现该第一请求的方式也可以有多种,例如,用户设备可以通过UI界面向用户呈现该第一请求,该种情况下,用户设备可以以弹出对话框或者弹出消息的方式提示用户保留第一设备实例或是重置第一设备实例。In the embodiment of the present application, the user equipment presents the content of the first request to the user, and the creation instruction is triggered by the user as an example for description. The content of the first request may include asking the user to reserve or reset the first device instance. Similar to the manner in which the user equipment presents the second request to the user described above, the user equipment may also present the first request to the user in multiple ways. For example, the user equipment may present the first request to the user through a UI interface. Next, the user equipment may prompt the user to reserve the first device instance or reset the first device instance in the manner of a pop-up dialog box or a pop-up message.
步骤410、物联网设备接收该创建指令。Step 410: The Internet of Things device receives the creation instruction.
物联网设备针对用户的选择可以接收到针对保留该第一设备实例的创建指令,或者,接收到针对重置该第一设备实例的创建指令。The Internet of Things device may receive a creation instruction for retaining the first device instance for the user's selection, or may receive a creation instruction for resetting the first device instance.
步骤411、物联网设备根据创建指令,创建初始化设备实例,该初始化设备实例用于被第二安全域网络的OBT设备配置为第二设备实例。Step 411: The Internet of Things device creates an initialization device instance according to the creation instruction, and the initialization device instance is used to be configured as a second device instance by the OBT device of the second security domain network.
由于创建指令可以有两种,即保留第一设备实例的创建指令以及重置第一设备实例的创建指令,则相应的,步骤411中,物联网设备根据创建指令,创建初始化设备实例也可以分为以下两种情况。Since there can be two creation instructions, namely the creation instruction to retain the first device instance and the creation instruction to reset the first device instance, correspondingly, in step 411, the IoT device creates an initial device instance according to the creation instruction. For the following two situations.
在第一种情况中,物联网设备中已运行有第一设备实例,该创建指令包括保留指令,则步骤411中创建初始化设备实例的过程可以包括:当接收到保留指令,通过保留该第一设备实例来创建初始化设备实例。In the first case, the first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction. The process of creating an initialization device instance in step 411 may include: when the reservation instruction is received, by reserving the first device instance Device instance to create an initial device instance.
在该第一种情况中,该过程可以进一步包括,将新创建的设备实例作为初始化设备实例(参考步骤B1),或者,将第一设备实例重置为初始化设备实例(参考步骤B2)这两种情况。In the first case, the process may further include using the newly created device instance as the initialization device instance (refer to step B1), or resetting the first device instance to the initialization device instance (refer to step B2). This situation.
步骤B1、当接收到保留指令,物联网设备保留第一设备实例,创建新的设备实例,将该新的设备实例作为初始化设备实例。Step B1: When receiving the reservation instruction, the Internet of Things device reserves the first device instance, creates a new device instance, and uses the new device instance as the initialization device instance.
保留第一设备实例,创建新的设备实例的过程可以包括:The first device instance is reserved, and the process of creating a new device instance may include:
步骤B11、当接收到保留指令,物联网设备根据该保留指令更新第一设备实例的目标资源。Step B11: When receiving the reservation instruction, the IoT device updates the target resource of the first device instance according to the reservation instruction.
该保留指令中可以包括用于更新第一设备实例的目标资源的更新指示,示例的,该更新指示可以包括:The reservation instruction may include an update instruction for updating the target resource of the first device instance. For example, the update instruction may include:
Figure PCTCN2019121994-appb-000003
Figure PCTCN2019121994-appb-000003
Figure PCTCN2019121994-appb-000004
Figure PCTCN2019121994-appb-000004
该更新指示中,"onboardas"属性的属性值为客户端,"onboardnew"属性的属性值为“true”,如此可以看出,该更新指示可以指示物联网设备启动设备重置并转入客户端的被配置状态,也即是,该更新指示可以指示物联网设备准备被配置为客户端。In the update instruction, the attribute value of the "onboardas" attribute is the client, and the attribute value of the "onboardnew" attribute is "true". It can be seen that the update instruction can instruct the IoT device to initiate a device reset and transfer to the client's The configured state, that is, the update indication may indicate that the IoT device is ready to be configured as a client.
步骤B12、物联网设备获取更新后的目标资源。Step B12: The Internet of Things device obtains the updated target resource.
该更新后的目标资源包括用于指示创建新的设备实例的属性值。也即是,在本申请实施例中,该更新后的pstat资源中的“onboardnew”属性的属性值为“true”。The updated target resource includes an attribute value for instructing the creation of a new device instance. That is, in the embodiment of the present application, the attribute value of the "onboardnew" attribute in the updated pstat resource is "true".
步骤B13、物联网设备根据更新后的目标资源创建新的设备实例。Step B13: The IoT device creates a new device instance according to the updated target resource.
步骤B14、物联网设备初始化该新的设备实例,将初始化后的新的设备实例作为初始化设备实例。Step B14: The Internet of Things device initializes the new device instance, and uses the initialized new device instance as the initialized device instance.
物联网设备通过初始化该新的设备实例,可以使该初始化后的新的设备实例即初始化设备实例处于出厂状态。然后再通过将第一设备实例的状态置为非激活态,使其不再进行外部交互,而将初始化设备实例的状态置为激活态,使其能够进行外部交互。此时,物联网设备的对外接口为该初始化设备实例,该物联网设备收到的外部请求均由该初始化设备实例处理。The Internet of Things device initializes the new device instance, so that the initialized new device instance, that is, the initialized device instance, can be in the factory state. Then, the state of the first device instance is set to an inactive state so that it no longer performs external interaction, and the state of the initialized device instance is set to an active state to enable it to perform external interaction. At this time, the external interface of the Internet of Things device is the initialization device instance, and all external requests received by the Internet of Things device are processed by the initialization device instance.
步骤B2、当接收到保留指令,物联网设备保留第一设备实例的副本,将第一设备实例重置为初始化设备实例,第一设备实例的副本具有的资源集合与第一设备实例具有的资源集合一致。Step B2. When receiving the reservation instruction, the IoT device reserves the copy of the first device instance, resets the first device instance to the initialization device instance, the set of resources possessed by the copy of the first device instance and the resources possessed by the first device instance The set is consistent.
其中,保留第一设备实例的副本,将第一设备实例重置为初始化设备实例的过程可以包括:Wherein, the process of keeping a copy of the first device instance and resetting the first device instance to the initialization device instance may include:
步骤B21、当接收到保留指令,物联网设备根据该保留指令更新第一设备实例的目标资源。Step B21: When a reservation instruction is received, the Internet of Things device updates the target resource of the first device instance according to the reservation instruction.
该保留指令中可以包括用于更新第一设备实例的目标资源的更新指示,示例的,该更新指示可包括:The reservation instruction may include an update instruction for updating the target resource of the first device instance. For example, the update instruction may include:
Figure PCTCN2019121994-appb-000005
Figure PCTCN2019121994-appb-000005
该更新指示中,"onboardas"属性的属性值为客户端,"onboardnew"属性的属性值为“true”,如此可以看出,该更新指示可以指示物联网设备启动设备重置并转入客户端的被配置状态,也即是,该更新指示可以指示物联网设备准备被配置为客户端。In the update instruction, the attribute value of the "onboardas" attribute is the client, and the attribute value of the "onboardnew" attribute is "true". It can be seen that the update instruction can instruct the IoT device to initiate a device reset and transfer to the client's The configured state, that is, the update indication may indicate that the IoT device is ready to be configured as a client.
步骤B22、物联网设备获取更新后的目标资源。Step B22: The Internet of Things device obtains the updated target resource.
该更新后的目标资源包括用于指示创建新的设备实例的属性值。也即是,在本申请实施例中,该更新后的pstat资源中的“onboardnew”属性的属性值为“true”。The updated target resource includes an attribute value for instructing the creation of a new device instance. That is, in the embodiment of the present application, the attribute value of the "onboardnew" attribute in the updated pstat resource is "true".
步骤B23、物联网设备根据该更新后的目标资源创建新的设备实例。Step B23: The Internet of Things device creates a new device instance according to the updated target resource.
步骤B24、物联网设备将该第一设备实例的资源集合写入新的设备实例,以保留该第一设备实例的副本。Step B24: The Internet of Things device writes the resource collection of the first device instance into the new device instance, so as to retain a copy of the first device instance.
物联网设备获取该第一设备实例的资源集合,并将该第一设备实例的资源集合写入新的设备实例。资源集合可以包括配置状态资源、管理安全凭证资源以及配置设备主人的资源等。The Internet of Things device obtains the resource set of the first device instance, and writes the resource set of the first device instance to a new device instance. The resource collection may include configuration status resources, management security credential resources, and configuration equipment owner resources.
步骤B25、物联网设备将第一设备实例重置为初始化设备实例。Step B25: The Internet of Things device resets the first device instance to the initialization device instance.
物联网设备可以将第一设备实例重置为初始化设备实例,在将该初始化设备实例置为激活态,将第二设备实例置为非激活态,可以使得该第二设备实例无需进行外部交互,而使初始化设备实例能够进行外部交互。The IoT device can reset the first device instance to the initialization device instance, and set the initialization device instance to the active state and the second device instance to the inactive state, so that the second device instance does not require external interaction. And enable the initialization of the device instance to be able to perform external interactions.
在第二种情况中,物联网设备中已运行有第一设备实例,该创建指令包括重置指令,则步骤411中创建初始化设备实例的过程可以包括:当接收到重置指令,通过重置该第一设备实例来创建所述初始化设备实例。也即是,该过程可以包括:In the second case, the first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction. The process of creating an initialization device instance in step 411 may include: when the reset instruction is received, resetting The first device instance is used to create the initialization device instance. That is, the process can include:
步骤B3、当接收到重置指令,物联网设备重置第一设备实例,将重置后第一设备实例作为初始化设备实例。Step B3: When the reset instruction is received, the IoT device resets the first device instance, and uses the reset first device instance as the initialization device instance.
进一步的,物联网设备重置第一设备实例的过程可以包括:Further, the process of resetting the first device instance by the IoT device may include:
步骤B31、当接收到重置指令,物联网设备根据该重置指令更新第一设备实例的目标资源。Step B31: When a reset instruction is received, the IoT device updates the target resource of the first device instance according to the reset instruction.
该重置指令中可以包括用于重置第一设备实例的目标资源的更新指令,示例的,该更新指令可以包括:The reset instruction may include an update instruction for resetting the target resource of the first device instance. For example, the update instruction may include:
Figure PCTCN2019121994-appb-000006
Figure PCTCN2019121994-appb-000006
该更新指示中,"onboardas"属性的属性值为客户端,"onboardnew"属性的属性值为“false”,如此可以看出,该更新指示可以指示物联网设备启动设备重置并转入客户端的被配置状态,也即是,该更新指示可以指示物联网设备准备被配置为客户端。In the update instruction, the attribute value of the "onboardas" attribute is the client, and the attribute value of the "onboardnew" attribute is "false". It can be seen that the update instruction can instruct the IoT device to initiate a device reset and transfer to the client's The configured state, that is, the update indication may indicate that the IoT device is ready to be configured as a client.
步骤B32、物联网设备获取更新后的目标资源。Step B32: The Internet of Things device obtains the updated target resource.
该更新后的目标资源包括用于指示重置该第一设备实例的属性值。也即是,在本申请实施例中,该更新后的pstat资源中的“onboardnew”属性的属性值为“false”。The updated target resource includes an attribute value for instructing to reset the first device instance. That is, in the embodiment of the present application, the attribute value of the "onboardnew" attribute in the updated pstat resource is "false".
步骤B33、物联网设备根据该更新后的目标资源,重置该第一设备实例。Step B33: The Internet of Things device resets the first device instance according to the updated target resource.
步骤B34、物联网设备将重置后的第一设备实例确定为初始化设备实例。Step B34: The Internet of Things device determines the reset first device instance as the initialization device instance.
物联网设备通过重置该第一设备实例,将其确定为处于配置状态的初始化设备实例,当其处于激活态时,其可以被OBT设备发现并配置。The IoT device resets the first device instance to determine it as an initialization device instance in the configuration state. When it is in the active state, it can be discovered and configured by the OBT device.
步骤412、当存在第二设备实例时,物联网设备将在物联网设备中已运行的第一设备实例切换至第二设备实例。Step 412: When there is a second device instance, the Internet of Things device switches the first device instance that has been running in the Internet of Things device to the second device instance.
物联网设备将其中已运行的第一设备实例切换至第二设备实例的过程可以包括:将已运行的第一设备实例的状态置为非激活态,将第二设备实例的状态置为激活态。如此使得该第一设备实例不再进行外部交互,转而通过第二设备实例进行外部交互。此时,物联网设备对外接口为该第二设备实例,收到的外部请求均由该第二设备实例进行处理。The process of switching the running first device instance to the second device instance by the IoT device may include: setting the state of the running first device instance to an inactive state, and setting the state of the second device instance to an active state . In this way, the first device instance no longer performs external interaction, and instead uses the second device instance to perform external interaction. At this time, the external interface of the Internet of Things device is the second device instance, and all received external requests are processed by the second device instance.
综上所述,本申请实施例提供的物联网设备的配置方法,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。当该创建指令包括保留指令,该物联网设备中可以同时保留有适用于第一安全域网络的第一设备实例以及适用于第二安全域网络的第二设备实例,使得当该物联网设备再重进进入第一安全域网络时,通过激活该第一设备实例便可使该物联网设备与该第一安全域网络连接,实现各种智能化场景的操作,并且,第一安全域网络和第二安全域网络中的OBT设备均可对该物联网设备进行设置,使得该物联网设备能够与第一安全域网络和第二安全域网络中的其它设备均实现互联互通。To sum up, the configuration method of the Internet of Things device provided in the embodiments of the present application is achieved when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such thing that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. When the creation instruction includes a reservation instruction, the first device instance applicable to the first security domain network and the second device instance applicable to the second security domain network may be retained in the Internet of Things device at the same time, so that when the Internet of Things device is re When reentering the first secure domain network, by activating the first device instance, the IoT device can be connected to the first secure domain network to realize operations in various intelligent scenarios, and the first secure domain network and All OBT devices in the second security domain network can set the IoT device, so that the IoT device can realize interconnection and intercommunication with other devices in the first security domain network and the second security domain network.
在上述第二种方法中,在物联网设备中新扩展的目标资源可以包括设备实例资源,设备实例资源可以用于管理物联网设备中的设备实例。因此,该设备实例资源中可以设置于管理物联网设备中的设备实例相关的属性。示例的,该设备实例资源可以包括切换属性以及上新属性。其中,切换属性为第三属性值以及第四属性值中的一个,该第三属性值用于指示切换设备实例,该第四属性值用于指示不切换设备实例;上新属性为第一属性值以及第二属性值中的一个,该第一属性值用于指示创建新的设备实例,该第二属性值用于指示将该第一设备实例重置为初始化设备实例。In the second method described above, the newly expanded target resource in the Internet of Things device may include device instance resources, and the device instance resources may be used to manage device instances in the Internet of Things device. Therefore, the device instance resource can be set to manage the attributes related to the device instance in the Internet of Things device. For example, the device instance resource may include switching attributes and new attributes. Wherein, the switching attribute is one of the third attribute value and the fourth attribute value, the third attribute value is used to indicate the device instance is switched, and the fourth attribute value is used to indicate not to switch the device instance; the new attribute is the first attribute One of a value and a second attribute value, where the first attribute value is used to instruct to create a new device instance, and the second attribute value is used to instruct to reset the first device instance to an initialized device instance.
在一些可选的实现方式中,设备实例资源称为deviceinstance资源,切换属性称为nextinstance属性,上新属性称为onboardnew属性。该切换属性和上新属性均可为布尔类型,也即是,切换属性包括的第三属性值和第四属性值被赋为真值或者假值,上新属性包括的第一属性值和第二属性值也被赋为真值或者假值。在本申请实施例中,以第一属性值和第三属性值均为“true”,以第二属性值和第四属性值均为“false”为例进行说明。当该属性值并未赋值时,该上新属性和切换属性的属性值可以均默认为“false”。In some optional implementations, the device instance resource is called the deviceinstance resource, the switching attribute is called the nextinstance attribute, and the new attribute is called the onboardnew attribute. Both the switch attribute and the last attribute can be of Boolean type, that is, the third attribute value and the fourth attribute value included in the switch attribute are assigned true or false values, and the first attribute value and the first attribute value included in the upper new attribute are assigned as true or false values. Binary attribute values are also assigned true or false values. In the embodiment of the present application, the first attribute value and the third attribute value are both "true", and the second attribute value and the fourth attribute value are both "false" as an example for description. When the attribute value is not assigned, the attribute value of the new attribute and the switch attribute can both default to "false".
此时,deviceinstance资源的表示形式可以为:At this time, the representation of the deviceinstance resource can be:
Figure PCTCN2019121994-appb-000007
Figure PCTCN2019121994-appb-000007
该deviceinstance资源的表示形式中,“nextinstance”属性的属性值为“false”,即当前“nextinstance”属性指示不切换为下一个设备实例,“onboardnew”属性的属性值为“false”,即当前“onboardnew”属性指示不创建新的设备实例。该上述deviceinstance资源的表示形式可以为该deviceinstance资源的默认状态。In the representation of the deviceinstance resource, the attribute value of the "nextinstance" attribute is "false", that is, the current "nextinstance" attribute indicates not to switch to the next device instance, and the attribute value of the "onboardnew" attribute is "false", that is, the current " The "onboardnew" attribute indicates that no new device instance will be created. The representation form of the deviceinstance resource may be the default state of the deviceinstance resource.
图5是本申请实施例提供的又一种物联网设备的配置方法的流程图。该流程图描述的是物联网设备 以及用户设备交互实现该物联网设备的配置方法,该物联网设备实例的配置方法包括上述第二种创建初始化设备实例的方法。该方法所对应的应用场景可以参考图2所描述的应用场景,本申请实施例在此不再赘述。该方法可以包括:Fig. 5 is a flowchart of yet another method for configuring an Internet of Things device provided by an embodiment of the present application. The flowchart describes a method for configuring the Internet of Things device by interacting with the user equipment to implement the Internet of Things device. The method for configuring the Internet of Things device instance includes the above-mentioned second method of creating an initialization device instance. For the application scenario corresponding to this method, reference may be made to the application scenario described in FIG. 2, and details are not described in the embodiment of the present application. The method can include:
步骤501、用户设备获取第一设备实例的资源集合。Step 501: The user equipment obtains the resource set of the first device instance.
为了确定物联网设备中是否设置有设备实例资源,用户设备可以先获取第一设备实例的资源集合。资源合集可以称为res资源。In order to determine whether device instance resources are set in the Internet of Things device, the user equipment may first obtain the resource set of the first device instance. The collection of resources can be called res resources.
步骤502、用户设备基于第一设备实例的资源集合确定第一设备实例中具有设备实例资源。Step 502: The user equipment determines that the first device instance has device instance resources based on the resource set of the first device instance.
用户设备在获取到的第一设备实例的资源集合中查找是否存在设备实例资源,当查找到该资源合集中存在设备实例资源,则确定该第一设备实例中具有设备实例资源。当未查找到该资源合集中存在设备实例资源,则确定该第一设备实例中不具有设备实例资源,用户设备以及物联网设备则不再进行后续步骤。The user equipment searches whether there is a device instance resource in the acquired resource collection of the first device instance, and when it finds that the device instance resource exists in the resource collection, it is determined that the first device instance has the device instance resource. When the device instance resource is not found in the resource collection, it is determined that the first device instance does not have the device instance resource, and the user equipment and the Internet of Things device do not perform subsequent steps.
步骤503、用户设备发送切换请求。Step 503: The user equipment sends a handover request.
该切换请求用于指示设备实例资源中的切换属性为第三属性值,用于指示物联网设备将已运行的第一设备实例切换至候选设备实例,根据候选设备实例,确定该物联网设备中是否存在第二设备实例。The switch request is used to indicate that the switch attribute in the device instance resource is the third attribute value, and is used to instruct the IoT device to switch the first device instance that has been running to the candidate device instance, and determine the device instance in the IoT device according to the candidate device instance. Whether there is a second device instance.
该切换请求中可以包括用于更新第一设备实例的设备实例资源的更新请求,实例的,该更新请求可以包括:The handover request may include an update request for updating the device instance resource of the first device instance. For example, the update request may include:
Figure PCTCN2019121994-appb-000008
Figure PCTCN2019121994-appb-000008
更新第一设备实例的设备实例资源指的是更新设备实例资源中切换属性的属性值,使得物联网设备能够从当前已运行的第一设备实例切换至候选设备实施例。该更新指示中,“nextinstance”属性的属性值为“true”,如此可以看出,该切换请求可以指示物联网设备触发切换设备实例。Updating the device instance resource of the first device instance refers to updating the attribute value of the switching attribute in the device instance resource, so that the IoT device can switch from the currently running first device instance to the candidate device embodiment. In the update instruction, the attribute value of the "nextinstance" attribute is "true", so it can be seen that the switching request can instruct the IoT device to trigger the switching device instance.
步骤504、物联网设备接收切换请求。Step 504: The Internet of Things device receives the handover request.
该切换请求用于指示设备实例资源中的切换属性为第三属性值。从步骤503中的切换请求中可以看出,更新后的设备实例资源可以指示设备实例资源中的切换属性为第三属性值。The switching request is used to indicate that the switching attribute in the device instance resource is the third attribute value. It can be seen from the handover request in step 503 that the updated device instance resource may indicate that the handover attribute in the device instance resource is the third attribute value.
步骤505、物联网设备根据切换请求将第一设备实例切换至候选设备实例。Step 505: The IoT device switches the first device instance to the candidate device instance according to the switching request.
物联网设备将其中已运行的第一设备实例切换至第二设备实例的过程可以包括:将已运行的第一设备实例的状态置为非激活态,将第二设备实例的状态置为激活态。如此使得该第一设备实例不再进行外部交互,转而通过候选设备实例进行外部交互。此时,物联网设备对外接口为该候选设备实例,收到的外部请求均由该候选设备实例进行处理。The process of switching the running first device instance to the second device instance by the IoT device may include: setting the state of the running first device instance to an inactive state, and setting the state of the second device instance to an active state . In this way, the first device instance no longer performs external interaction, and instead uses the candidate device instance to perform external interaction. At this time, the external interface of the IoT device is the candidate device instance, and all received external requests are processed by the candidate device instance.
步骤506、物联网设备根据所述候选设备实例,确定物联网设备中是否存在第二设备实例。Step 506: The Internet of Things device determines whether there is a second device instance in the Internet of Things device according to the candidate device instance.
在步骤505中,虽然物联网设备根据切换请求切换了设备实例,但是,切换至的候选设备实例是否为能够进行正常外部交互的设备实例,需要进一步确定。因此,在步骤506中,物联网设备根据候选设备实例,确定该物联网设备中是否存在第二设备实例。该第二设备实例可以为能够被第二安全域网络的OBT设备配置的设备实例。In step 505, although the IoT device switches the device instance according to the switching request, whether the switched candidate device instance is a device instance capable of normal external interaction needs to be further determined. Therefore, in step 506, the Internet of Things device determines whether there is a second device instance in the Internet of Things device according to the candidate device instance. The second device instance may be a device instance that can be configured by the OBT device of the second security domain network.
可选的,确定物联网设备中是否存在第二设备实例的过程可以包括如下步骤:Optionally, the process of determining whether there is a second device instance in the Internet of Things device may include the following steps:
步骤C1、当该候选设备实例所配置的安全域信息与第二安全域网络具有的安全域信息不一致时,确定该候选设备实例不为第二设备实例,即物联网设备中不存在第二设备实例。Step C1. When the security domain information configured by the candidate device instance is inconsistent with the security domain information of the second security domain network, it is determined that the candidate device instance is not a second device instance, that is, there is no second device in the IoT device Instance.
可选的,步骤C1也可以包括如下情况:物联网设备中包括至少两个候选设备实例,在确定某一候选设备实例不为第二设备实例后,继续执行切换设备实例的过程,当切换遍历物联网设备中的所有候选设备实例后,仍没有确定出第二设备实例,则该物联网设备中不存在第二设备实例。Optionally, step C1 may also include the following situation: the IoT device includes at least two candidate device instances, and after determining that a certain candidate device instance is not the second device instance, the process of switching the device instance is continued, and when the switching traverses After all the candidate device instances in the Internet of Things device, the second device instance is still not determined, then there is no second device instance in the Internet of Things device.
步骤C2、当该候选设备实例所配置的安全域信息与第二安全域网络具有的安全域信息一致时,确定该候选设备实例为第二设备实例,即物联网设备中存在第二设备实例。Step C2: When the security domain information configured by the candidate device instance is consistent with the security domain information of the second security domain network, it is determined that the candidate device instance is the second device instance, that is, the second device instance exists in the Internet of Things device.
可选的,步骤C2也可以包括如下情况:物联网设备中包括至少两个候选设备实例,在确定某一候选设备实例不为第二设备实例后,继续执行切换设备实例的过程,在切换遍历物联网设备中的该至少两个候选设备实例的过程中,确定出第二设备实例,则确定该物联网设备中存在第二设备实例。Optionally, step C2 may also include the following situation: the IoT device includes at least two candidate device instances, and after determining that a certain candidate device instance is not the second device instance, the process of switching the device instance is continued, and the switching traversal During the process of the at least two candidate device instances in the Internet of Things device, if the second device instance is determined, it is determined that the second device instance exists in the Internet of Things device.
示例的,候选设备实例所配置的安全域信息包括第二设备实例的Owner ID,第二安全域网络具有的安全域信息包括该第二安全域网络的OBT设备的ID,当二者一致时,确定该候选设备实例为第二设备实例,当该二者不一致时,确定该候选设备实例不为第二设备实例。其中,获取第二安全域网络的OBT设备的ID的过程可以参考上述步骤401中的相关描述,本申请实施例在此不再赘述。For example, the security domain information configured by the candidate device instance includes the Owner ID of the second device instance, and the security domain information possessed by the second security domain network includes the ID of the OBT device of the second security domain network. When the two are consistent, It is determined that the candidate device instance is the second device instance, and when the two are inconsistent, it is determined that the candidate device instance is not the second device instance. For the process of obtaining the ID of the OBT device of the second security domain network, reference may be made to the related description in the foregoing step 401, and details are not described herein again in the embodiment of the present application.
在上述步骤C1中,当确定该候选设备实例不为第二设备实例时,物联网设备可以继续自动触发执 行上述步骤505中,切换候选设备实例的过程,直至切换至第二设备实例,或者直至没有其他候选设备实例可以进行切换。当然,在其他可选的实现方式中,可以由用户选择重置该第一设备实例。本申请实施例以用户选择重置该第一设备实例为例进行说明。In the above step C1, when it is determined that the candidate device instance is not the second device instance, the IoT device can continue to automatically trigger the execution of the process of switching the candidate device instance in step 505 until it is switched to the second device instance, or until No other candidate device instances can be switched. Of course, in other optional implementation manners, the user may choose to reset the first device instance. The embodiment of the present application uses an example in which the user chooses to reset the first device as an example for description.
步骤507、当确定候选设备实例不为第二设备实例,用户设备向物联网设备发送重置指令。Step 507: When it is determined that the candidate device instance is not the second device instance, the user equipment sends a reset instruction to the Internet of Things device.
步骤508、物联网设备接收重置指令。Step 508: The IoT device receives a reset instruction.
该重置指令用于指示重置设备实例。The reset instruction is used to instruct to reset the device instance.
步骤509、物联网设备将第一设备实例以客户端身份加入第二安全域网络。Step 509: The Internet of Things device joins the first device instance to the second secure domain network as a client.
可选的,该重置指令中也可以包括用于指示将候选设备实例以客户端身份加入第二安全域网络的指示信息。即物联网设备将该物联网设备以客户端身份加入第二安全域网络。Optionally, the reset instruction may also include instruction information for instructing the candidate device instance to join the second security domain network as a client. That is, the Internet of Things device joins the Internet of Things device to the second security domain network as a client.
步骤510、物联网设备判断该物联网设备是否存储有目标资源。Step 510: The Internet of Things device judges whether the Internet of Things device stores target resources.
物联网设备判断该物联网设备是否存储有设备实例资源。The Internet of Things device determines whether the Internet of Things device stores device instance resources.
步骤511、当物联网设备存储有目标资源时,物联网设备触发第一请求。Step 511: When the target resource is stored in the Internet of Things device, the Internet of Things device triggers the first request.
当物联网设备确定其中存储有设备实例资源时,物联网设备触发向用户设备发送第一请求。该第一请求用于询问用户是否保留第一设备实例,即该第一请求用于询问用户保留第一设备实例或者重置该第一设备实例。When the Internet of Things device determines that the device instance resource is stored therein, the Internet of Things device triggers to send the first request to the user equipment. The first request is used to ask the user whether to reserve the first device instance, that is, the first request is used to ask the user to reserve the first device instance or reset the first device instance.
步骤512、用户设备接收第一请求。Step 512: The user equipment receives the first request.
步骤513、用户设备针对该第一请求发送保留指令。Step 513: The user equipment sends a reservation instruction in response to the first request.
用户设备接收到该第一请求之后,可以将该第一请求的内容呈现给用户,在接收到用户针对该第一请求的内容的选择结果之后,发送保留指令。用户设备向用户呈现该第一请求的方式也可以有多种,例如,用户设备可以通过UI界面向用户呈现该第一请求,该种情况下,用户设备可以以弹出对话框或者弹出消息的方式提示用户是否保留第一设备实例。After receiving the first request, the user equipment may present the content of the first request to the user, and after receiving the user's selection result for the content of the first request, send a reservation instruction. The user equipment may also present the first request to the user in many ways. For example, the user equipment may present the first request to the user through a UI interface. In this case, the user equipment may pop up a dialog box or a pop-up message. Prompt the user whether to keep the first device instance.
步骤514、当物联网设备接收到该保留指令,通过保留第一设备实例来创建初始化设备实例。Step 514: When the Internet of Things device receives the reservation instruction, it creates an initialization device instance by reserving the first device instance.
从上述第一种创建初始化设备实例的方法对应的物联网设备的配置方法中可知,通过保留第一设备实例来创建初始化设备实例的过程可以包括:将新创建的设备实例作为初始化设备实例(参考步骤D1),或者,将第一设备实例重置为初始化设备实例(参考步骤E1)这两种情况。From the configuration method of the Internet of Things device corresponding to the first method of creating an initialization device instance above, it can be known that the process of creating an initialization device instance by retaining the first device instance may include: using the newly created device instance as the initialization device instance (refer to Step D1), or reset the first device instance to the initialization device instance (refer to step E1).
步骤D1、当接收到保留指令,物联网设备保留第一设备实例,创建新的设备实例,将该新的设备实例作为初始化设备实例。Step D1. When receiving the reservation instruction, the Internet of Things device reserves the first device instance, creates a new device instance, and uses the new device instance as the initialization device instance.
进一步的,该过程可以包括:Further, the process may include:
步骤D11、当接收到该保留指令,物联网设备根据该保留指令更新第一设备实例的目标资源。Step D11: When receiving the reservation instruction, the Internet of Things device updates the target resource of the first device instance according to the reservation instruction.
该保留指令中可以包括用于更新第一设备实例的目标资源的更新指示,示例的,该更新指示可以包括:The reservation instruction may include an update instruction for updating the target resource of the first device instance. For example, the update instruction may include:
Figure PCTCN2019121994-appb-000009
Figure PCTCN2019121994-appb-000009
该更新指示中,"onboardnew"属性的属性值为“true”,如此可以看出,该更新指示可以指示物联网设备创建新的设备实例。In the update instruction, the attribute value of the "onboardnew" attribute is "true", so it can be seen that the update instruction can instruct the IoT device to create a new device instance.
步骤D12、获取更新后的目标资源。Step D12: Obtain the updated target resource.
该更新后的目标资源包括用于指示创建新的设备实例的属性值。也即是,在本申请实施例中,该更新后的deviceinstance资源中的“onboardnew”属性的属性值为“true”。The updated target resource includes an attribute value for instructing the creation of a new device instance. That is, in the embodiment of the present application, the attribute value of the "onboardnew" attribute in the updated deviceinstance resource is "true".
步骤D13、根据更新后的目标资源创建新的设备实例。Step D13: Create a new device instance according to the updated target resource.
步骤D14、初始化新的设备实例,将初始化后的新的设备实例作为初始化设备实例。Step D14: Initialize a new device instance, and use the initialized new device instance as the initialized device instance.
物联网设备通过初始化该新的设备实例,可以使该初始化后的新的设备实例即初始化设备实例处于出厂时状态。The Internet of Things device initializes the new device instance, so that the initialized new device instance, that is, the initialized device instance, can be in the factory state.
步骤D15、返回第一创建成功响应。Step D15: Return the first successful creation response.
为了使物联网设备将第一设备实例的状态置为非激活态,物联网设备需要启动设备重置并转入客户端的被配置状态,以此来获取该第一设备实例的其他属性的属性值。物联网设备在将第一设备实例的状态置为非激活态的过程中,物联网设备可以首先向用户设备返回第一创建成功响应,该第一创建成功响应可以使得用户设备可以根据该第一创建成功响应返回资源更新指令。In order for the IoT device to set the state of the first device instance to the inactive state, the IoT device needs to initiate a device reset and switch to the configured state of the client to obtain the attribute values of other attributes of the first device instance . When the Internet of Things device sets the state of the first device instance to the inactive state, the Internet of Things device may first return a first creation success response to the user equipment, and the first creation success response may enable the user equipment to respond according to the first creation success response. Create a successful response and return the resource update instruction.
步骤D17、用户设备接收第一创建成功响应。Step D17: The user equipment receives the first successful creation response.
步骤D18、用户设备根据该第一创建成功响应发送资源更新指令。Step D18: The user equipment sends a resource update instruction according to the first successful creation response.
该资源更新指令可以用于更新第一设备实例的其他属性的属性值。示例的,该更新指示可以包括:The resource update instruction can be used to update the attribute values of other attributes of the first device instance. For example, the update indication may include:
Figure PCTCN2019121994-appb-000010
Figure PCTCN2019121994-appb-000010
该更新指示中,“dos”属性的属性值为0,“onboardself”属性的属性值为no,“onboardas”属性的属性值为客户端,如此可以看出,该更新指示可以指示物联网设备启动设备重置并转入客户端的被配置状态,也即是,该更新指示可以指示物联网设备准备被配置为客户端。In the update instruction, the attribute value of the "dos" attribute is 0, the attribute value of the "onboardself" attribute is no, and the attribute value of the "onboardas" attribute is the client. It can be seen that the update instruction can instruct the IoT device to start The device is reset and transferred to the configured state of the client, that is, the update instruction may indicate that the IoT device is ready to be configured as a client.
步骤D19、物联网设备接收资源更新指令。Step D19: The Internet of Things device receives a resource update instruction.
该资源更新指令用于更新第一设备实例的配置状态资源。The resource update instruction is used to update the configuration state resource of the first device instance.
步骤D120、物联网设备根据资源更新指令,将第一设备实例置为非激活态。Step D120: The Internet of Things device places the first device instance in an inactive state according to the resource update instruction.
物联网设备通过获取pstat资源中“dos”属性、“onboardself”属性以及“onboardas”属性的属性值,来使第一设备实例的状态置为非激活态。此时,第一设备实例不再进行外部交互,而将初始化设备实例的状态置为激活态,使其能够进行外部交互。此时,物联网设备的对外接口为该初始化设备实例,该物联网设备收到的外部请求均由该初始化设备实例处理。The Internet of Things device obtains the attribute values of the "dos" attribute, the "onboardself" attribute, and the "onboardas" attribute in the pstat resource to set the state of the first device instance to the inactive state. At this time, the first device instance no longer performs external interaction, but sets the state of the initialized device instance to an active state, so that it can perform external interaction. At this time, the external interface of the Internet of Things device is the initialization device instance, and all external requests received by the Internet of Things device are processed by the initialization device instance.
步骤D121、物联网设备将初始化设备实例置为激活态。Step D121: The Internet of Things device sets the initialization device instance to an active state.
将第一设备实例置为非激活态,将初始化设备实例置为激活态使其能够被其他设备实例发现,如此使得该第一设备实例不再进行外部交互,转而通过初始化设备实例进行外部交互。此时,物联网设备对外接口为该初始化设备实例,收到的外部请求均由该初始化设备实例进行处理。Set the first device instance to an inactive state, and set the initialized device instance to an active state so that it can be discovered by other device instances, so that the first device instance no longer performs external interactions, but instead uses the initialized device instance to perform external interactions . At this time, the external interface of the Internet of Things device is the initialization device instance, and all received external requests are processed by the initialization device instance.
步骤D2、当接收到保留指令,物联网设备保留第一设备实例的副本,将第一设备实例重置为初始化设备实例,第一设备实例的副本具有的资源集合与第一设备实例具有的资源集合一致。Step D2. When receiving the reservation instruction, the Internet of Things device reserves the copy of the first device instance, resets the first device instance to the initialization device instance, the set of resources possessed by the copy of the first device instance and the resources possessed by the first device instance The set is consistent.
进一步的,该过程可以包括:Further, the process may include:
步骤D21、当接收到保留指令,根据该保留指令更新第一设备实例的目标资源。Step D21: When a reservation instruction is received, the target resource of the first device instance is updated according to the reservation instruction.
该保留指令中可以包括用于更新第一设备实例的目标资源的更新指示,示例的,该更新指示可以包括:The reservation instruction may include an update instruction for updating the target resource of the first device instance. For example, the update instruction may include:
Figure PCTCN2019121994-appb-000011
Figure PCTCN2019121994-appb-000011
该更新指示中,"onboardnew"属性的属性值为“true”,如此可以看出,该更新指示可以指示物联网设备创建新的设备实例。In the update instruction, the attribute value of the "onboardnew" attribute is "true", so it can be seen that the update instruction can instruct the IoT device to create a new device instance.
步骤D22、获取更新后的目标资源。Step D22: Obtain the updated target resource.
该更新后的目标资源包括用于指示创建新的设备实例的属性值。也即是,在本申请实施例中,该更新后的deviceinstance资源中的“onboardnew”属性的属性值为“true”。The updated target resource includes an attribute value for instructing the creation of a new device instance. That is, in the embodiment of the present application, the attribute value of the "onboardnew" attribute in the updated deviceinstance resource is "true".
步骤D23、根据更新后的目标资源创建新的设备实例。Step D23: Create a new device instance according to the updated target resource.
步骤D24、将第一设备实例的资源集合写入新的设备实例,以保留第一设备实例的副本。Step D24: Write the resource collection of the first device instance into the new device instance, so as to retain a copy of the first device instance.
步骤D25、物联网设备返回第二创建成功响应。Step D25: The Internet of Things device returns a second creation success response.
该第二创建成功响应可以使得用户设备可以根据该第二创建成功响应返回资源更新指令。The second creation success response may enable the user equipment to return a resource update instruction according to the second creation success response.
步骤D26、用户设备接收第二创建成功响应。Step D26: The user equipment receives the second creation success response.
步骤D27、用户设备根据第二创建成功响应发送资源更新指令。Step D27: The user equipment sends a resource update instruction according to the second successful creation response.
该资源更新指令可以用于更新第一设备实例的其他属性的属性值。示例的,该资源更新指令可以包括:The resource update instruction can be used to update the attribute values of other attributes of the first device instance. For example, the resource update instruction may include:
Figure PCTCN2019121994-appb-000012
Figure PCTCN2019121994-appb-000012
该更新指示中,“dos”属性的属性值为0,“onboardself”属性的属性值为no,“onboardas”属性的属性值为客户端,如此可以看出,该更新指示可以指示物联网设备启动设备重置并转入客户端的被配置状态,也即是,该更新指示可以指示物联网设备准备被配置为客户端。In the update instruction, the attribute value of the "dos" attribute is 0, the attribute value of the "onboardself" attribute is no, and the attribute value of the "onboardas" attribute is the client. It can be seen that the update instruction can instruct the IoT device to start The device is reset and transferred to the configured state of the client, that is, the update instruction may indicate that the IoT device is ready to be configured as a client.
步骤D28、物联网设备接收资源更新指令。Step D28: The Internet of Things device receives a resource update instruction.
该资源更新指令用于更新第一设备实例的配置状态资源。The resource update instruction is used to update the configuration state resource of the first device instance.
步骤D29、物联网设备根据资源更新指令,将第一设备实例重置为初始化设备实例。Step D29: The Internet of Things device resets the first device instance to the initialization device instance according to the resource update instruction.
物联网设备通过获取pstat资源中“dos”属性、“onboardself”属性以及“onboardas”属性的属性值,来将第一设备实例重置为初始化设备实例。此时,由第一设备实例进行外部交互,物联网设备的对外接口为该第一设备实例,该物联网设备收到的外部请求均由该第一设备实例处理。The IoT device resets the first device instance to the initial device instance by obtaining the attribute values of the "dos" attribute, the "onboardself" attribute, and the "onboardas" attribute in the pstat resource. At this time, the external interaction is performed by the first device instance, the external interface of the Internet of Things device is the first device instance, and all external requests received by the Internet of Things device are processed by the first device instance.
步骤D210、将新的设备实例置为非激活态,将初始化设备实例置为激活态。Step D210: Set the new device instance to an inactive state, and set the initialized device instance to an active state.
将新的设备实例(即第一设备实例的副本)置为非激活态,将初始化设备实例置为激活态使其能够被其他设备实例发现,如此使得该新的设备实例不进行外部交互,通过初始化设备实例进行外部交互。此时,物联网设备对外接口为该初始化设备实例,收到的外部请求均由该初始化设备实例进行处理。Set the new device instance (that is, the copy of the first device instance) to the inactive state, and set the initialized device instance to the active state so that it can be discovered by other device instances, so that the new device instance does not perform external interactions. Initialize the device instance for external interaction. At this time, the external interface of the Internet of Things device is the initialization device instance, and all received external requests are processed by the initialization device instance.
综上所述,本申请实施例提供的物联网设备的配置方法,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。当该创建指令包括保留指令,该物联网设备中可以同时保留有适用于第一安全域网络的第一设备实例以及适用于第二安全域网络的第二设备实例,使得当该物联网设备再重进进入第一安全域网络时,通过激活该第一设备实例便可使该物联网设备与该第一安全域网络连接,实现各种智能化场景的操作,并且,第一安全域网络和第二安全域网络中的OBT设备均可对该物联网设备进行设置,使得该物联网设备能够与第一安全域网络和第二安全域网络中的其它设备均实现互联互通。To sum up, the configuration method of the Internet of Things device provided in the embodiments of the present application is achieved when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such thing that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. When the creation instruction includes a reservation instruction, the first device instance applicable to the first security domain network and the second device instance applicable to the second security domain network may be retained in the Internet of Things device at the same time, so that when the Internet of Things device is re When reentering the first secure domain network, by activating the first device instance, the IoT device can be connected to the first secure domain network to realize operations in various intelligent scenarios, and the first secure domain network and All OBT devices in the second security domain network can set the IoT device, so that the IoT device can realize interconnection and intercommunication with other devices in the first security domain network and the second security domain network.
需要说明的是,在本申请实施例中,资源均针对的是每个设备实例的资源。It should be noted that in the embodiments of the present application, the resources are all directed to the resources of each device instance.
在前述介绍过,物联网设备中可以安装有应用平台,该应用平台可以控制该物联网设备中运行多个设备实例,应用平台以及其控制运行的多个设备实例可以理解为物联网设备中的应用程序。以下以物联网设备中包括应用平台以及多个设备实例与用户设备交互为例,对上述物联网设备的配置方法进行说明。As mentioned above, an application platform can be installed in an Internet of Things device, and the application platform can control multiple device instances running in the Internet of Things device. The application platform and multiple device instances that control the operation of the application platform can be understood as the Internet of Things device. application. The following takes the IoT device including the application platform and the interaction of multiple device instances with the user equipment as an example to describe the configuration method of the above-mentioned IoT device.
针对图4所描述的物联网设备的配置方法中,以第二设备实例所配置的安全域信息包括第二设备实例的Owner ID,第二安全域网络具有的安全域信息包括第二安全域网络的OBT设备的ID为例进行说明,如图6所示,该方法可以包括:In the configuration method of the Internet of Things device described in FIG. 4, the security domain information configured with the second device instance includes the Owner ID of the second device instance, and the security domain information possessed by the second security domain network includes the second security domain network The ID of the OBT device is taken as an example for description. As shown in Figure 6, the method may include:
步骤E1、当物联网设备从第一安全域网络进入第二安全域网络时,已运行的第一设备实例获取第二安全域网络中,除该第一设备实例之外的其他设备实例的设备角色。Step E1. When the Internet of Things device enters the second security domain network from the first security domain network, the first device instance that has been running acquires the devices of other device instances in the second security domain network except the first device instance Character.
步骤E2、第一设备实例将其他设备实例中,设备角色为obt的设备实例所在物联网设备确定为该第二安全域网络的OBT设备。Step E2: The first device instance determines that among other device instances, the Internet of Things device where the device instance with the device role of obt is located is the OBT device of the second security domain network.
步骤E3、第一设备实例获取OBT设备的ID。Step E3: The first device instance obtains the ID of the OBT device.
上述步骤E1至步骤E3对应图中第一设备实例发现网络中有OBT的步骤。The above steps E1 to E3 correspond to the steps in which the first device instance in the figure finds that there is an OBT in the network.
步骤E4、第一设备实例将获取到的OBT设备的ID发送至应用平台。Step E4: The first device instance sends the acquired ID of the OBT device to the application platform.
步骤E5、应用平台根据OBT设备的ID,确定该物联网设备中是否存在第二设备实例。Step E5: The application platform determines whether there is a second device instance in the Internet of Things device according to the ID of the OBT device.
也即是,应用平台根据OBT设备的ID,查找该物联网设备中的所有设备实施例中是否有Owner ID与OBT设备的ID匹配的设备实例。That is, according to the ID of the OBT device, the application platform searches whether there is a device instance whose Owner ID matches the ID of the OBT device among all the device embodiments in the Internet of Things device.
步骤E6、当应用平台确定存在第二设备实例,则将第一设备实例置为非激活态,将第二设备实例置为激活态。Step E6: When the application platform determines that there is a second device instance, it sets the first device instance to an inactive state and sets the second device instance to an active state.
此时,应用平台查找到第二设备实例的Owner ID为OBT设备的ID,则可以确定存在该第二设备实例,则将第一设备实例置为非激活态,将第二设备实例置为激活态,使得物联网设备通过第二设备实例对外进行交互。At this point, if the application platform finds that the Owner ID of the second device instance is the ID of the OBT device, it can be determined that the second device instance exists, and the first device instance is set to inactive state, and the second device instance is set to active State, enabling the Internet of Things device to interact with the outside world through the second device instance.
上述步骤E6对应图6中的“设备实例的切换”。The above step E6 corresponds to the "switching of the device instance" in FIG. 6.
步骤E7、当应用平台确定不存在第二设备实例,触发第一设备实例向用户设备发送第二请求。Step E7: When the application platform determines that there is no second device instance, it triggers the first device instance to send a second request to the user equipment.
也即是,当应用平台未找到设备实例的Owner ID为OBT设备的ID,则确定不存在第二设备实例,则触发第一设备实例向用户设备发送第二请求,即触发第一设备实例向用户进行询问。That is, when the application platform does not find the Owner ID of the device instance as the ID of the OBT device, it is determined that there is no second device instance, and the first device instance is triggered to send the second request to the user device, that is, the first device instance is triggered to The user asks.
步骤E8、第一设备实例向用户设备发送第二请求。Step E8: The first device instance sends a second request to the user equipment.
第一设备实例通过向用户设备发送第二请求来提示用户是否以客户端身份加入第二安全域网络。The first device instance prompts the user whether to join the second security domain network as a client by sending a second request to the user device.
步骤E9、用户设备接收该第二请求。Step E9: The user equipment receives the second request.
用户设备接收到该第二请求之后,可以通过UI界面弹出对话框或者消息提示用户的方式向用户询问。After receiving the second request, the user equipment may ask the user in a manner of popping up a dialog box or a message prompting the user through the UI interface.
步骤E10、用户设备针对该第二请求发送第二响应。Step E10: The user equipment sends a second response to the second request.
用户可以通过在用户设备中的UI界面进行操作触发用户设备发送第二响应。该第二响应包括用户确认以客户端身份加入第二安全域网络。The user can trigger the user equipment to send the second response through an operation on the UI interface in the user equipment. The second response includes the user confirming to join the second secure domain network as the client.
步骤E11、第一设备实例判断该物联网设备中是否存储有pstat资源。Step E11: The first device instance judges whether the pstat resource is stored in the Internet of Things device.
第一设备实例通过判断该物联网设备中是否存储有pstat资源来判断是否具有onboardnew属性。The first device instance determines whether it has the onboardnew attribute by determining whether the pstat resource is stored in the Internet of Things device.
步骤E12、当物联网设备中存储有pstat资源,第一设备实例触发第一请求。Step E12: When the pstat resource is stored in the Internet of Things device, the first device instance triggers the first request.
当物联网设备中存储有pstat资源且该pstat资源中具有onboardnew属性,则通过触发第一请求来继续向用户询问是保留还是放弃第一设备实例。When the pstat resource is stored in the IoT device and the pstat resource has the onboardnew attribute, the first request is triggered to continue to ask the user whether to reserve or abandon the first device instance.
步骤E13、用户设备接收第一请求。Step E13: The user equipment receives the first request.
步骤E14、用户设备针对该第一请求向第一设备实例发送保留指令。Step E14: The user equipment sends a reservation instruction to the first device instance in response to the first request.
当用户选择保留第一设备实例,用户设备想第一设备实例发送保留指令。该保留请求可以触发第一设备实例重置。When the user chooses to reserve the first device instance, the user device wants the first device instance to send a reservation instruction. The reservation request may trigger the reset of the first device instance.
步骤E15、应用平台监听或者订阅第一设备实例中的pstat资源。Step E15: The application platform monitors or subscribes to the pstat resource in the first device instance.
步骤E16、应用平台根据监听或者获取的pstat资源,创建新的设备实例。Step E16: The application platform creates a new device instance based on the monitored or acquired pstat resource.
应用平台根据监听或者获取的pstat资源中的onboardnew属性的属性值,创建新的设备实例。The application platform creates a new device instance according to the attribute value of the onboardnew attribute in the pstat resource that it monitors or obtains.
步骤E17、应用平台获取第一设备实例的资源合集。Step E17: The application platform obtains the resource collection of the first device instance.
步骤E18、应用平台将第一设备实例的资源合集写入新的设备实例。Step E18: The application platform writes the resource collection of the first device instance into the new device instance.
写入第一设备实例的资源集合的新的设备实例为第一设备实例的副本。The new device instance written into the resource set of the first device instance is a copy of the first device instance.
步骤E18、应用平台将新的设备实例置为非激活态。Step E18: The application platform places the new device instance in an inactive state.
步骤E19、应用平台指示第一设备实例进行重置。Step E19: The application platform instructs the first device instance to reset.
第一设备实例在接收到应用平台发送的重置指示后,进行重置。The first device instance resets after receiving the reset instruction sent by the application platform.
或者,上述步骤E16之后,可以执行下述步骤E20。Alternatively, after the above step E16, the following step E20 may be performed.
步骤E20、应用平台初始化该新的设备实例,将初始化后的新的设备实例作为初始化设备实例。Step E20: The application platform initializes the new device instance, and uses the initialized new device instance as the initialized device instance.
步骤E21、应用平台使第一设备实例处于非激活态,使初始化后的新的设备实例处于激活态。Step E21: The application platform makes the first device instance in an inactive state, and makes the initialized new device instance in an active state.
上述步骤E14至步骤E19描述的是第一种保留第一设备实例的相关过程,步骤E20至步骤E21描述的是第二种保留第一设备实例的相关过程。在图6中所描述的第二种保留第一设备实例的一些过程可以参考步骤E7至步骤E19描述的是第一种保留第一设备实例的相关过程,本申请实施例在此不再赘述。The above steps E14 to E19 describe the first related process of retaining the first device instance, and steps E20 to E21 describe the second related process of retaining the first device instance. For some processes of the second type of retaining the first device instance described in FIG. 6, reference may be made to Steps E7 to E19. The descriptions are related to the first type of retaining the first device instance, which will not be repeated in this embodiment of the application.
步骤E22、用户设备针对该第一请求向第一设备实例发送重置指令。Step E22: The user equipment sends a reset instruction to the first device instance in response to the first request.
重置指令指示用户选择放弃第一设备实例。The reset instruction instructs the user to choose to abandon the first device instance.
步骤E23、应用平台监听或者订阅第一设备实例中的pstat资源。Step E23: The application platform monitors or subscribes to the pstat resource in the first device instance.
第一设备实例通过判断该物联网设备中是否存储有pstat资源来判断是否具有onboardnew属性。The first device instance determines whether it has the onboardnew attribute by determining whether the pstat resource is stored in the Internet of Things device.
步骤E24、应用平台根据监听或者获取的pstat资源,重置第一设备实例。Step E24: The application platform resets the first device instance according to the monitored or acquired pstat resource.
应用平台根据监听或者获取的pstat资源中的onboardnew属性,使第一设备实例重置。The application platform resets the first device instance according to the onboardnew attribute in the monitored or acquired pstat resource.
步骤E7至步骤E24描述的是创建新的设备实施例的相关过程,其中步骤E7至步骤E21描述的是通过保留第一设备实例来创建新的设备实例的相关过程,步骤E22至步骤E24描述的是通过重置第一设备实例来创建新的设备实例的相关过程。Step E7 to step E24 describe the related process of creating a new device embodiment, where step E7 to step E21 describe the related process of creating a new device instance by retaining the first device instance, and step E22 to step E24 describe It is the related process of creating a new device instance by resetting the first device instance.
需要说明的是,在图6中,“第二设备实例(新的设备实例)”指的是,在设备实例的切换过程是第二设备实例,在设备实例的创建过程是新的设备实例。It should be noted that in FIG. 6, "the second device instance (new device instance)" refers to the second device instance in the switching process of the device instance, and the new device instance in the creation process of the device instance.
针对图5所描述的物联网设备的配置方法中,以第二设备实例所配置的安全域信息包括第二设备实例的Owner ID,第二安全域网络具有的安全域信息包括第二安全域网络的OBT设备的ID为例,如图7所示,该方法可以包括:In the configuration method of the Internet of Things device described in FIG. 5, the security domain information configured by the second device instance includes the Owner ID of the second device instance, and the security domain information possessed by the second security domain network includes the second security domain network Take the ID of the OBT device as an example, as shown in Figure 7, the method may include:
步骤F1、用户设备通过其中安装的客户端应用程序获取第一设备实例的资源集合。Step F1: The user equipment obtains the resource set of the first device instance through the client application installed therein.
步骤F2、用户设备查找到该资源集合中存在deviceinstance资源,通过客户端应用程序向第一设备实例发送切换请求。Step F2. The user equipment finds that there is a deviceinstance resource in the resource set, and sends a switching request to the first device instance through the client application.
步骤F3、应用平台通过监听或者订阅第一设备实例获取deviceinstance资源中nextinstance参数的属性值。Step F3: The application platform obtains the attribute value of the nextinstance parameter in the deviceinstance resource by monitoring or subscribing to the first device instance.
步骤F4、应用平台根据deviceinstance资源中nextinstance参数的属性值,将第一设备实例置为非激活态,将候选设备实例置为激活态。Step F4: The application platform sets the first device instance to the inactive state and the candidate device instance to the active state according to the attribute value of the nextinstance parameter in the deviceinstance resource.
上述步骤F1至步骤F4描述的是图7中设备实例切换的相关过程。The above steps F1 to F4 describe the related process of device instance switching in FIG. 7.
步骤F5、应用平台确定该候选设备实例不为第二设备实例。Step F5: The application platform determines that the candidate device instance is not a second device instance.
应用平台确定新切换的候选设备实例不为第二设备实例,无法与第二安全域网络中的物联网设备进行互联互通,则需要重新建立设备实例。The application platform determines that the newly switched candidate device instance is not the second device instance, and cannot communicate with the Internet of Things devices in the second security domain network, and the device instance needs to be re-established.
步骤F6、用户设备通过客户应用程序发送重置指令,并将该第一设备实例以客户端身份加入第二安全域网络。Step F6: The user equipment sends a reset instruction through the client application, and joins the first device instance to the second secure domain network as the client.
用户设备通过客户应用程序触发第一设备实例重置(reset)。The user device triggers a reset of the first device instance through the client application.
步骤F7、第一设备实例发现该第一设备实例中存在deviceinstance资源,向用户设备发送第一请求。Step F7: The first device instance finds that the deviceinstance resource exists in the first device instance, and sends a first request to the user equipment.
步骤F8、用户设备接收第一请求。Step F8: The user equipment receives the first request.
步骤F9、用户设备针对该第一请求向第一设备实例发送保留指令。Step F9: The user equipment sends a reservation instruction to the first device instance in response to the first request.
上述步骤F7至步骤F9所描述的是图7中第一种设备实例创建的过程中,用户设备发现第一设备实例中有deviceinstance资源,接收到询问用户是否保留已有配置(第一设备实例)的第一请求,且用户确认保留已有配置的情况。The above steps F7 to F9 describe the process of creating the first device instance in Figure 7, when the user equipment discovers that there is a deviceinstance resource in the first device instance, and receives an inquiry about whether the user retains the existing configuration (first device instance) The first request, and the user confirms to keep the existing configuration.
步骤F10、应用平台监听或者订阅第一设备实例中的目标资源。Step F10: The application platform monitors or subscribes to the target resource in the first device instance.
步骤F15、应用平台根据监听或者获取的deviceinstance资源,创建新的设备实例。Step F15: The application platform creates a new device instance based on the monitored or acquired deviceinstance resource.
应用平台通过监听或者订阅第一设备实例获取deviceinstance资源中nextinstance参数的属性值。The application platform obtains the attribute value of the nextinstance parameter in the deviceinstance resource by monitoring or subscribing to the first device instance.
步骤F16、应用平台获取第一设备实例的资源合集。Step F16: The application platform obtains the resource collection of the first device instance.
步骤F17、应用平台将第一设备实例的资源合集写入新的设备实例。Step F17: The application platform writes the resource collection of the first device instance into the new device instance.
步骤F18、应用平台将新的设备实例置为非激活态。Step F18: The application platform places the new device instance in an inactive state.
步骤F19、应用平台告知第一设备实例新的设备实例已创建完成。Step F19: The application platform informs the first device instance that the new device instance has been created.
步骤F20、第一设备实例向用户设备返回第一创建成功响应。Step F20: The first device instance returns a first creation success response to the user equipment.
步骤F21、用户设备接收第一创建成功响应。Step F21: The user equipment receives the first successful creation response.
步骤F22、用户设备根据该第一创建成功响应向第一设备实例发送资源更新指令。Step F22: The user equipment sends a resource update instruction to the first device instance according to the first creation success response.
步骤F23、第一设备实例根据该资源更新指令重置第一设备实例。Step F23: The first device instance resets the first device instance according to the resource update instruction.
上述步骤F5至步骤F23描述的是图7中第一种设备实例创建的过程。The above steps F5 to F23 describe the process of creating the first device instance in FIG. 7.
可选的,在步骤F15之后,可以执行步骤F20。Optionally, after step F15, step F20 may be performed.
步骤F20、应用平台初始化该新的设备实例。Step F20: The application platform initializes the new device instance.
步骤F21、应用平台告知第一设备实例新的设备实例已创建完成。Step F21: The application platform informs the first device instance that the new device instance has been created.
步骤F20、第一设备实例向用户设备返回第二创建成功响应。Step F20: The first device instance returns a second creation success response to the user equipment.
步骤F21、用户设备接收第二创建成功响应。Step F21: The user equipment receives the second creation success response.
步骤F22、用户设备根据该第二创建成功响应向第一设备实例发送资源更新指令。Step F22: The user equipment sends a resource update instruction to the first device instance according to the second creation success response.
步骤F23、应用平台根据该资源更新指令,将第一设备实例置为非激活态,将第二设备实例置为激活态。Step F23: The application platform sets the first device instance to an inactive state and sets the second device instance to an active state according to the resource update instruction.
上述步骤F20至步骤F23描述的是图7中第二种设备实例创建的过程。在图7中所描述的第二种设备实例创建的一些过程可以参考步骤F5至步骤F23描述的是第二种设备实例创建的相关过程,本申请实施例在此不再赘述。The above steps F20 to F23 describe the process of creating the second type of device instance in FIG. 7. For the process of creating the second type of device instance described in FIG. 7, reference may be made to steps F5 to F23. The descriptions are related to the process of creating the second type of device instance, which will not be repeated in the embodiment of the present application.
需要说明的是,在图7中,“候选设备实例(新的设备实例)”指的是,在设备实例的切换过程是候选设备实例,在设备实例的创建过程是新的设备实例。It should be noted that in FIG. 7, "candidate device instance (new device instance)" refers to a candidate device instance in the switching process of a device instance, and a new device instance in the creation process of a device instance.
值得说明的是,本申请实施例提供的上述物联网设备的配置方法的步骤的先后顺序可以进行适当调整,步骤也可以根据实际情况进行响应增减,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。It is worth noting that the order of the steps in the configuration method of the Internet of Things device provided in the embodiments of the present application can be adjusted appropriately, and the steps can also be increased or decreased in response to actual conditions. Anyone skilled in the art in this application Within the scope of the disclosed technology, the methods that can be easily conceived of changes should be covered by the scope of protection of this application, and therefore will not be repeated.
图8示出了本申请实施例提供的一种物联网设备的配置装置的框图。所述装置应用于物联网设备,所述装置800包括:Fig. 8 shows a block diagram of a device for configuring an Internet of Things device provided by an embodiment of the present application. The device is applied to Internet of Things equipment, and the device 800 includes:
处理模块801,所述处理模块用于当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致; Processing module 801, the processing module is configured to determine whether there is a second device instance in the Internet of Things device when the Internet of Things device enters the second security domain network from the first security domain network, and the second device instance The configured security domain information is consistent with the security domain information possessed by the second security domain network;
接收模块802,所述接收模块用于当不存在所述第二设备实例时,接收创建指令;A receiving module 802, the receiving module is configured to receive a creation instruction when the second device instance does not exist;
所述处理模块用于根据所述创建指令,创建初始化设备实例,所述初始化设备实例用于被所述第二安全域网络的激活工具OBT设备配置为所述第二设备实例。The processing module is configured to create an initialization device instance according to the creation instruction, and the initialization device instance is used to be configured as the second device instance by an activation tool OBT device of the second security domain network.
综上所述,本申请实施例提供的物联网设备的配置装置,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,根据接收到的创建指令创建能够被该第二安全域网络中的OBT设备配置为第二设备实例的初始化设备实例,使得该物联网设备能够与第二安全域网络中的其它设备互联互通。To sum up, the configuration device for the Internet of Things device provided by the embodiment of the present application can be used when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such device that can be used by the Internet of Things device. When the second device instance of the OBT device in the second security domain network is configured, according to the received creation instruction, an initialization device instance that can be configured by the OBT device in the second security domain network as the second device instance is created, so that the object The networked device can be interconnected with other devices in the second security domain network.
可选的,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,Optionally, a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
所述处理模块801,用于:当接收到所述保留指令,通过保留所述第一设备实例来创建所述初始化设备实例。The processing module 801 is configured to: when the reservation instruction is received, create the initialization device instance by reserving the first device instance.
可选的,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,所述处理模块801,用于:当接收到所述重置指令,通过重置所述第一设备实例来创建所述初始化设备实例。Optionally, the first device instance is already running in the Internet of Things device, the creation instruction includes a reset instruction, and the processing module 801 is configured to: when the reset instruction is received, reset the The first device instance is used to create the initialization device instance.
可选的,所述处理模块801,用于:当接收到所述保留指令,保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;Optionally, the processing module 801 is configured to: when the reservation instruction is received, reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance;
当接收到所述保留指令,保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。When the reservation instruction is received, the copy of the first device instance is reserved, the first device instance is reset to the initialization device instance, and the resource set of the copy of the first device instance is the same as that of the first device instance. A device instance has the same set of resources.
可选的,所述处理模块801,用于:当接收到所述重置指令,重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。Optionally, the processing module 801 is configured to reset the first device instance when the reset instruction is received, and use the reset first device instance as the initialization device instance.
可选的,所述处理模块801,用于:当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;根据所述更新后的目标资源创建新的设备实例;初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;将所述第一设备实例置为非激活态;将所述初始化设备实例置为激活态。Optionally, the processing module 801 is configured to: when the reservation instruction is received, update the target resource of the first device instance according to the reservation instruction; obtain the updated target resource, after the update The target resource of includes an attribute value used to indicate the creation of a new device instance; a new device instance is created according to the updated target resource; the new device instance is initialized, and the initialized new device instance is used as the The initialization device instance; the first device instance is set to an inactive state; the initialization device instance is set to an active state.
可选的,所述处理模块801,用于:当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;根据所述更新后的目标资源创建所述新的设备实例;将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;将所述第一设备实例重置为所述初始化设备实例;将所述新的设备实例置为非激活态;将所述初始化设备实例置为激活态。Optionally, the processing module 801 is configured to: when the reservation instruction is received, update the target resource of the first device instance according to the reservation instruction; obtain the updated target resource, after the update The target resource of includes the attribute value used to indicate the creation of a new device instance; the new device instance is created according to the updated target resource; the resource set of the first device instance is written into the new device instance , To keep a copy of the first device instance; reset the first device instance to the initialization device instance; set the new device instance to an inactive state; set the initialization device instance to be active state.
可选的,所述处理模块801,用于:当接收到所述重置指令,根据所述重置指令更新所述第一设备实例的目标资源;获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值;根据所述更新后的目标资源,重置所述所述第一设备实例;将重置后的所述第一设备实例确定为所述初始化设备实例;将所述初始化设备实例置为激活态。Optionally, the processing module 801 is configured to: when the reset instruction is received, update the target resource of the first device instance according to the reset instruction; obtain the updated target resource, the The updated target resource includes an attribute value for instructing to reset the first device instance; reset the first device instance according to the updated target resource; reset the first device instance after resetting The device instance is determined to be the initialization device instance; the initialization device instance is set to an active state.
可选的,所述接收模块802,用于:当所述物联网设备从第一安全域网络进入第二安全域网络时,接收切换请求,所述切换请求用于指示设备实例资源中的切换属性为第三属性值,其中,所述设备实例资源用于管理所述物联网设备中的设备实例,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;Optionally, the receiving module 802 is configured to: when the Internet of Things device enters the second secure domain network from the first secure domain network, receive a handover request, where the handover request is used to instruct a switch in the device instance resource The attribute is a third attribute value, where the device instance resource is used to manage the device instance in the Internet of Things device, the switching attribute is one of a third attribute value and a fourth attribute value, and the third attribute The value is used to indicate that the device instance is switched, and the fourth attribute value is used to indicate that the device instance is not to be switched;
所述处理模块801,用于:根据所述切换请求将所述第一设备实例切换至候选设备实例;通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例。The processing module 801 is configured to: switch the first device instance to a candidate device instance according to the switching request; determine the Internet of Things device by determining whether the candidate device instance is the second device instance Whether there is a second device instance in.
可选的,所述处理模块801,用于:当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息不一致时,确定所述候选设备实例不为所述第二设备实例,所述物联网设备中不存在所述第二设备实例;当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致时,确定所述候选设备实例为所述第二设备实例,所述物联网设备中存在所述第二设备实例。Optionally, the processing module 801 is configured to: when the security domain information configured by the candidate device instance is inconsistent with the security domain information of the second security domain network, determine that the candidate device instance is not owned by the candidate device instance. For the second device instance, the second device instance does not exist in the Internet of Things device; when the security domain information configured by the candidate device instance is consistent with the security domain information of the second security domain network, it is determined The candidate device instance is the second device instance, and the second device instance exists in the Internet of Things device.
可选的,所述目标资源包括配置状态资源;所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。Optionally, the target resource includes a configuration state resource; the configuration state resource includes a new attribute, and the new attribute is one of a first attribute value and a second attribute value, and the first attribute value is used for Instructing to create a new device instance, and the second attribute value is used to instruct to reset the first device instance to the initialization device instance.
可选的,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;所述设备实例资源包括切换属性以及上新属性;所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;Optionally, the target resource includes a device instance resource, the device instance resource is used to manage the device instance in the Internet of Things device; the device instance resource includes a handover attribute and an updated attribute; the handover attribute is the first One of a three attribute value and a fourth attribute value, where the third attribute value is used to indicate switching device instances, and the fourth attribute value is used to indicate not switching device instances;
所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
可选的,如图9所示,所述装置800包括:发送模块803,所述发送模块用于在接收创建指令之前,当不存在所述第二设备实例时,触发第一请求,所述第一请求用于询问保留或者重置所述第一设备实例;Optionally, as shown in FIG. 9, the apparatus 800 includes: a sending module 803 configured to trigger a first request when the second device instance does not exist before receiving the creation instruction, the The first request is used to inquire to reserve or reset the first device instance;
所述接收模块802,用于:接收针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,接收针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。The receiving module 802 is configured to: receive the creation instruction for reserving the first device instance, where the creation instruction includes a retention instruction; or, receive the creation instruction for resetting the first device instance, The creation instruction includes a reset instruction.
可选的,所述发送模块803,用于在触发第一请求之前,当不存在所述第一设备实例时,触发第二请求;Optionally, the sending module 803 is configured to trigger a second request when the first device instance does not exist before triggering the first request;
所述接收模块802,用于接收针对所述第二请求的第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络;The receiving module 802 is configured to receive a second response to the second request, where the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client;
所述处理模块801,用于判断所述物联网设备是否存储有所述目标资源;The processing module 801 is configured to determine whether the target resource is stored in the Internet of Things device;
所述发送模块803,用于当所述物联网设备存储有所述目标资源时,触发所述第一请求。The sending module 803 is configured to trigger the first request when the target resource is stored in the Internet of Things device.
可选的,所述处理模块801,用于:当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;根据所述更新后的目标资源创建新的设备实例;初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;Optionally, the processing module 801 is configured to: when the reservation instruction is received, update the target resource of the first device instance according to the reservation instruction; obtain the updated target resource, after the update The target resource of includes an attribute value used to indicate the creation of a new device instance; a new device instance is created according to the updated target resource; the new device instance is initialized, and the initialized new device instance is used as the Describe the initialization device example;
所述发送模块803,用于返回第一创建成功响应;The sending module 803 is configured to return the first successful creation response;
所述接收模块802,用于接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置 状态资源;The receiving module 802 is configured to receive a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
所述处理模块801,还用于:根据所述资源更新指令,将所述第一设备实例置为非激活态;The processing module 801 is further configured to: place the first device instance in an inactive state according to the resource update instruction;
将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
可选的,所述处理模块801,用于:当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;根据所述更新后的目标资源创建所述新的设备实例;将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;Optionally, the processing module 801 is configured to: when the reservation instruction is received, update the target resource of the first device instance according to the reservation instruction; obtain the updated target resource, after the update The target resource of includes the attribute value used to indicate the creation of a new device instance; the new device instance is created according to the updated target resource; the resource set of the first device instance is written into the new device instance To keep a copy of the first device instance;
所述发送模块803,用于返回第二创建成功响应;The sending module 803 is configured to return a second creation success response;
所述接收模块802,用于接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源;The receiving module 802 is configured to receive a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
所述处理模块801,用于根据所述资源更新指令,将所述第一设备实例重置为所述初始化设备实例;The processing module 801 is configured to reset the first device instance to the initialization device instance according to the resource update instruction;
所述处理模块801,还用于将所述新的设备实例置为非激活态;将所述初始化设备实例置为激活态。The processing module 801 is also used to set the new device instance to an inactive state; to set the initialized device instance to an active state.
可选的,所述处理模块801,用于:当存在所述第二设备实例时,将在所述物联网设备中已运行的第一设备实例切换至所述第二设备实例。Optionally, the processing module 801 is configured to: when the second device instance exists, switch the first device instance already running in the Internet of Things device to the second device instance.
可选的,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,Optionally, the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the security domain information possessed by the second security domain network includes the second security The ID of the OBT device of the activation tool of the domain network,
所述处理模块801,用于:确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例。The processing module 801 is configured to determine whether there is a device instance with the Owner ID consistent with the ID of the OBT device among the device instances included in the Internet of Things device.
可选的,所述接收模块802,用于在确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例之前,获取所述第二安全域网络中,除第一设备实例之外的其他设备实例的设备角色,所述第一设备实例为所述物联网设备已运行的设备实例;Optionally, the receiving module 802 is configured to obtain the second security domain before determining whether there is a device instance with the Owner ID consistent with the ID of the OBT device among the device instances included in the Internet of Things device In the network, device roles of other device instances except the first device instance, where the first device instance is a device instance that has been running on the Internet of Things device;
所述处理模块801,用于将所述其他设备实例中,设备角色为obt的设备实例所在的物联网设备确定为所述第二安全域网络的OBT设备;The processing module 801 is configured to determine the Internet of Things device where the device instance with the device role of obt is located among the other device instances as the OBT device of the second security domain network;
所述接收模块802,用于获取所述OBT设备的ID。The receiving module 802 is used to obtain the ID of the OBT device.
综上所述,本申请实施例提供的物联网设备的配置装置,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。当该创建指令包括保留指令,该物联网设备中可以同时保留有适用于第一安全域网络的第一设备实例以及适用于第二安全域网络的第二设备实例,使得当该物联网设备再重进进入第一安全域网络时,通过激活该第一设备实例便可使该物联网设备与该第一安全域网络连接,实现各种智能化场景的操作,并且,第一安全域网络和第二安全域网络中的OBT设备均可对该物联网设备进行设置,使得该物联网设备能够与第一安全域网络和第二安全域网络中的其它设备均实现互联互通。To sum up, the configuration device for the Internet of Things device provided by the embodiment of the present application can be used when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such device that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. When the creation instruction includes a reservation instruction, the first device instance applicable to the first security domain network and the second device instance applicable to the second security domain network may be retained in the Internet of Things device at the same time, so that when the Internet of Things device is re When reentering the first secure domain network, by activating the first device instance, the IoT device can be connected to the first secure domain network to realize operations in various intelligent scenarios, and the first secure domain network and All OBT devices in the second security domain network can set the IoT device, so that the IoT device can realize interconnection and intercommunication with other devices in the first security domain network and the second security domain network.
图10示出了本申请实施例提供的另一种物联网设备的配置装置,该装置可以应用于用户设备,所述装置100包括:FIG. 10 shows another device for configuring an Internet of Things device provided by an embodiment of the present application. The device can be applied to user equipment. The device 100 includes:
发送模块101,所述发送模块用于当物联网设备从第一安全域网络进入第二安全域网络时,且当所述物联网设备中不存在第二设备实例时,发送创建指令,A sending module 101, which is used to send a creation instruction when an IoT device enters a second secure domain network from a first security domain network, and when there is no second device instance in the IoT device,
其中,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致,所述创建指令用于被所述物联网设备创建初始化设备实例,所述初始化设备实例用于配置为所述第二设备实例。Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device The instance is used to configure as the second device instance.
综上所述,本申请实施例提供的物联网设备的配置装置,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。由于该创建指令能够用于被该物联网设备创建能够被第二安全域网络中的OBT设备配置为第二设备实例的初始化设备实例,使得该物联网设备能够与第二安全域网络中的其它设备互联互通。To sum up, the configuration device for the Internet of Things device provided by the embodiment of the present application can be used when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such device that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. Since the creation instruction can be used by the IoT device to create an initialization device instance that can be configured as a second device instance by the OBT device in the second security domain network, the IoT device can interact with other devices in the second security domain network. Equipment interconnection.
可选的,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,Optionally, a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
所述保留指令用于当不存在第二设备实例时,指示所述物联网设备通过保留所述第一设备实例来创建所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to create the initialization device instance by reserving the first device instance when there is no second device instance.
可选的,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,Optionally, a first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction,
所述重置指令用于当不存在第二设备实例时,指示所述物联网设备通过重置所述第一设备实例来创建所述初始化设备实例。The reset instruction is used for instructing the Internet of Things device to create the initialization device instance by resetting the first device instance when there is no second device instance.
可选的,所述保留指令用于,指示所述物联网设备保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;或者,所述保留指令用于,指示所述物联网设备保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。Optionally, the reservation instruction is used to instruct the Internet of Things device to reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance; or, the reservation The instruction is used to instruct the Internet of Things device to retain a copy of the first device instance, reset the first device instance to the initialization device instance, and the resource set of the copy of the first device instance and all The resource sets possessed by the first device instance are consistent.
可选的,所述重置指令用于,指示所述物联网设备重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。Optionally, the reset instruction is used to instruct the Internet of Things device to reset the first device instance, and use the reset first device instance as the initialization device instance.
可选的,所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建新的设备实例,初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例。Optionally, the reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction, and obtain the updated target resource, where the updated target resource includes An attribute value used to indicate the creation of a new device instance, create a new device instance according to the updated target resource, initialize the new device instance, and use the initialized new device instance as the initialization device instance .
可选的,所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建所述新的设备实例,将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例。Optionally, the reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction, and obtain the updated target resource, where the updated target resource includes The attribute value used to indicate the creation of a new device instance, the new device instance is created according to the updated target resource, and the resource collection of the first device instance is written into the new device instance to retain all A copy of the first device instance, resetting the first device instance to the initialization device instance.
可选的,所述重置指令用于,指示所述物联网设备根据所述重置指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值,根据所述更新后的目标资源,重置所述第一设备实例,将重置后的所述第一设备实例确定为所述初始化设备实例。Optionally, the reset instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reset instruction, to obtain the updated target resource, and the updated target The resource includes an attribute value for instructing to reset the first device instance, reset the first device instance according to the updated target resource, and determine the reset first device instance as the Initialize the device instance.
可选的,如图11所示,所述装置100包括:Optionally, as shown in FIG. 11, the apparatus 100 includes:
接收模块102,所述接收模块用于获取所述第一设备实例的资源集合;A receiving module 102, which is configured to obtain a resource set of the first device instance;
处理模块103,所述处理模块用于基于所述第一设备实例的资源集合确定所述第一设备实例中具有设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;The processing module 103 is configured to determine, based on the resource set of the first device instance, that the first device instance has device instance resources, and the device instance resources are used to manage the device instances in the Internet of Things device ;
所述发送模块101用于发送切换请求,所述切换请求用于指示所述设备实例资源中的切换属性为第三属性值,用于指示所述物联网设备将所述第一设备实例切换至候选设备实例,通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例;The sending module 101 is configured to send a switching request, the switching request is used to indicate that the switching attribute in the device instance resource is a third attribute value, and is used to instruct the Internet of Things device to switch the first device instance to A candidate device instance, determining whether a second device instance exists in the Internet of Things device by determining whether the candidate device instance is the second device instance;
其中,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例。Wherein, the switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance.
可选的,所述目标资源包括配置状态资源;所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。Optionally, the target resource includes a configuration state resource; the configuration state resource includes a new attribute, and the new attribute is one of a first attribute value and a second attribute value, and the first attribute value is used for Instructing to create a new device instance, and the second attribute value is used to instruct to reset the first device instance to the initialization device instance.
可选的,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;所述设备实例资源包括切换属性以及上新属性;所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;Optionally, the target resource includes a device instance resource, the device instance resource is used to manage the device instance in the Internet of Things device; the device instance resource includes a handover attribute and an updated attribute; the handover attribute is the first One of a three attribute value and a fourth attribute value, where the third attribute value is used to indicate switching device instances, and the fourth attribute value is used to indicate not switching device instances;
所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
可选的,所述接收模块102用于:所述发送创建指令之前,接收第一请求,所述第一请求为所述物联网设备在确定所述物联网设备中不存在所述第二备实例时发送的,所述第一请求用于询问保留或者重置所述第一设备实例;Optionally, the receiving module 102 is configured to: before sending the creation instruction, receive a first request, where the first request is that the Internet of Things device determines that the second device does not exist in the Internet of Things device. Sent during an instance, the first request is used to inquire to reserve or reset the first device instance;
所述发送模块101用于:发送针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,发送针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。The sending module 101 is configured to: send the creation instruction for reserving the first device instance, where the creation instruction includes a retention instruction; or, send the creation instruction for resetting the first device instance, so The creation instruction includes a reset instruction.
可选的,所述接收模块102,用于接收第一请求之前,接收第二请求;Optionally, the receiving module 102 is configured to receive a second request before receiving the first request;
所述发送模块101,用于针对所述第二请求发送第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络。The sending module 101 is configured to send a second response to the second request, and the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client.
可选的,所述接收模块102,用于接收第一创建成功响应,所述第一创建成功响应为所述物联网设备在根据所述更新后的目标资源创建新的设备实例,并初始化所述新的设备实例之后向所述用户设备返回的;Optionally, the receiving module 102 is configured to receive a first creation success response, where the first creation success response is that the IoT device creates a new device instance according to the updated target resource, and initializes all Returned to the user equipment after the new device instance;
所述发送模块101,用于根据所述第一创建成功响应发送资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源。The sending module 101 is configured to send a resource update instruction according to the first successful creation response, where the resource update instruction is used to update the configuration state resource of the first device instance.
可选的,所述接收模块102,用于接收第二创建成功响应,所述第二创建成功响应为所述物联网设备在根据所述更新后的目标资源创建所述新的设备实例,并将所述第一设备实例的资源集合写入所述新的设备实例之后返回的;Optionally, the receiving module 102 is configured to receive a second creation success response, where the second creation success response is that the IoT device creates the new device instance according to the updated target resource, and Returned after writing the resource set of the first device instance into the new device instance;
所述发送模块101,用于根据所述第二创建成功响应发送资源更新指令,所述资源更新指令用于更 新所述第一设备实例的配置状态资源。The sending module 101 is configured to send a resource update instruction according to the second creation success response, where the resource update instruction is used to update the configuration state resource of the first device instance.
可选的,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,Optionally, the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the security domain information possessed by the second security domain network includes the second security The ID of the OBT device of the activation tool of the domain network,
所述第二设备实例所配置的安全域信息与第二安全域网络具有的安全域信息一致包括所述第二设备实例的所有者Owner的识别符ID与所述第二安全域网络的激活工具OBT设备的ID一致。The security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, including the identifier ID of the owner of the second device instance and the activation tool of the second security domain network The IDs of the OBT devices are the same.
综上所述,本申请实施例提供的物联网设备的配置装置,通过在物联网设备从第一安全域网络进入第二安全域网络时,且当该物联网设备确定其中不存在能够被该第二安全域网络中的OBT设备配置的第二设备实例时,发送创建指令创建。当该创建指令包括保留指令,该物联网设备中可以同时保留有适用于第一安全域网络的第一设备实例以及适用于第二安全域网络的第二设备实例,使得当该物联网设备再重进进入第一安全域网络时,通过激活该第一设备实例便可使该物联网设备与该第一安全域网络连接,实现各种智能化场景的操作,并且,第一安全域网络和第二安全域网络中的OBT设备均可对该物联网设备进行设置,使得该物联网设备能够与第一安全域网络和第二安全域网络中的其它设备均实现互联互通。To sum up, the configuration device for the Internet of Things device provided by the embodiment of the present application can be used when the Internet of Things device enters the second security domain network from the first security domain network, and when the Internet of Things device determines that there is no such device that can be used by the Internet of Things device. When configuring the second device instance of the OBT device in the second security domain network, send a creation instruction to create it. When the creation instruction includes a reservation instruction, the first device instance applicable to the first security domain network and the second device instance applicable to the second security domain network may be retained in the Internet of Things device at the same time, so that when the Internet of Things device is re When reentering the first secure domain network, by activating the first device instance, the IoT device can be connected to the first secure domain network to realize operations in various intelligent scenarios, and the first secure domain network and All OBT devices in the second security domain network can set the IoT device, so that the IoT device can realize interconnection and intercommunication with other devices in the first security domain network and the second security domain network.
请参考图12,其示出了本申请一个示例性实施例提供的用户设备或者物联网设备的结构示意图,该通信设备包括:处理器1201、接收器1202、发射器1203、存储器1204和总线1205。Please refer to FIG. 12, which shows a schematic structural diagram of a user equipment or Internet of Things device provided by an exemplary embodiment of the present application. The communication device includes a processor 1201, a receiver 1202, a transmitter 1203, a memory 1204, and a bus 1205. .
处理器1201包括一个或者一个以上处理核心,处理器1201通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。The processor 1201 includes one or more processing cores, and the processor 1201 executes various functional applications and information processing by running software programs and modules.
接收器1202和发射器1203可以实现为一个通信组件,该通信组件可以是一块通信芯片。The receiver 1202 and the transmitter 1203 may be implemented as a communication component, and the communication component may be a communication chip.
存储器1204通过总线1205与处理器1201相连。The memory 1204 is connected to the processor 1201 through a bus 1205.
存储器1204可用于存储至少一个指令,处理器1201用于执行该至少一个指令,以实现上述各个方法实施例中的第一IAB网络设备执行的各个步骤。The memory 1204 may be used to store at least one instruction, and the processor 1201 is used to execute the at least one instruction, so as to implement each step performed by the first IAB network device in the foregoing method embodiments.
此外,存储器1204可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),静态随时存取存储器(SRAM),只读存储器(ROM),磁存储器,快闪存储器,可编程只读存储器(PROM)。In addition, the memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof. The volatile or non-volatile storage device includes, but is not limited to: magnetic disks or optical disks, electrically erasable and programmable Read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static anytime access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, programmable read-only memory (PROM) .
本申请提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现上述各个方法实施例提供的物联网设备的配置方法。The present application provides a computer-readable storage medium in which at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the configuration of the Internet of Things device provided by the foregoing various method embodiments method.
本申请还提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述各个方法实施例提供的非授权频谱上的数据传输方法。This application also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the data transmission method on the unlicensed spectrum provided by the foregoing method embodiments.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in one or more of the foregoing examples, the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of this application and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within range.

Claims (73)

  1. 一种物联网设备的配置方法,其特征在于,所述方法应用于物联网设备,所述方法包括:A method for configuring an Internet of Things device, characterized in that the method is applied to an Internet of Things device, and the method includes:
    当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致;When the IoT device enters the second security domain network from the first security domain network, it is determined whether there is a second device instance in the IoT device, and the security domain information configured by the second device instance is identical to the first security domain information. 2. The security domain information possessed by the security domain network is consistent;
    当不存在所述第二设备实例时,接收创建指令;When the second device instance does not exist, receive a creation instruction;
    根据所述创建指令,创建初始化设备实例,所述初始化设备实例用于被所述第二安全域网络的激活工具OBT设备配置为所述第二设备实例。According to the creation instruction, an initialization device instance is created, and the initialization device instance is used to be configured as the second device instance by the activation tool OBT device of the second security domain network.
  2. 根据权利要求1所述的方法,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,The method according to claim 1, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
    所述创建初始化设备实例,包括:The creation of an initialization device instance includes:
    当接收到所述保留指令,通过保留所述第一设备实例来创建所述初始化设备实例。When the reservation instruction is received, the initialization device instance is created by reserving the first device instance.
  3. 根据权利要求1或2所述的方法,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,The method according to claim 1 or 2, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction,
    所述创建初始化设备实例,包括:The creation of an initialization device instance includes:
    当接收到所述重置指令,通过重置所述第一设备实例来创建所述初始化设备实例。When the reset instruction is received, the initialization device instance is created by resetting the first device instance.
  4. 根据权利要求2所述的方法,其特征在于,所述当接收到所述保留指令,通过保留所述第一设备实例来创建所述初始化设备实例,包括:3. The method according to claim 2, wherein when the reservation instruction is received, creating the initialization device instance by reserving the first device instance comprises:
    当接收到所述保留指令,保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;When receiving the reservation instruction, reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance;
    当接收到所述保留指令,保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。When the reservation instruction is received, the copy of the first device instance is reserved, the first device instance is reset to the initialization device instance, and the resource set of the copy of the first device instance is the same as that of the first device instance. A device instance has the same set of resources.
  5. 根据权利要求3所述的方法,其特征在于,所述当接收到所述重置指令,通过重置所述第一设备实例来创建所述初始化设备实例,包括:3. The method according to claim 3, wherein the creating the initialization device instance by resetting the first device instance when the reset instruction is received comprises:
    当接收到所述重置指令,重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。When the reset instruction is received, the first device instance is reset, and the reset first device instance is used as the initialization device instance.
  6. 根据权利要求4所述的方法,其特征在于,所述当接收到所述保留指令,保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例,包括:The method according to claim 4, wherein when the reservation instruction is received, the first device instance is reserved, a new device instance is created, and the new device instance is used as the initialization device instance ,include:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建新的设备实例;Create a new device instance according to the updated target resource;
    初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;Initialize the new device instance, and use the initialized new device instance as the initialized device instance;
    所述方法还包括:The method also includes:
    将所述第一设备实例置为非激活态;Setting the first device instance to an inactive state;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  7. 根据权利要求4所述的方法,其特征在于,所述当接收到所述保留指令,保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,包括:The method according to claim 4, wherein when the reservation instruction is received, retaining a copy of the first device instance, and resetting the first device instance to the initialization device instance, comprises :
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建所述新的设备实例;Creating the new device instance according to the updated target resource;
    将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;Writing the resource set of the first device instance to the new device instance, so as to retain a copy of the first device instance;
    将所述第一设备实例重置为所述初始化设备实例;Reset the first device instance to the initialization device instance;
    所述方法还包括:The method also includes:
    将所述新的设备实例置为非激活态;Placing the new device instance in an inactive state;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  8. 根据权利要求5所述的方法,其特征在于,所述当接收到所述重置指令,重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例,包括:The method according to claim 5, wherein the resetting the first device instance when the reset instruction is received, and using the reset first device instance as the initialization device instance, comprises:
    当接收到所述重置指令,根据所述重置指令更新所述第一设备实例的目标资源;When the reset instruction is received, update the target resource of the first device instance according to the reset instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct to reset the first device instance;
    根据所述更新后的目标资源,重置所述第一设备实例;Reset the first device instance according to the updated target resource;
    将重置后的所述第一设备实例确定为所述初始化设备实例;Determining the reset first device instance as the initialization device instance;
    所述方法还包括:The method also includes:
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  9. 根据权利要求4所述的方法,其特征在于,所述当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,包括:The method according to claim 4, wherein the determining whether there is a second device instance in the Internet of Things device when the Internet of Things device enters the second security domain network from the first security domain network comprises :
    当所述物联网设备从第一安全域网络进入第二安全域网络时,接收切换请求,所述切换请求用于指示设备实例资源中的切换属性为第三属性值,其中,所述设备实例资源用于管理所述物联网设备中的设备实例,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;When the Internet of Things device enters the second security domain network from the first security domain network, it receives a handover request, where the handover request is used to indicate that the handover attribute in the device instance resource is a third attribute value, where the device instance The resource is used to manage the device instance in the Internet of Things device, the switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate the switching device instance, the fourth attribute The value is used to indicate that the device instance is not to be switched;
    根据所述切换请求将所述第一设备实例切换至候选设备实例;Switch the first device instance to a candidate device instance according to the switch request;
    通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例。By determining whether the candidate device instance is the second device instance, it is determined whether there is a second device instance in the Internet of Things device.
  10. 根据权利要求9所述的方法,其特征在于,所述通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例,包括:The method according to claim 9, wherein the determining whether a second device instance exists in the Internet of Things device by determining whether the candidate device instance is the second device instance comprises:
    当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息不一致时,确定所述候选设备实例不为所述第二设备实例,所述物联网设备中不存在所述第二设备实例;When the security domain information configured by the candidate device instance is inconsistent with the security domain information of the second security domain network, it is determined that the candidate device instance is not the second device instance, and the IoT device does not There is an instance of the second device;
    当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致时,确定所述候选设备实例为所述第二设备实例,所述物联网设备中存在所述第二设备实例。When the security domain information configured by the candidate device instance is consistent with the security domain information possessed by the second security domain network, it is determined that the candidate device instance is the second device instance, and all the IoT devices exist The second device example.
  11. 根据权利要求6至8任一所述的方法,其特征在于,所述目标资源包括配置状态资源;The method according to any one of claims 6 to 8, wherein the target resource comprises a configuration state resource;
    所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The configuration state resource includes a new attribute, the new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value Used to instruct to reset the first device instance to the initialization device instance.
  12. 根据权利要求6至10任一所述的方法,其特征在于,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;The method according to any one of claims 6 to 10, wherein the target resource comprises a device instance resource, and the device instance resource is used to manage a device instance in the Internet of Things device;
    所述设备实例资源包括切换属性以及上新属性;The device instance resources include handover attributes and updated attributes;
    所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;The switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance;
    所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
  13. 根据权利要求11所述的方法,其特征在于,所述接收创建指令之前,所述方法包括:The method according to claim 11, characterized in that, before the receiving the creation instruction, the method comprises:
    当不存在所述第二设备实例时,触发第一请求,所述第一请求用于询问保留或者重置所述第一设备实例;When the second device instance does not exist, trigger a first request, where the first request is used to inquire to reserve or reset the first device instance;
    所述接收创建指令,包括:The receiving creation instruction includes:
    接收针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,Receiving the creation instruction for retaining the first device instance, where the creation instruction includes a retaining instruction; or,
    接收针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。Receiving the creation instruction for resetting the first device instance, where the creation instruction includes a reset instruction.
  14. 根据权利要求13所述的方法,其特征在于,所述触发第一请求之前,所述方法包括:The method according to claim 13, wherein before the triggering of the first request, the method comprises:
    当不存在所述第一设备实例时,触发第二请求;When the first device instance does not exist, trigger a second request;
    接收针对所述第二请求的第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络;Receiving a second response to the second request, where the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client;
    判断所述物联网设备是否存储有所述目标资源;Judging whether the target resource is stored in the Internet of Things device;
    所述触发第一请求包括:The triggering of the first request includes:
    当所述物联网设备存储有所述目标资源时,触发所述第一请求。When the target resource is stored in the Internet of Things device, the first request is triggered.
  15. 根据权利要求12所述的方法,其特征在于,所述当接收到所述保留指令,保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例,包括:The method according to claim 12, wherein when the reservation instruction is received, the first device instance is reserved, a new device instance is created, and the new device instance is used as the initialization device instance ,include:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建新的设备实例;Create a new device instance according to the updated target resource;
    初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;Initialize the new device instance, and use the initialized new device instance as the initialized device instance;
    返回第一创建成功响应;Return the first successful creation response;
    接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源;Receiving a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
    所述方法还包括:The method also includes:
    根据所述资源更新指令,将所述第一设备实例置为非激活态;Setting the first device instance to an inactive state according to the resource update instruction;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  16. 根据权利要求12所述的方法,其特征在于,所述当接收到所述保留指令,保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,包括:The method according to claim 12, wherein when receiving the reservation instruction, retaining a copy of the first device instance, and resetting the first device instance to the initialization device instance, comprises :
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建所述新的设备实例;Creating the new device instance according to the updated target resource;
    将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;Writing the resource set of the first device instance to the new device instance, so as to retain a copy of the first device instance;
    返回第二创建成功响应;Return the second creation success response;
    接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源;Receiving a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
    根据所述资源更新指令,将所述第一设备实例重置为所述初始化设备实例;Reset the first device instance to the initialization device instance according to the resource update instruction;
    所述方法还包括:The method also includes:
    将所述新的设备实例置为非激活态;Placing the new device instance in an inactive state;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  17. 根据权利要求1至16任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 16, wherein the method further comprises:
    当存在所述第二设备实例时,将在所述物联网设备中已运行的第一设备实例切换至所述第二设备实例。When the second device instance exists, the first device instance that has been running in the Internet of Things device is switched to the second device instance.
  18. 根据权利要求1至17任一所述的方法,其特征在于,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,The method according to any one of claims 1 to 17, wherein the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the second security The security domain information possessed by the domain network includes the ID of the activation tool OBT device of the second security domain network,
    所述确定所述物联网设备中是否存在第二设备实例,包括:The determining whether there is a second device instance in the Internet of Things device includes:
    确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例。It is determined whether there is a device instance whose Owner ID is consistent with the ID of the OBT device among the device instances included in the Internet of Things device.
  19. 根据权利要求18所述的方法,其特征在于,所述确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例之前,所述方法包括:The method according to claim 18, wherein before the determining whether there is a device instance with the Owner ID consistent with the ID of the OBT device among the device instances included in the Internet of Things device, the method comprises:
    获取所述第二安全域网络中,除第一设备实例之外的其他设备实例的设备角色,所述第一设备实例为所述物联网设备已运行的设备实例;Acquiring device roles of device instances other than the first device instance in the second security domain network, where the first device instance is a device instance that is already running on the Internet of Things device;
    将所述其他设备实例中,设备角色为obt的设备实例所在的物联网设备确定为所述第二安全域网络的OBT设备;Determining, among the other device instances, the Internet of Things device where the device instance with the device role of obt is located as the OBT device of the second security domain network;
    获取所述OBT设备的ID。Obtain the ID of the OBT device.
  20. 一种物联网设备的配置方法,其特征在于,所述方法应用于用户设备,所述方法包括:A method for configuring an Internet of Things device, characterized in that the method is applied to user equipment, and the method includes:
    当物联网设备从第一安全域网络进入第二安全域网络时,且当所述物联网设备中不存在第二设备实例时,发送创建指令,When the IoT device enters the second secure domain network from the first secure domain network, and when there is no second device instance in the IoT device, send a creation instruction,
    其中,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致,所述创建指令用于被所述物联网设备创建初始化设备实例,所述初始化设备实例用于配置为所述第二设备实例。Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device The instance is used to configure as the second device instance.
  21. 根据权利要求20所述的方法,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,The method according to claim 20, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
    所述保留指令用于当不存在第二设备实例时,指示所述物联网设备通过保留所述第一设备实例来创建所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to create the initialization device instance by reserving the first device instance when there is no second device instance.
  22. 根据权利要求20所述的方法,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,The method according to claim 20, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction,
    所述重置指令用于当接收到所述重置指令,通过重置所述第一设备实例来创建所述初始化设备实例。The reset instruction is used for creating the initialization device instance by resetting the first device instance when the reset instruction is received.
  23. 根据权利要求21所述的方法,其特征在于,The method of claim 21, wherein:
    所述保留指令用于,指示所述物联网设备保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;The reservation instruction is used to instruct the Internet of Things device to reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance;
    或者,or,
    所述保留指令用于,指示所述物联网设备保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。The reservation instruction is used to instruct the Internet of Things device to reserve a copy of the first device instance, reset the first device instance to the initialization device instance, and the resources that the copy of the first device instance has The set is consistent with the resource set possessed by the first device instance.
  24. 根据权利要求22所述的方法,其特征在于,所述重置指令用于,指示所述物联网设备重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。The method according to claim 22, wherein the reset instruction is used to instruct the Internet of Things device to reset the first device instance, and use the reset first device instance as the initialization device instance .
  25. 根据权利要求23所述的方法,其特征在于,The method of claim 23, wherein:
    所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建新的设备实例,初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction to obtain the updated target resource, and the updated target resource includes instructions for instructing creation For the attribute value of the new device instance, create a new device instance according to the updated target resource, initialize the new device instance, and use the initialized new device instance as the initialization device instance.
  26. 根据权利要求23所述的方法,其特征在于,The method of claim 23, wherein:
    所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建所述新的设备实例,将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction to obtain the updated target resource, and the updated target resource includes instructions for instructing creation The attribute value of the new device instance, the new device instance is created according to the updated target resource, and the resource set of the first device instance is written into the new device instance to reserve the first device A copy of the instance, resetting the first device instance to the initialization device instance.
  27. 根据权利要求24所述的方法,其特征在于,The method of claim 24, wherein:
    所述重置指令用于,指示所述物联网设备根据所述重置指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值,根据所述更新后的目标资源,重置所述第一设备实例,将重置后的所述第一设备实例确定为所述初始化设备实例。The reset instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reset instruction to obtain the updated target resource, and the updated target resource includes Instructing to reset the attribute value of the first device instance, reset the first device instance according to the updated target resource, and determine the reset first device instance as the initialization device instance.
  28. 根据权利要求23所述的方法,其特征在于,所述方法包括:The method of claim 23, wherein the method comprises:
    获取所述第一设备实例的资源集合;Acquiring the resource collection of the first device instance;
    基于所述第一设备实例的资源集合确定所述第一设备实例中具有设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;Determining, based on the resource set of the first device instance, that the first device instance has device instance resources, and the device instance resources are used to manage the device instances in the Internet of Things device;
    发送切换请求,所述切换请求用于指示设备实例资源中的切换属性为第三属性值,用于指示所述物联网设备将所述第一设备实例切换至候选设备实例,通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例;Send a handover request, where the handover request is used to indicate that the handover attribute in the device instance resource is a third attribute value, and is used to instruct the Internet of Things device to switch the first device instance to a candidate device instance by determining Whether the device instance is the second device instance, to determine whether there is a second device instance in the Internet of Things device;
    其中,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例。Wherein, the switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance.
  29. 根据权利要求21至27任一所述的方法,其特征在于,所述目标资源包括配置状态资源;The method according to any one of claims 21 to 27, wherein the target resource comprises a configuration state resource;
    所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The configuration state resource includes a new attribute, the new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value Used to instruct to reset the first device instance to the initialization device instance.
  30. 根据权利要求21至28任一所述的方法,其特征在于,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;The method according to any one of claims 21 to 28, wherein the target resource comprises a device instance resource, and the device instance resource is used to manage a device instance in the Internet of Things device;
    所述设备实例资源包括切换属性以及上新属性;The device instance resources include handover attributes and updated attributes;
    所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;The switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance;
    所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
  31. 根据权利要求21至26任一所述的方法,其特征在于,所述发送创建指令之前,所述方法包括:The method according to any one of claims 21 to 26, characterized in that, before the sending the creation instruction, the method comprises:
    接收第一请求,所述第一请求为所述物联网设备在确定所述物联网设备中不存在所述第二设备实例时发送的,所述第一请求用于询问保留或者重置所述第一备实例;A first request is received, the first request is sent by the Internet of Things device when it is determined that the second device instance does not exist in the Internet of Things device, and the first request is used to query to reserve or reset the The first example;
    所述发送所述创建请求,包括:The sending of the creation request includes:
    发送针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,Sending the creation instruction for reserving the first device instance, where the creation instruction includes a reserving instruction; or,
    发送针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。Send the creation instruction for resetting the first device instance, where the creation instruction includes a reset instruction.
  32. 根据权利要求31所述的方法,其特征在于,所述接收第一请求之前,所述方法包括:The method according to claim 31, wherein before the receiving the first request, the method comprises:
    接收第二请求;Receive the second request;
    针对所述第二请求发送第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络。A second response is sent to the second request, where the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client.
  33. 根据权利要求30所述的方法,其特征在于,所述方法包括:The method of claim 30, wherein the method comprises:
    接收第一创建成功响应,所述第一创建成功响应为所述物联网设备在根据所述更新后的目标资源创建新的设备实例,并初始化所述新的设备实例之后向所述用户设备返回的;Receive a first creation success response, where the first creation success response is that the Internet of Things device creates a new device instance according to the updated target resource, and returns to the user equipment after initializing the new device instance of;
    根据所述第一创建成功响应发送资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源。A resource update instruction is sent according to the first successful creation response, where the resource update instruction is used to update the configuration state resource of the first device instance.
  34. 根据权利要求30所述的方法,其特征在于,所述方法包括:The method of claim 30, wherein the method comprises:
    接收第二创建成功响应,所述第二创建成功响应为所述物联网设备在根据所述更新后的目标资源创建所述新的设备实例,并将所述第一设备实例的资源集合写入所述新的设备实例之后返回的;A second creation success response is received, where the second creation success response is that the Internet of Things device creates the new device instance according to the updated target resource, and writes the resource set of the first device instance Returned after the new device instance;
    根据所述第二创建成功响应发送资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源。A resource update instruction is sent according to the second creation success response, where the resource update instruction is used to update the configuration state resource of the first device instance.
  35. 根据权利要求21至34任一所述的方法,其特征在于,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,The method according to any one of claims 21 to 34, wherein the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the second security The security domain information possessed by the domain network includes the ID of the activation tool OBT device of the second security domain network,
    所述第二设备实例所配置的安全域信息与第二安全域网络具有的安全域信息一致包括所述第二设备实例的所有者Owner的识别符ID与所述第二安全域网络的激活工具OBT设备的ID一致。The security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, including the identifier ID of the owner of the second device instance and the activation tool of the second security domain network The IDs of the OBT devices are the same.
  36. 一种物联网设备的配置装置,其特征在于,所述装置应用于物联网设备,所述装置包括:A configuration device for Internet of Things equipment, characterized in that the device is applied to Internet of Things equipment, and the device includes:
    处理模块,所述处理模块用于当所述物联网设备从第一安全域网络进入第二安全域网络时,确定所述物联网设备中是否存在第二设备实例,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致;Processing module, the processing module is used to determine whether there is a second device instance in the Internet of Things device when the Internet of Things device enters the second security domain network from the first security domain network. The configured security domain information is consistent with the security domain information possessed by the second security domain network;
    接收模块,所述接收模块用于当不存在所述第二设备实例时,接收创建指令;A receiving module configured to receive a creation instruction when the second device instance does not exist;
    所述处理模块用于根据所述创建指令,创建初始化设备实例,所述初始化设备实例用于被所述第二安全域网络的激活工具OBT设备配置为所述第二设备实例。The processing module is configured to create an initialization device instance according to the creation instruction, and the initialization device instance is used to be configured as the second device instance by an activation tool OBT device of the second security domain network.
  37. 根据权利要求36所述的装置,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,The apparatus according to claim 36, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
    所述处理模块,用于:当接收到所述保留指令,通过保留所述第一设备实例来创建所述初始化设备实例。The processing module is configured to: when the reservation instruction is received, create the initialization device instance by reserving the first device instance.
  38. 根据权利要求36或37所述的装置,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,The apparatus according to claim 36 or 37, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction,
    所述处理模块,用于:当接收到所述重置指令,通过重置所述第一设备实例来创建所述初始化设备实例。The processing module is configured to: when the reset instruction is received, create the initialization device instance by resetting the first device instance.
  39. 根据权利要求38所述的装置,其特征在于,所述处理模块,用于:The device according to claim 38, wherein the processing module is configured to:
    当接收到所述保留指令,保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;When receiving the reservation instruction, reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance;
    当接收到所述保留指令,保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。When the reservation instruction is received, the copy of the first device instance is reserved, the first device instance is reset to the initialization device instance, and the resource set of the copy of the first device instance is the same as that of the first device instance. A device instance has the same set of resources.
  40. 根据权利要求38所述的装置,其特征在于,所述处理模块,用于:The device according to claim 38, wherein the processing module is configured to:
    当接收到所述重置指令,重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。When the reset instruction is received, the first device instance is reset, and the reset first device instance is used as the initialization device instance.
  41. 根据权利要求39所述的装置,其特征在于,所述处理模块,用于:The device according to claim 39, wherein the processing module is configured to:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建新的设备实例;Create a new device instance according to the updated target resource;
    初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;Initialize the new device instance, and use the initialized new device instance as the initialized device instance;
    所述处理模块,还用于:将所述第一设备实例置为非激活态;将所述初始化设备实例置为激活态。The processing module is further configured to: set the first device instance to an inactive state; set the initialization device instance to an active state.
  42. 根据权利要求39所述的装置,其特征在于,所述处理模块,用于:The device according to claim 39, wherein the processing module is configured to:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建所述新的设备实例;Creating the new device instance according to the updated target resource;
    将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;Writing the resource set of the first device instance to the new device instance, so as to retain a copy of the first device instance;
    将所述第一设备实例重置为所述初始化设备实例;Reset the first device instance to the initialization device instance;
    所述处理模块,还用于:将所述新的设备实例置为非激活态;将所述初始化设备实例置为激活态。The processing module is further configured to: set the new device instance to an inactive state; and set the initialized device instance to an active state.
  43. 根据权利要求40所述的装置,其特征在于,所述处理模块,用于:The device according to claim 40, wherein the processing module is configured to:
    当接收到所述重置指令,根据所述重置指令更新所述第一设备实例的目标资源;When the reset instruction is received, update the target resource of the first device instance according to the reset instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct to reset the first device instance;
    根据所述更新后的目标资源,重置所述所述第一设备实例;Reset the first device instance according to the updated target resource;
    将重置后的所述第一设备实例确定为所述初始化设备实例;Determining the reset first device instance as the initialization device instance;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  44. 根据权利要求39所述的装置,其特征在于,所述接收模块,用于:The device according to claim 39, wherein the receiving module is configured to:
    当所述物联网设备从第一安全域网络进入第二安全域网络时,接收切换请求,所述切换请求用于指示设备实例资源中的切换属性为第三属性值,其中,所述设备实例资源用于管理所述物联网设备中的设备实例,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;When the Internet of Things device enters the second security domain network from the first security domain network, it receives a handover request, where the handover request is used to indicate that the handover attribute in the device instance resource is a third attribute value, where the device instance The resource is used to manage the device instance in the Internet of Things device, the switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate the switching device instance, the fourth attribute The value is used to indicate that the device instance is not to be switched;
    所述处理模块用于:The processing module is used for:
    根据所述切换请求将所述第一设备实例切换至候选设备实例;Switch the first device instance to a candidate device instance according to the switch request;
    通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例。By determining whether the candidate device instance is the second device instance, it is determined whether there is a second device instance in the Internet of Things device.
  45. 根据权利要求44所述的装置,其特征在于,所述处理模块,用于:The device according to claim 44, wherein the processing module is configured to:
    当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息不一致时,确定所述候选设备实例不为所述第二设备实例,所述物联网设备中不存在所述第二设备实例;When the security domain information configured by the candidate device instance is inconsistent with the security domain information of the second security domain network, it is determined that the candidate device instance is not the second device instance, and the IoT device does not There is an instance of the second device;
    当所述候选设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致时,确定所述候选设备实例为所述第二设备实例,所述物联网设备中存在所述第二设备实例。When the security domain information configured by the candidate device instance is consistent with the security domain information possessed by the second security domain network, it is determined that the candidate device instance is the second device instance, and all the IoT devices exist The second device example.
  46. 根据权利要求41至43任一所述的装置,其特征在于,所述目标资源包括配置状态资源;The device according to any one of claims 41 to 43, wherein the target resource comprises a configuration state resource;
    所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The configuration state resource includes a new attribute, the new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value Used to instruct to reset the first device instance to the initialization device instance.
  47. 根据权利要求41至45任一所述的装置,其特征在于,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;The apparatus according to any one of claims 41 to 45, wherein the target resource comprises a device instance resource, and the device instance resource is used to manage a device instance in the Internet of Things device;
    所述设备实例资源包括切换属性以及上新属性;The device instance resources include handover attributes and updated attributes;
    所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;The switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance;
    所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
  48. 根据权利要求47所述的装置,其特征在于,所述装置包括:The device according to claim 47, wherein the device comprises:
    发送模块,所述发送模块用于在接收创建指令之前,当不存在所述第二设备实例时,触发第一请求,所述第一请求用于询问保留或者重置所述第一设备实例;A sending module, the sending module is configured to trigger a first request when the second device instance does not exist before receiving the creation instruction, and the first request is used to inquire to reserve or reset the first device instance;
    所述接收模块,用于:The receiving module is used to:
    接收针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,Receiving the creation instruction for retaining the first device instance, where the creation instruction includes a retaining instruction; or,
    接收针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。Receiving the creation instruction for resetting the first device instance, where the creation instruction includes a reset instruction.
  49. 根据权利要求48所述的装置,其特征在于,The device of claim 48, wherein:
    所述发送模块,用于在触发第一请求之前,当不存在所述第一设备实例时,触发第二请求;The sending module is configured to trigger a second request when the first device instance does not exist before triggering the first request;
    所述接收模块,用于接收针对所述第二请求的第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络;The receiving module is configured to receive a second response to the second request, where the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client;
    所述处理模块,用于判断所述物联网设备是否存储有所述目标资源;The processing module is configured to determine whether the target resource is stored in the Internet of Things device;
    所述发送模块,用于当所述物联网设备存储有所述目标资源时,触发所述第一请求。The sending module is configured to trigger the first request when the target resource is stored in the Internet of Things device.
  50. 根据权利要求47所述的装置,其特征在于,所述处理模块,用于:The device according to claim 47, wherein the processing module is configured to:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建新的设备实例;Create a new device instance according to the updated target resource;
    初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例;Initialize the new device instance, and use the initialized new device instance as the initialized device instance;
    所述发送模块,用于返回第一创建成功响应;The sending module is used to return the first successful creation response;
    所述接收模块,用于接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源;The receiving module is configured to receive a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
    所述处理模块,还用于:The processing module is also used for:
    根据所述资源更新指令,将所述第一设备实例置为非激活态;Setting the first device instance to an inactive state according to the resource update instruction;
    将所述初始化设备实例置为激活态。Put the initialization device instance into an active state.
  51. 根据权利要求47所述的装置,其特征在于,所述处理模块,用于:The device according to claim 47, wherein the processing module is configured to:
    当接收到所述保留指令,根据所述保留指令更新所述第一设备实例的目标资源;When receiving the reservation instruction, update the target resource of the first device instance according to the reservation instruction;
    获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值;Acquiring the updated target resource, where the updated target resource includes an attribute value used to instruct the creation of a new device instance;
    根据所述更新后的目标资源创建所述新的设备实例;Creating the new device instance according to the updated target resource;
    将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本;Writing the resource set of the first device instance to the new device instance, so as to retain a copy of the first device instance;
    所述发送模块,用于返回第二创建成功响应;The sending module is configured to return a second creation success response;
    所述接收模块,用于接收资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源;The receiving module is configured to receive a resource update instruction, where the resource update instruction is used to update the configuration state resource of the first device instance;
    所述处理模块,用于根据所述资源更新指令,将所述第一设备实例重置为所述初始化设备实例;The processing module is configured to reset the first device instance to the initialization device instance according to the resource update instruction;
    所述处理模块,还用于将所述新的设备实例置为非激活态;将所述初始化设备实例置为激活态。The processing module is also used to set the new device instance to an inactive state; to set the initialized device instance to an active state.
  52. 根据权利要求36至51任一所述的装置,其特征在于,所述处理模块,用于:The device according to any one of claims 36 to 51, wherein the processing module is configured to:
    当存在所述第二设备实例时,将在所述物联网设备中已运行的第一设备实例切换至所述第二设备实例。When the second device instance exists, the first device instance that has been running in the Internet of Things device is switched to the second device instance.
  53. 根据权利要求36至52任一所述的装置,其特征在于,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,The apparatus according to any one of claims 36 to 52, wherein the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the second security The security domain information possessed by the domain network includes the ID of the activation tool OBT device of the second security domain network,
    所述处理模块,用于:The processing module is used for:
    确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例。It is determined whether there is a device instance whose Owner ID is consistent with the ID of the OBT device among the device instances included in the Internet of Things device.
  54. 根据权利要求53所述的装置,其特征在于,The device of claim 53, wherein:
    所述接收模块,用于在确定所述物联网设备包括的设备实例中是否存在所述Owner ID与所述OBT设备的ID一致的设备实例之前,获取所述第二安全域网络中,除第一设备实例之外的其他设备实例的设备角色,所述第一设备实例为所述物联网设备已运行的设备实例;The receiving module is configured to, before determining whether there is a device instance with the Owner ID consistent with the ID of the OBT device among the device instances included in the Internet of Things device, obtain the second security domain network, except for A device role of a device instance other than a device instance, where the first device instance is a device instance on which the Internet of Things device has been running;
    所述处理模块,用于将所述其他设备实例中,设备角色为obt的设备实例所在的物联网设备确定为所述第二安全域网络的OBT设备;The processing module is configured to determine the Internet of Things device where the device instance with the device role of obt is located among the other device instances as the OBT device of the second security domain network;
    所述接收模块,用于获取所述OBT设备的ID。The receiving module is used to obtain the ID of the OBT device.
  55. 一种物联网设备的配置装置,其特征在于,所述装置应用于用户设备,所述装置包括:A configuration device for Internet of Things equipment, characterized in that the device is applied to user equipment, and the device includes:
    发送模块,所述发送模块用于当物联网设备从第一安全域网络进入第二安全域网络时,且当所述物联网设备中不存在第二设备实例时,发送创建指令,A sending module, which is used to send a creation instruction when the IoT device enters the second secure domain network from the first security domain network, and when there is no second device instance in the IoT device,
    其中,所述第二设备实例所配置的安全域信息与所述第二安全域网络具有的安全域信息一致,所述创建指令用于被所述物联网设备创建初始化设备实例,所述初始化设备实例用于配置为所述第二设备实例。Wherein, the security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, and the creation instruction is used to create an initialization device instance by the Internet of Things device, and the initialization device The instance is used to configure as the second device instance.
  56. 根据权利要求55所述的装置,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括保留指令,The apparatus according to claim 55, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reservation instruction,
    所述保留指令用于当不存在第二设备实例时,指示所述物联网设备通过保留所述第一设备实例来创建所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to create the initialization device instance by reserving the first device instance when there is no second device instance.
  57. 根据权利要求55所述的装置,其特征在于,所述物联网设备中已运行有第一设备实例,所述创建指令包括重置指令,The apparatus according to claim 55, wherein a first device instance is already running in the Internet of Things device, and the creation instruction includes a reset instruction,
    所述重置指令用于当不存在第二设备实例时,指示所述物联网设备通过重置所述第一设备实例来创建所述初始化设备实例。The reset instruction is used for instructing the Internet of Things device to create the initialization device instance by resetting the first device instance when there is no second device instance.
  58. 根据权利要求56所述的装置,其特征在于,The device of claim 56, wherein:
    所述保留指令用于,指示所述物联网设备保留所述第一设备实例,创建新的设备实例,将所述新的设备实例作为所述初始化设备实例;The reservation instruction is used to instruct the Internet of Things device to reserve the first device instance, create a new device instance, and use the new device instance as the initialization device instance;
    或者,or,
    所述保留指令用于,指示所述物联网设备保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例,所述第一设备实例的副本具有的资源集合与所述第一设备实例具有的资源集合一致。The reservation instruction is used to instruct the Internet of Things device to reserve a copy of the first device instance, reset the first device instance to the initialization device instance, and the resources that the copy of the first device instance has The set is consistent with the resource set possessed by the first device instance.
  59. 根据权利要求56所述的装置,其特征在于,所述重置指令用于,指示所述物联网设备重置所述第一设备实例,将重置后第一设备实例作为所述初始化设备实例。The apparatus according to claim 56, wherein the reset instruction is used to instruct the Internet of Things device to reset the first device instance, and use the reset first device instance as the initialization device instance .
  60. 根据权利要求58所述的装置,其特征在于,The device of claim 58, wherein:
    所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建新的设备实例,初始化所述新的设备实例,将初始化后的所述新的设备实例作为所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction to obtain the updated target resource, and the updated target resource includes instructions for instructing creation For the attribute value of the new device instance, create a new device instance according to the updated target resource, initialize the new device instance, and use the initialized new device instance as the initialization device instance.
  61. 根据权利要求58所述的装置,其特征在于,The device of claim 58, wherein:
    所述保留指令用于,指示所述物联网设备根据所述保留指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示创建新的设备实例的属性值,根据所述更新后的目标资源创建所述新的设备实例,将所述第一设备实例的资源集合写入所述新的设备实例,以保留所述第一设备实例的副本,将所述第一设备实例重置为所述初始化设备实例。The reservation instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reservation instruction to obtain the updated target resource, and the updated target resource includes instructions for instructing creation The attribute value of the new device instance, the new device instance is created according to the updated target resource, and the resource set of the first device instance is written into the new device instance to reserve the first device A copy of the instance, resetting the first device instance to the initialization device instance.
  62. 根据权利要求59所述的装置,其特征在于,The device of claim 59, wherein:
    所述重置指令用于,指示所述物联网设备根据所述重置指令更新所述第一设备实例的目标资源,获取更新后的所述目标资源,所述更新后的目标资源包括用于指示重置所述第一设备实例的属性值,根据所述更新后的目标资源,重置所述第一设备实例,将重置后的所述第一设备实例确定为所述初始化设备实例。The reset instruction is used to instruct the Internet of Things device to update the target resource of the first device instance according to the reset instruction to obtain the updated target resource, and the updated target resource includes Instructing to reset the attribute value of the first device instance, reset the first device instance according to the updated target resource, and determine the reset first device instance as the initialization device instance.
  63. 根据权利要求58所述的装置,其特征在于,所述装置包括:The device according to claim 58, wherein the device comprises:
    接收模块,所述接收模块用于获取所述第一设备实例的资源集合;A receiving module, where the receiving module is used to obtain a resource set of the first device instance;
    处理模块,所述处理模块用于基于所述第一设备实例的资源集合确定所述第一设备实例中具有设备实 例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;A processing module, the processing module is configured to determine that the first device instance has a device instance resource based on the resource set of the first device instance, and the device instance resource is used to manage the device instance in the Internet of Things device;
    所述发送模块用于发送切换请求,所述切换请求用于指示所述设备实例资源中的切换属性为第三属性值,用于指示所述物联网设备将所述第一设备实例切换至候选设备实例,通过确定所述候选设备实例是否为所述第二设备实例,来确定所述物联网设备中是否存在第二设备实例;The sending module is configured to send a switching request, the switching request is used to indicate that the switching attribute in the device instance resource is a third attribute value, and is used to instruct the Internet of Things device to switch the first device instance to a candidate A device instance, by determining whether the candidate device instance is the second device instance, to determine whether there is a second device instance in the Internet of Things device;
    其中,所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例。Wherein, the switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance.
  64. 根据权利要求56至62任一所述的装置,其特征在于,所述目标资源包括配置状态资源;The device according to any one of claims 56 to 62, wherein the target resource comprises a configuration state resource;
    所述配置状态资源包括上新属性,所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The configuration state resource includes a new attribute, the new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value Used to instruct to reset the first device instance to the initialization device instance.
  65. 根据权利要求56至63任一所述的装置,其特征在于,所述目标资源包括设备实例资源,所述设备实例资源用于管理所述物联网设备中的设备实例;The apparatus according to any one of claims 56 to 63, wherein the target resource comprises a device instance resource, and the device instance resource is used to manage a device instance in the Internet of Things device;
    所述设备实例资源包括切换属性以及上新属性;The device instance resources include handover attributes and updated attributes;
    所述切换属性为第三属性值以及第四属性值中的一个,所述第三属性值用于指示切换设备实例,所述第四属性值用于指示不切换设备实例;The switching attribute is one of a third attribute value and a fourth attribute value, the third attribute value is used to indicate a switching device instance, and the fourth attribute value is used to indicate not to switch a device instance;
    所述上新属性为第一属性值以及第二属性值中的一个,所述第一属性值用于指示创建新的设备实例,所述第二属性值用于指示将所述第一设备实例重置为所述初始化设备实例。The new attribute is one of a first attribute value and a second attribute value, the first attribute value is used to indicate the creation of a new device instance, and the second attribute value is used to indicate that the first device instance Reset to the initialization device instance.
  66. 根据权利要求56至61任一所述的装置,其特征在于,所述接收模块,用于:The device according to any one of claims 56 to 61, wherein the receiving module is configured to:
    所述发送创建指令之前,接收第一请求,所述第一请求为所述物联网设备在确定所述物联网设备中不存在所述第二设备实例时发送的,所述第一请求用于询问保留或者重置所述第一设备实例;Before the sending of the creation instruction, a first request is received, the first request being sent by the Internet of Things device when it is determined that the second device instance does not exist in the Internet of Things device, and the first request is used for Ask to reserve or reset the first device instance;
    所述发送模块,用于:The sending module is used to:
    发送针对保留所述第一设备实例的所述创建指令,所述创建指令包括保留指令;或者,Sending the creation instruction for reserving the first device instance, where the creation instruction includes a reserving instruction; or,
    发送针对重置所述第一设备实例的所述创建指令,所述创建指令包括重置指令。Send the creation instruction for resetting the first device instance, where the creation instruction includes a reset instruction.
  67. 根据权利要求66所述的装置,其特征在于,The device of claim 66, wherein:
    所述接收模块,用于接收第一请求之前,接收第二请求;The receiving module is configured to receive a second request before receiving the first request;
    所述发送模块,用于针对所述第二请求发送第二响应,所述第二响应用于确认将所述物联网设备以客户端身份加入所述第二安全域网络。The sending module is configured to send a second response to the second request, and the second response is used to confirm that the Internet of Things device is added to the second secure domain network as a client.
  68. 根据权利要求65所述的装置,其特征在于,The device of claim 65, wherein:
    所述接收模块,用于接收第一创建成功响应,所述第一创建成功响应为所述物联网设备在根据所述更新后的目标资源创建新的设备实例,并初始化所述新的设备实例之后向所述用户设备返回的;The receiving module is configured to receive a first creation success response, where the first creation success response is that the Internet of Things device creates a new device instance according to the updated target resource, and initializes the new device instance Then returned to the user equipment;
    所述发送模块,用于根据所述第一创建成功响应发送资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源。The sending module is configured to send a resource update instruction according to the first successful creation response, where the resource update instruction is used to update the configuration state resource of the first device instance.
  69. 根据权利要求65所述的装置,其特征在于,The device of claim 65, wherein:
    所述接收模块,用于接收第二创建成功响应,所述第二创建成功响应为所述物联网设备在根据所述更新后的目标资源创建所述新的设备实例,并将所述第一设备实例的资源集合写入所述新的设备实例之后返回的;The receiving module is configured to receive a second creation success response, where the second creation success response is for the Internet of Things device to create the new device instance according to the updated target resource, and to convert the first The resource collection of the device instance is returned after the new device instance is written;
    所述发送模块,用于根据所述第二创建成功响应发送资源更新指令,所述资源更新指令用于更新所述第一设备实例的配置状态资源。The sending module is configured to send a resource update instruction according to the second creation success response, where the resource update instruction is used to update the configuration state resource of the first device instance.
  70. 根据权利要求56至69任一所述的装置,其特征在于,所述第二设备实例所配置的安全域信息包括所述第二设备实例的所有者Owner的识别符ID,所述第二安全域网络具有的安全域信息包括所述第二安全域网络的激活工具OBT设备的ID,The apparatus according to any one of claims 56 to 69, wherein the security domain information configured by the second device instance includes the identifier ID of the owner of the second device instance, and the second security The security domain information possessed by the domain network includes the ID of the activation tool OBT device of the second security domain network,
    所述第二设备实例所配置的安全域信息与第二安全域网络具有的安全域信息一致包括所述第二设备实例的所有者Owner的识别符ID与所述第二安全域网络的激活工具OBT设备的ID一致。The security domain information configured by the second device instance is consistent with the security domain information of the second security domain network, including the identifier ID of the owner of the second device instance and the activation tool of the second security domain network The IDs of the OBT devices are the same.
  71. 一种物联网设备,其特征在于,所述物联网设备包括处理器和存储器,所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现权利要求1-19任一项方法的步骤。An Internet of Things device, characterized in that the Internet of Things device includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement claims 1-19 Steps of any method.
  72. 一种用户设备,其特征在于,所述用户设备包括处理器和存储器,所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现权利要求20-35任一项方法的步骤。A user equipment, wherein the user equipment includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement any one of claims 20-35 The steps of the item method.
  73. 一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,其特征在于,所述指令被处理器执行时实现权利要求1-19任一项方法的步骤,或者,用于实现权利要求20-35任一项方法的步骤。A computer-readable storage medium having instructions stored on the computer-readable storage medium, characterized in that, when the instructions are executed by a processor, the steps of the method according to any one of claims 1-19 are implemented, or are used to implement The steps of any one of claims 20-35.
PCT/CN2019/121994 2019-11-29 2019-11-29 Method and apparatus for configuring internet-of-things device, and storage medium WO2021102915A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/121994 WO2021102915A1 (en) 2019-11-29 2019-11-29 Method and apparatus for configuring internet-of-things device, and storage medium
CN201980097430.0A CN114009143A (en) 2019-11-29 2019-11-29 Configuration method and device of Internet of things equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/121994 WO2021102915A1 (en) 2019-11-29 2019-11-29 Method and apparatus for configuring internet-of-things device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021102915A1 true WO2021102915A1 (en) 2021-06-03

Family

ID=76128976

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121994 WO2021102915A1 (en) 2019-11-29 2019-11-29 Method and apparatus for configuring internet-of-things device, and storage medium

Country Status (2)

Country Link
CN (1) CN114009143A (en)
WO (1) WO2021102915A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023216035A1 (en) * 2022-05-07 2023-11-16 Oppo广东移动通信有限公司 Security domain management method and apparatus, device, storage medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107851159A (en) * 2015-07-31 2018-03-27 阿姆Ip有限公司 Control configuration data holder
CN108683690A (en) * 2018-08-27 2018-10-19 创新维度科技(北京)有限公司 Method for authenticating, user equipment, authentication device, authentication server and storage medium
WO2018208289A1 (en) * 2017-05-09 2018-11-15 Intel Corporation Two-phase discovery and onboarding of internet of things (iot) devices

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016068442A1 (en) * 2014-10-27 2016-05-06 엘지전자 주식회사 Method for guaranteeing operation of control message in wireless communication system and device for same
CN108023757B (en) * 2016-11-03 2020-04-28 华为技术有限公司 Method, device and system for managing network slice instances
US11513864B2 (en) * 2018-03-22 2022-11-29 Amazon Technologies, Inc. Adoption of existing virtual computing resources into logical containers for management operations
CN109040200B (en) * 2018-07-13 2022-04-12 深圳绿米联创科技有限公司 Access method and device of Internet of things equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107851159A (en) * 2015-07-31 2018-03-27 阿姆Ip有限公司 Control configuration data holder
WO2018208289A1 (en) * 2017-05-09 2018-11-15 Intel Corporation Two-phase discovery and onboarding of internet of things (iot) devices
CN108683690A (en) * 2018-08-27 2018-10-19 创新维度科技(北京)有限公司 Method for authenticating, user equipment, authentication device, authentication server and storage medium

Also Published As

Publication number Publication date
CN114009143A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
US7747722B2 (en) Device management method for device management system
KR100493895B1 (en) Home network device and system for a cooperative work service and method thereof
US8095674B2 (en) Method, system and terminal for access control in device management
CN111371579B (en) Cloud platform deployment method, device, server and storage medium
WO2019184116A1 (en) Method and device for automatically building kubernetes main node, terminal device and computer-readable storage medium
JP2020530722A (en) PDU type setting method, UE policy setting method, and related entities
US20130024571A1 (en) Device control method, network device, and network system
JP6738965B2 (en) Network service life cycle management permission method and device
US9948603B1 (en) System and method of constructing dynamic namespaces in the internet of things
CN110716787A (en) Container address setting method, apparatus, and computer-readable storage medium
CN115039385B (en) Computer-implemented communication system and method for Internet of things
US8732715B2 (en) Resource management method, device and program thereof
WO2020216038A1 (en) Data management method, lepm, and mepm
WO2021102915A1 (en) Method and apparatus for configuring internet-of-things device, and storage medium
CN110933188A (en) Remote service calling method, system, server and storage medium
US11150884B1 (en) Device driver update images
US9736027B2 (en) Centralized enterprise image upgrades for distributed campus networks
KR101759429B1 (en) Node corresponding to the domain in multi-domain environment and Method for controlling the same
WO2010118702A1 (en) Terminal for device management and method for initiating management session thereof
US10872142B1 (en) Localized identity management in limited communication networks
US10979439B1 (en) Identity management for coordinated devices in a networked environment
KR20210043654A (en) Method, apparatus and storage medium for resource organization
KR20110070725A (en) Automatic mash-up apparatus and method
US11095514B2 (en) System and method for propagating anima network objective changes
WO2016197637A1 (en) Method for implementing remote access, alljoyn gateway proxy, cloud server and mobile device

Legal Events

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

Ref document number: 19954271

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19954271

Country of ref document: EP

Kind code of ref document: A1