WO2021102694A1 - BLE Mesh设备的访问方法、装置、设备及存储介质 - Google Patents

BLE Mesh设备的访问方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021102694A1
WO2021102694A1 PCT/CN2019/121008 CN2019121008W WO2021102694A1 WO 2021102694 A1 WO2021102694 A1 WO 2021102694A1 CN 2019121008 W CN2019121008 W CN 2019121008W WO 2021102694 A1 WO2021102694 A1 WO 2021102694A1
Authority
WO
WIPO (PCT)
Prior art keywords
ocf
ble mesh
access request
mapping relationship
access
Prior art date
Application number
PCT/CN2019/121008
Other languages
English (en)
French (fr)
Inventor
杨宁
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2019/121008 priority Critical patent/WO2021102694A1/zh
Priority to CN201980097356.2A priority patent/CN113994649A/zh
Publication of WO2021102694A1 publication Critical patent/WO2021102694A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the embodiments of the present application relate to the technical field of the Internet of Things, and in particular, to a method, device, device, and storage medium for accessing a BLE Mesh device.
  • the combination of the Internet of Things (IOT) and Artificial Intelligence (AI) is getting closer.
  • the Internet of Things is moving from “connection” to "intelligence”; on the other hand, artificial intelligence is moving from “cloud” to “edge”, and the two are working together to promote the Internet of Things to the Internet of Intelligences (Internet of Intelligences).
  • OCF Open Connectivity Foundation
  • the OCF standard supports search and communication between smart devices without being restricted by manufacturers, operating systems, chips, or physical transmission. Provides technical specifications for the seamless connection between various physical media layer, transport layer and application layer devices.
  • OCF has a wide range of flexible application scenarios: First of all, OCF clients (such as mobile phone applications) and OCF devices (Server) (such as air conditioners) can interact. For example, using mobile phone applications can switch, temperature, and mode of air conditioners. Secondly, multiple OCF clients can control OCF devices at the same time.
  • OCF clients can interact with other standard devices, such as Bluetooth, ZigBee (Zigbee), etc.; finally, OCF devices can also be bridged and controlled by other standard clients.
  • BLE Bluetooth Low Energy
  • BLE mesh star networking
  • the working mode of BLE mesh is managed flood (managed flood message dissemination).
  • the flooding method makes message dissemination very reliable, easy to expand, and performance can meet the commercial and industrial markets.
  • the embodiments of the present application provide a method, device, device, and storage medium for accessing a BLE Mesh device.
  • the technical solution is as follows:
  • an embodiment of the present application provides a method for accessing a BLE Mesh device, which is applied to a gateway device, and the method includes:
  • the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, the resource type of the resource and the There is a mapping relationship between service models.
  • an embodiment of the present application provides a method for accessing a BLE Mesh device, which is applied to an OCF client, and the method includes:
  • the first access request is a request by the OCF client to access the resources of the first OCF device, and the first OCF device is a virtual OCF device mapped by the first BLE Mesh device ;
  • the first access request is converted into a second access request and then sent to the first BLE Mesh device, and the second access request is for the gateway device to access the service model of the first BLE Mesh device
  • the gateway device There is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a method for accessing a BLE Mesh device, which is applied to a first BLE Mesh device, and the method includes:
  • the second access request is converted from the first access request, and the first access request is a request of an OCF client to access resources of a first OCF device, and the first OCF device is the first BLE For the virtual OCF device mapped by the Mesh device, there is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a BLE Mesh device access device, which is applied to a gateway device, and the device includes:
  • the first request receiving module is configured to receive a first access request sent by an OCF client, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device is The virtual OCF device mapped by the first BLE Mesh device;
  • the second request sending module is configured to send a second access request to the first BLE Mesh device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, and There is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a BLE Mesh device access device, which is applied to an OCF client, and the device includes:
  • the first request sending module is configured to send a first access request to the gateway device, where the first access request is a request by the OCF client to access the resources of the first OCF device, and the first OCF device is the first Virtual OCF device mapped by BLE Mesh device;
  • the first access request is converted into a second access request and then sent to the first BLE Mesh device, and the second access request is for the gateway device to access the service model of the first BLE Mesh device
  • the gateway device There is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides an apparatus for accessing a BLE Mesh device, which is applied to a first BLE Mesh device, and the apparatus includes:
  • a second request receiving module configured to receive a second access request sent by a gateway device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device;
  • the second access request is converted from the first access request, and the first access request is a request of an OCF client to access resources of a first OCF device, and the first OCF device is the first BLE For the virtual OCF device mapped by the Mesh device, there is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a gateway device, where the gateway device includes a processor, a memory, and a transceiver;
  • the transceiver is configured to receive a first access request sent by an OCF client, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device is a first OCF device.
  • the transceiver is further configured to send a second access request to the first BLE Mesh device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, and There is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a terminal, where an OCF client is installed and running, and the terminal includes a processor, a memory, and a transceiver;
  • the transceiver is configured to send a first access request to a gateway device, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device is a first BLE Virtual OCF device mapped by Mesh device;
  • the first access request is converted into a second access request and then sent to the first BLE Mesh device, and the second access request is for the gateway device to access the service model of the first BLE Mesh device
  • the gateway device There is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a BLE Mesh device, where the BLE Mesh device includes a processor, a memory, and a transceiver;
  • the transceiver is configured to receive a second access request sent by a gateway device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device;
  • the second access request is converted from the first access request, and the first access request is a request of an OCF client to access resources of a first OCF device, and the first OCF device is the first BLE For the virtual OCF device mapped by the Mesh device, there is a mapping relationship between the resource type of the resource and the service model.
  • an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored, and the computer program is used to be executed by a processor of a gateway device to implement the BLE on the gateway device side. Access method of Mesh device.
  • an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored, and the computer program is used to be executed by a processor of a terminal to implement the BLE on the OCF client side. Access method of Mesh device.
  • an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored, and the computer program is configured to be executed by a processor of a first BLE Mesh device to implement the first The access method of the BLE Mesh device on the BLE Mesh device side.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a gateway device, causes the gateway device to execute the above-mentioned method for accessing the BLE Mesh device on the gateway device side.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal with an OCF client installed and running, causes the terminal to execute the above-mentioned method for accessing the BLE Mesh device on the OCF client side.
  • the embodiments of the present application provide a computer program product, when the computer program product runs on a first BLE Mesh device, the first BLE Mesh device is caused to execute the BLE Mesh device on the first BLE Mesh device side. Access method.
  • the gateway device After the gateway device receives the first access request sent by the OCF client, it converts the first access request into a second access request, and then sends the second access request to the BLE Mesh device, thereby realizing the OCF client's response to the BLE Mesh
  • the access of equipment enriches the interconnection and intercommunication between different protocols.
  • Figure 1 is a schematic diagram of a bridge platform provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • Fig. 3 is a structural block diagram of a gateway device provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a method for accessing a BLE Mesh device provided by an embodiment of the present application
  • FIG. 5 is a flowchart of a method for accessing a BLE Mesh device provided by another embodiment of the present application.
  • Fig. 6 is a structural block diagram of a BLE Mesh device provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a method for accessing a BLE Mesh device provided by another embodiment of the present application.
  • FIG. 8 is a flowchart of a method for accessing a BLE Mesh device provided by another embodiment of the present application.
  • FIG. 9 is a flowchart of a method for creating and storing mapping information provided by an embodiment of the present application.
  • FIG. 10 is a flowchart of a method for creating and storing mapping information provided by another embodiment of the present application.
  • FIG. 11 is a flowchart of a method for creating and storing mapping information provided by still another embodiment of the present application.
  • FIG. 12 is a flowchart of a method for creating and storing mapping information provided by another embodiment of the present application.
  • FIG. 13 is a flowchart of a method for creating and storing mapping information provided by another embodiment of the present application.
  • FIG. 14 is a flowchart of a GET process for a smart light through an OCF client provided by an embodiment of the present application
  • FIG. 15 is a flowchart of a SET process for a smart light through an OCF client provided by an embodiment of the present application
  • FIG. 16 is a flowchart of a method for creating and storing mapping information provided by another embodiment of the present application.
  • FIG. 17 is a flowchart of a SET process for a smart light through an OCF client provided by another embodiment of the present application.
  • FIG. 18 is a block diagram of an apparatus for accessing a BLE Mesh device provided by an embodiment of the present application.
  • FIG. 19 is a block diagram of an apparatus for accessing a BLE Mesh device according to another embodiment of the present application.
  • FIG. 20 is a block diagram of an apparatus for accessing a BLE Mesh device according to another embodiment of the present application.
  • FIG. 21 is a block diagram of an apparatus for accessing a BLE Mesh device according to another embodiment of the present application.
  • FIG. 22 is a schematic structural diagram of a gateway device provided by an embodiment of the present application.
  • FIG. 23 is a schematic structural diagram of a terminal with an OCF client installed and running according to an embodiment of the present application.
  • FIG. 24 is a schematic structural diagram of a BLE Mesh device provided by an embodiment of the present application.
  • the OCF client can interact with a BLE GATT (Generic Attribute Profile) device.
  • FIG. 1 shows the interaction between the OCF client and the BLE GATT device through the bridge platform.
  • the bridge platform 110 includes the following functional modules: a virtual OCF server 112, a bridging function module (Bridging Function) 114, and a virtual BLE GATT client 116.
  • the OCF client 120 and the virtual OCF server 112 may communicate based on the OCF protocol, and the virtual BLE GATT client 116 and the BLE GATT device 130 may communicate based on the BLE protocol.
  • the bridging function module 114 is used to implement the conversion between the OCF protocol and the BLE protocol.
  • the role of the bridging function module 114 includes converting the information based on the OCF protocol sent by the OCF client 120 into information based on the BLE GATT protocol that can be recognized by the BLE GATT device 130.
  • the role of the bridging function module 114 may also include converting the BLE GATT protocol-based information sent by the BLE GATT device 130 into OCF protocol-based information that can be recognized by the OCF client 120.
  • the bridging function module 114 may establish a mapping relationship between the information based on the OCF protocol and the information based on the BLE GATT protocol, so as to realize the conversion of the information based on the OCF protocol into the information based on the BLE GATT protocol. As shown in Table 1 below, it shows the mapping relationship between the information based on the above two different protocols.
  • mapping relationships between the information based on the BLE GATT protocol and the information based on the OCF protocol can be obtained, as well as the mapping counts of both parties in each set of mapping relationships.
  • the four sets of mapping relationships based on Table 1 include: BLE GATT-based profile (BLE GATT-based profile) and OCF device type (OCF Device Type) mapping relationship, and the mapping relationship is an N to 1 mapping relationship; service The mapping relationship between (Service) and OCF resource (OCF Resource), and the mapping relationship is a 1-to-N mapping relationship; the mapping relationship between Characteristic and OCF Resource property (OCF Resource property), and the mapping The relationship is a 1-to-N mapping relationship; and, the mapping relationship between the Characteristic Descriptor and the OCF Notification on/off option (OCF Notification on/off option), and the mapping relationship is a 1-to-1 mapping relationship .
  • mapping relationship between the information based on the OCF protocol and the information based on the BLE GATT protocol is introduced.
  • Table 2 shows a specific mapping example based on the BLE GATT profile and the OCF device type.
  • Table 3 shows a specific mapping example between the services included in the information based on the BLE GATT protocol and the OCF resources included in the information based on the OCF protocol.
  • a service contained in the information based on the BLE GATT protocol may have multiple BLE Property names (BLE property names), and each BLE Property name corresponds to an OCF Resource (OCF resource), which can complete a service (Service) and The mapping relationship between N OCF resources (OCF Resources).
  • BLE property names BLE Property names
  • OCF resource OCF Resource
  • Service Service
  • OCF Resources N OCF resources
  • FIG. 2 shows a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • the implementation environment may include: a terminal 210, a BLE Mesh device 220, and a gateway device 230.
  • the implementation environment can be an intelligent networking system.
  • the terminal 210 may include various handheld devices (such as mobile phones, tablet computers, etc.) with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal device (terminal device), etc.
  • UE User Equipment
  • MS Mobile Station
  • terminal device terminal device
  • BLE Mesh device 220 refers to an intelligent networking device with network access capability under BLE Mesh networking.
  • BLE Mesh device 220 can be a smart home device, terminal device, or other device with network access capability. This is not limited.
  • the BLE Mesh device 220 may be smart home devices such as smart TVs, smart speakers, smart air conditioners, smart lights, smart doors and windows, smart curtains, and smart sockets.
  • the gateway device 230 is also called a network connector or a protocol converter, and is a computer system or device that provides data conversion services between multiple networks. Between two systems or devices that use different communication protocols, data formats or languages, or even completely different architectures, the gateway device is equivalent to a translator. The gateway device can parse the received information and repackage it and send it to The destination system or destination device is adapted to the needs of the destination system or destination device. At the same time, the gateway device can also play a role of filtering and security.
  • the gateway device 230 is respectively connected to the terminal 210 and the BLE Mesh device 220, and an OCF client 211 is installed and running in the terminal 210, and the OCF client 211 can access the BLE Mesh device 220 through the gateway device 230.
  • the user sends an access request to the gateway device 230 by operating the OCF client 211 running on the terminal 210.
  • the access request is information based on the OCF protocol.
  • the gateway device 230 After the gateway device 230 receives the access request, it converts the access request.
  • the access request is based on the information of the BLE Mesh protocol, and then the gateway device 230 sends the converted access request to the BLE Mesh device 230, thereby completing the access process of the OCF client 211 to the BLE Mesh device 230.
  • the "access" of the OCF client to the BLE Mesh device includes two methods: “obtain” and “setting”.
  • “Acquisition” means that the OCF client knows the status of the BLE Mesh device, etc.
  • “Settings” means that the OCF client selects, sets, and updates the status of the BLE Mesh device.
  • the "access" of the OCF client to the BLE Mesh device may also be referred to as the "operation" of the OCF client to the BLE Mesh device, but those skilled in the art can understand its meaning.
  • FIG. 3 shows a structural block diagram of a gateway device provided by an embodiment of the present application.
  • the gateway device 300 includes a virtual OCF server 310, a mapping function module 320, and a virtual BLE Mesh client 330.
  • the virtual OCF server 310 is a functional module used in the gateway device 300 to interact with the OCF client 301, and the virtual OCF server 310 and the OCF client 301 interact based on the OCF protocol.
  • the virtual BLE Mesh client 330 is a functional module used in the gateway device 300 to interact with the BLE Mesh device 302, and the virtual BLE Mesh client 330 and the BLE Mesh device 302 interact based on the BLE Mesh protocol.
  • the BLE Mesh device 302 may serve as the BLE Mesh server and receive an access request from the virtual BLE Mesh client 330.
  • the mapping function module 320 is a function module used in the gateway device 300 to realize the conversion between two different protocol information, that is, the mapping function module 320 is used to convert information based on the OCF protocol into information based on the BLE Mesh protocol, or for Convert the information based on the BLE Mesh protocol to the information based on the OCF protocol.
  • the OCF client 301 when the OCF client 301 initiates an access request to the BLE Mesh device 302, the OCF client 301 first sends a first access request to the gateway device 300.
  • the first access request is information based on the OCF protocol.
  • the virtual OCF server 310 in the gateway device 300 receives the first access request, and the mapping function module 320 converts the first access request into a second access request.
  • the second access request is information based on the BLE Mesh protocol.
  • the virtual BLE Mesh client 330 in the device 300 sends a second access request to the BLE Mesh device 302 to complete the access of the OCF client 301 to the BLE Mesh device 302.
  • gateway device 300 may also be referred to as a bridge platform, which is used to implement the interaction function between the OCF client 301 and the BLE Mesh device 302.
  • FIG. 4 shows a flowchart of a method for accessing a BLE Mesh device provided by an embodiment of the present application, and the method can be applied to the implementation environment shown in FIG. 2.
  • the method can include the following steps (410-420):
  • Step 410 The OCF client sends a first access request to the gateway device.
  • the first access request is a request from the OCF client to access the resources of the first OCF device, and the first access request is an access request based on the OCF protocol.
  • the first OCF device is a virtual OCF device mapped by the first BLE Mesh device.
  • the OCF client sends the first access request to the gateway device for the purpose of accessing the first BLE Mesh device to obtain or set related information of the first BLE Mesh device.
  • the gateway device receives the first access request.
  • the virtual OCF server in the gateway device may receive the first access request sent by the OCF client.
  • Step 420 The gateway device sends a second access request to the first BLE Mesh device.
  • the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, and the second access request is an access request based on the BLE Mesh protocol.
  • the gateway device converts the first access request into a second access request, thereby achieving access to the first BLE Mesh device.
  • the virtual OCF server of the gateway device can parse the first access request, obtain the information contained in the first access request, and then send the above information to the mapping function module.
  • the mapping function module of the gateway device maps the above information, and the mapped information is sent to the virtual BLE Mesh client, and the virtual BLE Mesh client generates a second access request according to the mapped information.
  • the gateway device sets the mapping function module to realize the mapping between the information based on the OCF protocol and the information based on the BLE Mesh protocol, thereby converting the first access request based on the OCF protocol into the second access request based on the BLE Mesh protocol.
  • the service model of the first BLE Mesh device refers to the setting model of the services that the first BLE Mesh device can provide.
  • the service model of the first BLE Mesh device varies according to the type of the first BLE Mesh device, for example
  • the service model of the first BLE Mesh device may include: switch model, brightness model, color temperature model, hue and saturation model, etc.; when the first BLE Mesh device is a smart air conditioner ,
  • the service model of the first BLE Mesh device may include: switch model, temperature model, refrigeration model, heating model, dehumidification model, and ventilation model.
  • the resource type of the resource of the first OCF device has a mapping relationship with the service model of the first BLE Mesh device. According to the mapping relationship, the mapping function module of the gateway device can convert the first access request for accessing the resources of the first OCF device into a second access request for accessing the service model of the first BLE Mesh device.
  • the foregoing step 420 includes: the gateway device sends a second access request to the first BLE Mesh device according to the mapping information.
  • the mapping information is used to determine the mapping relationship between the access request based on the OCF protocol and the access request based on the BLE Mesh protocol, that is, used to determine the mapping relationship between the first access request and the second access request.
  • the above-mentioned mapping information is stored in the gateway device.
  • the mapping function module of the gateway device can convert the information based on the OCF protocol contained in the first access request into corresponding information based on the BLE Mesh protocol , So that the virtual BLE Mesh client generates a second access request based on the converted information based on the BLE Mesh protocol.
  • the virtual BLE Mesh client of the gateway device sends a second access request to the first BLE Mesh device, and accordingly, the first BLE Mesh device receives the second access request sent by the virtual BLE Mesh client of the gateway device. So far, the OCF client's access to the first BLE Mesh device is realized.
  • step 420 after the above step 420, the following steps (step 430 to step 440) are further included:
  • Step 430 The first BLE Mesh device sends the first access result to the gateway device.
  • the first access result is an access result corresponding to the second access request.
  • the first BLE Mesh device processes the second access request and generates the first access result.
  • the processing of the second access request by the first BLE Mesh device includes: making a decision whether to accept the access operation indicated by the second access request, and in the case of accepting the access operation indicated by the second access request, executing the second access request Access request.
  • the smart light when the first BLE Mesh device is a smart light and the second access request is to access the switch state of the smart light, assuming that the smart light accepts the access operation indicated by the second access request, the smart light will obtain the switch where it is located State, generate a first access result corresponding to the second access request according to the switch state, and the first access result includes the switch state of the smart light.
  • the gateway device receives the first access result.
  • the virtual BLE Mesh client of the gateway device may receive the first access result sent by the first BLE Mesh device, where the first access result is information based on the BLE Mesh protocol.
  • Step 440 The gateway device sends the second access result to the OCF client.
  • the mapping function module converts the first access result into a second access result, and sends the second access result to the virtual OCF server of the gateway device.
  • the virtual OCF server sends the second access result to the OCF client.
  • the second access result is the access result generated by the gateway device that complies with the OCF protocol, that is, the second access result is information based on the OCF protocol. Because the OCF client cannot read the information based on the BLE Mesh protocol, it needs to convert the first access result into the second access result so that the OCF client can read it.
  • the OCF client receives the second access result.
  • the OCF client can receive the second access result sent by the virtual OCF server of the gateway device.
  • the technical solutions provided by the embodiments of the present application convert the first access request to the second access request after receiving the first access request sent by the OCF client through the gateway device, and then send it to the BLE Mesh device
  • the second access request realizes the access of the OCF client to the BLE Mesh device, which enriches the interconnection and intercommunication between different protocols.
  • the gateway device can convert the first access request sent by the OCF client into the second access request that can be recognized by the BLE Mesh device according to the mapping information, which realizes the access request based on the OCF protocol.
  • Establish a mapping relationship with the access request based on the BLE Mesh protocol so that when the gateway device converts the access request sent by the OCF client, it only needs to find the mapping information, that is, the access request can be converted into an access that can be recognized by the BLE Mesh device Requests, thereby facilitating the conversion of information based on different protocols by the gateway device, and improving the conversion efficiency of the gateway device.
  • mapping relationships includes the following mapping relationships:
  • the device identifier of the first OCF device is the unique identifier of the first OCF device and is used to uniquely identify the first OCF device;
  • the device identifier of the first BLE Mesh device is the unique identifier of the first BLE Mesh device and is used for unique identification The first BLE Mesh device.
  • the device identification may be expressed in the form of a device ID (Identity document), or may be expressed in the form of a device number, which is not limited in the embodiment of the present application.
  • the device identification of the first OCF device and the device identification of the first BLE Mesh device can both be expressed in the form of device ID, or in the form of device number, etc., one can also be expressed in the form of device ID, and the other can be expressed by device number. It is expressed in equivalent forms, which are not limited in the embodiments of the present application.
  • the first BLE Mesh device is a node (Node) in the BLE Mesh networking.
  • mapping relationship between the first OCF device and the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping information includes the mapping relationship between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device.
  • the resource address of the first OCF device refers to the href (Hypertext Reference) of the resource of the first OCF device
  • the href of the resource of the first OCF device is the uniform resource identifier (Uniform Resource Identifier) of the resource of the first OCF device.
  • Resource Identifier, URI Uniform Resource Identifier
  • the href of the resource of the first OCF device may be expressed in the form of "/xx/xxxx", where "xx" is the element address of the first BLE Mesh device, and "xxxx" is the description of href.
  • FIG. 6 shows a structural block diagram of a BLE Mesh device.
  • the BLE Mesh device 600 includes at least one element (Element), among which the primary element (Primary Element) 610 must exist, and the primary element 610 corresponds to an element address.
  • the Provisioner will assign a unicast address to the BLE Mesh device, and the unicast address is the element address of the main element 610.
  • all elements except the main element 610 are secondary elements (Secondary Element) 620, and the element address of the secondary element is accumulated on the element address of the main element.
  • the BLE Mesh device 600 has three elements, including a master element 610 and two slave elements 620. The element addresses of the two slave elements 620 are added to the element address of the master element 610 by 1 and respectively. 2 got it.
  • mapping relationship between the resources of the first OCF device and the elements of the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping information includes the mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device.
  • a resource type can be defined in an intelligent networking technology system, and then different fields, different devices, and different resources can instantiate the resource type.
  • each element in the BLE Mesh device 600 corresponds to multiple models (Model).
  • the BLE Mesh device 600 corresponds to three types of models, namely the Control Model and the Server Model. Model) and client model (Client Model), where the control model 630 generally exists in the master element 610, and the service model 640 and the client model 650 can exist in the master element 610 or the slave element 620.
  • the service model 640 may correspond to multiple states (State), which are used to be accessed. However, the client model 650 does not have a state, and the client model 650 is generally used to access the state of the service model 640.
  • mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping information includes the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the gateway device represents the mapping information in the form of a mapping table. As shown in Table 4 below, it shows a mapping table representing the above-mentioned mapping information.
  • mapping relationship there is a mapping relationship between the first BLE Mesh device and the first OCF device, and the mapping relationship is a one-to-one mapping relationship; the elements of the first BLE Mesh device and the first OCF device have a mapping relationship.
  • Mapping relationship There is a mapping relationship between the state of the first BLE Mesh device and the resource attribute of the first OCF device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping relationship between the state of the first BLE Mesh device and the resource attribute of the first OCF device can be directly obtained from the mapping relationship between the service model of the first BLE Mesh device and the resource type of the first OCF device.
  • the above BLE Mesh device access method can include the following steps:
  • Step 410 The OCF client sends a first access request to the gateway device.
  • step 410 in the embodiment of FIG. 7 Based on the description of step 410 in the embodiment of FIG. 4, the description of step 410 in the embodiment of FIG. 7 can be obtained.
  • step 410 in the embodiment of FIG. 7 please refer to the embodiment of FIG. 4 above. No longer.
  • Step 42A The gateway device parses the first access request to obtain the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device.
  • the virtual OCF server of the gateway device After the virtual OCF server of the gateway device receives the first access request sent by the OCF client, it can parse the first access request to obtain the device identifier of the first OCF device, the resource address of the first OCF device, and The resource type of the first OCF device, and then the parsed information is sent to the mapping function module of the gateway device.
  • Step 42B According to the mapping information, the gateway device maps the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device to the device identifier of the first BLE Mesh device and the first BLE Mesh respectively.
  • the element address of the device and the service model of the first BLE Mesh device is the mapping information.
  • the mapping function module of the gateway device After receiving the parsed information, the mapping function module of the gateway device queries the above-mentioned mapping information to map the parsed information respectively, that is, query the device of the first BLE Mesh device corresponding to the device identifier of the first OCF device from the mapping information The identifier, the element address of the first BLE Mesh device corresponding to the resource address of the first OCF device, and the service model of the first BLE Mesh device corresponding to the resource type of the first OCF device. After the mapping operation is completed, the mapping function module of the gateway device can send the mapped information to the virtual BLE Mesh client of the gateway device.
  • Step 42C The gateway device sends a second access request to the first BLE Mesh device according to the device identifier of the first BLE Mesh device, the element address of the first BLE Mesh device, and the service model of the first BLE Mesh device.
  • the virtual BLE Mesh client of the gateway device After the virtual BLE Mesh client of the gateway device receives the device identifier of the first BLE Mesh device, the element address of the first BLE Mesh device, and the service model of the first BLE Mesh device, it can send a second access request to the first BLE Mesh device , In order to complete the access process to the first BLE Mesh device through the OCF client.
  • the above steps 43A to 43C may specifically include the following steps when implemented: First, the gateway device can parse out the resource address of the first OCF device, and obtain the element address of the first BLE Mesh device through the resource address; then, The gateway device can parse out the resource type of the first OCF device, and obtain the service model of the first BLE Mesh device through the resource type; finally, obtain the client model of the first BLE Mesh device through the service model of the first BLE Mesh device .
  • the technical solution provided by the embodiments of the present application after receiving the first access request sent by the OCF client through the gateway device, can send the first access request based on the OCF protocol sent by the OCF client according to the mapping information , Converted to a second access request based on the BLE Mesh protocol, and then sent the second access request to the BLE Mesh device, thereby realizing a way of accessing the BLE Mesh device through the OCF client.
  • the gateway device determines the specific mapping relationship contained in the mapping information between the OCF device and the BLE Mesh device, so that the gateway device, after receiving the access request from the OCF client, can more intuitively and clearly convert the The access request improves the efficiency of the gateway device in converting the access request.
  • the technical solution provided by the embodiments of this application directly establishes a mapping relationship between a BLE Mesh device and an OCF device, instead of establishing a mapping relationship between a BLE Mesh device and an OCF platform containing multiple OCF devices, thereby reducing the mapping.
  • the number of mapping relationships included in the information reduces the complexity of the design and creation of the mapping information, and reduces the processing overhead that the gateway device needs to spend when querying the mapping information.
  • mapping information includes the following mapping relationships:
  • the device identification of the first OCF device and the element address of the first BLE Mesh device in this exemplary embodiment are obtained
  • the introduction and description of the element address of please refer to the above optional embodiment for the introduction and description, which will not be repeated here.
  • mapping relationship between the elements of the first OCF device and the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping information includes the mapping relationship between the device identifier of the first OCF device and the element address of the first BLE Mesh device.
  • the relationship between the resource type of the first OCF device and the service model of the first OCF device in the optional embodiment is obtained here.
  • the introduction and description of the mapping relationship between the service models of the first BLE Mesh device please refer to the optional embodiments above, and details are not repeated here.
  • mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping information includes the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the gateway device represents the mapping information in the form of a mapping table. As shown in Table 5 below, it shows a mapping table representing the above-mentioned mapping information.
  • the mapping relationship is a one-to-one mapping relationship.
  • the OCF platform can contain multiple OCF clients, and each OCF client corresponds to one OCF device. Therefore, the first BLE Mesh device can actually correspond to multiple OCF devices, that is, the first BLE Mesh device and the OCF device There is a one-to-many mapping relationship. Because the first BLE Mesh device may have one or more elements, as shown in Table 5 above, there is a mapping relationship between the elements of the first BLE Mesh device and the OCF device, and the mapping relationship is a one-to-one mapping relationship. In the embodiment of the present application, the first BLE Mesh device is a node (Node) in the BLE Mesh networking.
  • Node node
  • mapping relationship between the service model of the first BLE Mesh device and the resource type of the first OCF device there is a mapping relationship between the service model of the first BLE Mesh device and the resource type of the first OCF device, and the mapping relationship is a one-to-one mapping relationship; There is also a mapping relationship between the state and the resource property of the first OCF device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping relationship between the state of the first BLE Mesh device and the resource attributes of the first OCF platform can be directly obtained from the mapping relationship between the service model of the first BLE Mesh device and the resource type of the first OCF device.
  • the above BLE Mesh device access method can include the following steps:
  • Step 410 The OCF client sends a first access request to the gateway device.
  • step 410 in the embodiment of FIG. 8 Based on the description of step 410 in the embodiment of FIG. 4, the description of step 410 in the embodiment of FIG. 8 can be obtained.
  • step 410 in the embodiment of FIG. 8 please refer to the embodiment of FIG. 4 above. I won't repeat it here.
  • Step 421 The gateway device parses the first access request to obtain the device identifier of the first OCF device and the resource type of the first OCF device.
  • the virtual OCF server of the gateway device After the virtual OCF server of the gateway device receives the first access request sent by the OCF client, it can parse the first access request, so that the device identifier of the first OCF device and the resource type of the first OCF device can be obtained. Then send the parsed information to the mapping function module of the gateway device.
  • Step 422 The gateway device maps the device identifier of the first OCF device and the resource type of the first OCF device to the element address of the first BLE Mesh device and the service model of the first BLE Mesh device, respectively, according to the mapping information.
  • the mapping function module of the gateway device After receiving the parsed information, the mapping function module of the gateway device queries the above-mentioned mapping information to map the parsed information respectively, that is, query the element of the first BLE Mesh device corresponding to the device identifier of the first OCF device from the mapping information Address, and the service model of the first BLE Mesh device corresponding to the resource type of the first OCF device. After the mapping operation is completed, the mapping function module of the gateway device can send the mapped information to the virtual BLE Mesh client of the gateway device.
  • Step 423 The gateway device sends a second access request to the first BLE Mesh device according to the element address of the first BLE Mesh device and the service model of the first BLE Mesh device.
  • the virtual BLE Mesh client of the gateway device After the virtual BLE Mesh client of the gateway device receives the element address of the first BLE Mesh device and the service model of the first BLE Mesh device, it can send a second access request to the first BLE Mesh device to complete the second access request through the OCF client.
  • the access process of a BLE Mesh device After the virtual BLE Mesh client of the gateway device receives the element address of the first BLE Mesh device and the service model of the first BLE Mesh device, it can send a second access request to the first BLE Mesh device to complete the second access request through the OCF client.
  • the access process of a BLE Mesh device After the virtual BLE Mesh client of the gateway device receives the element address of the first BLE Mesh device and the service model of the first BLE Mesh device, it can send a second access request to the first BLE Mesh device to complete the second access request through the OCF client.
  • the access process of a BLE Mesh device After the virtual BLE Mes
  • the technical solution provided by the embodiments of the present application after receiving the first access request sent by the OCF client through the gateway device, can send the first access request based on the OCF protocol sent by the OCF client according to the mapping information , Converted to a second access request based on the BLE Mesh protocol, and then sent the second access request to the BLE Mesh device, thereby realizing a way of accessing the BLE Mesh device through the OCF client.
  • the gateway device determines the specific mapping relationship contained in the mapping information between the OCF device and the BLE Mesh device, so that the gateway device, after receiving the access request from the OCF client, can more intuitively and clearly convert the The access request improves the efficiency of the gateway device in converting the access request.
  • FIG. 9 shows a flowchart of a method for creating and storing mapping information provided by an embodiment of the present application.
  • the method can be applied to the implementation environment shown in FIG. 2, for example, in the implementation environment shown in FIG. In the gateway device.
  • the method can include the following steps (910-930):
  • Step 910 Create a first OCF device.
  • the virtual OCF server in the gateway device After receiving the notification of creating the first OCF device, the virtual OCF server in the gateway device creates the first OCF device according to the notification.
  • the gateway device stores a list of OCF devices to be created, and the list of OCF devices to be created is used to indicate the correspondence between the device identifier of the first BLE Mesh device to be created and the OCF device to be created, corresponding to the first OCF
  • the functional module of the device creates the first OCF device, it can query the device ID of the first BLE Mesh device discovered in the list of OCF devices to be created, and create it based on the device ID of the first BLE Mesh device discovered The corresponding first OCF device.
  • each successfully created first OCF device corresponds to a device identifier (Device index).
  • the function module corresponding to the first OCF device may return the device identifier of the first OCF device to the mapping function module in the gateway device.
  • step 910 the following steps (901-904) are further included before step 910:
  • Step 901 Store the first BLE Mesh device as a node in a list of discovered BLE Mesh devices.
  • the list of discovered BLE Mesh devices includes the node corresponding to the first BLE Mesh device that is discovered, that is, in the embodiment of the present application, the discovered BLE Mesh device list represents the first BLE Mesh device that is discovered in the form of a node.
  • the discovered BLE Mesh device list is located in the virtual BLE Mesh client of the gateway device, and it may be a device list stored in the gateway device, or a device list temporarily created by the gateway device, which is not limited in this embodiment of the application.
  • the list of BLE Mesh devices to be created is initially empty.
  • Step 902 Perform key binding for the service model corresponding to each node.
  • the first BLE Mesh device corresponding to each node may have multiple service models.
  • the first BLE Mesh device may have multiple service models.
  • the service model may be the same or different, which is not limited in the embodiment of the present application.
  • the service model of the smart lamp may be a switch model
  • the service model of the smart air conditioner may also be a switch model.
  • the service of the smart electric light may be a brightness model, a color temperature model, and a saturation model
  • the service model of the smart air conditioner may be a temperature model or a humidity model
  • the virtual BLE Mesh client of the gateway device can bind a key to the service model corresponding to each node, that is, assign a key to the service model corresponding to each node.
  • the key is allocated by the virtual BLE Mesh client, and is used to encrypt data transmitted between the first BLE Mesh device and the virtual BLE Mesh client.
  • Step 903 Specify a client model for the successfully bound service model.
  • the client model is located in the virtual BLE Mesh client.
  • each client model can correspond to a service model or Corresponds to a type of service model, which is not limited in the embodiment of this application.
  • the switch models in the service models of different BLE Mesh devices can correspond to different client models of virtual BLE Mesh clients, and one switch model corresponds to a virtual BLE Mesh client client model; it can also correspond to virtual BLE Mesh clients.
  • the client is the same client model.
  • each client model corresponds to a type of service model, it helps to reduce the number of client models in the virtual BLE Mesh client.
  • Step 904 Store the node in the OCF device list to be created.
  • the virtual BLE Mesh client of the gateway device After the virtual BLE Mesh client of the gateway device successfully creates the node, it can first send a notification of the successful creation to the mapping relationship of the gateway device. After the mapping function module receives the notification of the successful creation of the node, it can store the successfully created node in the waiting list. In the created OCF device list. Optionally, in this embodiment of the present application, after storing the node in the OCF device list to be created, the mapping function module may send a notification to create the first OCF device to the virtual OCF server.
  • Step 920 Establish a mapping relationship between the first OCF device and the first BLE Mesh device.
  • the mapping relationship module of the gateway device After receiving the device identifier of the first OCF device, the mapping relationship module of the gateway device establishes the mapping relationship between the first OCF device and the first BLE Mesh device.
  • the foregoing step 920 may include the following sub-steps (92A-92C):
  • Step 92A Establish a mapping relationship between the device identity of the first OCF device and the device identity of the first BLE Mesh device.
  • the mapping relationship between the first OCF device and the first BLE Mesh device can be expressed in the form of a key-value pair, and the first OCF device is a "key” and the first BLE Mesh device is a "value”, where " “Key” refers to the number of the stored data, “value” refers to the stored data, the first OCF device is the “key” refers to the number that stores the device identification of the first OCF device, the first BLE Mesh device is the "value” is Refers to storing the device ID of the first BLE Mesh device.
  • mapping relationship between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device may be expressed as: OCF Device index ⁇ ->Node.
  • Step 92B Establish a mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the service model of the first BLE Mesh device refers to the service model in which the key is successfully bound.
  • the mapping relationship is a one-to-one mapping relationship
  • the mapping relationship, and the mapping relationship is a one-to-one mapping relationship.
  • mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device may be expressed as: OCF resource type ⁇ -> Model SRV in Node, where SRV is an abbreviation of Sever.
  • Step 92C Establish a mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device.
  • the resource address of the first OCF device can be expressed as "/xx/xxxx/", where "xx" is the element address of the first BLE Mesh device.
  • the above step 920 may include the following sub-steps (921 to 922):
  • Step 921 Establish a mapping relationship between the device identifier of the first OCF device and the element address of the first BLE Mesh device.
  • mapping relationship between the element addresses of the first OCF device and the first BLE Mesh device there is a mapping relationship between the element addresses of the first OCF device and the first BLE Mesh device, and the mapping relationship is a one-to-one mapping relationship.
  • the mapping relationship between the element address of the first OCF device and the first BLE Mesh device can be expressed in the form of a key-value pair, and the first OCF device is a "key", and the element address of the first BLE Mesh device is " value”.
  • mapping relationship between the device identifier of the first OCF device and the element address of the first BLE Mesh device may be expressed as: OCF Device Index ⁇ ->Element.
  • Step 922 Establish a mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the service model of the first BLE Mesh device refers to the service model in which the key is successfully bound.
  • mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device may be expressed as: Model SRV in the OCF resource type ⁇ ->Element.
  • Step 930 Store the mapping information according to the mapping relationship.
  • the mapping function module of the gateway device After the mapping function module of the gateway device establishes the mapping relationship between the first OCF device and the first BLE Mesh device, it can store the mapping information according to the mapping relationship, so as to facilitate subsequent processing of OCF client access requests, etc., according to the Mapping information, conversion between information of different protocols.
  • the mapping relationship between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device in the mapping information, or the mapping between the device identifier of the first OCF device and the element address of the first BLE Mesh device Relationships can be stored in the form of key-value pairs.
  • steps 92A to 92C can be executed at the same time, and steps 921 to 922 can also be executed at the same time.
  • the embodiment of the present application does not limit the execution order of steps 92A to 92C, and steps 921 to 922.
  • the technical solution provided by the embodiments of this application is achieved by creating an OCF device corresponding to a BLE Mesh device, then establishing a mapping relationship between the BLE Mesh device and the OCF device, and storing the mapping information according to the mapping relationship. A way to establish and store mapping information.
  • the technical solution of the present application is introduced and explained mainly from the perspective of interaction between the OCF client, the gateway device, and the first BLE Mesh device.
  • the above steps related to the OCF client side can be implemented separately to access the BLE Mesh device on the OCF client side; the above steps related to the gateway device can be implemented separately to access the BLE Mesh device on the gateway device side; the above related The steps performed by the first BLE Mesh device can be separately implemented as an access method of the BLE Mesh device on the side of the first BLE Mesh device.
  • the following uses a specific example to introduce and explain the method for accessing the BLE Mesh device and the method for creating and storing mapping information provided in the embodiment of the present application.
  • the device identification of the smart electric light can be expressed as "Light”
  • the device identification of the first OCF device can be expressed as " oic.d.light”
  • the service models of smart lights include: Generic OnOff Server, Light Lightness Server, Light CTL Server, Light Hue and Saturation Model (Light HSL Server);
  • the resource types of the first OCF device include: switch resource (oic.r.switch.binary), brightness resource (oic.r.light.brightness), color temperature resource (oic.r.colour.colourtemperature) , Hue and saturation resources (oic.r.colour.hs), establish a mapping relationship based on the service model of the smart light and the resource type of the first OCF device.
  • the gateway device can establish the mapping information between the smart light and the first OCF device.
  • Step 1310 Use smart light 1 as node 1, and smart light 2 as node 2, and store node 1 and node 2 in the discovered device list;
  • Step 1320 Perform key binding for the service models corresponding to node 1 and node 2;
  • Step 1330 Specify a client model for the successfully bound service model
  • Step 1340 Store node 1 and node 2 in the OCF device list to be created
  • Step 1350 Create a first OCF device; this example takes the creation of the first OCF device corresponding to node 1 as an example for illustration;
  • Step 1360 Establish a mapping relationship between the device ID of the first OCF device and the device ID of the smart light 1;
  • Step 1370 Establish a mapping relationship between the resource type of the first OCF device and the service model of the smart lamp 1; for example, the service model of the smart lamp "Generic OnOff Server Model” can be used to use the resource type of the first OCF device If a mapping relationship is established between "oic.r.switch.binary", the resource corresponding to the resource type can be obtained (GET), set (SET) and updated (Update) operations in the first OCF device;
  • Step 1380 Establish a mapping relationship between the resource address of the first OCF device and the element address of the smart light 1;
  • Step 1390 Store the mapping information according to the mapping relationship.
  • the OCF client's GET process for the smart light can include the following processes (1410 ⁇ 1470):
  • Step 1410 the OCF client sends a first GET request to the gateway device; in this example, there are two OCF clients, namely OCF client 1 and OCF client 2, and in this example only OCF client 2 sends the first access request Take an example to illustrate;
  • Step 1420 The gateway device parses the first GET request to obtain the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device; when the gateway device parses the GET request, it can first parse out the first OCF device. The resource address of the OCF device, and then the resource type of the first OCF device is parsed;
  • Step 1430 The gateway device maps the device ID of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device to the device ID of the smart light, the element address of the smart light, and the smart light, respectively, according to the mapping information.
  • Service model of electric lights
  • Step 1440 the gateway device sends a second GET request to the smart light;
  • the second GET request includes: the device identification of the smart light, the element address of the smart light, and the service model of the smart light; there are two smart lights in this example, respectively Smart light 1 and smart light 2, this example only takes smart light 1 receiving the second access request as an example for illustration;
  • Step 1450 The smart light sends the first GET result to the gateway device
  • Step 1460 The gateway device processes the first GET result to obtain the second GET result
  • Step 1470 The gateway device sends the second GET result to the OCF client.
  • the OCF client's SET process for the smart lamp may include the following processes (1510-1570):
  • Step 1510 the OCF client sends a first SET request to the gateway device; there are also two OCF clients in this example, namely OCF client 1 and OCF client 2, and this example only uses OCF client 2 to send the first access Take the request as an example to illustrate;
  • Step 1520 The gateway device parses the first SET request to obtain the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device;
  • Step 1530 The gateway device maps the device ID of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device to the device ID of the smart light, the element address of the smart light, and the smart light, respectively, according to the mapping information.
  • Step 1540 The gateway device sends a second SET request to the smart light;
  • the second SET request includes: the device identification of the smart light, the element address of the smart light, and the service model of the smart light; there are two smart lights in this example, respectively Smart light 1 and smart light 2, this example only takes smart light 1 receiving the second access request as an example for illustration;
  • Step 1550 The smart light sends the first SET result to the gateway device
  • Step 1560 The gateway device processes the first SET result to obtain the second SET result
  • Step 1570 The gateway device sends the second SET result to the OCF client.
  • the gateway device is establishing the mapping information between the smart light and the first OCF device. Perform the following steps (1610 ⁇ 1680):
  • Step 1610 Use smart light 1 as node 1, and smart light 2 as node 2, and store node 1 and node 2 in the list of discovered smart lights;
  • Step 1620 Perform key binding for the service models corresponding to node 1 and node 2;
  • Step 1630 Specify a client model for the successfully bound service model
  • Step 1640 Store node 1 and node 2 in the OCF device list to be created
  • Step 1650 Create a first OCF device; this example takes the creation of the first OCF device corresponding to node 1 as an example for illustration;
  • Step 1660 Establish a mapping relationship between the device identifier of the first OCF device and the element address of the smart light 1;
  • Step 1670 Establish a mapping relationship between the resource type of the first OCF device and the service model of the smart light 1;
  • Step 1680 Store the mapping information according to the mapping relationship.
  • the SET process of the OCF client to the smart lamp may include the following processes (1710 ⁇ 1770):
  • Step 1710 the OCF client sends a first SET request to the gateway device; there are also two OCF clients in this example, namely OCF client 1 and OCF client 2, and this example only uses OCF client 1 to send the first access Take the request as an example to illustrate;
  • Step 1720 The gateway device parses the first access request to obtain the device identifier of the first OCF device and the resource type of the first OCF device.
  • Step 1730 The gateway device maps the device identifier of the first OCF device and the resource type of the first OCF device to the element address of the first BLE Mesh device and the service model of the first BLE Mesh device according to the mapping information;
  • Step 1740 The gateway device sends a second SET request to the smart light;
  • the second SET request includes: the element address of the first BLE Mesh device and the service model of the first BLE Mesh device; there are two smart lights in this example, respectively Smart light 1 and smart light 2, this example only takes the smart light 2 receiving the second access request as an example for illustration;
  • Step 1750 the smart light sends the first SET result to the gateway device
  • Step 1760 the gateway device processes the first SET result to obtain the second SET result
  • Step 1770 The gateway device sends the second SET result to the OCF client.
  • FIG. 18 shows a block diagram of an apparatus for accessing a BLE Mesh device according to an embodiment of the present application.
  • the device has the function of realizing the example of the method on the gateway device side, and the function can be realized by hardware, or by hardware executing corresponding software.
  • the device can be the gateway device described above, or it can be set in the gateway device.
  • the apparatus 1800 may include: a first request receiving module 1810 and a second request sending module 1820.
  • the first request receiving module 1810 is configured to receive a first access request sent by an OCF client, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device It is the virtual OCF device mapped by the first BLE Mesh device.
  • the second request sending module 1820 is configured to send a second access request to the first BLE Mesh device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, There is a mapping relationship between the resource type of the resource and the service model.
  • the second request sending module 1820 is configured to: send the second access request to the first BLE Mesh device according to the mapping information; wherein the mapping information is used to determine the access based on the OCF protocol The mapping relationship between the request and the access request based on the BLE Mesh protocol.
  • the mapping information includes the following mapping relationship: the mapping relationship between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device; the resource address of the first OCF device and the The mapping relationship between the element addresses of the first BLE Mesh device; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the second request sending module 1820 includes: a first request parsing submodule 1822, configured to parse the first access request to obtain the device identifier of the first OCF device, The resource address of the first OCF device and the resource type of the first OCF device; a mapping submodule 1824, configured to combine the device identifier of the first OCF device and the first OCF device according to the mapping information
  • the resource address of and the resource type of the first OCF device are respectively mapped to the device identifier of the first BLE Mesh device, the element address of the first BLE Mesh device, and the service model of the first BLE Mesh device;
  • the second request sending submodule 1826 is configured to send a message to the first BLE Mesh device according to the device identifier of the first BLE Mesh device, the element address of the first BLE Mesh device, and the service model of the first BLE Mesh device.
  • the Mesh device sends the second access request.
  • the mapping information includes the following mapping relationship: the mapping relationship between the device identifier of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the The mapping relationship between the service models of the first BLE Mesh device is described.
  • the second request sending module 1820 includes: a first request parsing submodule 1822, configured to parse the first access request to obtain the device identifier and the device identifier of the first OCF device The resource type of the first OCF device; a mapping submodule 1824, configured to map the device identifier of the first OCF device and the resource type of the first OCF device to the first OCF device according to the mapping information, respectively 1.
  • the element address of the BLE Mesh device and the service model of the first BLE Mesh device; the second request sending submodule 1826 is configured to use the element address of the first BLE Mesh device and the service of the first BLE Mesh device The model sends the second access request to the first BLE Mesh device.
  • the apparatus 1800 further includes: an OCF device creation module 1830, configured to create the first OCF device corresponding to the first BLE Mesh device; a mapping relationship establishment module 1840, using The mapping relationship between the first OCF device and the first BLE Mesh device is established; the mapping information storage module 1850 is configured to store the mapping information according to the mapping relationship.
  • an OCF device creation module 1830 configured to create the first OCF device corresponding to the first BLE Mesh device
  • a mapping relationship establishment module 1840 using The mapping relationship between the first OCF device and the first BLE Mesh device is established
  • the mapping information storage module 1850 is configured to store the mapping information according to the mapping relationship.
  • the apparatus 1800 further includes: a first result receiving module 1860, configured to receive a first access result corresponding to the second access request sent by the first BLE Mesh device;
  • the second result sending module 1870 is configured to send a second access result to the OCF client, where the second access result is an OCF protocol-compliant access result generated by the gateway device according to the first access result.
  • FIG. 20 shows a block diagram of an apparatus for accessing a BLE Mesh device according to an embodiment of the present application.
  • the device has the function of realizing the above example of the method on the OCF client side, and the function can be realized by hardware, or by hardware executing corresponding software.
  • the device can be the terminal with the OCF client installed and running as described above, or it can be set in the terminal with the OCF client installed and running.
  • the apparatus 2000 may include: a first request sending module 2010.
  • the first request sending module 2010 is configured to send a first access request to the gateway device.
  • the first access request is a request by the OCF client to access the resources of the first OCF device, and the first OCF device is the first OCF device.
  • the service model of the first BLE Mesh device makes a request for access, and there is a mapping relationship between the resource type of the resource and the service model.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device The mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the service model of the first BLE Mesh device The mapping relationship between.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the element address of the first BLE Mesh device Mapping relationship; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • FIG. 21 shows a block diagram of an apparatus for accessing a BLE Mesh device according to an embodiment of the present application.
  • the device has the function of realizing the above-mentioned method example on the first BLE Mesh device side, and the function can be realized by hardware, or by hardware executing corresponding software.
  • the device may be the first BLE Mesh device described above, or it may be set in the first BLE Mesh device.
  • the apparatus 2100 may include: a second request receiving module 2110.
  • the second request receiving module 2110 is configured to receive a second access request sent by a gateway device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device; wherein, the The second access request is converted from the first access request.
  • the first access request is a request from the OCF client to access the resources of the first OCF device, and the first OCF device is mapped by the first BLE Mesh device For the virtual OCF device, there is a mapping relationship between the resource type of the resource and the service model.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device The mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the service model of the first BLE Mesh device The mapping relationship between.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the element address of the first BLE Mesh device Mapping relationship; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the device provided in the above embodiment realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be allocated by different functional modules according to actual needs. That is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • FIG. 22 shows a schematic structural diagram of a gateway device 220 according to an embodiment of the present application.
  • the gateway device 220 can be used to implement the aforementioned BLE Mesh device access method.
  • the gateway device 220 may include: a processor 221, a receiver 222, a transmitter 223, a memory 224, and a bus 225.
  • the processor 221 includes one or more processing cores, and the processor 221 executes various functional applications and information processing by running software programs and modules.
  • the receiver 222 and the transmitter 223 may be implemented as a communication component, and the communication component may be a communication chip.
  • the memory 224 is connected to the processor 221 through the bus 225.
  • the memory 224 may be used to store a computer program, and the processor 221 is used to execute the computer program to implement each step executed by the gateway device in the foregoing method embodiment.
  • the memory 224 can be implemented by any type of volatile or non-volatile storage device or a combination thereof.
  • the volatile or non-volatile storage device includes, but is not limited to: magnetic disks or optical disks, electrically erasable and programmable Read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static anytime access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, programmable read-only memory (PROM) .
  • the gateway device includes a processor, a memory, and a transceiver (the transceiver may include a receiver and a transmitter, the receiver is used for receiving information, and the transmitter is used for sending information);
  • the transceiver is configured to receive a first access request sent by an OCF client, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device is a first OCF device.
  • the transceiver is further configured to send a second access request to the first BLE Mesh device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device, and There is a mapping relationship between the resource type of the resource and the service model.
  • the transceiver is further configured to: send the second access request to the first BLE Mesh device according to the mapping information; wherein the mapping information is used to determine the access request based on the OCF protocol and the The mapping relationship between the access requests of the BLE Mesh protocol.
  • the mapping information includes the following mapping relationship: the mapping relationship between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device; the resource address of the first OCF device and the The mapping relationship between the element addresses of the first BLE Mesh device; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the processor is configured to parse the first access request to obtain the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device;
  • the processor is further configured to map the device identifier of the first OCF device, the resource address of the first OCF device, and the resource type of the first OCF device into the The device identification of the first BLE Mesh device, the element address of the first BLE Mesh device, and the service model of the first BLE Mesh device;
  • the transceiver is configured to, according to the device identification of the first BLE Mesh device, The element address of the first BLE Mesh device and the service model of the first BLE Mesh device send the second access request to the first BLE Mesh device.
  • the mapping information includes the following mapping relationship: the mapping relationship between the device identifier of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the The mapping relationship between the service models of the first BLE Mesh device is described.
  • the processor is configured to parse the first access request to obtain the device identifier of the first OCF device and the resource type of the first OCF device; the processor is further configured to The mapping information maps the device identifier of the first OCF device and the resource type of the first OCF device to the element address of the first BLE Mesh device and the service model of the first BLE Mesh device, respectively;
  • the transceiver is configured to send the second access request to the first BLE Mesh device according to the element address of the first BLE Mesh device and the service model of the first BLE Mesh device.
  • the processor is further configured to create the first OCF device corresponding to the first BLE Mesh device; the processor is further configured to establish the first OCF device and the first OCF device The mapping relationship between BLE Mesh devices; the memory is configured to store the mapping information according to the mapping relationship.
  • the transceiver is further configured to receive the first access result corresponding to the second access request sent by the first BLE Mesh device; the transceiver is also configured to send the OCF client Send a second access result, where the second access result is an OCF protocol-compliant access result generated by the gateway device according to the first access result.
  • FIG. 23 shows a schematic structural diagram of a terminal 230 according to an embodiment of the present application.
  • An OCF client is installed and running in the terminal 230, and the terminal 230 may include a processor 231, a receiver 232, a transmitter 233, a memory 234, and a bus 235.
  • the processor 231 includes one or more processing cores, and the processor 221 executes various functional applications and information processing by running software programs and modules.
  • the receiver 232 and the transmitter 233 may be implemented as a communication component, and the communication component may be a communication chip.
  • the memory 234 is connected to the processor 231 through the bus 235.
  • the memory 234 may be used to store a computer program, and the processor 231 is used to execute the computer program to implement each step executed by the OCF client in the foregoing method embodiment.
  • the memory 234 may be implemented by any type of volatile or non-volatile storage device or a combination thereof.
  • the volatile or non-volatile storage device includes, but is not limited to: magnetic disks or optical disks, electrically erasable and programmable Read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static anytime access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, programmable read-only memory (PROM) .
  • the terminal includes a processor, a memory, and a transceiver (the transceiver may include a receiver and a transmitter, the receiver is used for receiving information, and the transmitter is used for sending information);
  • the transceiver is configured to send a first access request to a gateway device, where the first access request is a request by the OCF client to access resources of a first OCF device, and the first OCF device is a first BLE
  • the virtual OCF device mapped by the Mesh device; wherein the first access request is converted into a second access request and then sent to the first BLE Mesh device, and the second access request is the gateway device’s response to the first
  • the service model of the BLE Mesh device makes a request for access, and there is a mapping relationship between the resource type of the resource and the service model.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device The mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the service model of the first BLE Mesh device The mapping relationship between.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the element address of the first BLE Mesh device Mapping relationship; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • FIG. 24 shows a schematic structural diagram of a BLE Mesh device 240 provided by an embodiment of the present application.
  • the BLE Mesh device 240 may include: a processor 241, a receiver 242, a transmitter 243, a memory 244, and a bus 245.
  • the processor 241 includes one or more processing cores, and the processor 241 executes various functional applications and information processing by running software programs and modules.
  • the receiver 242 and the transmitter 243 may be implemented as a communication component, and the communication component may be a communication chip.
  • the memory 244 is connected to the processor 241 through the bus 245.
  • the memory 244 may be used to store a computer program, and the processor 241 is used to execute the computer program to implement each step executed by the first BLE Mesh device in the foregoing method embodiment.
  • the memory 244 can be implemented by any type of volatile or non-volatile storage device or a combination thereof.
  • the volatile or non-volatile storage device includes, but is not limited to: magnetic disks or optical disks, electrically erasable and programmable Read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static anytime access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, programmable read-only memory (PROM) .
  • the BLE Mesh device includes a processor, a memory, and a transceiver (the transceiver may include a receiver and a transmitter, the receiver is used for receiving information, and the transmitter is used for sending information);
  • the transceiver is configured to receive a second access request sent by a gateway device, where the second access request is a request for the gateway device to access the service model of the first BLE Mesh device; wherein, the second access request
  • the access request is converted from the first access request, and the first access request is a request from the OCF client to access the resources of the first OCF device, and the first OCF device is a virtual OCF mapped by the first BLE Mesh device
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the device identifier of the first BLE Mesh device The mapping relationship between the resource address of the first OCF device and the element address of the first BLE Mesh device; the resource type of the first OCF device and the service model of the first BLE Mesh device The mapping relationship between.
  • the mapping information between the first OCF device and the first BLE Mesh device includes the following mapping relationship: between the device identifier of the first OCF device and the element address of the first BLE Mesh device Mapping relationship; the mapping relationship between the resource type of the first OCF device and the service model of the first BLE Mesh device.
  • the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored, and the computer program is used to be executed by a processor of a gateway device to implement the BLE Mesh device on the gateway device side. Access method.
  • the embodiment of the present application also provides a computer-readable storage medium in which a computer program is stored, and the computer program is used to be executed by a processor of a terminal to implement the above-mentioned BLE Mesh device on the OCF client side. Access method.
  • the embodiment of the present application also provides a computer-readable storage medium in which a computer program is stored, and the computer program is used to be executed by a processor of a first BLE Mesh device to implement the above-mentioned first BLE Mesh device Access method of the BLE Mesh device on the side.
  • This application also provides a computer program product, when the computer program product runs on the gateway device, the gateway device executes the above-mentioned method for accessing the BLE Mesh device on the gateway device side.
  • This application also provides a computer program product.
  • the computer program product runs on a terminal with an OCF client installed and running, the OCF client executes the above-mentioned method for accessing the BLE Mesh device on the OCF client side.
  • This application also provides a computer program product.
  • the computer program product runs on the BLE Mesh device
  • the first BLE Mesh device executes the above-mentioned method for accessing the BLE Mesh device on the side of the first BLE Mesh device.
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
  • the computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种BLE Mesh设备的访问方法、装置、设备及存储介质,属于通信技术领域。所述方法包括:OCF客户端向网关设备发送第一访问请求;网关设备向第一BLE Mesh设备发送第二访问请求。本方法通过网关设备在接收到OCF客户端发送的第一访问请求之后,将该第一访问请求转换为第二访问请求,然后向BLE Mesh设备发送第二访问请求,从而实现了OCF客户端对BLE Mesh设备的访问,丰富了不同协议之间的互联互通。

