WO2016119110A1 - Resource access method, related device and m2m system - Google Patents

Resource access method, related device and m2m system Download PDF

Info

Publication number
WO2016119110A1
WO2016119110A1 PCT/CN2015/071578 CN2015071578W WO2016119110A1 WO 2016119110 A1 WO2016119110 A1 WO 2016119110A1 CN 2015071578 W CN2015071578 W CN 2015071578W WO 2016119110 A1 WO2016119110 A1 WO 2016119110A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
semantic model
type
sub
cse
Prior art date
Application number
PCT/CN2015/071578
Other languages
French (fr)
Chinese (zh)
Inventor
李龙
李炜
胡静
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/071578 priority Critical patent/WO2016119110A1/en
Publication of WO2016119110A1 publication Critical patent/WO2016119110A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management

Definitions

  • the existing devices of the Internet of Things application can be divided into two categories, one is a legacy device and the other is a common device.
  • a legacy device is a device that supports a semantic model of the DeviceType type
  • a generic device refers to a device that supports a semantic model of the Ontology type.
  • CSE Common Service Entity
  • an Ontology-type semantic model is obtained by abstracting a common device.
  • the Ontology-type semantic model provides richer content than the semantic model of the DeviceType type.
  • the legacy device can only access the basic semantic resources corresponding to the semantic model of the DeviceType type, the prior art does not provide a method for the legacy device to access the enhanced/complete semantic resource corresponding to the semantic model of the Ontology type.
  • an embodiment of the present invention provides a method for resource access, which is applicable to a machine-to-machine M2M system, and the method includes:
  • the CSE sends an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
  • the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
  • the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type
  • the method further includes:
  • the first acquiring resource configured to acquire the resource from a pre-stored resource set according to the URI information of the resource
  • the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the determining unit is specifically configured to:
  • the third obtaining unit is configured to acquire a semantic model of the Ontology type corresponding to the original description information
  • the abstracting unit is further configured to: abstract the device as a resource corresponding to a semantic model of the Ontology type.
  • an embodiment of the present invention provides a device, where the device includes: a sending unit and a receiving unit;
  • the sending unit is further configured to: resend a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
  • the receiver is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if Sub-resources abstract the legacy device for the CSE
  • the semantic model of the sub-resource is a semantic model of the DeviceType type. If the sub-resource is abstracted by the CSE for the common device, the semantic model of the sub-resource is the semantic of the DeviceType type.
  • the model and the semantic model of the Ontology type the legacy device being a device supporting a semantic model of a DeviceType type, the device being a device supporting a semantic model of the DeviceType type and a semantic model of the Ontology type.
  • 1 is a schematic diagram of an Internet of Things structure
  • FIG. 10 is another schematic diagram of CSE
  • Figure 11 is a schematic diagram of another device.
  • the general service entity may be the local IoT gateway shown in FIG. 1 or other devices, and the device may be the device 1, the device 2, the device n shown in FIG. Any device that is not shown in FIG. 1 is not limited to the specific embodiment of the present invention.
  • the device can only access the resource corresponding to the semantic model of the DeviceType type, and the semantic model information in the resource access request message is a semantic model of the DeviceType type, if the device is normal The device, if the device only accesses the resource marked by the semantic model of the Ontology type, then the semantic model information in the resource access request message is a semantic model of the Ontology type.
  • the resource access request message carries the URI of the container resource that is requested to be accessed, and the carried semantic model information is a semantic model of the DeviceType type.
  • the CSE obtains the container1 according to the URI of the container1, and obtains the sub-resource corresponding to the semantic model of the DeviceType type in the container1 according to the semantic model of the DeviceType type carried in the resource access request message.
  • the CSE obtains the URI of the child resource and the URI of the child resource Sending to the device, the device accessing the sub-resource according to the URI of the sub-resource.
  • the embodiment of the present invention further provides a method for resource access, which is applied to an M2M system, and the method includes:
  • the CSE After acquiring the semantic model of the DeviceType type, the CSE fills the original description information of the device into the semantic model, obtains resources corresponding to the semantic model of the DeviceType type, and records semantic model information of each resource. .
  • the CSE determines that the device can be abstracted into a resource corresponding to the semantic model of the Ontology type according to the original description information of the device, the device is a common device, and the CSE obtains the original device description.
  • the semantic model of the Ontology type corresponding to the information.
  • the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type.
  • the device receives the indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails; the device re-directs to the CSE Sending a resource request message, the semantic model information included in the retransmitted resource request message is a semantic model of a Type of DeviceType, and URI information of the resource; the device receives a URI of a sub-resource of the resource, where The sub-resource is a sub-resource corresponding to the semantic model of the DeviceType type.
  • the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type
  • the receiving unit 902 is specifically configured to:
  • the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type
  • An embodiment of the present invention provides a device, where a general service entity abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, abstracts the common device, obtains a resource corresponding to a semantic model of the DeviceType type, and an Ontology type. a resource corresponding to the semantic model, and recording semantic model information of each resource.
  • the resource access request message carries the URI information of the resource and the semantic model information
  • the CSE acquires the resource according to the URI of the resource, and Acquiring the sub-resource corresponding to the semantic model information in the resource, so that the legacy device can access the resource obtained by the CSE to abstract the common device, and further, if the device is a common device, the device requests the accessed resource. If the CSE abstracts the legacy device, the device fails to access the device, and the device initiates the resource access request again.
  • the semantic model corresponding to the semantic model information is DeviceType type. The semantic model enables ordinary devices to access the resources that the CSE abstracts for legacy devices.
  • the transmitter 1005 is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
  • the receiver 1001 is further configured to: receive a registration request message of the device, where the registration request message includes original device description information of the device;
  • the processor 1002 is further configured to: obtain a semantic model of a DeviceType type corresponding to the original device description information according to the original device description information of the device; and abstract the device into a resource corresponding to a semantic model of a DeviceType type, And assigning a URI to the resource; determining, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of the Ontology type; if yes, acquiring a semantic model of the Ontology type corresponding to the original description information; The resource corresponding to the semantic model of the DeviceType type is saved, and the device is abstracted into a resource corresponding to the semantic model of the Ontology type.
  • the embodiment of the present invention provides a CSE, which abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, records the semantic model information of each resource, abstracts the common device, and obtains a DeviceType type.
  • the resource corresponding to the semantic model and the resource corresponding to the semantic model of the Ontology type and record the semantic model information of each resource.
  • the resource request message carries semantic model information and URI information of the resource. Because the common equipment has The resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type enable the legacy device to access the resource obtained by the CSE abstracting the common device.
  • the receiver 1102 is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device,
  • the semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type
  • the legacy device is a device supporting a semantic model of a DeviceType type, the semantic model supporting the DeviceType type and the semantics of the Ontology type. Model of the device.
  • the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type
  • the resource access request message carries the URI information of the resource and the semantic model information
  • the CSE acquires the resource according to the URI of the resource, and Acquiring the sub-resource corresponding to the semantic model information in the resource, so that the legacy device can access the resource obtained by the CSE to abstract the common device, and further, if the device is a common device, the device requests the accessed resource. If the CSE abstracts the legacy device, the device fails to access the device, and the device initiates the resource access request again.
  • the semantic model corresponding to the semantic model information is a DeviceType type semantic model, so that the common device can access the CSE to the legacy device. Abstraction .
  • the embodiment of the present invention further provides an M2M system, where the M2M system includes at least the CSE in the embodiment corresponding to FIG. 8, and FIG. The device in the corresponding embodiment; or the M2M system includes at least the CSE in the embodiment corresponding to FIG. 10, and the device in the embodiment corresponding to FIG.

Abstract

Provided in an embodiment of the present invention are a resource access method, related device and M2M system, addressing the problem in which a legacy device cannot access a resource abstracted from a common device. The device comprises: receiving, by CSE, a resource request message transmitted by a device, the resource request message comprising semantic model information and URI information of a resource; acquiring, by the CSE, the resource from a pre-stored resource set according to the URI information of the resource; and according to the semantic model information, determining, by the CSE, whether the resource comprises a sub-resource corresponding to the semantic model information, and if the sub-resource is abstracted from the legacy device by the CSE, then a semantic model of the sub-resource is a semantic model in a DeviceType, and if the sub-resource is abstracted from the common device by the CSE, then the semantic model of the sub-resource is a semantic model in a DeviceType and an Ontology type. The method is applied to the technical field of Internet of things.

Description