Description

BLE Mesh设备的访问方法、装置、设备及存储介质 技术领域
本申请实施例涉及物联网技术领域,特别涉及一种BLE Mesh设备的访问方法、装置、设备及存储介质。
背景技术
物联网(Internet of things,IOT)与人工智能(Artificial Intelligence,AI)的结合日渐紧密。一方面,物联网正在从“连接”走向“智能”;另一方面,人工智能正在从“云端”走向“边缘”,两者正在合力推进物联网走向智联网(Internet of Intelligences)。
全球规模最大的智联网国际标准联盟为OCF(Open Connectivity Foundation,开放式互联基金会),OCF标准支持智能设备之间的搜索与通信,而不受厂商、操作系统、芯片或物理传输的制约,为实现各种物理介质层、传输层和应用层设备间的无缝连接提供了技术规范。OCF拥有灵活广泛的应用场景:首先,OCF客户端(Client)(如手机应用程序)和OCF设备(Server)(如空调)可以进行交互,例如使用手机应用程序可以对空调的开关、温度、模式等信息进行获取和设置;其次,多个OCF客户端可以同时对OCF设备进行控制,例如用户可以在家里通过智能手机、智能电视、智能音箱灵活控制同一个设备;再次,通过桥接(Bridging),OCF客户端可以和其他标准设备进行交互,例如蓝牙、ZigBee(紫蜂)等;最后,OCF设备也可以通过桥接,被其他标准的客户端控制。
BLE(Bluetooth Low Energy,低功耗蓝牙)相比于早前的经典蓝牙,极大程度地减少设备功耗,目前已经被广泛使用。BLE mesh(星形组网)是被设计用于大规模节点之间互相通信的网络支持,其目标是建立可信安全的网络、全部互通的操作、成熟的生态、满足工业级别的应用,以及支持大规模节点数量的组网。BLE mesh的工作方式是managed flood(有管理的泛洪消息传播),泛洪的方式使消息的传播非常可靠、易于扩展,并且性能可以满足商业与工业市场。
但是,目前无法实现OCF客户端与BLE Mesh设备之间的交互。
发明内容
本申请实施例提供了一种BLE Mesh设备的访问方法、装置、设备及存储介质。所述技术方案如下:
一方面,本申请实施例提供了一种BLE Mesh设备的访问方法,应用于网关设备中,所述方法包括:
接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
另一方面,本申请实施例提供了一种BLE Mesh设备的访问方法,应用于OCF客户端中,所述方法包括:
向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
再一方面,本申请实施例提供了一种BLE Mesh设备的访问方法,应用于第一BLE Mesh设备中,所述方法包括:
接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
又一方面,本申请实施例提供了一种BLE Mesh设备的访问装置,应用于网关设备中,所述装置包括:
第一请求接收模块,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设 备;
第二请求发送模块,用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种BLE Mesh设备的访问装置,应用于OCF客户端中,所述装置包括:
第一请求发送模块,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种BLE Mesh设备的访问装置,应用于第一BLE Mesh设备中,所述装置包括:
第二请求接收模块,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种网关设备,所述网关设备包括处理器、存储器和收发器;
所述收发器,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
所述收发器,还用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种终端,所述终端安装运行有OCF客户端,且所述终端包括处理器、存储器和收发器;
所述收发器,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种BLE Mesh设备,所述BLE Mesh设备包括处理器、存储器和收发器;
所述收发器,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
还一方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被网关设备的处理器执行,以实现上述网关设备侧的BLE Mesh设备的访问方法。
还一方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被终端的处理器执行,以实现上述OCF客户端侧的BLE Mesh设备的访问方法。
还一方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被第一BLE Mesh设备的处理器执行,以实现上述第一BLE Mesh设备侧的BLE Mesh设备的访问方法。
还一方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在网关设备上运行时,使得网关设备执行上述网关设备侧BLE Mesh设备的访问方法。
还一方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在安装运行有OCF客户端的终端上运行时,使得终端执行上述OCF客户端侧的BLE Mesh设备的访问方法。
还一方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在第一BLE Mesh设备上运行时,使得第一BLE Mesh设备执行上述第一BLE Mesh设备侧的BLE Mesh设备的访问方法。
本申请实施例提供的技术方案可以带来如下有益效果:
通过网关设备在接收到OCF客户端发送的第一访问请求之后,将该第一访问请求转换为第二访问请求,然后向BLE Mesh设备发送第二访问请求,从而实现了OCF客户端对BLE Mesh设备的访问,丰富了不同协议之间的互联互通。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例提供的桥接平台的示意图;
图2是本申请一个实施例提供的实施环境的示意图;
图3是本申请一个实施例提供的网关设备的结构框图;
图4是本申请一个实施例提供的BLE Mesh设备的访问方法的流程图;
图5是本申请另一个实施例提供的BLE Mesh设备的访问方法的流程图;
图6是本申请一个实施例提供的BLE Mesh设备的结构框图;
图7是本申请再一个实施例提供的BLE Mesh设备的访问方法的流程图;
图8是本申请又一个实施例提供的BLE Mesh设备的访问方法的流程图;
图9是本申请一个实施例提供的映射信息的创建和存储方法的流程图;
图10是本申请另一个实施例提供的映射信息的创建和存储方法的流程图;
图11是本申请再一个实施例提供的映射信息的创建和存储方法的流程图;
图12是本申请又一个实施例提供的映射信息的创建和存储方法的流程图;
图13是本申请还一个实施例提供的映射信息的创建和存储方法的流程图;
图14是本申请一个实施例提供的通过OCF客户端对智能电灯的GET过程的流程图;
图15是本申请一个实施例提供的通过OCF客户端对智能电灯的SET过程的流程图;
图16是本申请还一个实施例提供的映射信息的创建和存储方法的流程图;
图17是本申请另一个实施例提供的通过OCF客户端对智能电灯的SET过程的流程图;
图18是本申请一个实施例提供的BLE Mesh设备的访问装置的框图;
图19是本申请另一个实施例提供的BLE Mesh设备的访问装置的框图;
图20是本申请再一个实施例提供的BLE Mesh设备的访问装置的框图;
图21是本申请又一个实施例提供的BLE Mesh设备的访问装置的框图;
图22是本申请一个实施例提供的网关设备的结构示意图;
图23是本申请一个实施例提供的安装运行有OCF客户端的终端的结构示意图;
图24是本申请一个实施例提供的BLE Mesh设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在一个示例中,OCF客户端可以与BLE GATT(Generic Attribute Profile,通用属性配置文件)设备之间进行交互。请参考图1,其示出了通过桥平台实现OCF客户端与BLE GATT设备之间的交互。桥平台110中包含如下功能模块:虚拟OCF服务端112、桥接功能模块(Bridging Function)114和虚拟BLE GATT客户端116。OCF客户端120与虚拟OCF服务端112之间可以基于OCF协议进行通信,虚拟BLE GATT客户端116与BLE GATT设备130之间可以基于BLE协议进行通信。
桥接功能模块114用于实现OCF协议和BLE协议之间的转换。例如,桥接功能模块114的作用包括将OCF客户端120发送的基于OCF协议的信息,转换为BLE GATT设备130可识别的基于BLE GATT协议的信息。另外,桥接功能模块114的作用还可以包括将BLE GATT设备130发送的基于BLE GATT协议的信息,转换为OCF客户端120可识别的基于OCF协议的信息。
可选地,桥接功能模块114可以建立基于OCF协议的信息与基于BLE GATT协议的信息之间的映射关系,以实现将基于OCF协议的信息转换为基于BLE GATT协议的信息。如下述表一所示,其示出了基于以上两种不同协议的信息之间的映射关系。
表一
基于BLE GATT协议的信息 映射计数 基于OCF协议的信息 映射计数
基于BLE GATT的概要 N OCF设备类型 1
服务 1 OCF资源 N
特征 1 OCF资源属性 N
特征描述符 1 OCF通知开/关选项 1
从上述表一中,可以得到基于BLE GATT协议的信息与基于OCF协议的信息之间的四组映射关系,以及每组映射关系中双方的映射计数。基于表一的四组映射关系包括:基于BLE GATT的概要(BLE GATT-based profile)与OCF设备类型(OCF Device Type)之间的映射关系,且该映射关系为N对1的映射关系;服务(Service)与OCF资源(OCF Resource)之间的映射关系,且该映射关系为1对N的映射关系;特征(Characteristic)与OCF资源属性(OCF Resource property)之间的映射关系,且该映射关系为1对N的映射关系;以及,特征描述符(Characteristic Descriptor)与OCF通知开/关选项(OCF Notification on/off option)之间的映射关系,且该映射关系为1对1的映射关系。
下面,以OCF客户端访问BLE血压仪为例,介绍说明基于OCF协议的信息与基于BLE GATT协议的信息之间的映射关系。
如下述表二所示,其示出了基于BLE GATT的概要与OCF设备类型之间的具体映射示例。
表二
基于BLE GATT的概要 OCF设备类型
Blood Pressure Profile(血压概况) oic.d.bloodpressuremonitor(血压监测器)
如下述表三所示,其示出了基于BLE GATT协议的信息中包含的服务,与基于OCF协议的信息中包含的OCF资源之间的具体映射示例。
表三
Figure PCTCN2019121008-appb-000001
其中,基于BLE GATT协议的信息中包含的一种服务可能有多个BLE Property name(BLE属性名称),每个BLE Property name对应一个OCF Resource(OCF资源),即可完成一个服务(Service)与N个OCF资源(OCF Resource)之间的映射关系。在上述表三中,To OCF是指向OCF设备访问,From OCF是指被OCF客户端访问。
基于上述OCF客户端与BLE GATT设备之间交互的示例可以看出,通过桥平台在不同协议的信息之间建立映射关系,可以实现OCF客户端访问BLE GATT设备。但是,随着BLE Mesh组网的迅速发展,迫切需要在OCF协议与BLE Mesh协议之间建立映射关系,以实现通过OCF客户端对BLE Mesh设备进行访问。
下面,将通过几个实施例,对本申请技术方案进行介绍说明。
请参考图2,其示出了本申请一个实施例提供的实施环境的示意图,该实施环境可以包括:终端210、BLE Mesh设备220和网关设备230。该实施环境可以是一个智联网系统。
终端210可以包括各种具有无线通信功能的手持设备(如手机、平板电脑等)、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。为方便描述,本申请实施例中,上面提到的设备统称为终端。
BLE Mesh设备220是指BLE Mesh组网下具备网络接入能力的智联网设备,如BLE Mesh设备220可以是智能家居设备、终端设备,或者其它具备网络接入能力的设备,本申请实施例对此不作限定。在一个示例中,以实施环境为家庭智联网系统为例,BLE Mesh设备220可以是智能电视、智能音箱、智能空调、智能电灯、智能门窗、智能窗帘、智能插座等智能家居设备。
网关设备230又称为网间连接器、协议转换器,是多个网络间提供数据转换服务的计算机系统或设备。在使用不同的通信协议、数据格式或语言,甚至体系结构完全不同的两种系统或设备之间,网关设备相当于一个翻译器,网关设备可以对收到的信息进行解析,并重新打包发送给目的系统或目的设备,以适应目的系统或目的设备的需求,同时网关设备也可以起到过滤和安全的作用。
本申请实施例中,网关设备230分别连接终端210和BLE Mesh设备220,且终端210中安装运行有OCF客户端211,该OCF客户端211可以通过网关设备230对BLE Mesh设备220进行访问。例如,用户通过操作终端210上运行的OCF客户端211,向网关设备230发送访问请求,该访问请求是基于OCF协议的信息,网关设备230收到该访问请求后,转换该访问请求,转换后的访问请求是基于BLE Mesh协议的信息,然后网关设备230将该转换后的访问请求发送给BLE Mesh设备230,从而完成OCF客户端211对BLE Mesh设备230的访问过程。
需要说明的一点是,本申请实施例中,OCF客户端对BLE Mesh设备的“访问”包括“获取”和“设置”两种方式,“获取”是指OCF客户端获知BLE Mesh设备的状态等,“设置”是指OCF客户端对BLE Mesh设备的状态进行选择、设置、更新等。此外,在本申请实施例中,OCF客户端对BLE Mesh设备的“访问”又可以称为OCF客户端对BLE Mesh设备的“操作”,但本领域技术人员可以理解其含义。
请参考图3,其示出了本申请一个实施例提供的网关设备的结构框图。如图3所示,网关设备300包括虚拟OCF服务端310、映射功能模块320和虚拟BLE Mesh客户端330。
虚拟OCF服务端310是网关设备300中用于与OCF客户端301进行交互的功能模块,虚拟OCF服务端310与OCF客户端301之间基于OCF协议进行交互。
虚拟BLE Mesh客户端330是网关设备300中用于与BLE Mesh设备302进行交互的功能模块,虚拟BLE Mesh客户端330与BLE Mesh设备302之间基于BLE Mesh协议进行交互。BLE Mesh设备302可以作为BLE Mesh服务端,接收来自虚拟BLE Mesh客户端330的访问请求。
映射功能模块320是网关设备300中用于实现两种不同协议信息之间的转换的功能模块,即映射功能模块320用于将基于OCF协议的信息转换为基于BLE Mesh协议的信息,或者用于将基于BLE Mesh协议的信息转换为基于OCF协议的信息。
在一个示例中,当OCF客户端301发起对BLE Mesh设备302的访问请求时,OCF客户端301先向网关设备300发送第一访问请求,该第一访问请求是基于OCF协议的信息,然后由网关设备300中的虚拟OCF服务端310接收该第一访问请求,映射功能模块320将该第一访问请求转换为第二访问请求,该第二访问请求是基于BLE Mesh协议的信息,接着由网关设备300中的虚拟BLE Mesh客户端330向BLE Mesh设备302发送第二访问请求,以完成OCF客户端301对BLE Mesh设备302的访问。
另外,网关设备300也可以称为桥平台,用于实现OCF客户端301与BLE Mesh设备302之间的交互功能。
请参考图4,其示出了本申请一个实施例提供的BLE Mesh设备的访问方法的流程图,该方法可以应用于图2所示的实施环境中。该方法可以包括如下几个步骤(410~420):
步骤410,OCF客户端向网关设备发送第一访问请求。
第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,且第一访问请求是基于OCF协议的访问请求。其中,第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备。
OCF客户端向网关设备发送第一访问请求,其目的是为了对第一BLE Mesh设备进行访问,以获取或设置第一BLE Mesh设备的相关信息。
相应地,网关设备接收第一访问请求。网关设备中的虚拟OCF服务端可以接收OCF客户端发送的第一访问请求。
步骤420,网关设备向第一BLE Mesh设备发送第二访问请求。
第二访问请求是网关设备对第一BLE Mesh设备的服务模型进行访问的请求,且第二访问请求是基于BLE Mesh协议的访问请求。网关设备接收到第一访问请求之后,将该第一访问请求转换为第二访问请求,从而实现对第一BLE Mesh设备进行访问。
网关设备的虚拟OCF服务端可以解析第一访问请求,获取该第一访问请求中包含的信息,然后将上述信息发送至映射功能模块。网关设备的映射功能模块将上述信息进行映射,映射后的信息被发送至虚拟BLE Mesh客户端,由该虚拟BLE Mesh客户端根据映射后的信息生成第二访问请求。网关设备设置映射功能模块,是为了实现基于OCF协议的信息与基于BLE Mesh协议的信息之间的映射,从而将基于OCF协议的第一访问请求,转换为基于BLE Mesh协议的第二访问请求。
第一BLE Mesh设备的服务模型是指第一BLE Mesh设备可以提供的服务的设置模型,实际应用中,第一BLE Mesh设备的服务模型根据第一BLE Mesh设备类型的不同而有所区别,例如,在第一BLE Mesh设备为智能电灯时,第一BLE Mesh设备的服务模型可以包括:开关模型、亮度模型、色温模型,以及色调和饱和度模型等;在第一BLE Mesh设备为智能空调时,第一BLE Mesh设备的服务模型可以包括:开关模型、温度模型、制冷模型、制热模型、除湿模型,以及换气模型等。
本申请实施例中,第一OCF设备的资源的资源类型,与第一BLE Mesh设备的服务模型之间具有映射关系。根据该映射关系,网关设备的映射功能模块可以将用于访问第一OCF设备的资源的第一访问请求,转换为用于访问第一BLE Mesh设备的服务模型的第二访问请求。
在一种可能的实施方式中,上述步骤420包括:网关设备根据映射信息,向第一BLE Mesh设备发送第二访问请求。其中,映射信息用于确定基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间的映射关系,即用于确定第一访问请求与第二访问请求之间的映射关系。本申请实施例中,网关设备中存储有上述映射信息,网关设备的映射功能模块根据该映射信息,可以将第一访问请求中包含基于OCF协议的信息,转换为相应的基于BLE Mesh协议的信息,以使得虚拟BLE Mesh客户端基于该转换得到的基于BLE Mesh协议的信息生成第二访问请求。
网关设备的虚拟BLE Mesh客户端向第一BLE Mesh设备发送第二访问请求,相应地,第一BLE Mesh设备接收网关设备的虚拟BLE Mesh客户端发送的第二访问请求。至此,实现了OCF客户端对第一BLE Mesh设备的访问。
在示例性实施例中,如图5所示,上述步骤420之后,还包括如下几个步骤(步骤430~步骤440):
步骤430,第一BLE Mesh设备向网关设备发送第一访问结果。
第一访问结果是与第二访问请求对应的访问结果,第一BLE Mesh设备接收到第二访问请求后,对该第二访问请求进行处理,并生成第一访问结果。可选地,第一BLE Mesh设备对第二访问请求的处理包括:作出是否接受第二访问请求指示的访问操作的决定,以及在接受第二访问请求指示的访问操作的情况下,执行第二访问请求。例如,当第一BLE Mesh设备为智能电灯,且第二访问请求为访问该智能电灯的开关状态时,假设智能电灯接受第二访问请求指示的访问操作,则智能电灯会获取其所处的开关状态,根据开关状态生成第二访问请求对应的第一访问结果,该第一访问结果中包括智能电灯的开关状态。
相应地,网关设备接收第一访问结果。网关设备的虚拟BLE Mesh客户端可以接收第一BLE Mesh设备发送的第一访问结果,该第一访问结果是基于BLE Mesh协议的信息。
步骤440,网关设备向OCF客户端发送第二访问结果。
网关设备的虚拟BLE Mesh客户端接收到第一访问结果后,由映射功能模块将该第一访问结果转换为第二访问结果,并将该第二访问结果发送至网关设备的虚拟OCF服务端,由虚拟OCF服务端向OCF客户端发送第二访问结果。本申请实施例中,第二访问结果是网关设备生成的符合OCF协议的访问结果,即第二访问结果是基于OCF协议的信息。因为OCF客户端无法读取基于BLE Mesh协议的信息,因此需要将第一访问结果转换为第二访问结果,以便于OCF客户端读取。
相应地,OCF客户端接收第二访问结果。OCF客户端可以接收网关设备的虚拟OCF服务端发送的第二访问结果。
综上所述,本申请实施例提供的技术方案,通过网关设备在接收到OCF客户端发送的第一访问请求之后,将该第一访问请求转换为第二访问请求,然后向BLE Mesh设备发送第二访问请求,从而实现了OCF客户端对BLE Mesh设备的访问,丰富了不同协议之间的互联互通。
另外,本申请实施例提供的技术方案,网关设备可以根据映射信息,将OCF客户端发送的第一访问请求转换为BLE Mesh设备可识别的第二访问请求,实现了在基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间建立映射关系,这样网关设备在转换OCF客户端发送的访问请求时,仅需查找该映射信息,即可以将该访问请求转换为BLE Mesh设备可识别的访问请求,从而便于网关设备对基于不同协议的信息之间的转换,提升网关设备的转换效率。
在一个示例中,上述映射信息包括以下映射关系:
(1)第一OCF设备的设备标识与第一BLE Mesh设备的设备标识之间的映射关系;
第一OCF设备的设备标识是第一OCF设备的唯一标识符,用于唯一标识该第一OCF设备;第一BLE Mesh设备的设备标识是第一BLE Mesh设备的唯一标识符,用于唯一标识该第一BLE Mesh设备。可选地,设备标识可以使用设备ID(Identity document,身份标识)的形式表示,也可以使用设备编号等形式表示,本申请实施例对此不作限定。其中,第一OCF设备的设备标识与第一BLE Mesh设备的设备标识可以都使用设备ID的形式表示,也可以使用设备编号等形式表示,还可以一个使用设备ID的形式表示,一个使用设备编号等形式表示,本申请实施例对此不作限定。可选地,本申请实施例中,第一BLE Mesh设备在BLE Mesh组网中是一个节点(Node)。
在本实施例中,第一OCF设备与第一BLE Mesh设备之间具有映射关系,且该映射关系是1对1的映射关系。这样,映射信息中就包括第一OCF设备的设备标识与第一BLE Mesh设备的设备标识之间的映射关系。
(2)第一OCF设备的资源地址与第一BLE Mesh设备的元素地址之间的映射关系;
其中,第一OCF设备的资源地址是指第一OCF设备的资源的href(Hypertext Reference,超文本引用),第一OCF设备的资源的href是第一OCF设备的资源的统一资源标识符(Uniform Resource Identifier,URI)。示例性的,第一OCF设备的资源的href可以表示为“/xx/xxxx”的形式,其中,“xx”为第一BLE Mesh设备的元素地址,“xxxx”为href的描述。
请参考图6,其示出了一种BLE Mesh设备的结构框图。如图6所示,BLE Mesh设备600包括至少一个元素(Element),其中,主元素(Primary Element)610是必须存在的,且主元素610对应有一个元素地址,当BLE Mesh设备被发现(Provisioned)后,配置节点(Proivisioner)会为该BLE Mesh设备分配一个单播地址,该单播地址即为主元素610的元素地址。在存在多个元素的情况下,除了主元素610外的其他元素均为从元素(Secondary Element)620,且从元素的元素地址是在主元素的元素地址上累加的。如图6所示,BLE Mesh设备600有三个元素,包括一个主元素610和两个从元素620,则这两个从元素620的元素地址是在主元素610的元素地址上分别加1和加2得到的。
在本实施例中,第一OCF设备的资源与第一BLE Mesh设备的元素之间具有映射关系,且该映射关系是1对1的映射关系。这样,映射信息中就包括第一OCF设备的资源地址与第一BLE Mesh设备的元素地址之间的映射关系。
(3)第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
一般来说,一个智联网技术体系内可以定义一个资源类型,然后不同的领域、不同的设备、不同的资源可以实例化该资源类型。
如图6所示,BLE Mesh设备600中的每个元素对应有多个模型(Model),通常,BLE Mesh设备600对应有三种类型的模型,分别为控制模型(Control Model)、服务模型(Server Model)和客户端模型(Client Model),其中,控制模型630一般存在于主元素610中,服务模型640和客户端模型650既可以存在于主元素610中,也可以存在于从元素620中。服务模型640可以对应有多个状态(State),该状态是用于被访问的,然而,客户端模型650不存在状态,客户端模型650一般用于访问服务模型640的状态。
在本实施例中,第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间具有映射关系,且该映射关系是1对1的映射关系。这样,映射信息中就包括第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
可选地,网关设备以映射表格的形式表示该映射信息。如下述表四所示,其示出了一种表示上述映射信息的映射表格。
表四
BLE Mesh协议 映射计数 OCF协议 映射计数
设备(或称为“节点”) 1 OCF设备 1
元素 1 OCF资源 1
服务模型 1 OCF资源类型 1
状态 1 OCF资源属性 1
从上述表四中可以看出,第一BLE Mesh设备与第一OCF设备之间具有映射关系,且该映射关系是1对1的映射关系;第一BLE Mesh设备的元素与第一OCF设备的资源之间具有映射关系,且该映射关系是1对1的映射关系;第一BLE Mesh设备的服务模型与第一OCF设备的资源类型之间具有映射关系,且该映射关系是1对1的映射关系;第一BLE Mesh设备的状态与第一OCF设备的资源属性之间具有映射关系,且该映射关系是1对1的映射关系。其中,第一BLE Mesh设备的状态与第一OCF设备的资源属性之间的 映射关系,可以由第一BLE Mesh设备的服务模型与第一OCF设备的资源类型之间的映射关系直接得到。
基于包含上述三种映射关系的映射信息,如图7所示,可以将上述步骤420替换为下述步骤42A至42C,上述BLE Mesh设备的访问方法可以包括如下几个步骤:
步骤410,OCF客户端向网关设备发送第一访问请求。
基于上述图4实施例中步骤410介绍说明,可以得到此处图7实施例中步骤410的介绍说明,有关图7实施例中步骤410的介绍说明,请参照上文图4实施例,此处不再赘述。
步骤42A,网关设备解析第一访问请求,得到第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型。
网关设备的虚拟OCF服务端接收到OCF客户端发送的第一访问请求后,即可对该第一访问请求进行解析,从而可以得到第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型,然后向网关设备的映射功能模块发送解析出的信息。
步骤42B,网关设备根据映射信息,将第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型,分别映射为第一BLE Mesh设备的设备标识、第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型。
网关设备的映射功能模块接收到解析出的信息后,查询上述映射信息以对解析出的信息分别进行映射,即从映射信息中查询第一OCF设备的设备标识对应的第一BLE Mesh设备的设备标识、第一OCF设备的资源地址对应的第一BLE Mesh设备的元素地址,以及第一OCF设备的资源类型对应的第一BLE Mesh设备的服务模型。网关设备的映射功能模块在映射操作完成后,可以向网关设备的虚拟BLE Mesh客户端发送映射得到的信息。
步骤42C,网关设备根据第一BLE Mesh设备的设备标识、第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型,向第一BLE Mesh设备发送第二访问请求。
网关设备的虚拟BLE Mesh客户端接收到第一BLE Mesh设备的设备标识、第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型后,可以向第一BLE Mesh设备发送第二访问请求,以完成通过OCF客户端对第一BLE Mesh设备的访问过程。
以上步骤43A至步骤43C具体在实现时可以包括如下几个步骤:首先,网关设备中可以解析出第一OCF设备的资源地址,通过该资源地址,获得第一BLE Mesh设备的元素地址;然后,网关设备可以解析出第一OCF设备的资源类型,通过该资源类型,获得第一BLE Mesh设备的服务模型;最后,通过第一BLE Mesh设备的服务模型,获得第一BLE Mesh设备的客户端模型。
综上所述,本申请实施例提供的技术方案,通过网关设备在接收到OCF客户端发送的第一访问请求后,可以根据映射信息,将OCF客户端发送的基于OCF协议的第一访问请求,转换为基于BLE Mesh协议的第二访问请求,然后向BLE Mesh设备发送第二访问请求,从而实现了一种通过OCF客户端访问BLE Mesh设备的方式。并且,本申请实施例中,网关设备确定了OCF设备与BLE Mesh设备之间的映射信息所包含的具体映射关系,从而使得网关设备在接收到OCF客户端的访问请求后,更加直观明确地转换该访问请求,提升了网关设备转换访问请求的效率。
另外,本申请实施例提供的技术方案,在BLE Mesh设备与OCF设备之间直接建立映射关系,而非在BLE Mesh设备与包含多个OCF设备的OCF平台之间建立映射关系,从而可以降低映射信息中包含的映射关系的数量,以此降低映射信息在设计创建时的复杂度,并且降低网关设备在查询映射信息时所需要花费的处理开销。
在另一个示例中,上述映射信息包括以下映射关系:
(1)第一OCF设备的设备标识与第一BLE Mesh设备的元素地址之间的映射关系;
基于上述可选实施例对第一OCF设备的设备标识,以及第一BLE Mesh设备的元素地址的介绍说明,得到此示例性实施例中关于第一OCF设备的设备标识,以及第一BLE Mesh设备的元素地址的介绍说明,有关介绍说明请参见上述可选实施例,此处不再赘述。
在本实施例中,第一OCF设备与第一BLE Mesh设备的元素之间具有映射关系,且该映射关系是1对1的映射关系。这样,映射信息中就包括第一OCF设备的设备标识与第一BLE Mesh设备的元素地址之间的映射关系。
(2)第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
基于上述可选实施例中对第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系的介绍说明,得到此处可选实施例中对第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系的介绍说明,有关介绍说明,请参照上文可选实施例,此处不再赘述。
在本实施例中,第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间具有映射关系,且该 映射关系是1对1的映射关系。这样,映射信息中就包括第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
可选地,网关设备以映射表格的形式表示该映射信息。如下述表五所示,其示出了一种表示上述映射信息的映射表格。
表五
BLE Mesh协议 映射计数 OCF协议 映射计数
设备(或称为“节点”) 1 OCF平台 1
元素 1 OCF设备 1
服务模型 1 OCF资源类型 1
状态 1 OCF资源属性 1
从上述表五中可以看出,第一BLE Mesh设备与OCF平台之间具有映射关系,且该映射关系是1对1的映射关系。可选地,OCF平台中可以包含多个OCF客户端,每个OCF客户端对应一个OCF设备,因此第一BLE Mesh设备实际上可以与多个OCF设备对应,即第一BLE Mesh设备与OCF设备之间是一对多的映射关系。因为第一BLE Mesh设备可以有一个或多个元素,因此如上述表五所示,第一BLE Mesh设备的元素与OCF设备之间具有映射关系,且该映射关系是1对1的映射关系。本申请实施例中,第一BLE Mesh设备在BLE Mesh组网中是一个节点(Node)。
从上述表五中还可以看出,第一BLE Mesh设备的服务模型与第一OCF设备的资源类型之间具有映射关系,且该映射关系是1对1的映射关系;第一BLE Mesh设备的状态与第一OCF设备的资源属性(Resource property)之间也具有映射关系,且该映射关系是1对1的映射关系。其中,第一BLE Mesh设备的状态与第一OCF平台的资源属性之间的映射关系,可以由第一BLE Mesh设备的服务模型与第一OCF设备的资源类型之间的映射关系直接得到。
基于包含上述两种映射关系的映射信息,如图8所示,可以将上述步骤420替换为下述步骤421至423,上述BLE Mesh设备的访问方法可以包括如下几个步骤:
步骤410,OCF客户端向网关设备发送第一访问请求。
基于上述图4实施例中步骤410的介绍说明,可以得到此处图8实施例中步骤410的介绍说明,有关图8实施例中步骤410的介绍说明,请参照上文图4实施例,此处不再赘述。
步骤421,网关设备解析第一访问请求,得到第一OCF设备的设备标识和第一OCF设备的资源类型。
网关设备的虚拟OCF服务端接收到OCF客户端发送的第一访问请求后,即可对该第一访问请求进行解析,从而可以得到第一OCF设备的设备标识和第一OCF设备的资源类型,然后向网关设备的映射功能模块发送解析出的信息。
步骤422,网关设备根据映射信息,将第一OCF设备的设备标识和第一OCF设备的资源类型,分别映射为第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型。
网关设备的映射功能模块接收到解析出的信息后,查询上述映射信息以对解析出的信息分别进行映射,即从映射信息中查询第一OCF设备的设备标识对应的第一BLE Mesh设备的元素地址,以及第一OCF设备的资源类型对应的第一BLE Mesh设备的服务模型。网关设备的映射功能模块在映射操作完成后,可以向网关设备的虚拟BLE Mesh客户端发送映射得到的信息。
步骤423,网关设备根据第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型,向第一BLE Mesh设备发送第二访问请求。
网关设备的虚拟BLE Mesh客户端接收到第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型后,可以向第一BLE Mesh设备发送第二访问请求,以完成通过OCF客户端对第一BLE Mesh设备的访问过程。
综上所述,本申请实施例提供的技术方案,通过网关设备在接收到OCF客户端发送的第一访问请求后,可以根据映射信息,将OCF客户端发送的基于OCF协议的第一访问请求,转换为基于BLE Mesh协议的第二访问请求,然后向BLE Mesh设备发送第二访问请求,从而实现了一种通过OCF客户端访问BLE Mesh设备的方式。并且,本申请实施例中,网关设备确定了OCF设备与BLE Mesh设备之间的映射信息所包含的具体映射关系,从而使得网关设备在接收到OCF客户端的访问请求后,更加直观明确地转换该访问请求,提升了网关设备转换访问请求的效率。
请参考图9,其示出了本申请一个实施例提供的映射信息的创建和存储方法的流程图,该方法可以应用于图2所示的实施环境中,如应用于图2所示实施环境的网关设备中。该方法可以包括如下几个步骤(910~930):
步骤910,创建第一OCF设备。
网关设备中的虚拟OCF服务端在接收到创建第一OCF设备的通知后,即根据该通知创建第一OCF设备。可选地,网关设备中存储有待创建的OCF设备列表,该待创建的OCF设备列表用于指示待创建的第一BLE Mesh设备的设备标识与待创建的OCF设备的对应关系,对应第一OCF设备的功能模块在创建第一OCF设备时,可以在该待创建的OCF设备列表中查询被发现的第一BLE Mesh设备的设备标识,并根据被发现的第一BLE Mesh设备的设备标识,创建与之对应的第一OCF设备。可选地,每个创建成功的第一OCF设备均对应有一个设备标识(Device index)。可选地,对应第一OCF设备的功能模块在成功创建第一OCF设备之后,可以向网关设备中的映射功能模块返回该第一OCF设备的设备标识。
在一种可能的实施方式中,如图10所示,上述步骤910之前还包括如下几个步骤(901~904):
步骤901,将第一BLE Mesh设备作为节点存储在被发现的BLE Mesh设备列表中。
被发现的BLE Mesh设备列表包括被发现的第一BLE Mesh设备对应的节点,即本申请实施例中,被发现的BLE Mesh设备列表中以节点的形式表示被发现的第一BLE Mesh设备。被发现的BLE Mesh设备列表位于网关设备的虚拟BLE Mesh客户端中,且其可以是网关设备中存储的设备列表,也可以是网关设备临时创建的设备列表,本申请实施例对此不作限定。可选地,待创建的BLE Mesh设备列表初始为空。
步骤902,为每个节点对应的服务模型进行密钥绑定。
被发现的BLE Mesh设备列表中的节点与第一BLE Mesh设备之间存在对应关系,每个节点对应的第一BLE Mesh设备可能都存在多个服务模型,可选地,第一BLE Mesh设备的服务模型可以相同,也可以不相同,本申请实施例对此不作限定。例如,当第一BLE Mesh设备包括智能电灯和智能空调时,智能电灯的服务模型可以为开关模型,智能空调的服务模型也可以为开关模型。又例如,当第一BLE Mesh设备包括智能电灯和智能空调时,智能电灯的服务可以为亮度模型、色温模型和饱和度模型,智能空调的服务模型可以为温度模型、湿度模型。
网关设备的虚拟BLE Mesh客户端可以为每个节点对应的服务模型进行密钥(Key)绑定,也即为每个节点对应的服务模型分配密钥。本申请实施例中,密钥是虚拟BLE Mesh客户端分配的,并且用于对第一BLE Mesh设备与虚拟BLE Mesh客户端之间传输的数据进行加密。
步骤903,为绑定成功的服务模型指定客户端模型。
客户端模型位于虚拟BLE Mesh客户端中,本申请实施例中,虚拟BLE Mesh客户端中有一个或多个客户端模型,可选地,每个客户端模型既可以对应一个服务模型,也可以对应一类服务模型,本申请实施例对此不作限定。例如,不同的BLE Mesh设备的服务模型中的开关模型,既可以对应虚拟BLE Mesh客户端不同的客户端模型,且一个开关模型对应一个虚拟BLE Mesh客户端客户端模型;也可以对应虚拟BLE Mesh客户端同一个客户端模型。当每个客户端模型对应一类服务模型时,有助于减少虚拟BLE Mesh客户端中客户端模型的数量。
步骤904,将节点存储在待创建的OCF设备列表中。
网关设备的虚拟BLE Mesh客户端将节点创建成功后,可以先向网关设备的映射关系发送创建成功的通知,映射功能模块接收到节点创建成功的通知后,即可以将创建成功的节点存储在待创建的OCF设备列表中。可选地,本申请实施例中,映射功能模块在将节点存储在待创建的OCF设备列表中之后,可以向虚拟OCF服务端发送创建第一OCF设备的通知。
步骤920,建立第一OCF设备与第一BLE Mesh设备之间的映射关系。
在接收到第一OCF设备的设备标识之后,网关设备的映射关系模块即建立第一OCF设备与第一BLE Mesh设备之间的映射关系。
在一个示例中,如图11所示,为了得到上述表四所示的映射信息,上述步骤920可以包括如下几个子步骤(92A~92C):
步骤92A,建立第一OCF设备的设备标识与第一BLE Mesh设备的设备标识之间的映射关系。
可选地,第一OCF设备与第一BLE Mesh设备之间的映射关系可以键值对的形式表示,且第一OCF设备为“键”,第一BLE Mesh设备为“值”,其中,“键”是指所存数据的编号,“值”是指所存的数据,则第一OCF设备为“键”是指存储第一OCF设备的设备标识的编号,第一BLE Mesh设备为“值”是指存储第一BLE Mesh设备的设备标识。
示例性地,第一OCF设备的设备标识与第一BLE Mesh设备的设备标识之间的映射关系可以表示为:OCF Device index<->Node。
步骤92B,建立第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
本申请实施例中,第一BLE Mesh设备的服务模型是指成功绑定密钥的服务模型。当第一OCF设备与第一BLE Mesh设备之间存在映射关系,且该映射关系是1对1的映射关系时,第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间也存在映射关系,且该映射关系是1对1的映射关系。
示例性地,第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系可以表示为: OCF资源类型<->Node中Model SRV,其中,SRV为Sever的缩写。
步骤92C,建立第一OCF设备的资源地址与第一BLE Mesh设备的元素地址之间的映射关系。
第一OCF设备的资源地址可以表示为“/xx/xxxx/”,其中“xx”即为第一BLE Mesh设备的元素地址。示例性的,第一OCF设备的资源地址与第一BLE Mesh设备的元素地址之间的映射关系可以表示为:OCF Resource href(href:<uri=/xx/xxxx/>)<->xx对应Node中Model SRV所在的Element地址。
在另一个示例中,如图12所示,为了得到上述表五所示的映射信息,上述步骤920可以包括如下几个子步骤(921~922):
步骤921,建立第一OCF设备的设备标识与第一BLE Mesh设备的元素地址之间的映射关系。
本申请实施例中,第一OCF设备与第一BLE Mesh设备的元素地址之间存在映射关系,且该映射关系是1对1的映射关系。可选地,第一OCF设备与第一BLE Mesh设备的元素地址之间的映射关系可以键值对的形式表示,且第一OCF设备为“键”,第一BLE Mesh设备的元素地址为“值”。
示例性地,第一OCF设备的设备标识与第一BLE Mesh设备的元素地址之间的映射关系可以表示为:OCF Device Index<->Element。
步骤922,建立第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系。
本申请实施例中,第一BLE Mesh设备的服务模型是指成功绑定密钥的服务模型。
示例性地,第一OCF设备的资源类型与第一BLE Mesh设备的服务模型之间的映射关系可以表示为:OCF资源类型<->Element中Model SRV。
步骤930,根据映射关系存储映射信息。
网关设备的映射功能模块在第一OCF设备与第一BLE Mesh设备之间建立映射关系后,即可以按照该映射关系存储映射信息,以便于后续在处理OCF客户端的访问请求等情况下,根据该映射信息,进行不同协议的信息之间的转换。可选地,映射信息中第一OCF设备的设备标识与第一BLE Mesh设备的设备标识之间的映射关系,或者第一OCF设备的设备标识与第一BLE Mesh设备的元素地址之间的映射关系,可以键值对的形式存储。
需要说明的一点是,在上述实施例中,步骤92A至步骤92C之间的实施顺序,以及步骤921至步骤922之间的执行顺序均不存在限定,即上述步骤编号仅起到区分各个步骤的目的,实际应用中,步骤92A至步骤92C可以同时执行,步骤921至步骤922也可以同时执行,本申请实施例对步骤92A至步骤92C,以及步骤921至步骤922之间的执行顺序不作限定。
综上所述,本申请实施例提供的技术方案,通过创建与BLE Mesh设备对应的OCF设备,然后在BLE Mesh设备与OCF设备之间建立映射关系,并根据该映射关系存储映射信息,从而实现了一种映射信息的建立与存储的方式。
需要说明的另一点是,在上述方法实施例中,主要从OCF客户端、网关设备和第一BLE Mesh设备之间交互的角度,对本申请技术方案进行了介绍说明。上述有关OCF客户端执行的步骤,可以单独实现成为OCF客户端侧的BLE Mesh设备的访问方法;上述有关网关设备执行的步骤,可以单独实现成为网关设备侧的BLE Mesh设备的访问方法;上述有关第一BLE Mesh设备执行的步骤,可以单独实现成为第一BLE Mesh设备侧的BLE Mesh设备的访问方法。
下面以一个具体的例子,对本申请实施例提供的BLE Mesh设备的访问方法,和映射信息的创建和存储方法进行介绍说明。
假设智联网系统为家庭智联网系统,第一BLE Mesh设备为智能电灯,则如下述表六所示,智能电灯的设备标识可以表示为“Light”,第一OCF设备的设备标识可以表示为“oic.d.light”,且“Light”与“oic.d.light”之间存在映射关系。
表六
第一BLE Mesh设备(智能电灯)的设备标识 第一OCF设备的设备标识
Light oic.d.light
由此,如下述表七所示,智能电灯的服务模型包括:通用开关模型(Generic OnOff Server)、灯光亮度模型(Light Lightness Server)、灯光色温模型(Light CTL Server)、灯光色调和饱和度模型(Light HSL Server);第一OCF设备的资源类型包括:开关资源(oic.r.switch.binary)、亮度资源(oic.r.light.brightness)、色温资源(oic.r.colour.colourtemperature)、色调和饱和度资源(oic.r.colour.hs),根据智能电灯的服务模型与第一OCF设备的资源类型,建立映射关系。
表七
智能电灯的服务模型 第一OCF设备的资源类型
Generic OnOff Server oic.r.switch.binary
Light Lightness Server oic.r.light.brightness
Light CTL Server oic.r.colour.colourtemperature
Light HSL Server oic.r.colour.hs
在一个示例中,如图13所示,本示例中,有两个智能电灯,分别为智能电灯1和智能电灯2,网关设备在建立智能电灯与第一OCF设备之间的映射信息,可以进行如下几个步骤(1310~1390):
步骤1310,将智能电灯1作为节点1、将智能电灯2作为节点2,并将节点1和节点2存储在被发现的设备列表中;
步骤1320,为节点1和节点2对应的服务模型进行密钥绑定;
步骤1330,为绑定成功的服务模型指定客户端模型;
步骤1340,将节点1和节点2存储在待创建的OCF设备列表中;
步骤1350,创建第一OCF设备;本示例以创建节点1对应的第一OCF设备为例进行举例说明;
步骤1360,建立第一OCF设备的设备标识与智能电灯1的设备标识之间的映射关系;
步骤1370,建立第一OCF设备的资源类型与智能电灯1的服务模型之间的映射关系;例如,可以在智能电灯的“Generic OnOff Server Model”这一服务模型,以第一OCF设备的资源类型“oic.r.switch.binary”之间建立映射关系,则在第一OCF设备中可以对该资源类型对应的资源可进行获取(GET)、设置(SET)和更新(Update)操作;
步骤1380,建立第一OCF设备的资源地址与智能电灯1的元素地址之间的映射关系;
步骤1390,根据映射关系存储映射信息。
结合参考图14,基于图13示例中创建的映射信息,OCF客户端对智能电灯的GET过程可以包括如下几个过程(1410~1470):
步骤1410,OCF客户端向网关设备发送第一GET请求;本示例中存在两个OCF客户端,分别为OCF客户端1和OCF客户端2,本示例仅以OCF客户端2发送第一访问请求为例进行举例说明;
步骤1420,网关设备解析第一GET请求,得到第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型;网关设备在解析GET请求时,可以先解析出第一OCF设备的资源地址,然后解析第一OCF设备的资源类型;
步骤1430,网关设备根据映射信息,将第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型,分别映射为智能电灯的设备标识、智能电灯的元素地址和智能电灯的服务模型;
步骤1440,网关设备向智能电灯发送第二GET请求;第二GET请求中包括:智能电灯的设备标识、智能电灯的元素地址和智能电灯的服务模型;本示例中存在两个智能电灯,分别为智能电灯1和智能电灯2,本示例仅以智能电灯1接收第二访问请求为例进行举例说明;
步骤1450,智能电灯向网关设备发送第一GET结果;
步骤1460,网关设备对第一GET结果进行处理,得到第二GET结果;
步骤1470,网关设备向OCF客户端发送第二GET结果。
结合参考图15,基于图13示例中创建的映射信息,OCF客户端对智能电灯的SET过程可以包括如下几个过程(1510~1570):
步骤1510,OCF客户端向网关设备发送第一SET请求;本示例中也存在两个OCF客户端,分别为OCF客户端1和OCF客户端2,本示例仅以OCF客户端2发送第一访问请求为例进行举例说明;
步骤1520,网关设备解析第一SET请求,得到第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型;
步骤1530,网关设备根据映射信息,将第一OCF设备的设备标识、第一OCF设备的资源地址和第一OCF设备的资源类型,分别映射为智能电灯的设备标识、智能电灯的元素地址和智能电灯的服务模型;
步骤1540,网关设备向智能电灯发送第二SET请求;第二SET请求中包括:智能电灯的设备标识、智能电灯的元素地址和智能电灯的服务模型;本示例中存在两个智能电灯,分别为智能电灯1和智能电灯2,本示例仅以智能电灯1接收第二访问请求为例进行举例说明;
步骤1550,智能电灯向网关设备发送第一SET结果;
步骤1560,网关设备对第一SET结果进行处理,得到第二SET结果;
步骤1570,网关设备向OCF客户端发送第二SET结果。
在另一个示例中,如图16所示,本示例中,也有两个智能电灯,分别为智能电灯1和智能电灯2,网关设备在建立智能电灯与第一OCF设备之间的映射信息,可以进行如下几个步骤(1610~1680):
步骤1610,将智能电灯1作为节点1、将智能电灯2作为节点2,并将节点1和节点2存储在被发现的智能电灯列表中;
步骤1620,为节点1和节点2对应的服务模型进行密钥绑定;
步骤1630,为绑定成功的服务模型指定客户端模型;
步骤1640,将节点1和节点2存储在待创建的OCF设备列表中;
步骤1650,创建第一OCF设备;本示例以创建节点1对应的第一OCF设备为例进行举例说明;
步骤1660,建立第一OCF设备的设备标识与智能电灯1的元素地址之间的映射关系;
步骤1670,建立第一OCF设备的资源类型与智能电灯1的服务模型之间的映射关系;
步骤1680,根据映射关系存储映射信息。
结合参考图17,基于图16示例中创建的映射信息,OCF客户端对智能电灯的SET过程可以包括如下几个过程(1710~1770):
步骤1710,OCF客户端向网关设备发送第一SET请求;本示例中也存在两个OCF客户端,分别为OCF客户端1和OCF客户端2,本示例仅以OCF客户端1发送第一访问请求为例进行举例说明;
步骤1720,网关设备解析第一访问请求,得到第一OCF设备的设备标识和第一OCF设备的资源类型;
步骤1730,网关设备根据映射信息,将第一OCF设备的设备标识和第一OCF设备的资源类型,分别映射为第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型;
步骤1740,网关设备向智能电灯发送第二SET请求;第二SET请求中包括:第一BLE Mesh设备的元素地址和第一BLE Mesh设备的服务模型;本示例中存在两个智能电灯,分别为智能电灯1和智能电灯2,本示例仅以智能电灯2接收第二访问请求为例进行举例说明;
步骤1750,智能电灯向网关设备发送第一SET结果;
步骤1760,网关设备对第一SET结果进行处理,得到第二SET结果;
步骤1770,网关设备向OCF客户端发送第二SET结果。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图18,其示出了本申请一个实施例提供的BLE Mesh设备的访问装置的框图。该装置具有实现上述网关设备侧的方法示例的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该装置可以是上文介绍的网关设备,也可以设置在网关设备中。如图18所示,该装置1800可以包括:第一请求接收模块1810和第二请求发送模块1820。
第一请求接收模块1810,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备。
第二请求发送模块1820,用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述第二请求发送模块1820,用于:根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求;其中,所述映射信息用于确定基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间的映射关系。
可选地,所述映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,如图19所示,所述第二请求发送模块1820,包括:第一请求解析子模块1822,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型;映射子模块1824,用于根据所述映射信息,将所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;第二请求发送子模块1826,用于根据所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
可选地,所述映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,如图19所示,所述第二请求发送模块1820,包括:第一请求解析子模块1822,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识和所述第一OCF设备的资源类型;映射子模块1824,用于根据所述映射信息,将所述第一OCF设备的设备标识和所述第一OCF设备的资源类型,分别映射为 所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;第二请求发送子模块1826,用于根据所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
可选地,如图19所示,所述装置1800还包括:OCF设备创建模块1830,用于创建与所述第一BLE Mesh设备对应的所述第一OCF设备;映射关系建立模块1840,用于建立所述第一OCF设备与所述第一BLE Mesh设备之间的映射关系;映射信息存储模块1850,用于根据所述映射关系存储所述映射信息。
可选地,如图19所示,所述装置1800还包括:第一结果接收模块1860,用于接收所述第一BLE Mesh设备发送的与所述第二访问请求对应的第一访问结果;第二结果发送模块1870,用于向所述OCF客户端发送第二访问结果,所述第二访问结果是所述网关设备根据所述第一访问结果生成的符合OCF协议的访问结果。
请参考图20,其示出了本申请一个实施例提供的BLE Mesh设备的访问装置的框图。该装置具有实现上述OCF客户端侧的方法示例的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该装置可以是上文介绍的安装运行有OCF客户端的终端,也可以设置在安装运行有OCF客户端的终端中。如图20所示,该装置2000可以包括:第一请求发送模块2010。
第一请求发送模块2010,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
请参考图21,其示出了本申请一个实施例提供的BLE Mesh设备的访问装置的框图。该装置具有实现上述第一BLE Mesh设备侧的方法示例的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该装置可以是上文介绍的第一BLE Mesh设备,也可以设置在第一BLE Mesh设备中。如图21所示,该装置2100可以包括:第二请求接收模块2110。
第二请求接收模块2110,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
需要说明的一点是,上述实施例提供的装置在实现其功能时,仅以上述各个功能模块的划分进行举例说明,实际应用中,可以根据实际需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
请参考图22,其示出了本申请一个实施例提供的网关设备220的结构示意图。该网关设备220可以用 于实现上述BLE Mesh设备的访问方法。该网关设备220可以包括:处理器221、接收器222、发射器223、存储器224和总线225。
处理器221包括一个或者一个以上处理核心,处理器221通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。
接收器222和发射器223可以实现为一个通信组件,该通信组件可以是一块通信芯片。
存储器224通过总线225与处理器221相连。
存储器224可用于存储计算机程序,处理器221用于执行该计算机程序,以实现上述方法实施例中的网关设备执行的各个步骤。
此外,存储器224可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),静态随时存取存储器(SRAM),只读存储器(ROM),磁存储器,快闪存储器,可编程只读存储器(PROM)。
在示例性实施例中,所述网关设备包括处理器、存储器和收发器(该收发器可以包括接收器和发射器,接收器用于接收信息,发射器用于发送信息);
所述收发器,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
所述收发器,还用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述收发器,还用于:根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求;其中,所述映射信息用于确定基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间的映射关系。
可选地,所述映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述处理器,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型;所述处理器,还用于根据所述映射信息,将所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;所述收发器,用于根据所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
可选地,所述映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述处理器,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识和所述第一OCF设备的资源类型;所述处理器,还用于根据所述映射信息,将所述第一OCF设备的设备标识和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;所述收发器,用于根据所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
可选地,所述处理器,还用于创建与所述第一BLE Mesh设备对应的所述第一OCF设备;所述处理器,还用于建立所述第一OCF设备与所述第一BLE Mesh设备之间的映射关系;所述存储器,用于根据所述映射关系存储所述映射信息。
可选地,所述收发器,还用于接收所述第一BLE Mesh设备发送的与所述第二访问请求对应的第一访问结果;所述收发器,还用于向所述OCF客户端发送第二访问结果,所述第二访问结果是所述网关设备根据所述第一访问结果生成的符合OCF协议的访问结果。
请参考图23,其示出了本申请一个实施例提供的终端230的结构示意图。该终端230中安装运行有OCF客户端,该终端230可以包括:处理器231、接收器232、发射器233、存储器234和总线235。
处理器231包括一个或者一个以上处理核心,处理器221通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。
接收器232和发射器233可以实现为一个通信组件,该通信组件可以是一块通信芯片。
存储器234通过总线235与处理器231相连。
存储器234可用于存储计算机程序,处理器231用于执行该计算机程序,以实现上述方法实施例中的 OCF客户端执行的各个步骤。
此外,存储器234可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),静态随时存取存储器(SRAM),只读存储器(ROM),磁存储器,快闪存储器,可编程只读存储器(PROM)。
在示例性实施例中,所述终端包括处理器、存储器和收发器(该收发器可以包括接收器和发射器,接收器用于接收信息,发射器用于发送信息);
所述收发器,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
请参考图24,其示出了本申请一个实施例提供的BLE Mesh设备240的结构示意图。该BLE Mesh设备240可以包括:处理器241、接收器242、发射器243、存储器244和总线245。
处理器241包括一个或者一个以上处理核心,处理器241通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。
接收器242和发射器243可以实现为一个通信组件,该通信组件可以是一块通信芯片。
存储器244通过总线245与处理器241相连。
存储器244可用于存储计算机程序,处理器241用于执行该计算机程序,以实现上述方法实施例中的第一BLE Mesh设备执行的各个步骤。
此外,存储器244可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),静态随时存取存储器(SRAM),只读存储器(ROM),磁存储器,快闪存储器,可编程只读存储器(PROM)。
在示例性实施例中,所述BLE Mesh设备包括处理器、存储器和收发器(该收发器可以包括接收器和发射器,接收器用于接收信息,发射器用于发送信息);
所述收发器,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
可选地,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被网关设备的处理器执行,以实现上述网关设备侧的BLE Mesh设备的访问方法。
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被终端的处理器执行,以实现上述OCF客户端侧的BLE Mesh设备的访问方法。
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序用于被第一BLE Mesh设备的处理器执行,以实现上述第一BLE Mesh设备侧的BLE Mesh设备的访问 方法。
本申请还提供了一种计算机程序产品,当计算机程序产品在网关设备上运行时,使得网关设备执行上述网关设备侧BLE Mesh设备的访问方法。
本申请还提供了一种计算机程序产品,当计算机程序产品在安装运行有OCF客户端的终端上运行时,使得OCF客户端执行上述OCF客户端侧的BLE Mesh设备的访问方法。
本申请还提供了一种计算机程序产品,当计算机程序产品在BLE Mesh设备上运行时,使得第一BLE Mesh设备执行上述第一BLE Mesh设备侧的BLE Mesh设备的访问方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (34)

  1. 一种BLE Mesh设备的访问方法,其特征在于,应用于网关设备,所述方法包括:
    接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  2. 根据权利要求1所述的方法,其特征在于,所述向所述第一BLE Mesh设备发送第二访问请求,包括:
    根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求;
    其中,所述映射信息用于确定基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间的映射关系。
  3. 根据权利要求2所述的方法,其特征在于,所述映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  4. 根据权利要求3所述的方法,其特征在于,所述根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求,包括:
    解析所述第一访问请求,得到所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型;
    根据所述映射信息,将所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;
    根据所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
  5. 根据权利要求2所述的方法,其特征在于,所述映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  6. 根据权利要求5所述的方法,其特征在于,所述根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求,包括:
    解析所述第一访问请求,得到所述第一OCF设备的设备标识和所述第一OCF设备的资源类型;
    根据所述映射信息,将所述第一OCF设备的设备标识和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;
    根据所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
  7. 根据权利要求2至6任一项所述的方法,其特征在于,所述根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求之前,还包括:
    创建与所述第一BLE Mesh设备对应的所述第一OCF设备;
    建立所述第一OCF设备与所述第一BLE Mesh设备之间的映射关系;
    根据所述映射关系存储所述映射信息。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述向所述第一BLE Mesh设备发送第二访问请求之后,还包括:
    接收所述第一BLE Mesh设备发送的与所述第二访问请求对应的第一访问结果;
    向所述OCF客户端发送第二访问结果,所述第二访问结果是所述网关设备根据所述第一访问结果生成的符合OCF协议的访问结果。
  9. 一种BLE Mesh设备的访问方法,其特征在于,应用于OCF客户端,所述方法包括:
    向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  10. 根据权利要求9所述的方法,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  11. 根据权利要求9所述的方法,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  12. 一种BLE Mesh设备的访问方法,其特征在于,应用于第一BLE Mesh设备,所述方法包括:
    接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
    其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
  13. 根据权利要求12所述的方法,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  14. 根据权利要求12所述的方法,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  15. 一种BLE Mesh设备的访问装置,其特征在于,应用于网关设备,所述装置包括:
    第一请求接收模块,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    第二请求发送模块,用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  16. 根据权利要求15所述的装置,其特征在于,所述第二请求发送模块,用于:
    根据映射信息,向所述第一BLE Mesh设备发送所述第二访问请求;
    其中,所述映射信息用于确定基于OCF协议的访问请求与基于BLE Mesh协议的访问请求之间的映射关系。
  17. 根据权利要求16所述的装置,其特征在于,所述映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  18. 根据权利要求17所述的装置,其特征在于,所述第二请求发送模块,包括:
    第一请求解析子模块,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型;
    映射子模块,用于根据所述映射信息,将所述第一OCF设备的设备标识、所述第一OCF设备的资源地址和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;
    第二请求发送子模块,用于根据所述第一BLE Mesh设备的设备标识、所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
  19. 根据权利要求16所述的装置,其特征在于,所述映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  20. 根据权利要求19所述的装置,其特征在于,所述第二请求发送模块,包括:
    第一请求解析子模块,用于解析所述第一访问请求,得到所述第一OCF设备的设备标识和所述第一 OCF设备的资源类型;
    映射子模块,用于根据所述映射信息,将所述第一OCF设备的设备标识和所述第一OCF设备的资源类型,分别映射为所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型;
    第二请求发送子模块,用于根据所述第一BLE Mesh设备的元素地址和所述第一BLE Mesh设备的服务模型,向所述第一BLE Mesh设备发送所述第二访问请求。
  21. 根据权利要求16至20任一项所述的装置,其特征在于,所述装置还包括:
    OCF设备创建模块,用于创建与所述第一BLE Mesh设备对应的所述第一OCF设备;
    映射关系建立模块,用于建立所述第一OCF设备与所述第一BLE Mesh设备之间的映射关系;
    映射信息存储模块,用于根据所述映射关系存储所述映射信息。
  22. 根据权利要求15至21任一项所述的装置,其特征在于,所述装置还包括:
    第一结果接收模块,用于接收所述第一BLE Mesh设备发送的与所述第二访问请求对应的第一访问结果;
    第二结果发送模块,用于向所述OCF客户端发送第二访问结果,所述第二访问结果是所述网关设备根据所述第一访问结果生成的符合OCF协议的访问结果。
  23. 一种BLE Mesh设备的访问装置,其特征在于,应用于OCF客户端,所述装置包括:
    第一请求发送模块,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  24. 根据权利要求23所述的装置,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  25. 根据权利要求23所述的装置,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  26. 一种BLE Mesh设备的访问装置,其特征在于,应用于第一BLE Mesh设备,所述装置包括:
    第二请求接收模块,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
    其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
  27. 根据权利要求26所述的装置,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的设备标识之间的映射关系;
    所述第一OCF设备的资源地址与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  28. 根据权利要求26所述的装置,其特征在于,所述第一OCF设备与所述第一BLE Mesh设备之间的映射信息包括以下映射关系:
    所述第一OCF设备的设备标识与所述第一BLE Mesh设备的元素地址之间的映射关系;
    所述第一OCF设备的资源类型与所述第一BLE Mesh设备的服务模型之间的映射关系。
  29. 一种网关设备,其特征在于,所述网关设备包括处理器、存储器和收发器;
    所述收发器,用于接收OCF客户端发送的第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    所述收发器,还用于向所述第一BLE Mesh设备发送第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  30. 一种终端,其特征在于,所述终端安装运行有OCF客户端,且所述终端包括处理器、存储器和收发器;
    所述收发器,用于向网关设备发送第一访问请求,所述第一访问请求是所述OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是第一BLE Mesh设备映射的虚拟OCF设备;
    其中,所述第一访问请求被转换为第二访问请求后发送给所述第一BLE Mesh设备,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求,所述资源的资源类型和所述服务模型之间具有映射关系。
  31. 一种BLE Mesh设备,其特征在于,所述BLE Mesh设备包括处理器、存储器和收发器;
    所述收发器,用于接收网关设备发送的第二访问请求,所述第二访问请求是所述网关设备对所述第一BLE Mesh设备的服务模型进行访问的请求;
    其中,所述第二访问请求由第一访问请求转换得到,所述第一访问请求是OCF客户端对第一OCF设备的资源进行访问的请求,所述第一OCF设备是所述第一BLE Mesh设备映射的虚拟OCF设备,所述资源的资源类型和所述服务模型之间具有映射关系。
  32. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如权利要求1至8任一项所述的BLE Mesh设备的访问方法。
  33. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如权利要求9至11任一项所述的BLE Mesh设备的访问方法。
  34. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如权利要求12至14任一项所述的BLE Mesh设备的访问方法。