一种资源访问的方法、相关装置和M2M系统Method for accessing resources, related device and M2M system 技术领域Technical field
本发明涉及物联网技术领域,尤其涉及一种资源访问的方法、相关装置和M2M系统。The present invention relates to the field of Internet of Things technologies, and in particular, to a resource access method, related device, and M2M system.
背景技术Background technique
随着物联网技术研发及市场推广的不断深入,为加强物联网标准化工作,物联网领域国际标准化组织oneM2M于2011年5月正式成立。oneM2M是一个制定全球统一的机器对机器(Machine to Machine,M2M)规范的标准组织,该标准组织制定的标准用于规范物联网应用的设备和业务通信的标准,其基本目标是统一全球M2M技术标准,从而有利于降低物联网应用开发、系统集成和建设、运营以及售后服务的成本。With the continuous development of IoT technology research and development and market promotion, in order to strengthen the standardization work of the Internet of Things, the international standardization organization oneM2M in the field of Internet of Things was formally established in May 2011. oneM2M is a standards organization that develops a globally unified Machine to Machine (M2M) specification that sets standards for device and service communication standards for IoT applications. The basic goal is to unify global M2M technologies. Standards, which help reduce the cost of IoT application development, system integration and construction, operations, and after-sales services.
现有的物联网应用的设备可以分为两类,一类是遗留设备(1egacy device),一类是普通设备。遗留设备是指支持DeviceType类型的语义模型的设备,普通设备是指支持Ontology类型的语义模型的设备。在现有技术中,通用服务实体(Common Service Entity,CSE)通过将遗留设备进行抽象,获得DeviceType类型的语义模型所对应的基础语义资源;通过将普通设备进行抽象,获得Ontology类型的语义模型所对应的增强/完全语义资源,相较于DeviceType类型的语义模型,Ontology类型的语义模型提供更丰富的内容。The existing devices of the Internet of Things application can be divided into two categories, one is a legacy device and the other is a common device. A legacy device is a device that supports a semantic model of the DeviceType type, and a generic device refers to a device that supports a semantic model of the Ontology type. In the prior art, a Common Service Entity (CSE) obtains a basic semantic resource corresponding to a semantic model of a DeviceType type by abstracting a legacy device; and an Ontology-type semantic model is obtained by abstracting a common device. Corresponding enhancement/complete semantic resources, the Ontology-type semantic model provides richer content than the semantic model of the DeviceType type.
由于遗留设备只能访问DeviceType类型的语义模型所对应的基础语义资源,现有技术并没有给出遗留设备访问Ontology类型的语义模型所对应的增强/完全语义资源的方法。Since the legacy device can only access the basic semantic resources corresponding to the semantic model of the DeviceType type, the prior art does not provide a method for the legacy device to access the enhanced/complete semantic resource corresponding to the semantic model of the Ontology type.
发明内容Summary of the invention
本发明的实施例提供一种资源访问的方法、相关装置和M2M系统,解决了现有M2M系统中遗留设备无法访问Ontology类型的语义模型所对应的增强/完全语义资源的问题。 The embodiments of the present invention provide a resource access method, a related device, and an M2M system, which solve the problem that the legacy device in the existing M2M system cannot access the enhanced/complete semantic resource corresponding to the Ontology type semantic model.
为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
第一方面,本发明实施例提供了一种资源访问的方法,该方法适用于机器对机器M2M系统,该方法包括:In a first aspect, an embodiment of the present invention provides a method for resource access, which is applicable to a machine-to-machine M2M system, and the method includes:
通用服务实体CSE接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The general service entity CSE receives the resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述CSE根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The CSE acquires the resource from a pre-stored resource set according to the URI information of the resource;
所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;The CSE determines, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic relationship between the sub-resource and a URI of the sub-resource. If the sub-resource is abstracted from the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, and the common device is a semantic model and Ontology supporting a DeviceType type. Type of semantic model of the device;
若有,所述CSE获取所述子资源的URI,并将所述子资源的URI发送至所述设备。If yes, the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
在第一种可能的实施方式中,结合第一方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型;In a first possible implementation, in combination with the first aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type;
所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源具体包括:The determining, by the CSE, whether the sub-resource corresponding to the semantic model information is included in the resource according to the semantic model information includes:
所述CSE判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。The CSE determines whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
在第二种可能的实施方式中,结合第一方面,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型; In a second possible implementation, in combination with the first aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源具体包括:The determining, by the CSE, whether the sub-resource corresponding to the semantic model information is included in the resource according to the semantic model information includes:
所述CSE判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining, by the CSE, whether the resource includes a sub-resource corresponding to a semantic model of an Ontology type;
所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源之后,该方法还包括:After the CSE determines, according to the semantic model information, whether the resource includes the sub-resource corresponding to the semantic model information, the method further includes:
若没有,所述CSE向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;If not, the CSE sends an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
所述CSE接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;Receiving, by the CSE, a resource request message resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述CSE根据所述资源的URI信息,从所述资源集合中获取所述资源;The CSE acquires the resource from the resource set according to the URI information of the resource;
所述CSE判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源;Determining, by the CSE, whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type;
若有,所述CSE获取所述子资源的URI,并将所述子资源的URI发送至所述设备。If yes, the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
在第三种可能的实施方式中,结合第一方面至第一方面第二种可能的实施方式中的任一种,所述CSE接收设备发送的资源请求消息之前,该方法还包括:In a third possible implementation, in combination with the first aspect to the second possible implementation manner of the first aspect, before the CSE receiving the resource request message sent by the device, the method further includes:
所述CSE接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;The CSE receives a registration request message of the device, where the registration request message includes original device description information of the device;
所述CSE根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;The CSE acquires a semantic model of the DeviceType type corresponding to the original device description information according to the original device description information of the device;
所述CSE将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;The CSE abstracts the device into a resource corresponding to a semantic model of a DeviceType type, and allocates a URI for the resource;
所述CSE根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;Determining, by the CSE, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type according to the original device description information;
若是,所述CSE获取所述原始描述信息所对应的Ontology类 型的语义模型;If yes, the CSE obtains the Ontology class corresponding to the original description information. Semantic model
所述CSE保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。The CSE saves resources corresponding to the semantic model of the DeviceType type, and abstracts the device into resources corresponding to the semantic model of the Ontology type.
第二方面,本发明实施例提供了一种资源访问的方法,适用于机器对机器M2M系统,该方法包括:In a second aspect, an embodiment of the present invention provides a resource access method, which is applicable to a machine-to-machine M2M system, and the method includes:
设备向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The device sends a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述设备接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The device receives a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if the sub-resource is If the CSE abstracts the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, the sub-resource The semantic model is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, which is a device supporting a semantic model of the DeviceType type and a semantic model of the Ontology type.
在第一种可能的实施方式中,结合第二方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型;In a first possible implementation, in combination with the second aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type;
所述设备接收所述资源的子资源的URI具体包括:The URI of the sub-resource of the device receiving the resource specifically includes:
所述设备接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The device receives a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
在第二种可能的实施方式中,结合第二方面,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;In a second possible implementation, in combination with the second aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述设备接收所述资源的子资源的URI之前,该方法还包括:Before the device receives the URI of the sub-resource of the resource, the method further includes:
所述设备接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;Receiving, by the device, an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
所述设备重新向所述CSE发送资源请求消息,所述重新发送的 资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The device resends a resource request message to the CSE, the resending The semantic model information included in the resource request message is a semantic model of the DeviceType type, and URI information of the resource;
所述设备接收所述资源的子资源的URI具体包括:The URI of the sub-resource of the device receiving the resource specifically includes:
所述设备接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The device receives a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
第三方面,本发明实施例提供了一种通用服务实体CSE,所述CSE包括:接收单元,第一获取单元,判断单元,第二获取单元和发送单元;In a third aspect, an embodiment of the present invention provides a general service entity CSE, where the CSE includes: a receiving unit, a first acquiring unit, a determining unit, a second acquiring unit, and a sending unit;
所述接收单元,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiving unit is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述第一获取资源,用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The first acquiring resource, configured to acquire the resource from a pre-stored resource set according to the URI information of the resource;
所述判断单元,用于根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;The determining unit is configured to determine, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic model of the sub-resource and the sub-resource Corresponding relationship of the URI, if the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, if the sub-resource is the CSE-to-common device For abstraction, the semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, and the common device supports a DeviceType type. a semantic model and a device of the Ontology type semantic model;
所述第二获取单元,用于获取所述子资源的URI;The second obtaining unit is configured to acquire a URI of the sub-resource;
所述发送单元,用于将所述子资源的URI发送至所述设备。The sending unit is configured to send a URI of the sub-resource to the device.
在第一种可能的实施方式中,结合第三方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述判断单元具体用于:In a first possible implementation, in combination with the third aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the determining unit is specifically configured to:
判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。 Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
在第二种可能的实施方式中,结合第三方面,所述若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型,所述判断单元具体用于:In a second possible implementation, in combination with the third aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type, and the determining unit Specifically used for:
判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining whether the resource includes a sub-resource corresponding to a semantic model of the Ontology type;
所述发送单元还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The sending unit is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
所述接收单元还用于:接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiving unit is further configured to: receive a resource request message that is resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述第一获取单元还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源;The first obtaining unit is further configured to: obtain the resource from the resource set according to the URI information of the resource;
所述判断单元还用于:判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源;The determining unit is further configured to: determine whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type;
所述第二获取单元还用于:获取所述子资源的URI;The second obtaining unit is further configured to: acquire a URI of the sub-resource;
所述发送单元还用于:将所述子资源的URI发送至所述设备。The sending unit is further configured to: send a URI of the sub-resource to the device.
在第三种可能的实施方式中,结合第三方面至第三方面第二种可能的实施方式,所述CSE还包括第三获取单元和抽象单元,所述接收单元还用于:In a third possible implementation, in combination with the second possible implementation manner of the third aspect to the third aspect, the CSE further includes a third obtaining unit and an abstracting unit, where the receiving unit is further configured to:
接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;Receiving a registration request message of the device, where the registration request message includes original device description information of the device;
所述第三获取单元,用于根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;The third acquiring unit is configured to acquire, according to the original device description information of the device, a semantic model of the DeviceType type corresponding to the original device description information;
所述抽象单元,用于将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;The abstracting unit is configured to abstract the device into a resource corresponding to a semantic model of a DeviceType type, and allocate a URI for the resource;
所述判断单元还用于:根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;The determining unit is further configured to: determine, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type;
所述第三获取单元,用于获取所述原始描述信息所对应的Ontology类型的语义模型; The third obtaining unit is configured to acquire a semantic model of the Ontology type corresponding to the original description information;
所述抽象单元还用于:将所述设备抽象为Ontology类型的语义模型所对应的资源。The abstracting unit is further configured to: abstract the device as a resource corresponding to a semantic model of the Ontology type.
第四方面,本发明实施例提供了一种设备,所述设备包括:发送单元和接收单元;In a fourth aspect, an embodiment of the present invention provides a device, where the device includes: a sending unit and a receiving unit;
所述发送单元,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The sending unit is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述接收单元,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The receiving unit is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if The child resource is abstracted from the CSE for the legacy device, and the semantic model of the child resource is a semantic model of the DeviceType type. If the child resource is abstracted by the CSE for the common device, the The semantic model of the sub-resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device is a semantic model supporting the DeviceType type and a semantic model of the Ontology type. device of.
在第一种可能的实施方式中,结合第四方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收单元具体用于:In a first possible implementation, in combination with the fourth aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the receiving unit is specifically configured to:
接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
在第二种可能的实施方式中,结合第四方面,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;In a second possible implementation, in combination with the fourth aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述接收单元还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiving unit is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
所述发送单元还用于:重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息; The sending unit is further configured to: resend a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述接收单元具体用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiving unit is specifically configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
第五方面,本发明实施例提供了一种通用服务实体CSE,所述CSE包括:接收器,处理器,总线,存储器和发送器;In a fifth aspect, an embodiment of the present invention provides a general service entity CSE, where the CSE includes: a receiver, a processor, a bus, a memory, and a transmitter;
所述接收器,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiver is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述处理器通过所述总线获取所述存储器中的指令,以用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;And the processor acquires, by using the bus, an instruction in the memory, to obtain the resource from a pre-stored resource set according to the URI information of the resource;
根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;Determining, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, the semantic model supporting the DeviceType type and the semantics of the Ontology type. Model device
若有,所述CSE获取所述子资源的URI;If yes, the CSE obtains a URI of the sub-resource;
所述发送器,用于将所述子资源的URI发送至所述设备。The sender is configured to send a URI of the sub-resource to the device.
在第一种可能的实施方式中,结合第五方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述处理器具体用于:In a first possible implementation, in combination with the fifth aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type, and the processor is specifically configured to:
判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
在第二种可能的实施方式中,结合第五方面,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型,所述处理器具体用于:In a second possible implementation, in combination with the fifth aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type, and the processor specifically uses to:
判断所述资源中是否包含Ontology类型的语义模型所对应的子 资源;Determining whether the resource includes a child corresponding to a semantic model of the Ontology type Resource
所述发送器还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The transmitter is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
所述接收器还用于:接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiver is further configured to: receive a resource request message resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述处理器还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源,判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源,若有,获取所述子资源的URI;The processor is further configured to: obtain the resource from the resource set according to the URI information of the resource, and determine whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type, and if so, the acquiring The URI of the child resource;
所述发送器,用于将所述子资源的URI发送至所述设备。The sender is configured to send a URI of the sub-resource to the device.
在第三种可能的实施方式中,结合第五方面至第五方面第二种可能的实施方式,所述接收器还用于:接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;In a third possible implementation, in combination with the second possible implementation manners of the fifth aspect to the fifth aspect, the receiver is further configured to: receive a registration request message of the device, where the registration request message includes Raw device description information of the device;
所述处理器还用于:根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;若是,获取所述原始描述信息所对应的Ontology类型的语义模型;保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。The processor is further configured to: obtain a semantic model of a DeviceType type corresponding to the original device description information according to the original device description information of the device; and abstract the device into a resource corresponding to a semantic model of a DeviceType type, and Allocating a URI for the resource; determining, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of the Ontology type; if yes, acquiring a semantic model of the Ontology type corresponding to the original description information; The resource corresponding to the semantic model of the DeviceType type, and abstracting the device into a resource corresponding to the semantic model of the Ontology type.
第六方面,本发明实施例提供了一种设备,所述设备包括:发送器和接收器;In a sixth aspect, an embodiment of the present invention provides a device, where the device includes: a transmitter and a receiver;
所述发送器,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The transmitter is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述接收器,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象 得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The receiver is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if Sub-resources abstract the legacy device for the CSE The semantic model of the sub-resource is a semantic model of the DeviceType type. If the sub-resource is abstracted by the CSE for the common device, the semantic model of the sub-resource is the semantic of the DeviceType type. The model and the semantic model of the Ontology type, the legacy device being a device supporting a semantic model of a DeviceType type, the device being a device supporting a semantic model of the DeviceType type and a semantic model of the Ontology type.
在第一种可能的实施方式中,结合第六方面,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收器具体用于:In a first possible implementation, in combination with the sixth aspect, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type, and the receiver is specifically configured to:
接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
在第二种可能的实施方式中,结合第六方面,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;In a second possible implementation, in combination with the sixth aspect, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述接收器还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiver is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
所述发送器还用于:重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The transmitter is further configured to: resend a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述接收器还用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiver is further configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
第七方面,本发明实施例提供了一种M2M系统,该M2M系统至少包含第三方面至第三方面第三种可能的实施方式中的任一种所述的CSE,以及第四方面至第四方面第二种可能的实施方式中的任一种所述的设备;或者,所述M2M系统至少包含第五方面至第五方面第三种可能的实施方式中的任一种所述的CSE,以及第六方面至第六方面第二种可能的实施方式中的任一种所述的设备。According to a seventh aspect, an embodiment of the present invention provides an M2M system, where the M2M system includes at least the CSE according to any one of the third aspect to the third aspect, and the fourth aspect to the The apparatus of any one of the second possible implementations of the fourth aspect; or the M2M system comprising at least the CSE of any one of the fifth aspect to the fifth aspect, the third possible implementation And the apparatus of any one of the second aspect to the second possible aspect of the sixth aspect.
本发明实施例提供了一种资源访问的方法、相关装置和M2M系统。CSE将遗留设备进行抽象,获得DeviceType类型的语义模型 所对应的资源,并记录每个资源的语义模型信息,将普通设备进行抽象,获得DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息。当设备进行资源请求时,资源请求消息中携带语义模型信息和资源的URI信息。由于普通设备对应有DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,使得遗留设备能够访问CSE对普通设备进行抽象获得的资源。从而解决了现有技术中遗留设备不能访问CSE对普通设备进行抽象获得的资源的问题。The embodiment of the invention provides a resource access method, a related device and an M2M system. CSE abstracts legacy devices and obtains a semantic model of DeviceType type Corresponding resources, and record the semantic model information of each resource, abstract the common device, obtain the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, and record the semantic model information of each resource. When the device makes a resource request, the resource request message carries semantic model information and URI information of the resource. The common device corresponds to the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, so that the legacy device can access the resource obtained by the CSE abstracting the common device. Therefore, the problem that the legacy device in the prior art cannot access the resources obtained by abstracting the common device by the CSE is solved.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为一种物联网结构示意图;1 is a schematic diagram of an Internet of Things structure;
图2为一种资源结构示意图;2 is a schematic diagram of a resource structure;
图3为一种资源访问的方法流程图;3 is a flow chart of a method for resource access;
图4为另一种资源结构示意图;4 is a schematic diagram of another resource structure;
图5为又一种资源结构示意图;FIG. 5 is a schematic diagram of another resource structure;
图6为另一种资源访问的方法流程图;6 is a flow chart of another method for resource access;
图7为又一种资源访问的方法流程图;7 is a flow chart of another method for resource access;
图8为一种CSE示意图;Figure 8 is a schematic view of a CSE;
图9为一种设备示意图;Figure 9 is a schematic diagram of a device;
图10为另一种CSE示意图;Figure 10 is another schematic diagram of CSE;
图11为另一种设备示意图。Figure 11 is a schematic diagram of another device.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本 领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. Based on an embodiment of the present invention, this All other embodiments obtained by a person of ordinary skill in the art without creative efforts are within the scope of the present invention.
结合图1,示例性的描述了一种物联网结构示意图,设备1、设备2...设备n等设备与本地物联网网关相连接,本地物联网网关与物联网中的其他物联网网关相连。Referring to FIG. 1, a schematic diagram of an Internet of Things structure is schematically illustrated. Devices such as device 1, device 2, device n, etc. are connected to a local IoT gateway, and a local IoT gateway is connected to other IoT gateways in the Internet of Things. .
在现有技术中,设备1,设备2...设备n在接入本地物联网网关时向本地物联网网关发送注册请求消息,本地物联网网关将设备进行抽象,获得由不同语义模型标注的语义资源。In the prior art, the device 1, the device 2, the device n send a registration request message to the local IoT gateway when accessing the local IoT gateway, and the local IoT gateway abstracts the device and obtains the labeling by different semantic models. Semantic resources.
现有的物联网应用的设备可以分为两类,一类是遗留设备,一类是普通设备,遗留设备所能提供的原始设备描述信息较少,普通设备所能提供的原始设备描述信息较多。举例来说,假设图1中的设备1是遗留设备,设备2是普通设备,当设备1向本地物联网网关发送注册请求消息时,会携带设备1的一些原始设备描述信息,如设备的制造商信息、设备型号信息以及输入输出(Input/Output,I/O)操作等信息,当设备2向本地物联网网关发送注册请求消息时,所能提供的原始设备描述信息更为丰富,除了携带上述设备1所携带的原始设备描述信息之外,还能够提供更多的原始设备描述信息,如设备2与物联网中其他实体的连接关系等信息。The existing devices of the Internet of Things application can be divided into two categories, one is a legacy device, and the other is a common device. The legacy device can provide less original device description information, and the original device description information provided by the common device is smaller. many. For example, suppose that device 1 in FIG. 1 is a legacy device, and device 2 is a common device. When device 1 sends a registration request message to a local IoT gateway, it carries some original device description information of device 1, such as device manufacturing. Information about the business information, device model information, and input/output (I/O) operations. When the device 2 sends a registration request message to the local IoT gateway, the original device description information can be provided more than the carrier information. In addition to the original device description information carried by the device 1, the original device description information, such as the connection relationship between the device 2 and other entities in the Internet of Things, can be provided.
本地物联网网关分别根据设备1的原始设备描述信息和设备2的原始设备描述信息对设备1和设备2进抽象。具体的,oneM2M组织根据遗留设备和普通设备所能提供的原始设备描述信息不同,分别提供了两种类型的语义模型,分别为DeviceType类型的语义模型和Ontology类型的语义模型,例如,DeviceType类型的语义模型的详细定义可参见oneM2M组织提供的文档名为oneM2M-TR-0007-Study_on_Abstraction_and_Semantics_Enablement-V0_11_0的文档的第8.2.3小节。The local IoT gateway abstracts the device 1 and the device 2 according to the original device description information of the device 1 and the original device description information of the device 2, respectively. Specifically, the oneM2M organization provides two types of semantic models according to the original device description information that the legacy device and the common device can provide, respectively, a semantic model of the DeviceType type and a semantic model of the Ontology type, for example, a DeviceType type. A detailed definition of the semantic model can be found in section 8.2.3 of the document entitled oneM2M-TR-0007-Study_on_Abstraction_and_Semantics_Enablement-V0_11_0 provided by the oneM2M organization.
所述语义模型相当于模板,将设备1的原始设备描述信息以一定的形式填充至DeviceType类型的语义模型中,获得的资源可以称之为基础语义资源,其他设备通过访问该基础语义资源即可访问设 备1。将设备2的原始设备描述信息以一定的形式填充至Ontology类型的语义模型中,获得的数据可以称之为增强/完全语义资源,其他设备通过访问该增强/完全语义资源即可对设备2进行访问。The semantic model is equivalent to a template, and the original device description information of the device 1 is filled into a semantic model of the DeviceType type in a certain form, and the obtained resource may be referred to as a basic semantic resource, and other devices may access the basic semantic resource by accessing the basic semantic resource. Access Prepare 1. The original device description information of the device 2 is filled into the semantic model of the Ontology type in a certain form, and the obtained data may be referred to as an enhanced/complete semantic resource, and other devices may access the device 2 by accessing the enhanced/complete semantic resource. access.
需要说明的是,在物联网领域,所有的实体,如应用实体(Application Entity,AE),网关等,以及数据,如在DeviceType类型的语义模型中填充设备1的原始设备描述信息获得的数据等,都可以称之为资源。并且,在oneM2M系统中,每个资源都有一个与其唯一对应的统一资源标识符(Uniform Resource Identifier,URI)。It should be noted that in the field of the Internet of Things, all entities, such as Application Entity (AE), gateway, etc., and data, such as data obtained by filling the original device description information of the device 1 in the semantic model of the DeviceType type, etc. , can be called resources. Moreover, in the oneM2M system, each resource has a Uniform Resource Identifier (URI) corresponding to it.
图2示例性的描述了一种资源结构,假设图2所示的应用实体是一个空调,该空调被网关抽象后得到三个container资源,每个container资源又包含至少一个内容实例资源。FIG. 2 exemplarily describes a resource structure. It is assumed that the application entity shown in FIG. 2 is an air conditioner. The air conditioner is abstracted by the gateway to obtain three container resources, and each container resource includes at least one content instance resource.
需要说明的是,container资源相当于一个容器,对设备的描述等数据位于内容实例资源中,内容实例资源是container资源的子资源。不同的container资源代表不同的大类,例如,container1代表container1中的内容实例资源是对空调的温度控制、湿度控制等的空调控制方面的描述,container2中的内容实例资源代表对空调自身运行时间,工作状态,散热等情况的描述,container的子资源,即内容实例资源包含具体描述信息,例如,图2中的container1中的内容实例1中包含空调对温度控制的信息,container2中的内容实例n中包含空调对湿度控制的信息,当一个设备想要监控空调对温度湿度的控制情况时,通过获container1中的内容实例1和内容实例2中的信息就可以实现监控空调对温度和湿度的控制情况。It should be noted that the container resource is equivalent to a container, and the description of the device and the like are located in the content instance resource, and the content instance resource is a sub-resource of the container resource. Different container resources represent different categories. For example, container1 represents the content instance resource in container1. It is a description of the air conditioning control of air conditioner temperature control and humidity control. The content instance resource in container2 represents the running time of the air conditioner itself. Description of the working state, heat dissipation, etc., the sub-resource of the container, that is, the content instance resource contains specific descriptive information. For example, the content example 1 in the container 1 in FIG. 2 contains the air conditioning temperature control information, and the content instance in the container 2 It contains information on the humidity control of the air conditioner. When a device wants to monitor the temperature and humidity control of the air conditioner, it can control the temperature and humidity of the air conditioner by obtaining the information in the content instance 1 and the content instance 2 in the container1. Happening.
假设该空调是一个遗留设备,则内容实例资源是由DeviceType类型的语义模型对该设备的原始设备描述信息所对应的数据进行标注所获得的资源,假设该空调是一个普通设备,则内容实例是由Ontology类型的语义模型对该设备的原始设备描述信息所对应的数据进行标注所获得的资源。Assuming that the air conditioner is a legacy device, the content instance resource is a resource obtained by labeling data corresponding to the original device description information of the device by a semantic model of the DeviceType type. If the air conditioner is a common device, the content instance is The data obtained by labeling the data corresponding to the original device description information of the device by the semantic model of the Ontology type.
在现有技术中,假设设备3是遗留设备,该设备想要访图2所 示的应用实体中的container1中的资源,则所述设备3可以获取到container1的URI,设备3向本地网关发起访问请求,携带container1的URI,本地网关根据container1的URI获取container1,并将container1的内容实例资源的URI发送给设备3,设备3根据内容实例资源的URI访问container1的内容实例资源。In the prior art, it is assumed that the device 3 is a legacy device, and the device wants to visit FIG. 2 The resource in the container1 of the application entity, the device 3 can obtain the URI of the container1, the device 3 initiates an access request to the local gateway, carries the URI of the container1, and the local gateway obtains the container1 according to the URI of the container1, and the container1 The URI of the content instance resource is sent to the device 3, and the device 3 accesses the content instance resource of the container1 according to the URI of the content instance resource.
但是,若所述应用实体为普通设备,则图2所示的内容实例资源是由Ontology类型的语义模型对该设备的原始设备描述信息所对应的数据进行标注所获得的资源,由于Ontology类型的语义模型是更高级的语义模型,遗留设备无法访问Ontology类型的语义模型所对应的资源,导致遗留设备无法访问由普通设备的内容实例资源。However, if the application entity is a common device, the content instance resource shown in FIG. 2 is a resource obtained by labeling data corresponding to the original device description information of the device by a semantic model of the Ontology type, due to the Ontology type. The semantic model is a more advanced semantic model. The legacy device cannot access the resources corresponding to the semantic model of the Ontology type, and the legacy device cannot access the content instance resources of the ordinary device.
为解决这一问题,本发明实施例提供了一种资源访问的方法,结合图3,该方法包括:To solve this problem, an embodiment of the present invention provides a method for resource access. Referring to FIG. 3, the method includes:
301、通用服务实体CSE接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息。301. The common service entity CSE receives a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource.
需要说明的是,所述通用服务实体可以为图1中所示的本地物联网网关,也可以为其他设备,所述设备可以为图1所示的设备1、设备2...设备n中的任一设备,也可以为图1未示出的其他设备,具体的,本发明实施例对此不做限定。It should be noted that the general service entity may be the local IoT gateway shown in FIG. 1 or other devices, and the device may be the device 1, the device 2, the device n shown in FIG. Any device that is not shown in FIG. 1 is not limited to the specific embodiment of the present invention.
具体的,所述设备可以为遗留设备,也可以是普通设备。Specifically, the device may be a legacy device or a common device.
若所述设备为遗留设备,则所述设备只能访问DeviceType类型的语义模型所对应的资源,则所述资源访问请求消息中的语义模型信息为DeviceType类型的语义模型,若所述设备为普通设备,则所述设备只访问由Ontology类型的语义模型标注的资源,则则所述资源访问请求消息中的语义模型信息为Ontology类型的语义模型。If the device is a legacy device, the device can only access the resource corresponding to the semantic model of the DeviceType type, and the semantic model information in the resource access request message is a semantic model of the DeviceType type, if the device is normal The device, if the device only accesses the resource marked by the semantic model of the Ontology type, then the semantic model information in the resource access request message is a semantic model of the Ontology type.
在本发明中,CSE对图2所示的资源结构中的container资源的语义模型和内容实例资源的语义模型进行标注,举例来说,结合图4,假设该应用实体为遗留设备,则记录该资源对应的语义模型为DeviceType类型的语义模型。 In the present invention, the CSE labels the semantic model of the container resource and the semantic model of the content instance resource in the resource structure shown in FIG. 2. For example, referring to FIG. 4, if the application entity is a legacy device, the CSE is recorded. The semantic model corresponding to the resource is a semantic model of the DeviceType type.
需要说明的是,图4中只对container资源的语义模型进行了标注,container的子资源,也就是内容实例资源的语义模型可以继承其父资源的语义模型,此时子资源的语义模型与父资源的语义模型相同,当然,也可以单独标注每个内容实例资源的语义模型。It should be noted that in Figure 4, only the semantic model of the container resource is marked. The child resource of the container, that is, the semantic model of the content instance resource can inherit the semantic model of the parent resource. At this time, the semantic model of the child resource and the parent The semantic model of the resource is the same. Of course, the semantic model of each content instance resource can also be labeled separately.
302、所述CSE根据所述资源的URI信息,从预存储的资源集合中获取所述资源。302. The CSE acquires the resource from a pre-stored resource set according to the URI information of the resource.
举例来说,所述设备请求访问图4中的资源为container1中的内容实例资源,所述URI即为所述container1的URI,container1的URI可以在所述CSE的资源集合中唯一标识container1。For example, the device requests to access the content instance resource in the container 1 in FIG. 4, where the URI is the URI of the container1, and the URI of the container1 can uniquely identify the container1 in the resource set of the CSE.
所述CSE中预存储有多个图4所示的资源结构,例如,所述CSE是一个家庭网关,该家庭中的10个设备在该家庭网关上进行了注册,则该家庭网关就会包含这10个设备所对应的如图4所示的抽象后的资源,这些资源即为所述资源集合。A plurality of resource structures shown in FIG. 4 are pre-stored in the CSE. For example, if the CSE is a home gateway, and 10 devices in the home are registered on the home gateway, the home gateway includes The 10 devices correspond to the abstracted resources shown in FIG. 4, and these resources are the resource sets.
303、所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。303. The CSE determines, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic model of the sub-resource and a URI of the sub-resource. Corresponding relationship, if the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is an abstraction of the common device by the CSE In addition, the semantic model of the sub-resource is a semantic model of a DeviceType type, and a semantic model of an Ontology type, the legacy device is a device supporting a semantic model of a DeviceType type, and the common device is a semantic model supporting a DeviceType type. And the device of the Ontology type semantic model.
在本发明实施例中,如图1所示,设备1、设备2...设备n在所述通用服务实体进行注册时,若请求注册的设备为遗留设备,则所CSE将请求注册的设备进行抽象,获得DeviceType类型的语义模型所对应的资源,若请求注册的设备为普通设备,则所述CSE将请求注册的设备进行抽象,获得DeviceType类型的语义模型和Ontology类型的语义模型对应的资源。In the embodiment of the present invention, as shown in FIG. 1, when the device 1, the device 2, the device n registers with the universal service entity, if the device requesting registration is a legacy device, the CSE will request the registered device. The abstraction is performed to obtain the resource corresponding to the semantic model of the DeviceType type. If the device requesting registration is a common device, the CSE abstracts the device requesting the registration, and obtains a semantic model of the DeviceType type and a resource corresponding to the semantic model of the Ontology type. .
具体的,若请求注册的设备为遗留设备,则CSE对所述设备进 抽象后获得如图4所示的资源结构,若所述设备为普通设备,则CSE对所述设备进行抽象后获得如图5所示的资源结构。Specifically, if the device requesting registration is a legacy device, the CSE enters the device. After the abstraction, the resource structure shown in FIG. 4 is obtained. If the device is a normal device, the CSE abstracts the device to obtain a resource structure as shown in FIG. 5.
即,CSE不但将普通设备抽象为DeviceType类型的语义模型对应的资源,还将普通设备抽象为Ontology类型的语义模型对应的资源。That is, the CSE not only abstracts the ordinary device into a resource corresponding to the semantic model of the DeviceType type, but also abstracts the ordinary device into a resource corresponding to the semantic model of the Ontology type.
当然,图5只是一种可能的实现形式,举例来说,也可以是container1对应的语义模型=DeviceType and Ontology,container1包含多个内容实例资源,每个内容实例资源的语义模型单独标注,如包含4个内容实例资源,前两个对应的语义模型=DeviceType,后两个对应的语义模型=Ontology。Of course, FIG. 5 is only a possible implementation form. For example, it may be a semantic model corresponding to container1=DeviceType and Ontology, and container1 includes multiple content instance resources, and the semantic model of each content instance resource is separately labeled, such as 4 content instance resources, the first two corresponding semantic models = DeviceType, the last two corresponding semantic models = Ontology.
当向所述CSE发送资源访问请求的设备为遗留设备时,所述资源访问请求消息中携带请求访问的container资源的URI,携带的语义模型信息为DeviceType类型的语义模型。When the device that sends the resource access request to the CSE is a legacy device, the resource access request message carries the URI of the container resource that is requested to be accessed, and the carried semantic model information is a semantic model of the DeviceType type.
结合图5,若所述设备为遗留设备,且所述设备请求访问对普通设备进行抽象所获得的如图5所示的资源结构中的container1,则所述资源访问请求中携带container1的URI,以及DeviceType类型的语义模型。所述CSE接收到所述资源访问请求后,先通过container1的URI在资源集合中获取到container1,再判断container1中是否有DeviceType类型的语义模型所对应的子资源。With reference to FIG. 5, if the device is a legacy device, and the device requests to access the container1 in the resource structure as shown in FIG. 5 obtained by abstracting the common device, the resource access request carries the URI of the container1. And the semantic model of the DeviceType type. After receiving the resource access request, the CSE obtains the container1 in the resource set through the URI of the container1, and determines whether there is a sub-resource corresponding to the semantic model of the DeviceType type in the container1.
又由于所述普通设备同时被抽象为DeviceType类型的语义模型所对应的资源,以及Ontology类型的语义模型所对应的资源,且所述CSE记录了每个资源所对应的语义模型,使得遗留设备能够访问对普通设备所获得的资源。And because the common device is simultaneously abstracted into a resource corresponding to a semantic model of the DeviceType type, and a resource corresponding to the semantic model of the Ontology type, and the CSE records a semantic model corresponding to each resource, so that the legacy device can Access resources acquired for common devices.
304、若有,所述CSE获取所述子资源的URI,并将所述子资源的URI发送至所述设备。304. If yes, the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
结合图5,所述CSE根据所述container1的URI获取到所述container1,再根据所述资源访问请求消息中携带的DeviceType类型的语义模型获取到container1中的DeviceType类型的语义模型所对应的子资源,所述CSE获取该子资源的URI,并将该子资源的URI 发送至所述设备,使得所述设备根据所述子资源的URI访问该子资源。With reference to FIG. 5, the CSE obtains the container1 according to the URI of the container1, and obtains the sub-resource corresponding to the semantic model of the DeviceType type in the container1 according to the semantic model of the DeviceType type carried in the resource access request message. The CSE obtains the URI of the child resource and the URI of the child resource Sending to the device, the device accessing the sub-resource according to the URI of the sub-resource.
进一步的,若发送所述资源访问请求的设备为普通设备,则资源访问请求消息中携带的语义模型信息为Ontology类型的语义模型,举例来说,结合图4,所述设备请求访问所述CSE对遗留设备进行抽象获得的资源中的container1资源,则所述资源的URI即为图4中的container1的URI,CSE根据container1的URI获取到所述container1,但判断container1中不存在Ontology类型的语义模型所对应的资源,此时CSE向所述设备发送一个指示消息,指示所述设备的资源访问请求失败。Further, if the device that sends the resource access request is a common device, the semantic model information carried in the resource access request message is a semantic model of the Ontology type. For example, in conjunction with FIG. 4, the device requests access to the CSE. For the container1 resource in the resource obtained by abstracting the legacy device, the URI of the resource is the URI of the container1 in FIG. 4, and the CSE obtains the container1 according to the URI of the container1, but it is determined that the semantic of the Ontology type does not exist in the container1. The resource corresponding to the model, the CSE sends an indication message to the device, indicating that the resource access request of the device fails.
此时,所述设备再次发起资源访问请求,携带container1的URI以及DeviceType类型的语义模型,CSE根据container1的URI获取到所述container1,并获取container1的DeviceType类型的语义模型对应的子资源,将子资源的URI发送至所述设备,使得所述设备能够访问CSE对遗留设备进行抽象获得的资源,并且,还能够保证若所述设备访问的是CSE对普通设备进行抽象获得的资源时,所述设备能够获取到Ontology类型的语义模型所对应的子资源。At this time, the device initiates the resource access request again, and carries the URI of the container1 and the semantic model of the DeviceType type. The CSE obtains the container1 according to the URI of the container1, and obtains the sub-resource corresponding to the semantic model of the DeviceType type of the container1. The URI of the resource is sent to the device, so that the device can access the resource obtained by the CSE to abstractly obtain the legacy device, and can also ensure that if the device accesses the resource obtained by the CSE abstracting the common device, The device can obtain the sub-resource corresponding to the semantic model of the Ontology type.
本发明实施例提供了一种资源访问的方法,在该方法中,通用服务实体将遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,并记录每个资源的语义模型信息,将普通设备进行抽象,获得DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息。当设备进行资源请求时,资源请求消息中携带语义模型信息和资源的URI信息。由于普通设备对应有DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,使得遗留设备能够访问CSE对普通设备进行抽象获得的资源。An embodiment of the present invention provides a resource access method, in which a general service entity abstracts a legacy device, obtains a resource corresponding to a semantic model of a DeviceType type, and records semantic model information of each resource, which is common. The device abstracts, obtains the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, and records the semantic model information of each resource. When the device makes a resource request, the resource request message carries semantic model information and URI information of the resource. The common device corresponds to the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, so that the legacy device can access the resource obtained by the CSE abstracting the common device.
结合图6,本发明实施例还提供了一种资源访问的方法,该方法应用于M2M系统,该方法包括: With reference to FIG. 6, the embodiment of the present invention further provides a method for resource access, which is applied to an M2M system, and the method includes:
601、所述CSE接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息。601. The CSE receives a registration request message of the device, where the registration request message includes original device description information of the device.
与CSE相连的设备在发起资源请求之前需要在CSE上进行注册。所述设备的注册请求消息中携带所述设备的原始设备描述信息,相较于遗留设备,普通设备能够提供更为丰富的原始设备描述信息。A device connected to the CSE needs to register on the CSE before initiating a resource request. The device's registration request message carries the original device description information of the device, and the ordinary device can provide richer original device description information than the legacy device.
602、所述CSE根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型。602. The CSE acquires a semantic model of a DeviceType type corresponding to the original device description information according to the original device description information of the device.
具体的,所述CSE根据所述设备的原始描述信息,判断自身存储的语义模型库中是否存储有与所述原始描述信息相对应的DeviceType类型的语义模型,若没有,所述CSE将所述注册请求消息转发至远端CSE,远端CSE中包含有所有语义模型,远端CSE根据所述设备的原始描述信息匹配到DeviceType类型的语义模型后,将该语义模型的URI发送至所述CSE,所述CSE根据所述语义模型的URI从远端CSE访问所述语义模型。Specifically, the CSE determines, according to the original description information of the device, whether a semantic model of the DeviceType type corresponding to the original description information is stored in the semantic model library stored by itself, and if not, the CSE will The registration request message is forwarded to the remote CSE, and the remote CSE includes all the semantic models. After the remote CSE matches the semantic model of the DeviceType type according to the original description information of the device, the URI of the semantic model is sent to the CSE. The CSE accesses the semantic model from a remote CSE according to a URI of the semantic model.
603、所述CSE将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI。603. The CSE abstracts the device into a resource corresponding to a semantic model of a DeviceType type, and allocates a URI for the resource.
所述CSE获取到所述DeviceType类型的语义模型后,将所述设备的原始描述信息填充至所述语义模型中,获得DeviceType类型的语义模型所对应的资源,并记录每个资源的语义模型信息。After acquiring the semantic model of the DeviceType type, the CSE fills the original description information of the device into the semantic model, obtains resources corresponding to the semantic model of the DeviceType type, and records semantic model information of each resource. .
604、所述CSE根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源。604. The CSE determines, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type.
进一步的,所述CSE根据所述设备的原始描述信息,或者所述CSE请求远端CSE根据所述设备的原始描述信息判断是否可以抽象为Ontology类型的语义模型所对应的资源。Further, the CSE determines, according to the original description information of the device, or the CSE, the remote CSE, according to the original description information of the device, whether it can be abstracted into a resource corresponding to the semantic model of the Ontology type.
需要说明的是,若所述设备为遗留设备,则所述设备的原始描述信息较少,所述CSE判断所述设备不能将所述设备抽象为Ontology类型的语义模型所对应的资源,若所述设备为普通设备,则所述设备的原始描述信息较遗留设备更为丰富,所述CSE判断将所述设备抽象为Ontology类型的语义模型对应的资源。 It should be noted that if the device is a legacy device, the original description information of the device is less, and the CSE determines that the device cannot abstract the device into a resource corresponding to the semantic model of the Ontology type. If the device is a common device, the original description information of the device is more abundant than the legacy device, and the CSE judges that the device is abstracted into a resource corresponding to the semantic model of the Ontology type.
605、若是,所述CSE获取所述原始描述信息所对应的Ontology类型的语义模型。605. If yes, the CSE obtains a semantic model of the Ontology type corresponding to the original description information.
若所述CSE根据所述设备的原始描述信息判断可以将所述设备抽象为Ontology类型的语义模型所对应的资源,则说明所述设备为普通设备,此时所述CSE获取所述原始设备描述信息所对应的Ontology类型的语义模型。If the CSE determines that the device can be abstracted into a resource corresponding to the semantic model of the Ontology type according to the original description information of the device, the device is a common device, and the CSE obtains the original device description. The semantic model of the Ontology type corresponding to the information.
具体的,所述CSE根据所述设备的原始设备描述信息,判断自身存储的语义模型库中是否存储有与所述原始设备描述信息相对应的DeviceType类型的语义模型,若没有,所述CSE向远端CSE请求所述设备的原始设备描述信息对应的Ontology类型的语义模型,远端CSE根据所述设备的原始设备描述信息获取到所述原始设备描述信息相对应的Ontology类型的语义模型后,将该语义模型的URI发送至所述CSE,所述CSE根据所述Ontology类型的语义模型的URI获取所述Ontology类型的语义模型。Specifically, the CSE determines, according to the original device description information of the device, whether a semantic model of the DeviceType type corresponding to the original device description information is stored in the semantic model library stored by the CSE, and if not, the CSE is The remote CSE requests the semantic model of the Ontology type corresponding to the original device description information of the device, and the remote CSE obtains the semantic model of the Ontology type corresponding to the original device description information according to the original device description information of the device. Sending the URI of the semantic model to the CSE, the CSE acquiring the semantic model of the Ontology type according to the URI of the semantic model of the Ontology type.
606、所述CSE保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。606. The CSE saves a resource corresponding to the semantic model of the DeviceType type, and abstracts the device into a resource corresponding to a semantic model of the Ontology type.
具体的,本发明实施例的详细技术特征可参见上述图3所对应的实施例的技术特征,本发明实施例对此不再赘述。For a detailed technical feature of the embodiment of the present invention, reference may be made to the technical features of the embodiment corresponding to the foregoing FIG. 3, which is not repeatedly described in the embodiment of the present invention.
本发明实施例提供了一种资源访问的方法,在该方法中,CSE将遗留设备抽象为DeviceType类型的语义模型所对应的资源,将普通设备抽象为DeviceType类型的语义模型所对应的资源和Ontology类型的语义模型所对应的资源,并且记录每个资源的语义模型信息。从而使得遗留设备能够访问DeviceType类型的语义模型所对应的CSE对普通设备进行抽象所获得的资源。An embodiment of the present invention provides a resource access method, in which a CSE abstracts a legacy device into a resource corresponding to a semantic model of a DeviceType type, and abstracts the common device into a resource corresponding to a DeviceType type and an Ontology. The resources corresponding to the semantic model of the type, and record the semantic model information of each resource. Thereby, the legacy device can access the resources obtained by abstracting the common device by the CSE corresponding to the semantic model of the DeviceType type.
结合图7,本发明实施例还提供了一种资源访问的方法,该方法应用于M2M系统,该方法包括:With reference to FIG. 7, an embodiment of the present invention further provides a method for resource access, which is applied to an M2M system, and the method includes:
701、设备向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI 信息。701. The device sends a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and a uniform resource identifier URI of the resource. information.
702、所述设备接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。702. The device receives a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if the sub-resource For the CSE to abstract the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the ordinary device, the sub-resource The semantic model of the resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device is a device supporting a semantic model of the DeviceType type and a semantic model of the Ontology type. .
具体的,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述设备接收CSE发送的DeviceType类型的语义模型所对应的子资源的URI。Specifically, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the device receives the URI of the sub-resource corresponding to the semantic model of the DeviceType type sent by the CSE.
若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型。所述设备接收所述资源的子资源的URI之前,所述设备接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;所述设备重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;所述设备接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。If the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type. Before the device receives the URI of the sub-resource of the resource, the device receives the indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails; the device re-directs to the CSE Sending a resource request message, the semantic model information included in the retransmitted resource request message is a semantic model of a Type of DeviceType, and URI information of the resource; the device receives a URI of a sub-resource of the resource, where The sub-resource is a sub-resource corresponding to the semantic model of the DeviceType type.
需要说明的,本发明实施例的详细技术特征可参见上述图3和图6所对应的方法的实施例,本发明实施对此不再赘述。It should be noted that the detailed technical features of the embodiments of the present invention can be referred to the embodiments of the method corresponding to the foregoing FIG. 3 and FIG.
本发明实施例提供了一种资源访问的方法,在该方法中,通用服务实体对遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,对普通设备进行抽象,获得DeviceType类型的语义模型对应的资源,以及Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息,当设备发起资源访问时,资源访问请求消息携带资源的URI信息以及语义模型信息,CSE根据资源的URI 获取所述资源,并获取所述资源中所述语义模型信息所对应的子资源,从而使得遗留设备能够访问CSE对普通设备进行抽象获得的资源,进一步的,若所述设备为普通设备,所述设备请求访问的资源是CSE对遗留设备进行抽象获得的,所述设备访问失败,所述设备再次发起资源访问请求,携带的语义模型信息对应的语义模型为DeviceType类型的语义模型,使得普通设备能够访问CSE对遗留设备进行抽象获得的资源。An embodiment of the present invention provides a resource access method, in which a general service entity abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, abstracts the common device, and obtains a semantic model of the DeviceType type. Corresponding resources, and resources corresponding to the semantic model of the Ontology type, and recording semantic model information of each resource. When the device initiates resource access, the resource access request message carries the URI information of the resource and the semantic model information, and the CSE is based on the URI of the resource. Obtaining the resource, and acquiring the sub-resource corresponding to the semantic model information in the resource, so that the legacy device can access the resource obtained by the CSE to abstract the common device, and further, if the device is a common device, The resource requested by the device is obtained by abstraction of the legacy device by the CSE. If the device fails to access, the device initiates a resource access request again, and the semantic model corresponding to the semantic model information carried is a semantic model of the DeviceType type, so that the common device Ability to access resources that the CSE abstracts for legacy devices.
为解决遗留设备无法访问由普通设备所对应的资源的问题,结合图8,本发明实施例还提供了一种CSE,该CSE包括:接收单元801,第一获取单元802,判断单元803,第二获取单元804和发送单元805;To solve the problem that the legacy device cannot access the resources corresponding to the common device, the embodiment of the present invention further provides a CSE, where the CSE includes: a receiving unit 801, a first obtaining unit 802, and a determining unit 803. Two obtaining unit 804 and sending unit 805;
所述接收单元801,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiving unit 801 is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述第一获取资源802,用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The first acquiring resource 802 is configured to obtain the resource from a pre-stored resource set according to the URI information of the resource;
所述判断单元803,用于根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;The determining unit 803 is configured to determine, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic model of the sub-resource and the sub-resource Correspondence relationship of the URI, if the sub-resource is abstracted from the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, if the sub-resource is the CSE pair If the device is abstracted, the semantic model of the sub-resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device supports the DeviceType type. Semantic model and device of the Ontology type of semantic model;
所述第二获取单元804,用于获取所述子资源的URI;The second obtaining unit 804 is configured to acquire a URI of the sub-resource;
所述发送单元805,用于将所述子资源的URI发送至所述设备。 The sending unit 805 is configured to send a URI of the sub-resource to the device.
具体的,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述判断单元803具体用于:Specifically, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the determining unit 803 is specifically configured to:
判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
具体的,所述若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型,所述判断单元803具体用于:Specifically, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type, and the determining unit 803 is specifically configured to:
判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining whether the resource includes a sub-resource corresponding to a semantic model of the Ontology type;
所述发送单元805还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The sending unit 805 is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
所述接收单元801还用于:接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiving unit 801 is further configured to: receive a resource request message that is resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述第一获取单元802还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源;The first obtaining unit 802 is further configured to: obtain the resource from the resource set according to the URI information of the resource;
所述判断单元803还用于:判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源;The determining unit 803 is further configured to: determine whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type;
所述第二获取单元804还用于:获取所述子资源的URI;The second obtaining unit 804 is further configured to: acquire a URI of the sub-resource;
所述发送单元805还用于:将所述子资源的URI发送至所述设备。The sending unit 805 is further configured to: send a URI of the sub-resource to the device.
具体的,所述CSE还包括第三获取单元806和抽象单元807,所述接收单元801还用于:Specifically, the CSE further includes a third obtaining unit 806 and an abstracting unit 807, where the receiving unit 801 is further configured to:
接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;Receiving a registration request message of the device, where the registration request message includes original device description information of the device;
所述第三获取单元806,用于根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型; The third obtaining unit 806 is configured to acquire, according to the original device description information of the device, a semantic model of the DeviceType type corresponding to the original device description information;
所述抽象单元807,用于将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;The abstracting unit 807 is configured to abstract the device into a resource corresponding to a semantic model of a DeviceType type, and allocate a URI for the resource;
所述判断单元803还用于:根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;The determining unit 803 is further configured to: determine, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type;
所述第三获取单元806,用于获取所述原始描述信息所对应的Ontology类型的语义模型;The third obtaining unit 806 is configured to acquire a semantic model of the Ontology type corresponding to the original description information;
所述抽象单元807还用于:将所述设备抽象为Ontology类型的语义模型所对应的资源。The abstracting unit 807 is further configured to: abstract the device as a resource corresponding to a semantic model of the Ontology type.
本发明实施例提供了一种CSE,所述CSE将遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,并记录每个资源的语义模型信息,将普通设备进行抽象,获得DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息。当设备进行资源请求时,资源请求消息中携带语义模型信息和资源的URI信息。由于普通设备对应有DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,使得遗留设备能够访问CSE对普通设备进行抽象获得的资源。The embodiment of the present invention provides a CSE, which abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, records the semantic model information of each resource, abstracts the common device, and obtains a DeviceType type. The resource corresponding to the semantic model and the resource corresponding to the semantic model of the Ontology type, and record the semantic model information of each resource. When the device makes a resource request, the resource request message carries semantic model information and URI information of the resource. The common device corresponds to the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, so that the legacy device can access the resource obtained by the CSE abstracting the common device.
为解决遗留设备无法访问由普通设备所对应的资源的问题,结合图9,本发明实施例还提供了一种设备,该设备包括:发送单元901和接收单元902;In order to solve the problem that the legacy device cannot access the resources corresponding to the common device, the embodiment of the present invention further provides a device, and the device includes: a sending unit 901 and a receiving unit 902;
所述发送单元901,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The sending unit 901 is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述接收单元902,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述 子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The receiving unit 902 is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, Said The semantic model of the sub-resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device is a semantic model supporting the DeviceType type and a semantic model of the Ontology type. device.
具体的,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收单元902具体用于:Specifically, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the receiving unit 902 is specifically configured to:
接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
具体的,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;Specifically, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述接收单元902还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiving unit 902 is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
所述发送单元901还用于:重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The sending unit 901 is further configured to: re-send a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述接收单元902具体用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiving unit 902 is specifically configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
本发明实施例提供了一种设备,通用服务实体对遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,对普通设备进行抽象,获得DeviceType类型的语义模型对应的资源,以及Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息,当所述设备发起资源访问时,资源访问请求消息携带资源的URI信息以及语义模型信息,CSE根据资源的URI获取所述资源,并获取所述资源中所述语义模型信息所对应的子资源,从而使得遗留设备能够访问CSE对普通设备进行抽象获得的资源,进一步的,若所述设备为普通设备,所述设备请求访问的资源是CSE对遗留设备进行抽象获得的,所述设备访问失败,所述设备再次发起资源访问请求,携带的语义模型信息对应的语义模型为DeviceType类型的 语义模型,使得普通设备能够访问CSE对遗留设备进行抽象获得的资源。An embodiment of the present invention provides a device, where a general service entity abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, abstracts the common device, obtains a resource corresponding to a semantic model of the DeviceType type, and an Ontology type. a resource corresponding to the semantic model, and recording semantic model information of each resource. When the device initiates resource access, the resource access request message carries the URI information of the resource and the semantic model information, and the CSE acquires the resource according to the URI of the resource, and Acquiring the sub-resource corresponding to the semantic model information in the resource, so that the legacy device can access the resource obtained by the CSE to abstract the common device, and further, if the device is a common device, the device requests the accessed resource. If the CSE abstracts the legacy device, the device fails to access the device, and the device initiates the resource access request again. The semantic model corresponding to the semantic model information is DeviceType type. The semantic model enables ordinary devices to access the resources that the CSE abstracts for legacy devices.
为解决遗留设备无法访问由普通设备所对应的资源的问题,结合图10,本发明实施例还提供了一种CSE,接收器1001,处理器1002,总线1003,存储器1004和发送器1005;To solve the problem that the legacy device cannot access the resources corresponding to the common device, in conjunction with FIG. 10, the embodiment of the present invention further provides a CSE, a receiver 1001, a processor 1002, a bus 1003, a memory 1004, and a transmitter 1005.
所述接收器1001,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiver 1001 is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述处理器1002通过所述总线1003获取所述存储器1004中的指令,以用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The processor 1002 acquires, by using the bus 1003, an instruction in the memory 1004, to obtain the resource from a pre-stored resource set according to the URI information of the resource;
根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;Determining, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, the semantic model supporting the DeviceType type and the semantics of the Ontology type. Model device
若有,所述CSE获取所述子资源的URI;If yes, the CSE obtains a URI of the sub-resource;
所述发送器1005,用于将所述子资源的URI发送至所述设备。The sender 1005 is configured to send a URI of the sub-resource to the device.
具体的,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述处理器1002具体用于:Specifically, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the processor 1002 is specifically configured to:
判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
具体的,若所述设备为普通设备,则所述资源的语义模型信息 所对应的语义模型为:Ontology类型的语义模型,所述处理器1002具体用于:Specifically, if the device is a common device, the semantic model information of the resource The corresponding semantic model is: a semantic model of the Ontology type, and the processor 1002 is specifically configured to:
判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining whether the resource includes a sub-resource corresponding to a semantic model of the Ontology type;
所述发送器1005还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The transmitter 1005 is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
所述接收器1001还用于:接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiver 1001 is further configured to: receive a resource request message that is resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述处理器1002还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源,判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源,若有,获取所述子资源的URI;The processor 1002 is further configured to: obtain the resource from the resource set according to the URI information of the resource, and determine whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type, and if yes, obtain The URI of the sub-resource;
所述发送器1005,用于将所述子资源的URI发送至所述设备。The sender 1005 is configured to send a URI of the sub-resource to the device.
具体的,所述接收器1001还用于:接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;Specifically, the receiver 1001 is further configured to: receive a registration request message of the device, where the registration request message includes original device description information of the device;
所述处理器1002还用于:根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;若是,获取所述原始描述信息所对应的Ontology类型的语义模型;保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。The processor 1002 is further configured to: obtain a semantic model of a DeviceType type corresponding to the original device description information according to the original device description information of the device; and abstract the device into a resource corresponding to a semantic model of a DeviceType type, And assigning a URI to the resource; determining, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of the Ontology type; if yes, acquiring a semantic model of the Ontology type corresponding to the original description information; The resource corresponding to the semantic model of the DeviceType type is saved, and the device is abstracted into a resource corresponding to the semantic model of the Ontology type.
本发明实施例提供了一种CSE,所述CSE将遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,并记录每个资源的语义模型信息,将普通设备进行抽象,获得DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息。当设备进行资源请求时,资源请求消息中携带语义模型信息和资源的URI信息。由于普通设备对应有 DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,使得遗留设备能够访问CSE对普通设备进行抽象获得的资源。The embodiment of the present invention provides a CSE, which abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, records the semantic model information of each resource, abstracts the common device, and obtains a DeviceType type. The resource corresponding to the semantic model and the resource corresponding to the semantic model of the Ontology type, and record the semantic model information of each resource. When the device makes a resource request, the resource request message carries semantic model information and URI information of the resource. Because the common equipment has The resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type enable the legacy device to access the resource obtained by the CSE abstracting the common device.
为解决遗留设备无法访问由普通设备所对应的资源的问题,结合图11,本发明实施例还提供了一种设备,该设备包括:发送器1101和接收器1102;To solve the problem that the legacy device cannot access the resources corresponding to the common device, the embodiment of the present invention further provides a device, and the device includes: a transmitter 1101 and a receiver 1102;
所述发送器1101,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The transmitter 1101 is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
所述接收器1102,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The receiver 1102 is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, the semantic model supporting the DeviceType type and the semantics of the Ontology type. Model of the device.
具体的,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收器1102具体用于:Specifically, if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the receiver 1102 is specifically configured to:
接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
具体的,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;Specifically, if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
所述接收器1102还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiver 1102 is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
所述发送器1101还用于:重新向所述CSE发送资源请求消息, 所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The transmitter 1101 is further configured to: resend a resource request message to the CSE, where The semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
所述接收器1102还用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiver 1102 is further configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
本发明实施例提供了一种设备,通用服务实体对遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,对普通设备进行抽象,获得DeviceType类型的语义模型对应的资源,以及Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息,当所述设备发起资源访问时,资源访问请求消息携带资源的URI信息以及语义模型信息,CSE根据资源的URI获取所述资源,并获取所述资源中所述语义模型信息所对应的子资源,从而使得遗留设备能够访问CSE对普通设备进行抽象获得的资源,进一步的,若所述设备为普通设备,所述设备请求访问的资源是CSE对遗留设备进行抽象获得的,所述设备访问失败,所述设备再次发起资源访问请求,携带的语义模型信息对应的语义模型为DeviceType类型的语义模型,使得普通设备能够访问CSE对遗留设备进行抽象获得的资源。An embodiment of the present invention provides a device, where a general service entity abstracts a legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, abstracts the common device, obtains a resource corresponding to a semantic model of the DeviceType type, and an Ontology type. a resource corresponding to the semantic model, and recording semantic model information of each resource. When the device initiates resource access, the resource access request message carries the URI information of the resource and the semantic model information, and the CSE acquires the resource according to the URI of the resource, and Acquiring the sub-resource corresponding to the semantic model information in the resource, so that the legacy device can access the resource obtained by the CSE to abstract the common device, and further, if the device is a common device, the device requests the accessed resource. If the CSE abstracts the legacy device, the device fails to access the device, and the device initiates the resource access request again. The semantic model corresponding to the semantic model information is a DeviceType type semantic model, so that the common device can access the CSE to the legacy device. Abstraction .
为解决遗留设备无法访问由普通设备所对应的资源的问题,本发明实施例还提供了一种M2M系统,所述M2M系统至少包括如图8所对应的实施例中的CSE,以及如图9所对应的实施例中的设备;或者,所述M2M系统至少包括如图10所对应的实施例中的CSE,以及如图11所对应的实施例中的设备。To solve the problem that the legacy device cannot access the resources corresponding to the common device, the embodiment of the present invention further provides an M2M system, where the M2M system includes at least the CSE in the embodiment corresponding to FIG. 8, and FIG. The device in the corresponding embodiment; or the M2M system includes at least the CSE in the embodiment corresponding to FIG. 10, and the device in the embodiment corresponding to FIG.
本发明实施例提供了一种M2M系统,该M2M系统中包括CSE和设备,所述CSE将遗留设备进行抽象,获得DeviceType类型的语义模型所对应的资源,并记录每个资源的语义模型信息,将普通设备进行抽象,获得DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,并记录每个资源的语义模型信息。当所述设备进行资源请求时,资源请求消息中携带语义模型 信息和资源的URI信息。由于普通设备对应有DeviceType类型的语义模型对应的资源和Ontology类型的语义模型对应的资源,使得遗留设备能够访问CSE对普通设备进行抽象获得的资源。An embodiment of the present invention provides an M2M system, where the M2M system includes a CSE and a device, and the CSE abstracts the legacy device, obtains a resource corresponding to a semantic model of the DeviceType type, and records semantic model information of each resource. The common device is abstracted, the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type are obtained, and the semantic model information of each resource is recorded. When the device makes a resource request, the resource request message carries a semantic model URI information for information and resources. The common device corresponds to the resource corresponding to the semantic model of the DeviceType type and the resource corresponding to the semantic model of the Ontology type, so that the legacy device can access the resource obtained by the CSE abstracting the common device.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims (22)

  1. 一种资源访问的方法,该方法适用于机器对机器M2M系统,其特征在于,该方法包括:A method for resource access, the method being applicable to a machine-to-machine M2M system, characterized in that the method comprises:
    通用服务实体CSE接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The general service entity CSE receives the resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述CSE根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The CSE acquires the resource from a pre-stored resource set according to the URI information of the resource;
    所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;The CSE determines, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic relationship between the sub-resource and a URI of the sub-resource. If the sub-resource is abstracted from the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, and the common device is a semantic model and Ontology supporting a DeviceType type. Type of semantic model of the device;
    若有,所述CSE获取所述子资源的URI,并将所述子资源的URI发送至所述设备。If yes, the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
  2. 根据权利要求1所述的方法,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型;The method according to claim 1, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type;
    所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源具体包括:The determining, by the CSE, whether the sub-resource corresponding to the semantic model information is included in the resource according to the semantic model information includes:
    所述CSE判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。The CSE determines whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
  3. 根据权利要求1所述的方法,其特征在于,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型; The method according to claim 1, wherein if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
    所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源具体包括:The determining, by the CSE, whether the sub-resource corresponding to the semantic model information is included in the resource according to the semantic model information includes:
    所述CSE判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining, by the CSE, whether the resource includes a sub-resource corresponding to a semantic model of an Ontology type;
    所述CSE根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源之后,该方法还包括:After the CSE determines, according to the semantic model information, whether the resource includes the sub-resource corresponding to the semantic model information, the method further includes:
    若没有,所述CSE向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;If not, the CSE sends an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
    所述CSE接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;Receiving, by the CSE, a resource request message resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
    所述CSE根据所述资源的URI信息,从所述资源集合中获取所述资源;The CSE acquires the resource from the resource set according to the URI information of the resource;
    所述CSE判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源;Determining, by the CSE, whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type;
    若有,所述CSE获取所述子资源的URI,并将所述子资源的URI发送至所述设备。If yes, the CSE acquires a URI of the sub-resource and sends a URI of the sub-resource to the device.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述CSE接收设备发送的资源请求消息之前,该方法还包括:The method according to any one of claims 1-3, wherein before the CSE receives the resource request message sent by the device, the method further includes:
    所述CSE接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;The CSE receives a registration request message of the device, where the registration request message includes original device description information of the device;
    所述CSE根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;The CSE acquires a semantic model of the DeviceType type corresponding to the original device description information according to the original device description information of the device;
    所述CSE将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;The CSE abstracts the device into a resource corresponding to a semantic model of a DeviceType type, and allocates a URI for the resource;
    所述CSE根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;Determining, by the CSE, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type according to the original device description information;
    若是,所述CSE获取所述原始描述信息所对应的Ontology类型的语义模型; If yes, the CSE acquires a semantic model of the Ontology type corresponding to the original description information;
    所述CSE保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。The CSE saves resources corresponding to the semantic model of the DeviceType type, and abstracts the device into resources corresponding to the semantic model of the Ontology type.
  5. 一种资源访问的方法,适用于机器对机器M2M系统,其特征在于,该方法包括:A method for resource access, suitable for a machine-to-machine M2M system, characterized in that the method comprises:
    设备向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The device sends a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述设备接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The device receives a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if the sub-resource is If the CSE abstracts the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, the sub-resource The semantic model is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, which is a device supporting a semantic model of the DeviceType type and a semantic model of the Ontology type.
  6. 根据权利要求5所述的方法,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型;The method according to claim 5, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type;
    所述设备接收所述资源的子资源的URI具体包括:The URI of the sub-resource of the device receiving the resource specifically includes:
    所述设备接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The device receives a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  7. 根据权利要求5所述的方法,其特征在于,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;The method according to claim 5, wherein if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
    所述设备接收所述资源的子资源的URI之前,该方法还包括:Before the device receives the URI of the sub-resource of the resource, the method further includes:
    所述设备接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;Receiving, by the device, an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
    所述设备重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型, 以及所述资源的URI信息;The device sends a resource request message to the CSE, and the semantic model information included in the retransmitted resource request message is a semantic model of the DeviceType type. And URI information of the resource;
    所述设备接收所述资源的子资源的URI具体包括:The URI of the sub-resource of the device receiving the resource specifically includes:
    所述设备接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The device receives a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  8. 一种通用服务实体CSE,其特征在于,所述CSE包括:接收单元,第一获取单元,判断单元,第二获取单元和发送单元;A general service entity CSE, the CSE includes: a receiving unit, a first acquiring unit, a determining unit, a second obtaining unit, and a sending unit;
    所述接收单元,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiving unit is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述第一获取资源,用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;The first acquiring resource, configured to acquire the resource from a pre-stored resource set according to the URI information of the resource;
    所述判断单元,用于根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;The determining unit is configured to determine, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a semantic model of the sub-resource and the sub-resource Corresponding relationship of the URI, if the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, if the sub-resource is the CSE-to-common device For abstraction, the semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, and the common device supports a DeviceType type. a semantic model and a device of the Ontology type semantic model;
    所述第二获取单元,用于获取所述子资源的URI;The second obtaining unit is configured to acquire a URI of the sub-resource;
    所述发送单元,用于将所述子资源的URI发送至所述设备。The sending unit is configured to send a URI of the sub-resource to the device.
  9. 根据权利要求8所述的CSE,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述判断单元具体用于:The CSE according to claim 8, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the determining unit is specifically configured to:
    判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
  10. 根据权利要求8所述的CSE,其特征在于,所述若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为: Ontology类型的语义模型,所述判断单元具体用于:The CSE according to claim 8, wherein if the device is a general device, the semantic model corresponding to the semantic model information of the resource is: The semantic model of the Ontology type, the judging unit is specifically used to:
    判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining whether the resource includes a sub-resource corresponding to a semantic model of the Ontology type;
    所述发送单元还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The sending unit is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
    所述接收单元还用于:接收所述设备重新发送的资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiving unit is further configured to: receive a resource request message that is resent by the device, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
    所述第一获取单元还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源;The first obtaining unit is further configured to: obtain the resource from the resource set according to the URI information of the resource;
    所述判断单元还用于:判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源;The determining unit is further configured to: determine whether the resource includes a sub-resource corresponding to a semantic model of a DeviceType type;
    所述第二获取单元还用于:获取所述子资源的URI;The second obtaining unit is further configured to: acquire a URI of the sub-resource;
    所述发送单元还用于:将所述子资源的URI发送至所述设备。The sending unit is further configured to: send a URI of the sub-resource to the device.
  11. 根据权利要求8-10中任一项所述的CSE,其特征在于,所述CSE还包括第三获取单元和抽象单元,所述接收单元还用于:The CSE according to any one of claims 8 to 10, wherein the CSE further comprises a third obtaining unit and an abstracting unit, the receiving unit is further configured to:
    接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;Receiving a registration request message of the device, where the registration request message includes original device description information of the device;
    所述第三获取单元,用于根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;The third acquiring unit is configured to acquire, according to the original device description information of the device, a semantic model of the DeviceType type corresponding to the original device description information;
    所述抽象单元,用于将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;The abstracting unit is configured to abstract the device into a resource corresponding to a semantic model of a DeviceType type, and allocate a URI for the resource;
    所述判断单元还用于:根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;The determining unit is further configured to: determine, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of an Ontology type;
    所述第三获取单元,用于获取所述原始描述信息所对应的Ontology类型的语义模型;The third obtaining unit is configured to acquire a semantic model of the Ontology type corresponding to the original description information;
    所述抽象单元还用于:将所述设备抽象为Ontology类型的语义模型所对应的资源。The abstracting unit is further configured to: abstract the device as a resource corresponding to a semantic model of the Ontology type.
  12. 一种设备,其特征在于,所述设备包括:发送单元和接收单 元;An apparatus, comprising: a sending unit and a receiving order yuan;
    所述发送单元,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The sending unit is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述接收单元,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备。The receiving unit is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if The child resource is abstracted from the CSE for the legacy device, and the semantic model of the child resource is a semantic model of the DeviceType type. If the child resource is abstracted by the CSE for the common device, the The semantic model of the sub-resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device is a semantic model supporting the DeviceType type and a semantic model of the Ontology type. device of.
  13. 根据权利要求12所述的设备,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收单元具体用于:The device according to claim 12, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the receiving unit is specifically configured to:
    接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  14. 根据权利要求12所述的设备,其特征在于,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;The device according to claim 12, wherein if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
    所述接收单元还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiving unit is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
    所述发送单元还用于:重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The sending unit is further configured to: resend a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
    所述接收单元具体用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiving unit is specifically configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  15. 一种通用服务实体CSE,其特征在于,所述CSE包括:接 收器,处理器,总线,存储器和发送器;A general service entity CSE, characterized in that the CSE includes: Receiver, processor, bus, memory and transmitter;
    所述接收器,用于接收设备发送的资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The receiver is configured to receive a resource request message sent by the device, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述处理器通过所述总线获取所述存储器中的指令,以用于根据所述资源的URI信息,从预存储的资源集合中获取所述资源;And the processor acquires, by using the bus, an instruction in the memory, to obtain the resource from a pre-stored resource set according to the URI information of the resource;
    根据所述语义模型信息,判断所述资源中是否包含所述语义模型信息所对应子资源,其中,所述资源集合中包含子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的语义模型的设备;Determining, according to the semantic model information, whether the resource includes a sub-resource corresponding to the semantic model information, where the resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if If the sub-resource is abstracted by the CSE for the legacy device, the semantic model of the sub-resource is a semantic model of the DeviceType type, and if the sub-resource is abstracted by the CSE for the common device, The semantic model of the sub-resource is a semantic model of a DeviceType type and a semantic model of an Ontology type, and the legacy device is a device supporting a semantic model of a DeviceType type, the semantic model supporting the DeviceType type and the semantics of the Ontology type. Model device
    若有,所述CSE获取所述子资源的URI;If yes, the CSE obtains a URI of the sub-resource;
    所述发送器,用于将所述子资源的URI发送至所述设备。The sender is configured to send a URI of the sub-resource to the device.
  16. 根据权利要求15所述的CSE,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述处理器具体用于:The CSE according to claim 15, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of a DeviceType type, and the processor is specifically configured to:
    判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源。Determining whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type.
  17. 根据权利要求15所述的CSE,其特征在于,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型,所述处理器具体用于:The CSE according to claim 15, wherein if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type, and the processor is specifically configured to:
    判断所述资源中是否包含Ontology类型的语义模型所对应的子资源;Determining whether the resource includes a sub-resource corresponding to a semantic model of the Ontology type;
    所述发送器还用于:向所述设备发送指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The transmitter is further configured to: send an indication message to the device, where the indication message is used to indicate that the resource access request of the device fails;
    所述接收器还用于:接收所述设备重新发送的资源请求消息,所 述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The receiver is further configured to: receive a resource request message resent by the device, where The semantic model information included in the retransmitted resource request message is a semantic model of the DeviceType type, and URI information of the resource;
    所述处理器还用于:根据所述资源的URI信息,从所述资源集合中获取所述资源,判断所述资源中是否包含DeviceType类型的语义模型所对应的子资源,若有,获取所述子资源的URI;The processor is further configured to: obtain the resource from the resource set according to the URI information of the resource, and determine whether the resource includes a sub-resource corresponding to a semantic model of the DeviceType type, and if so, the acquiring The URI of the child resource;
    所述发送器,用于将所述子资源的URI发送至所述设备。The sender is configured to send a URI of the sub-resource to the device.
  18. 根据权利要求15-17任一项所述的CSE,其特征在于,所述接收器还用于:接收所述设备的注册请求消息,所述注册请求消息中包含所述设备的原始设备描述信息;The CSE according to any one of claims 15-17, wherein the receiver is further configured to: receive a registration request message of the device, where the registration request message includes original device description information of the device. ;
    所述处理器还用于:根据所述设备的原始设备描述信息,获取所述原始设备描述信息所对应的DeviceType类型的语义模型;将所述设备抽象为DeviceType类型的语义模型对应的资源,并为所述资源分配URI;根据所述原始设备描述信息判断是否将所述设备抽象为Ontology类型的语义模型所对应的资源;若是,获取所述原始描述信息所对应的Ontology类型的语义模型;保存所述DeviceType类型的语义模型所对应资源,并将所述设备抽象为Ontology类型的语义模型所对应的资源。The processor is further configured to: obtain a semantic model of a DeviceType type corresponding to the original device description information according to the original device description information of the device; and abstract the device into a resource corresponding to a semantic model of a DeviceType type, and Allocating a URI for the resource; determining, according to the original device description information, whether the device is abstracted into a resource corresponding to a semantic model of the Ontology type; if yes, acquiring a semantic model of the Ontology type corresponding to the original description information; The resource corresponding to the semantic model of the DeviceType type, and abstracting the device into a resource corresponding to the semantic model of the Ontology type.
  19. 一种设备,其特征在于,所述设备包括:发送器和接收器;An apparatus, comprising: a transmitter and a receiver;
    所述发送器,用于向通用服务实体CSE发送资源请求消息,其中,所述资源请求消息中包含语义模型信息和资源的统一资源标识符URI信息;The transmitter is configured to send a resource request message to the universal service entity CSE, where the resource request message includes semantic model information and uniform resource identifier URI information of the resource;
    所述接收器,用于接收所述资源的子资源的URI,其中,所述CSE预存储的资源集合中包含所述子资源的语义模型和所述子资源的URI的对应关系,若所述子资源为所述CSE对遗留设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型,若所述子资源为所述CSE对普通设备进行抽象得来的,则所述子资源的语义模型为DeviceType类型的语义模型以及Ontology类型的语义模型,所述遗留设备为支持DeviceType类型的语义模型的设备,所述普通设备为支持DeviceType类型的语义模型和Ontology类型的 语义模型的设备。The receiver is configured to receive a URI of a sub-resource of the resource, where the CSE pre-stored resource set includes a correspondence between a semantic model of the sub-resource and a URI of the sub-resource, if The child resource is abstracted from the CSE for the legacy device, and the semantic model of the child resource is a semantic model of the DeviceType type. If the child resource is abstracted by the CSE for the common device, the The semantic model of the sub-resource is a semantic model of the DeviceType type and a semantic model of the Ontology type, and the legacy device is a device supporting a semantic model of the DeviceType type, and the common device is a semantic model supporting the DeviceType type and an Ontology type. Semantic model of the device.
  20. 根据权利要求19所述的设备,其特征在于,若所述设备为遗留设备,则所述语义模型信息所对应的语义模型为:DeviceType类型的语义模型,所述接收器具体用于:The device according to claim 19, wherein if the device is a legacy device, the semantic model corresponding to the semantic model information is: a semantic model of the DeviceType type, and the receiver is specifically configured to:
    接收所述子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。Receiving a URI of the sub-resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  21. 根据权利要求19所述的设备,其特征在于,若所述设备为普通设备,则所述资源的语义模型信息所对应的语义模型为:Ontology类型的语义模型;The device according to claim 19, wherein if the device is a common device, the semantic model corresponding to the semantic model information of the resource is: a semantic model of the Ontology type;
    所述接收器还用于:接收所述CSE发送的指示消息,所述指示消息用于指示所述设备的资源访问请求失败;The receiver is further configured to: receive an indication message sent by the CSE, where the indication message is used to indicate that the resource access request of the device fails;
    所述发送器还用于:重新向所述CSE发送资源请求消息,所述重新发送的资源请求消息中包含的语义模型信息为DeviceType类型的语义模型,以及所述资源的URI信息;The transmitter is further configured to: resend a resource request message to the CSE, where the semantic model information included in the retransmitted resource request message is a semantic model of a DeviceType type, and URI information of the resource;
    所述接收器还用于:接收所述资源的子资源的URI,其中,所述子资源是DeviceType类型的语义模型所对应的子资源。The receiver is further configured to: receive a URI of a sub-resource of the resource, where the sub-resource is a sub-resource corresponding to a semantic model of a DeviceType type.
  22. 一种机器对机器M2M系统,其特征在于,所述M2M系统中至少包含如权利要求8-权利要求11中的任一项所述的通用服务实体CSE,以及如权利要求12-权利要求14中的任一项所述的设备;或者,A machine-to-machine M2M system, characterized in that the M2M system comprises at least the universal service entity CSE according to any one of claims 8 to 11, and as in claims 12-claim 14 Any of the devices described; or
    所述通用服务实体至少包含如权利要求15-权利要求18中的任一项所述的CSE,以及如权利要求19-权利要求21中的任一项所述的设备。 The general service entity comprises at least the CSE according to any one of claims 15 to 18, and the device according to any one of claims 19 to 21.
PCT/CN2015/071578 2015-01-26 2015-01-26 Resource access method, related device and m2m system WO2016119110A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/071578 WO2016119110A1 (en) 2015-01-26 2015-01-26 Resource access method, related device and m2m system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/071578 WO2016119110A1 (en) 2015-01-26 2015-01-26 Resource access method, related device and m2m system

Publications (1)

Publication Number Publication Date
WO2016119110A1 true WO2016119110A1 (en) 2016-08-04

Family

ID=56542114

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071578 WO2016119110A1 (en) 2015-01-26 2015-01-26 Resource access method, related device and m2m system

Country Status (1)

Country Link
WO (1) WO2016119110A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014042446A2 (en) * 2012-09-12 2014-03-20 엘지전자 주식회사 Method and device for requesting for specific right acquisition on specific resource in wireless communication system
US20140256285A1 (en) * 2013-03-05 2014-09-11 Kt Corporation Providing m2m data to unregistered terminal
US20150012551A1 (en) * 2013-07-02 2015-01-08 Convida Wireless, Llc Mechanisms For Semantics Publishing And Discovery

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014042446A2 (en) * 2012-09-12 2014-03-20 엘지전자 주식회사 Method and device for requesting for specific right acquisition on specific resource in wireless communication system
US20140256285A1 (en) * 2013-03-05 2014-09-11 Kt Corporation Providing m2m data to unregistered terminal
US20150012551A1 (en) * 2013-07-02 2015-01-08 Convida Wireless, Llc Mechanisms For Semantics Publishing And Discovery

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
THE TELECOMMUNICATION TECHNOLOGY COMMITTEE.: "Study of Existing Abstraction & Semantic Capability Enablement Technologies for consideration by one M2M", ONEM2M- TR -0007-STUDY-OF-ABSTRACTION-AND-SEMANTICS-ENABLEMENTS-V-0. 11. 0, no. 10, 10 November 2014 (2014-11-10), pages 14 - 30 *