PCT/CN2019/121008 2019-11-26 2019-11-26 BLE Mesh设备的访问方法、装置、设备及存储介质 WO2021102694A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/121008 WO2021102694A1 (zh) 2019-11-26 2019-11-26 BLE Mesh设备的访问方法、装置、设备及存储介质
CN201980097356.2A CN113994649A (zh) 2019-11-26 2019-11-26 BLE Mesh设备的访问方法、装置、设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/121008 WO2021102694A1 (zh) 2019-11-26 2019-11-26 BLE Mesh设备的访问方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021102694A1 true WO2021102694A1 (zh) 2021-06-03

Family

ID=76129114

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121008 WO2021102694A1 (zh) 2019-11-26 2019-11-26 BLE Mesh设备的访问方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113994649A (zh)
WO (1) WO2021102694A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175109A (zh) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 控制命令的发送方法和装置、存储介质及电子装置
WO2024050832A1 (zh) * 2022-09-09 2024-03-14 Oppo广东移动通信有限公司 命令的传输方法、装置、芯片、存储介质和计算机程序

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465783A (zh) * 2007-12-18 2009-06-24 闪联信息技术工程中心有限公司 异构家庭网络设备之间的连接方法、装置及连接网桥
CN102497364A (zh) * 2010-12-07 2012-06-13 中国科学院计算技术研究所 用于桥接IGRS设备和UPnP设备的桥接器及方法
CN109951493A (zh) * 2019-03-29 2019-06-28 深圳市信锐网科技术有限公司 一种网络互通方法、装置、设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465783A (zh) * 2007-12-18 2009-06-24 闪联信息技术工程中心有限公司 异构家庭网络设备之间的连接方法、装置及连接网桥
CN102497364A (zh) * 2010-12-07 2012-06-13 中国科学院计算技术研究所 用于桥接IGRS设备和UPnP设备的桥接器及方法
CN109951493A (zh) * 2019-03-29 2019-06-28 深圳市信锐网科技术有限公司 一种网络互通方法、装置、设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JOO-CHUL LEE, SEUNG-YUN LEE , SANG-HA KIM: "Virtualizing Non-OCF Devices into OCF Ecosystem", 2018 INTERNATIONAL CONFERENCE ON INFORMATION AND COMMUNICATION TECHNOLOGY CONVERGENCE (ICTC), 17 October 2018 (2018-10-17), pages 1037 - 1039, XP033448092 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175109A (zh) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 控制命令的发送方法和装置、存储介质及电子装置
CN115175109B (zh) * 2022-05-30 2024-01-26 青岛海尔科技有限公司 控制命令的发送方法和装置、存储介质及电子装置
WO2024050832A1 (zh) * 2022-09-09 2024-03-14 Oppo广东移动通信有限公司 命令的传输方法、装置、芯片、存储介质和计算机程序