Similar Documents

Publication Publication Date Title
US20230319534A1 (en) Cross-resource subscription for m2m service layer
JP6514315B2 (en) Resource and attribute management in machine-to-machine network
US10241839B2 (en) Method and system for generating a virtual device resource accessible by an application
CN106797400B (en) System and method for enabling access to third party services via a service layer
US11805166B2 (en) Enhanced M2M content management based on interest
US8775651B2 (en) System and method for dynamic adaptation service of an enterprise service bus over a communication platform
TW201826869A (en) Method, system and device for connecting devices
JP2020506564A (en) Service layer resource management for universal interworking and scalability
WO2019144742A1 (en) Binding method for user terminal and device, apparatus, and system
CN108476236B (en) Semantic-based content specification of internet of things data
US7930370B2 (en) Method and system for remote configuration of managed nodes
WO2019056943A1 (en) Method and device for managing application program
US10104537B2 (en) Terminal peripheral control method, M2M gateway, and communications system
JP7246379B2 (en) Service layer message templates in communication networks
CN114025021A (en) Communication method, system, medium and electronic device across Kubernetes cluster
WO2020038443A1 (en) Bridging communication method and device
WO2016086659A1 (en) Service message transmission method, device and system
WO2016119110A1 (en) Resource access method, related device and m2m system
WO2019136120A1 (en) Cross-domain discovery between service layer systems and web of things systems
CN106416191B (en) Providing information to services in a communication network
Cai et al. Control protocols design for cyber-physical systems
CN115100840B (en) Equipment control method, device, electronic equipment and storage medium
KR102344599B1 (en) Apparatus and method for transmitting/receiving information related to media content in a multimedia system
CN117527938A (en) Automatic configuration method, device and equipment for communication protocol stack applied to vehicle

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: 15879321

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: 15879321

Country of ref document: EP

Kind code of ref document: A1