Also Published As

Publication number Publication date
CN113994649A (zh) 2022-01-28

Similar Documents

Publication Publication Date Title
CN110933146B (zh) 一种数据转换方法、装置和服务器
CN107196964B (zh) 用于实现多频段服务发现的系统和方法
WO2022262465A1 (zh) 基于opc ua的时间敏感网络集中用户配置方法及系统
US10798779B2 (en) Enhanced CoAP group communications with selective responses
US10148739B2 (en) M2M data querying and invoking methods, querying and invoking devices, and system
WO2021243837A1 (zh) 基于ursp规则的应用数据路由方法及用户设备
WO2009111965A1 (zh) 一种数据同步的方法、设备及系统
WO2021102694A1 (zh) BLE Mesh设备的访问方法、装置、设备及存储介质
KR102094041B1 (ko) IoT 단말 간 실시간으로 자율적인 상호작용을 위한 RDF 그래프 기반의 Semantic 엔진을 구비한 시스템
CN101459532A (zh) 一种多网口设备自动组网的方法及设备
WO2017041534A1 (zh) 一种电力线网络通信的方法及装置、计算机存储介质
WO2022151420A1 (zh) 一种数据包传输的方法、装置和系统
CN103765819B (zh) 一种数据配置方法及网络管理服务器
WO2022087795A1 (zh) 资源映射方法、装置、设备及存储介质
CN110753135A (zh) 一种ip地址配置方法、配置设备及存储介质
CN113260072B (zh) Mesh组网流量调度方法、网关设备和存储介质
EP4304144A1 (en) Communication method and apparatus
WO2022087796A1 (zh) Zigbee设备的属性订阅方法、装置及设备
WO2022042254A1 (zh) 广播消息的发送方法、接收方法、装置、设备及存储介质
WO2022000579A1 (zh) 多链路终端及其执行链路交换的方法、装置及存储介质
CN112104468B (zh) 一种管理服务的发现方法及装置
WO2023138256A1 (zh) 一种通信方法及通信装置
WO2023019874A1 (zh) 分布式业务转发方法、装置、系统、存储介质及电子设备
WO2024031681A1 (zh) 设备绑定方法、装置、设备、存储介质及程序产品
CN115296989B (zh) 订阅地址的配置方法、相关设备及存储介质

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

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

Country of ref document: EP

Kind code of ref document: A1