WO2024259618A1 - 用于设备连接的方法和装置、芯片、存储介质和程序产品 - Google Patents
用于设备连接的方法和装置、芯片、存储介质和程序产品 Download PDFInfo
- Publication number
- WO2024259618A1 WO2024259618A1 PCT/CN2023/101614 CN2023101614W WO2024259618A1 WO 2024259618 A1 WO2024259618 A1 WO 2024259618A1 CN 2023101614 W CN2023101614 W CN 2023101614W WO 2024259618 A1 WO2024259618 A1 WO 2024259618A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- registration
- subscription
- message
- registration request
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
Definitions
- the present application relates to the field of communication technology, and more specifically, to a method and apparatus, chip, storage medium and program product for device connection.
- a device may establish connections with multiple devices when it is in a connectable state or awake state.
- an intermittently connected device ICD
- ICD intermittently connected device
- some connections are unnecessary, for example, the two parties establishing the connection may not have the need to exchange information, resulting in a waste of resources.
- the device can choose to establish connections with some of the multiple devices when it is in a connectable state or awake state. Then, how the device selects some of the devices to establish connections is a problem that needs to be solved.
- the present application provides a method and apparatus, a chip, a storage medium and a program product for device connection.
- the following introduces various aspects involved in the present application.
- a method for device connection comprising: a first device receives a registration request, the registration request being used to register a second device; wherein successful registration of the second device is used to indicate that the first device changes to a connectable state or enters a wake-up state and sends a first message to the second device, the first message being used to indicate that the second device establishes a connection with the first device.
- a method for device connection comprising: a second device receives a first message sent by a first device, the first message being used to instruct the second device to establish a connection with the first device, the first message being sent when the second device successfully registers at the first device and the first device changes to a connectable state or enters a wake-up state.
- a method for device connection comprising: a third device sends a registration request to a first device, wherein the registration request is used to register a second device; wherein successful registration of the second device is used to indicate that the first device changes to a connectable state or enters a wake-up state, and sends a first message to the second device, wherein the first message is used to instruct the second device to establish a connection with the first device.
- a device for device connection which is applied to a first device, and includes: a first receiving module, used to receive a registration request, and the registration request is used to register a second device; wherein, the successful registration of the second device is used to indicate that the first device changes to a connectable state or enters a wake-up state and sends a first message to the second device, and the first message is used to indicate that the second device establishes a connection with the first device.
- a device for device connection which is applied to a second device, and the device includes: a receiving module, used to receive a first message sent by a first device, the first message is used to indicate that the second device establishes a connection with the first device, and the first message is sent when the second device successfully registers at the first device and the first device changes to a connectable state or enters a wake-up state.
- a device for device connection which is applied to a third device, and the device includes: a sending module, used to send a registration request to a first device, and the registration request is used to register a second device; wherein, the successful registration of the second device is used to indicate that the first device changes to a connectable state or enters a wake-up state, and sends a first message to the second device, and the first message is used to instruct the second device to establish a connection with the first device.
- a device for device connection comprising a processor, a memory and a communication interface, wherein the memory is used to store one or more computer programs, and the processor is used to call the computer program in the memory so that the device executes part or all of the steps in the methods of the above aspects.
- an embodiment of the present application provides a communication system, which includes the above-mentioned device for connecting devices.
- the system may also include other devices that interact with the device in the solution provided by the embodiment of the present application.
- an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute part or all of the steps in the methods of the above aspects.
- an embodiment of the present application provides a computer program, which enables a computer to execute part or all of the steps in the methods of the above aspects.
- an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the above-mentioned various aspects.
- the computer program product may be a software installation package.
- an embodiment of the present application provides a chip, which includes a memory and a processor.
- the processor can call and run a computer program from the memory to implement some or all of the steps described in the methods of the above aspects.
- the embodiment of the present application can register the second device at the first device, so that when the first device changes to a connectable state or enters a wake-up state, it can establish a connection with the second device that has successfully registered.
- the first device changes to a connectable state or enters a wake-up state, it can choose to establish a connection with the second device that has successfully registered according to the device registration situation.
- the embodiment of the present application is conducive to avoiding the establishment of unnecessary connections, thereby helping to save resources.
- FIG1 is a diagram showing an example of a system architecture of a wireless communication system to which an embodiment of the present application can be applied.
- FIG2 is a flow chart of a method for device connection provided in an embodiment of the present application.
- FIG. 3 is a flowchart of a method for registering a second device provided in an embodiment of the present application.
- FIG. 4 is a possible implementation method for determining whether a subscription relationship exists provided in an embodiment of the present application.
- FIG5 is a schematic flow chart of a method for registering a second device provided in another embodiment of the present application.
- FIG6 is a flowchart of a method for registering a second device provided in yet another embodiment of the present application.
- FIG. 7 is a flowchart of a method for registering a second device provided in yet another embodiment of the present application.
- FIG8 is a flowchart of a method for registering a second device provided in yet another embodiment of the present application.
- FIG. 9 is a schematic diagram of the structure of an apparatus for connecting devices provided in an embodiment of the present application.
- FIG. 10 is a schematic diagram of the structure of an apparatus for connecting devices provided in another embodiment of the present application.
- FIG. 11 is a schematic diagram of the structure of an apparatus for connecting devices provided in yet another embodiment of the present application.
- FIG. 12 is a schematic structural diagram of a communication device provided in an embodiment of the present application.
- FIG1 is a diagram showing an example of a system architecture of a wireless communication system 100 to which an embodiment of the present application can be applied.
- the wireless communication system 100 may include a first device 110 and a second device 120.
- the first device 110 and the second device 120 may communicate with each other.
- the first device 110 and the second device 120 may establish a connection via a wired (e.g., USB interface) or wireless (e.g., Bluetooth or mobile network) method to achieve mutual communication.
- a wired e.g., USB interface
- wireless e.g., Bluetooth or mobile network
- the first device 110 and the second device 120 may belong to the same IoT system, or in other words, the first device 110 and the second device 120 may belong to the same ecosystem. In other words, the first device 110 and the second device 120 may be IoT devices in the same IoT system or the same ecosystem.
- the Internet of Things is the "Internet of Everything Connected". It is a network that extends and expands on the basis of the Internet. It can connect any object to the Internet through various information sensing devices (such as radio frequency identification, global positioning system, etc.) to form a huge network for information exchange and communication to achieve interconnection between all things.
- the IoT device can be a smart home device.
- the IoT device can include smart air conditioners, smart refrigerators, washing machines, rice cookers, sweeping robots and other devices.
- the IoT device can be a smart monitoring device.
- the IoT device can include monitoring cameras, temperature sensors, sound sensors, etc.
- the first device 110 and the second device 120 may be located in the same network.
- the first device 110 and the second device 120 may both be located in a home network.
- the home network is mainly composed of two parts: the home smart gateway and the IoT devices associated with the home smart gateway.
- the home smart gateway is the bridge that connects the entire home network with the external network. It can receive signals from the external network and transmit the received signals to a certain IoT device through the home network signal.
- the home smart gateway can be understood as the central device of home intelligence.
- system information collection, information input, information output, as well as centralized control, remote control, linkage control and other functions of various types of IoT devices can be realized.
- the connection between the home smart gateway and the IoT device can be diverse. For example, the two can be connected by Ethernet, Bluetooth (bluetooth, BT) wireless fidelity (wireless fidelity, WIFI), ZigBee and other methods.
- the first device 110 may be an electronic device capable of intermittent sleep or intermittent wakeup.
- the first device 110 is an electronic device capable of intermittent sleep or intermittent wakeup. The intermittent sleep or intermittent wakeup of the first device 110 can save power.
- the first device 110 being in a dormant state may also be understood as the first device 110 being in an idle mode or an idle state.
- the first device 110 being in an awake state may also be understood as the first device 110 being in an active mode, an activated mode, or an idle state. Living status or working status, etc.
- the first device 110 may be put into sleep periodically or regularly. For example, the first device 110 may be put into sleep every 2 minutes.
- the first device 110 may sleep randomly or irregularly. For example, the first device 110 sleeps once at an interval of 2 minutes, and may sleep at an interval of 3 minutes next time.
- the sleep or wake-up of the first device 110 may be triggered by an event, or in other words, the first device may enter a sleep state or enter a wake-up state based on the occurrence of certain events.
- the temperature sensor or the smoke sensor can sense an alarm event (for example, sensing that the temperature exceeds a certain threshold, or sensing that the smoke concentration is higher than a certain threshold, etc.) when in the wake-up state.
- the temperature sensor or the smoke sensor may enter a sleep state after reporting the alarm event.
- the embodiments of the present application do not specifically limit the sleep time (or sleep duration, sleep duration, etc.) of the first device 110 and/or the wake-up time (or wake-up duration, wake-up duration, etc.) of the first device 110.
- the sleep time of the first device 110 can be the same each time.
- the sleep time of the first device 110 is 1 minute each time.
- the sleep time of the first device 110 can vary.
- the sleep time of the first device 110 is 1 minute at one time, and the sleep time of the next time changes to 2 minutes, etc.
- the embodiment of the present application does not specifically limit the configuration method of the sleep time of the first device 110 and/or the wake-up time of the first device 110.
- the sleep time of the first device 110 and/or the wake-up time of the first device 110 may be configured by a configuration device of the first device. This configuration method is more flexible, and the sleep time of the first device 110 and/or the wake-up time of the first device 110 may be modified later by the configuration device.
- the sleep time of the first device 110 and/or the wake-up time of the first device 110 may be hard-coded in the first device by firmware or software, that is, the sleep time of the first device 110 and/or the wake-up time of the first device 110 cannot be changed by software configuration, and this configuration method can ensure the security of the configuration.
- the first device 110 can operate on a limited power source.
- the first device 110 can operate in a battery-powered manner.
- the first device 110 can operate in a limited energy scavenging-powered manner.
- the first device 110 may be an ICD.
- An ICD needs to be in sleep mode periodically to save power.
- An ICD is generally powered by a battery.
- the first device 110 may refer to a resource-constrained device.
- the embodiments of the present application do not limit the type of resource constraints of resource-constrained devices.
- the resource constraints of a device may refer to one or more of the computing resources, storage resources, network resources, and power resources of the device being constrained.
- the resource constraints of a device may refer to the hardware resources and/or software resources of the device being constrained, etc.
- the first device 110 may be a device with one or more of computing resources, storage resources, and network resources being constrained; or, the first device 110 may be a device with hardware resources and/or software resources being constrained, etc.
- the first device 110 may be a low-power device, such as a wearable device.
- the first device 110 may be a smart sensor that intermittently sleeps or wakes up, such as a smoke sensor, a temperature sensor, etc. Taking the first device 110 as a smoke sensor as an example, the first device 110 may need to measure smoke data regularly, or send alarm information to the second device 120 when an alarm event occurs; and the first device 110 may sleep when it does not need to measure smoke data or send alarm information.
- the first device 110 may refer to a device that does not take energy-saving measures, for example, the first device 110 may refer to some normally working devices.
- the first device 110 may be dormant due to a sudden power outage or other reasons, and it will establish connections with multiple devices after being reawakened.
- the first device 110 may have a communication module, for example, the first device 110 may be an electronic device with a short-distance communication function.
- the short-distance communication function may include one or more of the following: Bluetooth, WIFI, Zigbee, etc.
- the first device can establish a connection with other devices in a first state, but cannot establish a connection with other devices in a second state.
- the first state may include one or more of the following states: connectable state, awake state, powered-on state, turned-on state, active state, non-energy-saving state, normal working state, etc.
- the second state may include one or more of the following states: unconnectable state, sleep state, shutdown state, off state, idle state, energy saving state, abnormal working state, etc.
- the state of the first device 110 may include a connectable state and a non-connectable state.
- the first device 110 When the first device 110 is in the connectable state, it can establish a connection with other devices.
- the first device 110 is in the non-connectable state, it cannot establish a connection with other devices, or cannot establish a connection with other devices.
- the state of the first device 110 may include an awake state and a sleep state.
- the first device When the first device is in the awake state, It can establish a connection with other devices.
- the first device 110 When the first device 110 is in a dormant state, it cannot establish a connection with other devices, or cannot establish a connection with other devices.
- the second device 120 can be connected to the first device 110 to exchange information.
- the second device 120 can be, for example, a handheld smart terminal, such as a smart phone, a tablet computer, etc.
- the second device 120 can also be a wearable device, such as a smart watch, a smart bracelet, etc.
- the second device 120 may be a hub device of the first device 110, such as a local hub device.
- the second device 120 may control the first device 110.
- the "local hub device” mentioned in the embodiments of the present application is used to emphasize that the second device 120 is a local device that can control and manage the first device 110.
- the hub device may store the request for the first device so as to send the stored request to the first device during the wake-up window of the first device.
- the hub device mentioned in the embodiments of the present application may include multiple types, and the embodiments of the present application are not limited to this.
- the hub device may be a terminal device, such as a handheld smart terminal, a computer, a tablet computer, etc.
- the hub device may be a smart gateway (for example, the home smart gateway mentioned above), a router, or other devices.
- the second device 120 may include a "shadow device" of the first device 110.
- the second device 120 may be a hub device that includes a "shadow device” of the first device 110.
- the first device changes to a connectable state or enters a wake-up state, it will synchronize messages with the "shadow device” so that the user can indirectly operate the first device 110 by operating the "shadow device”.
- the physical device that carries the "shadow device” has high requirements, and a series of solutions that support data twins are required, including but not limited to the selection of the "shadow device” carrier, the generation of the "shadow device”, and the message synchronization solution corresponding to the first device 110 and the "shadow device”.
- the entire system is highly complex.
- the message synchronization between the first device 110 and the "shadow device” can be replaced by the synchronization of messages between the first device 110 and its corresponding "shadow device” (i.e., virtual device).
- the first device 110 can send its status information to the "shadow device” through the cloud.
- the "shadow device” saves the status information of the first device 110 in the cloud and synchronizes it to other applications that have subscribed to the first device 110, so as to realize the sharing and synchronization of the first device status information. In this way, when there is a communication problem between the first device 110 and the cloud, the application can still obtain the latest status information of the first device 110, thereby ensuring the reliability and stability of the first device 110.
- the second device 120 may be a proxy device for the first device 110 .
- the second device 120 may be a relay device for the first device 110 .
- the second device 120 can be any device that communicates or interacts with the first device 110.
- the second device 120 can be an administrator device of the first device 110, that is, the second device 120 has administrator authority of the first device 110; or, a subscription relationship can exist between the second device 120 and the first device 110, so that the second device 120 can subscribe to resource data of the first device 110.
- FIG1 exemplarily shows a first device 110 and a second device 120, but the embodiments of the present application are not limited thereto.
- the wireless communication system 100 may include multiple first devices and/or multiple second devices, for example, a first device may report data to multiple second devices, establish connections with multiple second devices, etc.; or a second device may receive data reported by multiple first devices, establish connections with multiple first devices, etc.
- the wireless communication system 100 may also include other devices, which is not limited in the embodiments of the present application.
- the first device 110 may communicate with other devices through the second device 120.
- the first device 110 may control or access other devices through the second device 120.
- the second device 120 may be understood as a proxy device, a relay device, or a bridge device.
- the technical solutions of the embodiments of the present application can be applied to various communication systems, such as: the fifth generation (5th generation, 5G) system or new radio (new radio, NR), long term evolution (long term evolution, LTE) system, LTE frequency division duplex (frequency division duplex, FDD) system, LTE time division duplex (time division duplex, TDD), Bluetooth system, WIFI system, etc.
- 5G fifth generation
- NR new radio
- long term evolution long term evolution
- LTE long term evolution
- LTE frequency division duplex frequency division duplex
- FDD frequency division duplex
- TDD time division duplex
- Bluetooth system time division duplex
- WIFI system Worldwide Interoperability for Microwave Access
- the first device and the second device in the embodiments of the present application may be respectively referred to as a first terminal device and a second terminal device.
- the terminal device may also be referred to as a user equipment (UE), an access terminal, a user unit, a user station, a mobile station, a mobile station (MS), a mobile terminal (MT), a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent or a user device.
- UE user equipment
- MS mobile station
- MT mobile terminal
- remote station a remote terminal
- a mobile device a user terminal, a terminal, a wireless communication device, a user agent or a user device.
- the first device and the second device in the embodiment of the present application may be devices that provide voice and/or data connectivity to users, and may be used to connect people, objects, and machines, such as handheld devices and vehicle-mounted devices with wireless connection functions.
- the first device and/or the second device in the embodiment of the present application may be a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile Mobile internet devices (MID), wearable devices, Internet of things (IoT) devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc.
- MID mobile Mobile internet devices
- IoT Internet of things
- VR virtual reality
- AR augmented reality
- IoT devices may include smart travel tools such as vehicles and ships.
- IoT devices may include smart home devices such as smart TVs, smart air conditioners, smart refrigerators, and sweeping robots.
- IoT devices may include smart monitoring devices such as surveillance cameras, temperature sensors, and sound sensors, etc.
- the vehicle when the IoT device is a vehicle, the vehicle may be, for example, a family car, a taxi, a bus, a motorcycle, etc.; when the IoT device is a smart air conditioner, the smart air conditioner may be, for example, a floor-standing air conditioner, a wall-mounted air conditioner, etc., and the present application does not limit this.
- the first device 110 and the second device 120 may be different types of devices to implement information interaction between different types of devices.
- the first device 110 may be an IoT device (e.g., a smart sensor, a smart air conditioner, etc.)
- the second device 120 may be a handheld terminal device such as a mobile phone or a tablet computer, based on which the handheld terminal device may control the IoT device (smart sensor, smart air conditioner, etc.).
- the first device 110 and the second device 120 may be devices from different manufacturers to enable information interaction between devices from different manufacturers.
- the first device 110 may be a device from a first manufacturer
- the second device 120 may be a device from a second manufacturer (different from the first manufacturer).
- the embodiments of the present application do not limit the scenarios in which the first device and the second device are located.
- the first device and the second device can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted.
- the first device may be a device that is intermittently dormant or intermittently awakened. Some problems may occur when the first device is in the first state (connectable state, awake state, etc.) or the second state (such as unconnectable state, dormant state) mentioned above. The following takes the first device in the dormant state and the awakened state as an example to introduce the possible problems of the first device.
- the business continuity of the first device and other devices will be affected.
- the business continuity of the first device and other devices will be disrupted by the dormancy of the first device.
- the first device needs to close the connection with other devices when it is in a dormant state, and the closure of the connection may cause damage to the continuity of some businesses.
- the two parties to the subscription have negotiated that the subscriber (subscribed device) needs to reply a message to the subscriber (subscribing device) every certain period of time (for example, 1 minute) to confirm the existence of the subscription relationship.
- the subscriber may think that the subscriber has lost or closed the subscription relationship and may need to re-subscribe, resulting in the disruption of business continuity.
- the first device and other devices need to establish a connection (such as restoring the connection, re-establishing a new connection, etc.) to complete information exchange during the awakening cycle of the first device.
- a connection such as restoring the connection, re-establishing a new connection, etc.
- the first device wakes up it may need to establish a connection with the hub device in a timely manner to notify the hub device of information or report its online status; or after the first device wakes up, it may need to establish a connection with the "shadow device" in a timely manner to synchronize messages, etc.
- the first device after the first device enters the awake state, it can actively establish a connection with other devices, for example, the first device can actively send a connection request to other devices. In some embodiments, after the first device enters the awake state, it can receive a connection request from other devices to establish a connection with other devices.
- the first device after the first device enters the awake state, it can restore the connection with other devices if the necessary information for restoring the connection is complete, otherwise it needs to re-establish the connection.
- the embodiment of the present application does not specifically limit the necessary information for restoring the connection, for example, including a shared key between devices, a recovery session ID, a device ID, etc.
- the first device may establish connections with multiple devices after waking up.
- an intermittently connected device ICD
- Such devices may establish connections with multiple devices each time they wake up; or some devices may also establish connections with multiple devices after they wake up again due to temporary power outages.
- the establishment of some connections is unnecessary.
- the two parties establishing the connection may not have the need to exchange information, resulting in a waste of resources.
- the first device may choose to establish a connection with some of the multiple devices. Therefore, how the first device selects some of the multiple devices to establish a connection is a problem that needs to be solved.
- the first device may randomly select some devices to establish a connection.
- the first device may select some devices to establish a connection based on the principle of "first come, first served". When selecting a device to establish a connection, it may still lead to the establishment of unnecessary connections, resulting in a waste of resources. For example, considering that the process of establishing a connection is long, the first device may enter a dormant state soon during or after establishing a connection with some of the multiple devices, or there may be no need for information exchange between the two after the connection is established, resulting in a waste of resources.
- the first device may receive a large number of connection request messages.
- this method is a random collision among a large number of connection requests to determine whether they can receive a response from the first device, which theoretically also requires a lot of network resources to be wasted.
- a device changes to the first state (e.g., a connectable state or an awake state)
- the first state e.g., a connectable state or an awake state
- how to select some devices to establish a connection is a problem that needs to be solved.
- how to select some devices from multiple devices to establish a connection after the device wakes up is a problem that needs to be solved urgently.
- the embodiments of the present application provide a method and apparatus, chip, storage medium and program product for device connection, so that when the first device changes to the first state, it can selectively select and establish a connection with a successfully registered device according to the device registration situation at the first device, which is conducive to avoiding the establishment of unnecessary connections, thereby helping to save resources.
- the following takes the first state including the connectable state or the awake state as an example, and introduces the method embodiment of the present application in conjunction with the accompanying drawings.
- Fig. 2 is a flow chart of a method for device connection provided by an embodiment of the present application. The method shown in Fig. 2 is described from the perspective of interaction between a first device and a second device.
- the first device and the second device may be, for example, the first device 110 and the second device 120 shown in Fig. 1, respectively.
- the first device may refer to a device that has taken certain energy-saving measures.
- the first device may be a device that is intermittently in a dormant state or intermittently in an awake state.
- the first device may be an IoT device, such as a wearable device, a smart sensor, a smart air conditioner, etc.
- the embodiments of the present application are not limited thereto, and the first device may refer to any device that needs to establish a connection with other devices.
- the first device may refer to a device that does not take energy-saving measures, such as a device that works normally and goes into sleep mode due to a sudden power outage or other reasons, and needs to establish a connection with other devices after being reawakened.
- the second device may establish a connection with the first device so that the two may exchange information.
- the second device may be a handheld smart terminal, such as a mobile phone, a tablet computer, and the like.
- the second device may be a proxy device, a relay device, a bridge device, etc. of the first device.
- the second device may be a subscription device of the first device, that is, the second device may subscribe to resources of the first device.
- the second device may be a "shadow device" of the first device, etc.
- the second device refers to a device to be registered at the first device. After the second device successfully registers at the first device, the first device can notify the second device when it enters the awake state after changing to the connectable state, so that the two can establish a connection.
- the method shown in FIG. 2 may include step S210, which is described in detail below.
- step S210 the first device receives a registration request for registering the second device.
- the registration request for registering the second device can be understood as requesting the first device to send a first message to the second device when it changes to a connectable state or enters an awake state, so that the second device can establish a connection with the first device.
- the registration request for registering the second device may include: the registration request is used to register relevant information of the second device at the first device, so that the first device sends a first message to the successfully registered second device when the first device changes from an unconnectable state to a connectable state, or so that the first device sends a first message to the successfully registered second device when the first device enters a wake-up state from a sleep state.
- the embodiments of the present application do not specifically limit the device that sends the registration request (or, the sending device of the registration request, the sender of the registration request, etc.).
- the registration request may be sent by the second device itself.
- the registration request may be sent by a device other than the second device, for example, the registration request may be sent by a third device.
- the third device that sends the registration request may be any device other than the second device, for example, the third device may be any device that has access rights to the first device.
- the third device that sends the registration request may be an administrator device of the first device, or in other words, the third device may have administrator rights of the first device.
- the embodiments of the present application are not limited to this, and the third device may also be a device with operation rights, management rights, or other rights of the first device.
- the successful registration of the second device can be used to instruct the first device to send a first message to the second device when it changes to a connectable state or enters an awake state, and the first message is used to instruct the second device to establish a connection with the first device.
- the first device can determine whether to send the first message to the second device when it changes to a connectable state or enters an awake state based on the registration status of the second device at the first device.
- the first device may send a first message to the second device.
- the second device fails to register at the first device, the first device will not send the first message to the second device after changing to a connectable state or entering an awake state.
- the method may also include a scheme in which the first device determines whether to send the first message to the second device based on the registration status of the second device, which will be described below in conjunction with FIG. 2 .
- the method of the embodiment of the present application may further include step S220, in which, when the second device is successfully registered, in response to the first device changing to a connectable state or entering an awake state, the first device sends a first message to the second device.
- the first message is used to instruct the second device to establish a connection with the first device.
- the first device changing to a connectable state may mean that the first device can currently establish a connection with other devices, that is, the first device can establish a connection with other devices after changing to a connectable state.
- the first device changing to a connectable state may be replaced by the first device being in a connected state.
- the first device may also establish a connection with other devices.
- the first device entering the awake state may be replaced by the first device being in the awake state.
- the first message may be used to indicate that the first device is in the awake state, so that the purpose of the first message may also be interpreted as the first message being used to notify the second device that the first device is in the awake state (awake cycle), and the second device may establish a connection with the first device if necessary.
- sending a first message to a second device when the first device changes to a connectable state or enters an awake state may mean that the first device sends the first message to the second device at the same time as it switches from other states (such as the second state mentioned above, including an unconnectable state, a sleep state, etc.) to a connectable state or to an awake state, or in other words, the first device sends the first message to the second device immediately after entering a connectable state or entering an awake state.
- states such as the second state mentioned above, including an unconnectable state, a sleep state, etc.
- sending a first message to a second device when the first device changes to a connectable state or enters an awake state may mean that the first device sends the first message to the second device after switching from other states (such as the second state mentioned above, including an unconnectable state and a dormant state) to a connectable state for a period of time or switching to an awake state for a period of time, or in other words, the first device sends the first message to the second device after entering a connectable state for a period of time or entering an awake state for a period of time.
- the first device sends the first message to the second device 10 seconds after entering the connectable state or entering the awake state, or the first device sends the first message to the second device 30 seconds after entering the connectable state or entering the awake state, etc.
- the first message can be understood as a reminder (check in) message, which can be used to remind the second device to establish a connection with the first device.
- the embodiment of the present application does not limit the implementation manner in which the first message is used to instruct the second device to establish a connection with the first device.
- Two implementation manners are given as examples below.
- the first message can be understood as a notification message, which can be used to notify the second device that the first device is in a connectable state or awake state, so that the second device initiates a connection request to the first device to establish a connection.
- the second device can perform the next business, such as establishing a connection with the first device to restore the subscription relationship with the first device.
- the embodiment of the present application does not specifically limit the implementation method of the first message indicating that the first device is in a connectable state or an awake state.
- the embodiment of the present application can use the message type of the first message to indicate that the first message is a check-in message, thereby indicating that the first device is in a connectable state or an awake state.
- the embodiment of the present application can add a first field to the first message, and the value of the first field is used to indicate that the first device is in a connectable state or an awake state, etc.
- the first message may be used to initiate a connection request to the second device, that is, the first message may be a connection request message, so that the second device responds to the connection request initiated by the first device, thereby establishing a connection.
- the embodiment of the present application can register the second device at the first device, so that when the first device changes to a connectable state or enters a wake-up state, it can establish a connection with the second device that has successfully registered.
- the first device changes to a connectable state or enters a wake-up state, it can choose to establish a connection with the second device that has successfully registered according to the device registration situation.
- the embodiment of the present application is conducive to avoiding the establishment of unnecessary connections, thereby helping to save resources.
- the following is a detailed introduction to registering the second device at the first device. First, the information included in the registration request is introduced.
- the registration request can be used to request registration of the second device, so the registration request can include information related to the device to be registered (the second device).
- the embodiment of the present application is not limited to this, and the registration request can also include other information related to this registration, for example, including permission information of the device sending the registration request, including relevant information of the first message sent by the first device to the second device, etc.
- the registration request may be used to indicate one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; verification code information; and first priority information. These information are introduced below.
- the identity information of the second device can be indicated by the device identification (device ID) of the second device.
- the device ID of the second device can be understood as a unique identifier of the second device in the ecosystem, such as a unique identifier of the second device in a network (fabric).
- the identity information of the second device can be indicated by an alias for the device ID of the second device.
- the alias of the device ID of the second device may be bound to the device ID of the second device, so that the identity of the second device may be identified through the alias of the device ID of the second device without exposing the device ID of the second device (i.e., the device ID of the second device may be hidden).
- the device ID of the second device carried in the registration request may be the same as the device ID of the device that sends the registration request, that is, the registration request may be sent by the second device.
- the device ID of the second device carried in the registration request may be different from the device ID of the device that sends the registration request, that is, the registration request may be sent by a device other than the second device, for example, it may be sent by the administrator device of the first device.
- the embodiment of the present application does not limit the name of the field indicating the identity information of the second device. For example, it can be indicated by the field RegisterClientID, or it can be indicated by the field ClientID, etc.
- the access control subject information of the second device at the first device can be used to determine whether the second device has the authority to interact with the target on the first device, or in other words, the access control subject information of the second device at the first device can be used to determine what kind of authority the second device has over the resources on the first device.
- the access control subject information of the second device at the first device may refer to a subject identifier of the second device in an access control list (ACL) of the first device.
- ACL access control list
- the access control subject information of the second device at the first device may be recorded in the ACL of the first device, for example, in the subject field in the ACL of the first device.
- An ACL may contain access control entries (ACEs) that encode policies.
- the access control system may check and verify all attempted accesses based on the rules in the ACEs contained in the ACL of the first device.
- Each ACE may encode a separate permission grant on the first device, and the ACE is used by the access control permission grant algorithm to determine whether a subject has permission to interact with a target on the node.
- the access control subject information of the second device at the first device may be recorded in an ACE of the first device, and the content indicated by the subject field in the ACE is the access control subject information of the second device at the first device.
- the subject field in the ACE may include the device ID of the device. That is, the access control subject information of the second device at the first device may be indicated by the device ID of the second device.
- the subject field in the ACE may include the group ID of the device. That is, the access control subject information of the second device at the first device may be indicated using the group ID of the second device.
- the embodiment of the present application does not specifically limit the indication method of the group ID of the second device.
- the group ID of the second device may include a CASE authenticated tag (CAT) corresponding to the second device.
- CAT CASE authenticated tag
- the second device may correspond to one or more CATs, and the group ID of the second device mentioned in the embodiment of the present application may be any one or more of the one or more CATs corresponding to the second device.
- the embodiment of the present application does not limit the name of the field indicating the access control subject information of the second device at the first device. For example, it can be indicated by the field AccessSubject, or it can be indicated by the field MonitoredSubject, etc.
- the content used to indicate the access control subject information of the second device at the first device may be the same as the content used to indicate the identity information of the second device. For example, both may be indicated by the device ID of the second device.
- the content used to indicate the access control subject information of the second device at the first device may be different from the content used to indicate the identity information of the second device.
- the group ID of the second device (such as the CAT corresponding to the second device) may be used to indicate the access control subject information of the second device at the first device, and the device ID of the second device may be used to indicate the identity information of the second device.
- the encryption information associated with the first message can be used to encrypt the first message, for example, the encryption information can be a key. In this way, after the second device successfully registers with the first device, when the first device changes to a connectable state or enters an awake state, the first message encrypted using the encryption information can be sent to the second device.
- the encryption information may be a symmetric key.
- the second device may use the same encryption information to decrypt the first message.
- the encrypted information may be an asymmetric key, for example, the encrypted information may be a public key in a key pair, so that after the second device subsequently receives the first message sent by the first device, it can use the private key corresponding to the public key to decrypt the first message.
- the embodiment of the present application does not specifically limit the indication field of the encryption information associated with the first message.
- the field EncryptedKey can be used to indicate the encryption information associated with the first message.
- other fields such as KeyInfo
- the verification code information carried in the registration request can be used to verify the authority (registration authority) of the device sending the registration request.
- the verification code information can be used to determine whether the device sending the registration request has the authority to register the second device at the first device.
- the verification code information may include the identity code (pincode) of the device sending the registration request, and the first device can determine whether the device sending the registration request has the authority to register the second device based on the identity code.
- the verification code information may include the encryption information used when the first device sends the first message to the second device before the current registration. In this way, the first device can determine whether the device sending the registration request has the authority to register the second device based on the verification code information carried in the registration request and the encryption information used in the current registration.
- Whether the device sending the registration request has the authority to register the second device is determined by whether the encryption information used when the first device sent the first message to the second device before the registration is the same. For example, if the verification code information carried in the registration request is the same as the encryption information used when the first device sent the first message to the second device before the current registration, the first device can determine that the device sending the registration request has the authority to register the second device; if the verification code information carried in the registration request is different from the encryption information used when the first device sent the first message to the second device before the current registration, the first device can determine that the device sending the registration request does not have the authority to register the second device.
- the verification code information when the above-mentioned verification code information includes the encryption information used when the first device sends the first message to the second device before this registration, the verification code information may be the same as or different from the encryption information associated with the first message carried in the registration request. For example, when this registration request is used to request to modify the encryption information associated with the first message, the verification code information may be different from the encryption information associated with the first message carried in the registration request. Alternatively, when this registration request does not modify the encryption information associated with the first message, the verification code information may be the same as the encryption information associated with the first message carried in the registration request.
- the first device may also store verification code information so that the first device compares the stored verification code information with the verification code information carried in the registration request to determine whether the device sending the registration request has the authority to register the second device.
- the registration request may not carry verification code information, that is, for the device with administrator privileges of the first device, the verification code information is not necessary when sending the registration request.
- the registration request needs to carry verification code information so that the first device can determine the registration privileges of the device sending the registration request.
- the verification code information can ensure that a device that does not have the administrator privileges of the first device can only modify, update or delete its own registration information, but cannot modify, update or delete the registration information of other devices.
- the embodiment of the present application does not specifically limit the indication field of the verification code information.
- the field PinCode can be used to indicate the verification code information.
- other fields such as VerificationInfo
- VerificationInfo can also be used to indicate the verification code information.
- the first priority information can be used to indicate the priority of the second device requesting to send the first message. For example, if the second device wants the first device to send the first message to the second device first, the priority indicated by the first priority information can be higher.
- the first priority information may be omitted.
- the first device may assume that the second device has no requirements for the priority of receiving the first message.
- the first device may set a lower priority for the second device.
- the fact that the registration request carries the first priority information does not mean that the first device will eventually send the first message to the second device according to the first priority information.
- the first device can determine the priority of sending the first message to each successfully registered device.
- the first device can send the first message to a successfully registered device (such as the second device) based on the second priority information (for the relevant introduction to the second priority information, see below).
- the embodiment of the present application does not specifically limit the indication field of the first priority information.
- the field PriorityLevel can be used to indicate the first priority information, or other fields (such as PriorityInfo) can be used to indicate the first priority information.
- the registration request may include one or more of the above information.
- the registration request may include the identity information of the second device, the access control subject information of the second device at the first device, and the verification code information.
- the registration request includes the device ID of the second device, the group ID of the second device, and the verification code information.
- the registration request may include the identity information of the second device, the access control subject information of the second device at the first device, and the encryption information associated with the first message.
- the registration request may include the identity information of the second device, the access control subject information of the second device at the first device, the encryption information associated with the first message, the verification code information, and the first priority information, etc.
- the registration request may also carry other information, which is not limited in the embodiments of the present application.
- the registration request may carry the access control subject information of the device sending the registration request at the first device, so that the first device can determine the access rights of the device sending the registration request to the first device, for example, to determine whether the device sending the registration request has the administrator rights of the first device.
- the following introduces the process of registering the second device at the first device.
- Fig. 3 is a schematic diagram of a process of registering a second device at a first device according to an embodiment of the present application. As shown in Fig. 3, the registration process may include step S310 and step S320.
- step S310 the first device receives a registration request for registering the second device.
- the registration request received by the first device may be sent by the second device, or may be sent by a third device other than the second device.
- the registration request may be sent by a device with administrator privileges of the first device, or the registration request may be sent by another device that does not have administrator privileges of the first device (e.g., a device that subscribes to the first device, a device with operation privileges of the first device, etc.).
- the registration request may carry one or more types of information.
- information that may be carried in the registration request please refer to the above description and will not be repeated here.
- step S320 the first device determines a registration policy of the second device according to a subscription relationship between the first device and the second device.
- the first device may determine whether there is a subscription relationship between the first device and the second device before registering the second device, so as to determine the registration policy of the second device according to the subscription relationship between the first device and the second device.
- the purpose of the first device determining whether a subscription relationship exists between the first device and the second device is to confirm whether registration of the second device is allowed. That is, the registration policy of the second device may include allowing registration of the second device and not allowing (refusing) registration of the second device. The first device may determine whether registration of the second device is allowed based on the subscription relationship between the first device and the second device.
- the embodiments of the present application are not limited to this.
- the registration policy of the second device may include which information of the second device is allowed to be registered (for example, identity information of the second device, access control subject information of the second device at the first device, etc.), and which information of the second device is not allowed to be registered (for example, registration of the first priority information is not allowed, etc.).
- the first device may allow the second device to be registered; if the first device determines that no subscription relationship exists between the first device and the second device, the first device may not allow (refuse) to register the second device.
- the first device confirms whether to allow the second device to be registered based on whether a subscription relationship exists between the first device and the second device.
- the following introduces how the first device avoids operational confusion after the first device subsequently changes to a connectable state or enters a wake-up state based on whether a subscription relationship exists between the first device and the second device.
- the purpose of whether the first device allows registration of the second device is to avoid confusion in operation after the first device subsequently changes to a connectable state or enters a wake-up state, or in other words, the purpose of the first device determining whether there is a subscription relationship between the first device and the second device is to avoid confusion in operation after the first device subsequently changes to a connectable state or enters a wake-up state.
- the purpose of the first device determining whether there is a subscription relationship between the first device and the second device is to confirm whether the first device should enter a long sleep cycle or a short sleep cycle next time after changing to a connectable state or entering a wake-up state.
- the sleep period corresponding to the first device is a long sleep period; and/or, if the first device does not allow registration of the second device, the sleep period corresponding to the first device is a short sleep period.
- the first device if the first device allows registration of the second device, then after the first device changes to a connectable state or enters a wake-up state, it can subsequently enter a long sleep cycle; if the first device does not allow registration of the second device, then after the first device changes to a connectable state or enters a wake-up state, it can subsequently enter a short sleep cycle (but not a long sleep cycle) to ensure that the first device can be connected in time.
- the first device determines that there is a subscription relationship between the first device and the second device, then after the first device changes to a connectable state or enters a wake-up state, it can subsequently enter a long sleep cycle; if the first device determines that there is no subscription relationship between the first device and the second device, then after the first device changes to a connectable state or enters a wake-up state, it can subsequently enter a short sleep cycle.
- the first device determining whether a subscription relationship exists between the first device and the second device mentioned in the embodiments of the present application means that the first device determines whether a subscription relationship exists between the first device and the second device, or in other words, the first device determines whether a subscription relationship exists between the current first device and the second device.
- the embodiment of the present application does not specifically limit the implementation manner in which the first device determines whether a subscription relationship exists between the first device and the second device. Two implementation manners are given as examples below.
- the first device may confirm whether the second device has subscribed to the first device by checking the subscription relationship associated with the first device, that is, confirm whether there is a subscription relationship between the first device and the second device.
- the first device can save the corresponding subscription relationship. For example, the first device can save which device subscribes to which resources of the first device and other subscription parameters (e.g., maximum notification message sending interval, minimum notification message sending interval, etc.). In this way, the first device can determine which devices have a subscription relationship with the first device.
- a device e.g., a second device
- subscription parameters e.g., maximum notification message sending interval, minimum notification message sending interval, etc.
- the first device can save the subscription relationships corresponding to device A, device B, and device C, respectively, so that the first device can also determine that there is a subscription relationship between device A, device B, and device C and the first device.
- the first device needs to determine whether there is a subscription relationship between device B and the first device, it can check based on the subscription relationship to determine whether there is a subscription relationship between device B and the first device; or, if the first device needs to determine whether there is a subscription relationship between device D and the first device, it can also check based on the subscription relationship to determine that there is no subscription relationship between device D and the first device.
- the first device determines whether there is a subscription relationship between the first device and the second device by checking the subscription relationship associated with the first device, which reduces the process and is simple to implement.
- the first device can confirm whether the second device has subscribed to the first device through the information of the pre-registered subscription device. equipment, that is, confirming whether there is a subscription relationship between the first device and the second device.
- Implementation 2 is described below in conjunction with Figure 4.
- the method shown in Figure 4 is described from the perspective of interaction between the first device, the subscription device, and the device that sends the registration request.
- the method shown in Figure 4 may include steps S410 to S440, which are described below.
- a first device receives a subscription request sent by a subscription device.
- the subscription request is used to request to subscribe to a resource of the first device.
- the subscription device may be any device that can subscribe to the resources of the first device.
- the subscription device may be a proxy device of the first device, or may be a device with view permission of the first device.
- the subscription device may include the second device mentioned in the embodiment of the present application, or may include other devices other than the second device.
- the subscription device may not include the second device mentioned in the embodiment of the present application.
- step S420 the first device registers the identity information of the subscribing device according to the subscription request sent by the subscribing device.
- the first device registering the identity information of the subscribing device can be understood as the first device can perform a pre-registration, which is used to register the identity information of the subscribing device so as to subsequently determine whether there is a subscription relationship between the first device and the second device based on the pre-registration result.
- the first device registers the identity information of the subscription device according to the subscription request sent by the subscription device, which may include: the first device pre-registers the subscription device according to the device ID of the sender of the subscription request (the device ID of the subscription device). For example, the first device may only register the device ID of the subscription device to indicate that the device corresponding to the device ID has subscribed to the resources of the first device.
- the first device registering the identity information of the subscription device according to the subscription request sent by the subscription device may include: the first device pre-registering the subscription device according to the device ID of the sender of the subscription request (the device ID of the subscription device) and other parameters carried in the subscription request.
- the first device may register the device ID of the subscription device, the resources subscribed by the subscription device, the maximum notification message sending interval associated with the subscription, etc.
- the embodiments of the present application do not limit the manner in which the first device stores the identity information of the pre-registered subscription device.
- the first device may pre-store the identity information of the subscription device at the storage location of the registration information of the device associated with the first message (such as the second device).
- the relevant content of the registration information of the device associated with the first message please refer to the relevant content of the registration information for registering the second device mentioned later.
- the device associated with the first message mentioned here may refer to the device to which the first device can send the first message after the device is successfully registered.
- the first device may write the device ID of the subscription device into the field (such as the RegisterClientID field mentioned in the present application) in the registration information of the device associated with the first message to indicate the identity information of the device associated with the first message.
- the field such as the RegisterClientID field mentioned in the present application
- the first device pre-registering the subscribing device may mean that the first device writes the device ID of the subscribing device into a RegisterClient attribute, which is used to store the device ID of the device (such as the second device) registered at the first device.
- the attribute may be stored in a management cluster of the first device, such as in an ICDmanagement cluster of the ICD.
- the first device as the subscriber in the subscription relationship, can know the subscription relationship, but the preservation and maintenance of the subscription relationship are all managed by the first device itself.
- the first device as the subscriber, can make a record in the Register Client (RegisterClient) attribute during the subscription process, so when the second device is registered later, the record of the Register Client (RegisterClient) attribute can be directly viewed.
- the registration of the second device itself also requires the operation of the Register Client (RegisterClient) attribute, the pre-registration in the subscription process does not need to check other resources related to subscription management, and can directly view the Register Client (RegisterClient) attribute, thereby improving efficiency.
- the first device may pre-store the identity information of the subscribing device in another storage location, and then read the relevant information from the storage location.
- the first device may also authenticate the subscription request. If the subscription request authentication is successful, the first device may pre-register the identity information of the subscription device according to the subscription request.
- step S430 the first device receives a registration request for registering the second device.
- step S430 please refer to the introduction of step S210 or step S310 above, which will not be repeated here for the sake of brevity.
- step S440 the first device determines a registration policy of the second device according to a subscription relationship between the first device and the second device.
- the first device may determine whether to allow registration of the second device according to a subscription relationship between the first device and the second device.
- the first device may determine the registration policy of the second device according to the pre-registration result of step S420. For example, it may be determined whether there is a subscription relationship between the first device and the second device according to the pre-registration result of step S420, so as to allow the second device to be registered if there is a subscription relationship, or not to allow the second device to be registered if there is no subscription relationship. In other words, the first device may determine whether there is a subscription relationship between the first device and the second device according to the identity information of the registered subscriber device, thereby determining whether to allow the second device to be registered.
- the first device may determine whether a subscription relationship exists between the first device and the second device based on the identity information of the registered subscription device, which may include: if the identity information of the subscription device registered by the first device includes the identity information of the second device, the first device determines that a subscription relationship exists between the first device and the second device; and/or, if the identity information of the subscription device registered by the first device does not include the identity information of the second device, the first device determines that no subscription relationship exists between the first device and the second device.
- the identity information of the subscription device pre-registered by the first device includes device A, device B and device C. If device B and the second device are the same device (such as the same device ID), the first device can determine that there is a subscription relationship between the first device and the second device; if device A, device B and device C are different devices from the second device (such as the device IDs are different), the first device can determine that there is no subscription relationship between the first device and the second device.
- the embodiments of the present application are not limited to the above implementations.
- the method of implementation 1 can still be used. That is, in some embodiments, even if the first device pre-registers the identity information of the subscription device, it is not necessary to use the pre-registered information to determine whether there is a subscription relationship between the first device and the second device.
- the first device may allow the second device to be registered. In some embodiments, if there is no subscription relationship between the first device and the second device, the first device may not allow (refuse) to register the second device.
- the method of Fig. 4 may further include step S425.
- step S425 the first device sends a subscription success notification message to the subscription device.
- the first device can more conveniently determine whether there is a subscription relationship between the first device and the second device through the information of the pre-registered subscription device.
- Fig. 5 is a schematic diagram of a process of registering a second device at a first device according to another embodiment of the present application. As shown in Fig. 5, the registration process may include step S510 and step S520.
- step S510 the first device receives a registration request for registering the second device.
- the registration request received by the first device may be sent by the second device, or may be sent by a third device other than the second device.
- the registration request may be sent by a device with administrator privileges of the first device, or the registration request may be sent by another device that does not have administrator privileges of the first device (e.g., a device that subscribes to the first device, a device with operation privileges of the first device, etc.).
- the registration request may carry one or more types of information.
- information that may be carried in the registration request please refer to the above description and will not be repeated here.
- step S520 the first device determines whether there is storage space to store the registration information for registering the second device. In other words, the first device determines whether there are enough storage resources to store the registration information for registering the second device.
- the registration information used to register the second device is first introduced below. It should be noted that the registration information of the device associated with the first message mentioned above is also applicable to the content of the registration information described below.
- the registration information below can be used to register a device that wants to receive the first message, such as for registering the second device. The following is an example of the registration information used to register the second device.
- the registration information used to register the second device may include one or more of the following information: identity information of the second device, access control subject information of the second device at the first device, encryption information associated with the first message, and second priority information.
- the access control subject information of the second device at the first device please refer to the relevant description in the information carried in the registration request introduced above. For the sake of brevity, it will not be repeated here.
- the second priority information can be used to indicate the priority of the first device to send the first message to the second device. For example, if the first device determines to send the first message to the second device first, the priority indicated by the second priority information can be higher.
- the second priority information is determined based on the first priority information carried in the registration request.
- the second priority information may be the same as the first priority information.
- the embodiments of the present application are not limited thereto.
- the second priority information may be different from the first priority information.
- the first device may determine the second priority information corresponding to the second device by itself.
- the first device may determine (assign) the second priority information corresponding to the second device by itself, or may omit the second priority information.
- the first device may save the registration information for registering the second device, so that after the first device changes to a connectable state or enters a wake-up state next time, the first device sends the first message to the second device according to the registration information.
- Step S520 is introduced below.
- the first device may allow the second device to be registered. In some embodiments, if the first device determines that there is no storage space to store the registration information for registering the second device, or if the first device determines that there are insufficient storage resources to save the registration information for registering the second device, the first device may not allow (Deny) Register the second device.
- the first device will allocate a certain storage space to store the registration information of the device associated with the first message.
- the first device can allocate a smaller storage space to store the registration information of the device associated with the first message.
- the allocated storage space can store the registration information of up to 4 devices. Then, if the allocated storage space is insufficient, the first device can refuse to register the second device.
- the first device allocates a smaller storage space to store the registration information of the device associated with the first message.
- it is beneficial to ensure that the devices that have successfully registered can subsequently establish a connection with the first device and on the other hand, it is beneficial to save storage resources.
- the first device can allocate a larger storage space to store the registration information of the device associated with the first message. However, the first device has already stored the registration information of more devices. Then, the first device still needs to determine whether the remaining storage space is sufficient to store the registration information of the second device. If the remaining storage space is insufficient, the first device can refuse to register the second device.
- Fig. 6 is a schematic diagram of a process of registering a second device at a first device according to another embodiment of the present application. As shown in Fig. 6, the registration process may include step S610 and step S620.
- step S610 the first device receives a registration request for registering the second device.
- the registration request received by the first device may be sent by the second device, or may be sent by a third device other than the second device.
- the registration request may be sent by a device with administrator privileges of the first device, or the registration request may be sent by another device that does not have administrator privileges of the first device (e.g., a device that subscribes to the first device, a device with operation privileges of the first device, etc.).
- the registration request may carry one or more types of information.
- information that may be carried in the registration request please refer to the above description and will not be repeated here.
- step S620 the first device registers the second device according to the authority of the device that sends the registration request.
- the first device can register the second device based on the registration request sent by the device.
- the device sending the registration request is a third device
- the third device is the administrator device of the first device.
- the first device receives the registration request sent by the third device and confirms that the third device is the administrator device of the first device, it directly registers the information carried in the registration request, so that the first device can send a first message to the registered device when it changes to a connectable state or enters a wake-up state.
- the first device may verify the registration authority of the device sending the registration request and determine whether to allow registration of the second device based on the verification result.
- the embodiment of the present application does not specifically limit the implementation method of the first device verifying the registration authority of the device that sends the registration request.
- the first device can determine the registration authority of the device that sends the registration request by determining whether the verification code information in the registration request matches (for example, whether they are consistent with) the verification code information saved by the first device. For example, if the verification code information in the registration request matches the verification code information saved by the first device, the first device can determine that the device that sends the registration request has registration authority, and therefore, the first device can register the second device based on the registration request. Alternatively, if the verification code information in the registration request does not match the verification code information saved by the first device, the first device can determine that the device that sends the registration request does not have registration authority, and therefore, the first device can refuse to register the second device.
- the first device can determine whether the verification code information in the registration request matches the verification code information saved by the first device; in response to the verification code information in the registration request matching the verification code information saved by the first device, the first device can register the second device based on the registration request.
- the verification code information saved by the first device may include encryption information used by the first device to send the first message to the second device before the current registration. In this way, the first device can determine whether the verification code information carried in the registration request is consistent with the encryption information used by the first device to send the first message to the second device before the current registration to determine whether the device sending the registration request has the registration authority.
- the embodiments of the present application do not specifically limit the implementation method of determining whether the device sending the registration request has the administrator authority of the first device.
- the first device can determine whether the device sending the registration request has the administrator authority of the first device through the access control subject information of the device sending the registration request at the first device.
- the access control subject information of the device sending the registration request at the first device is used to indicate that the device sending the registration request has the administrator authority of the first device, then the first device determines that the device sending the registration request has the administrator authority of the first device; or, the access control subject information of the device sending the registration request at the first device is used to indicate that the device sending the registration request does not have the administrator authority of the first device (for example, the access control subject information of the device sending the registration request at the first device is used to indicate that the device sending the registration request has the view authority of the first device), then the first device determines that the device sending the registration request does not have the administrator authority of the first device.
- the first device can directly use the device ID of the device sending the registration request to determine whether it has the administrator authority of the first device.
- the first registration at the first device may be performed by a device with administrator privileges at the first device. Subsequent registrations may be performed by a device with administrator privileges or by a device without administrator privileges. As an example, after the device with administrator privileges performs the first registration at the first device, the verification code information may be sent to the device in some way. A device that does not have administrator privileges can use the verification code information to modify, update, or delete the registration information.
- the methods for registering a second device at a first device mentioned in different embodiments of the present application can be combined arbitrarily.
- the steps in the registration methods shown in Figures 3, 5, and 6 can be combined arbitrarily.
- the registration process may include steps S310 to S330, and step S520.
- the registration process may include steps S310 to S330, and step S620.
- the registration process may include steps S310 to S330, step S520, and step S620, etc.
- step S520 can be executed before step S320, or after step S320, or simultaneously with step S320.
- step S620 can be executed before step S320 or step S520, or after step S320 or step S520, or simultaneously with step S320 and step S520, etc.
- the first device may send a registration success response message to the device that sent the registration request.
- the first device may send a registration failure response message to the device that sent the registration request.
- the second device may establish a connection with the first device based on the first message and subscribe (eg, resubscribe) to the first device.
- the embodiment of the present application may also include the following steps: the first device establishes a connection with the second device based on the connection request sent by the second device; the second device sends a subscription request to the first device, and the subscription request is used to subscribe to the resources of the first device.
- the connection request sent by the second device to the first device is sent by the second device when the second device determines that it needs to establish a connection with the first device according to the first message. For example, after receiving the first message, the second device determines that it needs to establish a connection with the first device (for example, subscription data needs to be updated), and the second device can send a connection request to the first device. Alternatively, after receiving the first message, the second device determines that it does not need to establish a connection with the first device (for example, subscription data is not updated), and the second device may not send a connection request to the first device.
- Embodiment 1 is a diagrammatic representation of Embodiment 1:
- Fig. 7 is a schematic diagram of a process of registering a second device at a first device according to another embodiment of the present application.
- the method shown in Fig. 7 may include steps S701 to S707.
- a first device receives a registration request, where the registration request is used to register a second device.
- the first device can send a notification message to the successfully registered second device after changing to a connectable state or entering a wake-up cycle, so that the second device can perform the next business according to the notification message, such as restoring the connection with the first device, restoring the subscription relationship with the first device, etc.
- the registration request may carry one or more of the following information: identity information of the second device, access control subject information of the second device at the first device, encryption information associated with the first message, verification code information, and first priority information.
- the registration request may be sent by the second device, or may be sent by a third device other than the second device (eg, an administrator device of the first device).
- a third device other than the second device (eg, an administrator device of the first device).
- step S702 the first device determines whether a subscription relationship exists between the first device and the second device.
- the first device determines whether there is a live subscription relationship between the first device and the second device.
- the first device may determine whether there is a live subscription relationship between the first device and the second device according to a stored subscription relationship table.
- step S703 the first device determines whether there is storage space to store registration information for registering the second device.
- the first device may determine whether there are sufficient storage resources to store the registration information.
- the first device generally allocates a certain storage space for storing the registration information, for example, allocates space for storing the registration information of four devices, then the first device needs to determine whether there is sufficient storage space to store the registration information corresponding to the registration request.
- step S704 the first device determines the registration authority of the device that sends the registration request.
- the first device determines that the device sending the registration request has administrator privileges of the first device, the first device performs step S705.
- the first device if the first device determines that the device sending the registration request does not have administrator privileges for the first device, the first device Prepare to execute step S706.
- step S705 the first device registers the second device based on the registration request.
- the first device modifies, updates, or deletes registration information used to register the second device based on the information carried in the registration request.
- step S706 the first device determines whether the verification code information in the registration request matches the verification code information stored in the first device.
- step S705 if the verification code information in the registration request matches the verification code information stored by the first device, the first device executes step S705.
- the first device if the verification code information in the registration request does not match the verification code information stored by the first device, the first device refuses to register the second device.
- step S707 the first device sends a response message to the device that sent the registration request.
- the first device may send a success response message to the device that sent the registration request to indicate that the second device has been successfully registered. For example, after executing step S705, the first device may send a success response message to the device that sent the registration request.
- the first device may send a failure response message to the device that sent the registration request to indicate that the registration of the second device failed. For example, when the first device determines in step S702 that there is no subscription relationship between the first device and the second device, it may send a failure response message to the device that sent the registration request. For another example, when the first device determines in step S703 that there is no storage space to store the registration information for registering the second device, it may send a failure response message to the device that sent the registration request. For another example, when the first device determines in step S706 that the verification code information in the registration request does not match the verification code information stored by the first device, it may send a failure response message to the device that sent the registration request.
- Embodiment 2 is a diagrammatic representation of Embodiment 1:
- Fig. 8 is a schematic diagram of a process of registering a second device at a first device according to another embodiment of the present application.
- the method shown in Fig. 8 may include steps S801 to S810.
- a first device receives a subscription request sent by a subscription device.
- step S802 the first device registers identity information of the subscription device.
- the first device may perform pre-registration.
- the first device may pre-register the identity information of the subscribing device and write the device ID of the subscribing device into the field RegisterClientID.
- step S803 the first device sends a subscription success notification message to the subscribing device.
- step S804 the first device receives a registration request, which is used to register the second device.
- the first device can send a notification message to the successfully registered second device after changing to a connectable state or entering a wake-up cycle, so that the second device can perform the next business according to the notification message, such as restoring the connection with the first device, restoring the subscription relationship with the first device, etc.
- the registration request may carry one or more of the following information: identity information of the second device, access control subject information of the second device at the first device, encryption information associated with the first message, verification code information, and first priority information.
- the registration request may be sent by the second device, or may be sent by a third device other than the second device (eg, an administrator device of the first device).
- a third device other than the second device (eg, an administrator device of the first device).
- step S805 the first device determines whether a subscription relationship exists between the first device and the second device.
- the first device determines whether there is a surviving subscription relationship between the first device and the second device.
- the first device may determine whether there is a surviving subscription relationship between the first device and the second device according to the pre-registration result in step S802.
- the first device may determine whether there is a surviving subscription relationship between the first device and the second device according to a saved subscription relationship table.
- step S806 the first device determines whether there is storage space to store registration information for registering the second device.
- the first device may determine whether there are sufficient storage resources to store the registration information.
- the first device generally allocates a certain storage space for storing the registration information, for example, allocates space for storing the registration information of four devices, then the first device needs to determine whether there is sufficient storage space to store the registration information corresponding to the registration request.
- step S807 the first device determines the registration authority of the device that sends the registration request.
- the first device if the first device determines that the device sending the registration request has administrator privileges of the first device, the first device performs step S808.
- the first device determines that the device sending the registration request does not have administrator privileges of the first device, the first device performs step S809.
- step S808 the first device registers the second device based on the registration request.
- the first device modifies, updates, or deletes registration information used to register the second device based on the information carried in the registration request.
- step S809 the first device determines whether the verification code information in the registration request matches the verification code information stored in the first device.
- step S808 if the verification code information in the registration request matches the verification code information stored by the first device, the first device executes step S808.
- the first device if the verification code information in the registration request does not match the verification code information stored by the first device, the first device refuses to register the second device.
- step S810 the first device sends a response message to the device that sent the registration request.
- the first device may send a success response message to the device that sent the registration request to indicate that the second device has been successfully registered. For example, after executing step S808, the first device may send a success response message to the device that sent the registration request.
- the first device may send a failure response message to the device that sent the registration request to indicate that the registration of the second device failed. For example, when the first device determines in step S805 that there is no subscription relationship between the first device and the second device, it may send a failure response message to the device that sent the registration request. For another example, when the first device determines in step S806 that there is no storage space to store the registration information for registering the second device, it may send a failure response message to the device that sent the registration request. For another example, when the first device determines in step S809 that the verification code information in the registration request does not match the verification code information stored by the first device, it may send a failure response message to the device that sent the registration request.
- FIG9 is a schematic diagram of a structure of an apparatus for device connection provided by an embodiment of the present application.
- the apparatus 900 shown in FIG9 can be applied to any of the first devices described above.
- the apparatus 900 may include a first receiving module 910.
- the first receiving module 910 can be used to receive a registration request, which is used to register a second device; wherein the successful registration of the second device is used to indicate that the first device sends a first message to the second device when it changes to a connectable state or enters a wake-up state, and the first message is used to indicate that the second device establishes a connection with the first device.
- the apparatus 900 further includes: a first determining module 920, configured to determine a registration policy of the second device according to a subscription relationship between the first device and the second device.
- a first determining module 920 configured to determine a registration policy of the second device according to a subscription relationship between the first device and the second device.
- the first determination module is further used to: allow registration of the second device if a subscription relationship exists between the first device and the second device; and/or not allow registration of the second device if no subscription relationship exists between the first device and the second device.
- the apparatus 900 further includes: a first registration module, configured to register identity information of the subscription device according to a subscription request sent by the subscription device; wherein the identity information of the registered subscription device is used to determine whether a subscription relationship exists between the first device and the second device.
- a first registration module configured to register identity information of the subscription device according to a subscription request sent by the subscription device; wherein the identity information of the registered subscription device is used to determine whether a subscription relationship exists between the first device and the second device.
- the identity information of the registered subscription device includes the identity information of the second device, a subscription relationship exists between the first device and the second device; and/or, if the identity information of the registered subscription device does not include the identity information of the second device, no subscription relationship exists between the first device and the second device.
- the sleep cycle corresponding to the first device is a long sleep cycle; and/or if the first device does not allow registration of the second device, the sleep cycle corresponding to the first device is a short sleep cycle.
- the registration request is used to indicate one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; verification code information, the verification code information is used to verify the authority of the device sending the registration request; and first priority information, the first priority information is used to indicate the priority of the second device's request to send the first message.
- the access control subject information is indicated using a device identifier of the second device; and/or, the access control subject information is indicated using a group identifier of the second device.
- the registration request is sent by the second device; or, the registration request is sent by a third device other than the second device.
- the third device has administrator authority of the first device.
- the registration information used to register the second device includes one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; and second priority information, wherein the second priority information is used to indicate the priority of the first device sending the first message to the second device.
- the apparatus 900 further includes: a second determining module, configured to determine whether there is storage space to store registration information for registering the second device.
- the apparatus 900 further includes: a second registration module, configured to register the second device according to the authority of the device that sends the registration request.
- a second registration module configured to register the second device according to the authority of the device that sends the registration request.
- the second registration module is further used to: register the second device based on the registration request if the device sending the registration request has administrator authority of the first device.
- the second registration module is further configured to: if the device sending the registration request does not have administrator privileges for the first device, determine whether the verification code information in the registration request matches the verification code information stored in the first device; The verification code information in the registration request matches the verification code information stored in the first device, and the second device is registered based on the registration request.
- the device 900 also includes: a connection module, used to establish a connection with the second device based on a connection request sent by the second device, and the connection request is sent by the second device when it determines that it is necessary to establish a connection with the first device according to the first message; a second receiving module, used to receive a subscription request sent by the second device, and the subscription request sent by the second device is used to subscribe to the resources of the first device.
- a connection module used to establish a connection with the second device based on a connection request sent by the second device, and the connection request is sent by the second device when it determines that it is necessary to establish a connection with the first device according to the first message
- a second receiving module used to receive a subscription request sent by the second device, and the subscription request sent by the second device is used to subscribe to the resources of the first device.
- the first device is a resource-constrained device or an ICD.
- the first receiving module 910 may be a transceiver 1230.
- the apparatus 900 may further include a processor 1210 and a memory 1220, as specifically shown in FIG. 12 .
- FIG10 is a schematic diagram of a structure of an apparatus for device connection provided by another embodiment of the present application.
- the apparatus 1000 shown in FIG10 can be applied to any of the second devices described above.
- the apparatus 1000 can include a receiving module 1010.
- the receiving module 1010 can be used to receive a first message sent by a first device, where the first message is used to instruct the second device to establish a connection with the first device.
- the first message is sent when the second device successfully registers at the first device and the first device changes to a connectable state or enters a wake-up state.
- the registration policy of the second device is determined according to a subscription relationship between the first device and the second device.
- the second device is allowed to register at the first device; and/or if no subscription relationship exists between the first device and the second device, the second device is not allowed to register at the first device.
- whether a subscription relationship exists between the first device and the second device is determined according to identity information of a subscribing device registered at the first device.
- the identity information of the subscription device registered at the first device includes the identity information of the second device, a subscription relationship exists between the first device and the second device; and/or, if the identity information of the subscription device registered at the first device does not include the identity information of the second device, no subscription relationship exists between the first device and the second device.
- the sleep cycle corresponding to the first device is a long sleep cycle; and/or if the first device does not allow registration of the second device, the sleep cycle corresponding to the first device is a short sleep cycle.
- the registration of the second device at the first device is triggered based on a registration request received by the first device, and the registration request is used to indicate one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; verification code information, the verification code information is used to verify the authority of the device sending the registration request; and first priority information, the first priority information is used to indicate the priority of the second device's request to send the first message.
- the access control subject information is indicated using a device identifier of the second device; and/or, the access control subject information is indicated using a group identifier of the second device.
- the registration request is sent by the second device; or, the registration request is sent by a third device other than the second device.
- the third device has administrator authority of the first device.
- the registration information used to register the second device includes one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; and second priority information, wherein the second priority information is used to indicate the priority of the first device sending the first message to the second device.
- whether the second device is allowed to register at the first device is determined according to whether the first device has storage space to store registration information for registering the second device.
- the device 1000 also includes: a first sending module 1020, used to send a connection request to the first device, the connection request is used to establish a connection with the first device, and the connection request is sent by the second device when it determines that it is necessary to establish a connection with the first device based on the first message; a second sending module 1030, used to send a subscription request to the first device, and the subscription request is used to subscribe to the resources of the first device.
- a first sending module 1020 used to send a connection request to the first device, the connection request is used to establish a connection with the first device, and the connection request is sent by the second device when it determines that it is necessary to establish a connection with the first device based on the first message
- a second sending module 1030 used to send a subscription request to the first device, and the subscription request is used to subscribe to the resources of the first device.
- the first device is a resource-constrained device or an ICD.
- the receiving module 1010 may be a transceiver 1230.
- the apparatus 1000 may further include a processor 1210 and a memory 1220, as specifically shown in FIG. 12 .
- Fig. 11 is a schematic diagram of a structure of an apparatus for device connection provided by another embodiment of the present application.
- the apparatus 1100 shown in Fig. 11 can be applied to any of the third devices described above.
- the apparatus 1100 can include a sending module 1110.
- the sending module 1110 can be used to send a registration request to the first device, and the registration request is used to register the second device; wherein, the successful registration of the second device is used to indicate that the first device changes to a connectable state or enters a wake-up state and sends a first message to the second device, and the first message is used to indicate that the second device establishes a connection with the first device.
- the registration policy of the second device is determined according to a subscription relationship between the first device and the second device.
- registration of the second device at the first device is allowed; and/or if no subscription relationship exists between the first device and the second device, registration of the second device at the first device is not allowed.
- whether a subscription relationship exists between the first device and the second device is determined according to identity information of a subscribing device registered at the first device.
- the identity information of the subscription device registered at the first device includes the identity information of the second device, a subscription relationship exists between the first device and the second device; and/or, if the identity information of the subscription device registered at the first device does not include the identity information of the second device, no subscription relationship exists between the first device and the second device.
- the sleep cycle corresponding to the first device is a long sleep cycle; and/or if the first device does not allow registration of the second device, the sleep cycle corresponding to the first device is a short sleep cycle.
- the registration request is used to indicate one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; verification code information, the verification code information is used to verify the authority of the device sending the registration request; and first priority information, the first priority information is used to indicate the priority of the second device's request to send the first message.
- the access control subject information is indicated using a device identifier of the second device; and/or, the access control subject information is indicated using a group identifier of the second device.
- the registration information used to register the second device includes one or more of the following information: identity information of the second device; access control subject information of the second device at the first device; encryption information associated with the first message; and second priority information, wherein the second priority information is used to indicate the priority of the first device sending the first message to the second device.
- whether the second device is allowed to register at the first device is determined according to whether the first device has storage space to store registration information for registering the second device.
- the third device has administrator authority of the first device.
- the first device is a resource-constrained device or an ICD.
- the sending module 1110 may be a transceiver 1230.
- the apparatus 1100 may further include a processor 1210 and a memory 1220, as specifically shown in FIG. 12 .
- FIG12 is a schematic structural diagram of a communication device according to an embodiment of the present application.
- the dotted lines in FIG12 indicate that the unit or module is optional.
- the device 1200 may be used to implement the method described in the above method embodiment.
- the device 1200 may be a chip, a terminal device, or a network device.
- the device 1200 may include one or more processors 1210.
- the processor 1210 may support the device 1200 to implement the method described in the above method embodiment.
- the processor 1210 may be a general-purpose processor or a special-purpose processor.
- the processor may be a central processing unit (CPU).
- the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- DSP digital signal processor
- ASIC application specific integrated circuits
- FPGA field programmable gate arrays
- a general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
- the apparatus 1200 may further include one or more memories 1220.
- the memory 1220 stores a program, which can be executed by the processor 1210, so that the processor 1210 executes the method described in the above method embodiment.
- the memory 1220 may be independent of the processor 1210 or integrated in the processor 1210.
- the apparatus 1200 may further include a transceiver 1230.
- the processor 1210 may communicate with other devices or chips through the transceiver 1230.
- the processor 1210 may transmit and receive data with other devices or chips through the transceiver 1230.
- the present application also provides a computer-readable storage medium for storing a program.
- the computer-readable storage medium can be applied to a terminal or network device provided in the present application, and the program enables a computer to execute the method performed by the terminal or network device in each embodiment of the present application.
- the embodiment of the present application also provides a computer program product.
- the computer program product includes a program.
- the computer program product can be applied to the terminal or network device provided in the embodiment of the present application, and the program enables the computer to execute the method performed by the terminal or network device in each embodiment of the present application.
- the embodiment of the present application also provides a computer program.
- the computer program can be applied to the terminal or network device provided in the embodiment of the present application, and the computer program enables a computer to execute the method executed by the terminal or network device in each embodiment of the present application.
- the “indication” mentioned may be a direct indication, an indirect indication, or an indication of
- a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, B can be obtained through C; it can also mean that there is an association relationship between A and B.
- B corresponding to A means that B is associated with A, and B can be determined according to A.
- determining B according to A does not mean determining B only according to A, and B can also be determined according to A and/or other information.
- the term "corresponding" may indicate that there is a direct or indirect correspondence between the two, or an association relationship between the two, or a relationship of indication and being indicated, configuration and being configured, etc.
- the term “include” may refer to direct inclusion or indirect inclusion.
- the term “include” in the embodiments of the present application may be replaced with “indicates” or “is used to determine”.
- “A includes B” may be replaced with “A indicates B” or "A is used to determine B”.
- pre-definition or “pre-configuration” can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device), and the present application does not limit the specific implementation method.
- pre-definition can refer to what is defined in the protocol.
- the “protocol” may refer to a standard protocol in the communication field, for example, it may include an LTE protocol, an NR protocol, and related protocols used in future communication systems, and the present application does not limit this.
- the term "and/or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships.
- a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
- the character "/" in this article generally indicates that the associated objects before and after are in an "or" relationship.
- the size of the serial numbers of the above-mentioned processes does not mean the order of execution.
- the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the computer program product includes one or more computer instructions.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
- the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
- the computer-readable storage medium may be any available medium that can be read by a computer or a data storage device such as a server or data center that includes one or more available media integrated.
- the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
- a magnetic medium e.g., a floppy disk, a hard disk, a magnetic tape
- an optical medium e.g., a digital video disc (DVD)
- DVD digital video disc
- SSD solid state disk
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
提供了一种用于设备连接的方法和装置、芯片、存储介质和程序产品。该用于设备连接的方法包括:第一设备接收注册请求,注册请求用于注册第二设备;其中,第二设备的成功注册用于指示第一设备变化为可连接状态或进入唤醒状态时向第二设备发送第一消息,第一消息用于指示第二设备与第一设备建立连接。
Description
本申请涉及通信技术领域,并且更为具体地,涉及一种用于设备连接的方法和装置、芯片、存储介质和程序产品。
通信系统中,设备处于可连接状态或唤醒状态时可能会和多个设备建立连接。例如,间歇性连接设备(intermittently connected device,ICD)会间歇性休眠或间歇性唤醒,以便节省电量,这类设备每次唤醒可能会和多个设备建立连接;或者,某些设备由于临时断电导致休眠,重新唤醒后也可能会和多个设备建立连接。但是,有些连接的建立是不必要的,例如建立连接的双方可能并没有信息交互的需求,造成资源的浪费。
为了避免资源浪费,设备处于可连接状态或唤醒状态时可以选择与多个设备中的部分设备建立连接。那么,设备如何选择部分设备建立连接是需要解决的问题。
发明内容
本申请提供一种用于设备连接的方法和装置、芯片、存储介质和程序产品。下面对本申请涉及的各个方面进行介绍。
第一方面,提供了一种用于设备连接的方法,包括:第一设备接收注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
第二方面,提供了一种用于设备连接的方法,包括:第二设备接收第一设备发送的第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接,所述第一消息是所述第二设备在所述第一设备处注册成功的情况下,所述第一设备变化为可连接状态或进入唤醒状态时发送的。
第三方面,提供了一种用于设备连接的方法,包括:第三设备向第一设备发送注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
第四方面,提供了一种用于设备连接的装置,所述装置应用于第一设备,所述装置包括:第一接收模块,用于接收注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
第五方面,提供了一种用于设备连接的装置,所述装置应用于第二设备,所述装置包括:接收模块,用于接收第一设备发送的第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接,所述第一消息是所述第二设备在所述第一设备处注册成功的情况下,所述第一设备变化为可连接状态或进入唤醒状态时发送的。
第六方面,提供了一种用于设备连接的装置,所述装置应用于第三设备,所述装置包括:发送模块,用于向第一设备发送注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
第七方面,提供了一种用于设备连接的装置,包括处理器、存储器以及通信接口,所述存储器用于存储一个或多个计算机程序,所述处理器用于调用所述存储器中的计算机程序使得所述装置执行上述各个方面的方法中的部分或全部步骤。
第八方面,本申请实施例提供了一种通信系统,该系统包括上述的用于设备连接的装置。在另一种可能的设计中,该系统还可以包括本申请实施例提供的方案中与该装置进行交互的其他设备。
第九方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得计算机执行上述各个方面的方法中的部分或全部步骤。
第十方面,本申请实施例提供了一种计算机程序,所述计算机程序使得计算机执行上述各个方面的方法中的部分或全部步骤。
第十一方面,本申请实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行上述各个方面的方
法中的部分或全部步骤。在一些实现方式中,该计算机程序产品可以为一个软件安装包。
第十二方面,本申请实施例提供了一种芯片,该芯片包括存储器和处理器,处理器可以从存储器中调用并运行计算机程序,以实现上述各个方面的方法中所描述的部分或全部步骤。
本申请实施例可以在第一设备处注册第二设备,以便第一设备变化为可连接状态或进入唤醒状态时可以针对性地与注册成功的第二设备建立连接。也就是说,第一设备变化为可连接状态或进入唤醒状态时,可以根据设备注册的情况,选择与注册成功的第二设备建立连接。如此一来,本申请实施例有利于避免不必要的连接的建立,从而有助于节省资源。
图1是可应用本申请实施例的无线通信系统的系统架构示例图。
图2是本申请实施例提供的用于设备连接的方法的流程示意图。
图3是本申请一实施例提供的注册第二设备的方法的流程示意图。
图4是本申请实施例提供的确定是否存在订阅关系的一种可能的实现方式。
图5是本申请另一实施例提供的注册第二设备的方法的流程示意图。
图6是本申请又一实施例提供的注册第二设备的方法的流程示意图。
图7是本申请又一实施例提供的注册第二设备的方法的流程示意图。
图8是本申请又一实施例提供的注册第二设备的方法的流程示意图。
图9是本申请一实施例提供的用于设备连接的装置的结构示意图。
图10是本申请另一实施例提供的用于设备连接的装置的结构示意图。
图11是本申请又一实施例提供的用于设备连接的装置的结构示意图。
图12是本申请实施例提供的通信装置的示意性结构图。
下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。
图1是可应用本申请实施例的无线通信系统100的系统架构示例图。如图1所示,该无线通信系统100可以包括第一设备110和第二设备120。第一设备110与第二设备120之间可以相互通信。作为一种实现方式,第一设备110和第二设备120可以通过有线(例如,USB接口)或者无线(例如,蓝牙或移动网络)等方式建立连接,以实现相互通信。
第一设备110和第二设备120可以属于同一物联网系统,或者说,第一设备110和第二设备120可以属于同一生态。换句话说,第一设备110和第二设备120可以是同一物联网系统或同一生态中的物联网设备。
物联网(internet of things,IoT)即“万物相连的互联网”,其是在互联网基础上延伸和扩展的网络,可以通过各种信息传感设备(如射频识别、全球定位系统等)将任何物品与互联网连接起来形成一个巨大的网络,进行信息交换和通信,以实现万物之间的互联互通。在一些实施例中,物联网设备可以是智能家居设备,例如,物联网设备可以包括智能空调、智能冰箱、洗衣机、电饭煲、扫地机器人等设备。在一些实施例中,物联网设备可以是智能监控设备,例如,物联网设备可以包括监控摄像头、温度传感器、声音传感器等。
在一些实施例中,第一设备110和第二设备120可以位于同一网络,例如,第一设备110和第二设备120可以均位于家庭网络。
需要说明的是,一般全网范围内存在多个家庭网络,家庭网络中的设备之间可以相互通信。家庭网络主要由家庭智能网关和家庭智能网关关联的物联网设备两大部分组成。家庭智能网关是整个家庭网络与外部网络发生联系的桥梁,它能够从外部网络接收信号,并通过家庭网络信号将接收的信号传送给某个物联网设备。换句话说,家庭智能网关可以理解为家居智能化的中枢设备。通过家庭智能网关可以实现系统信息的采集、信息输入、信息输出、以及对各种类型的物联网设备的集中控制、远程控制、联动控制等功能。家庭智能网关与物联网设备之间的连接方式可以是多样的,比如,两者之间可以采用以太网、蓝牙(bluetooth,BT)无线保真(wireless fidelity,WIFI)、ZigBee等方式连接。
在一些实施例中,第一设备110可以是能够间歇性休眠或间歇性唤醒的电子设备。或者说,第一设备110是能够间歇性处于休眠状态或者能够间歇性处于唤醒状态的电子设备。第一设备110间歇性休眠或者间歇性唤醒能够节省电量。
在一些实施例中,第一设备110处于休眠状态也可以理解为第一设备110处于空闲模式(idle mode)或空闲状态。第一设备110处于唤醒状态也可以理解为第一设备110处于激活模式(active mode)、激
活状态或工作状态等。
在一些实施例中,第一设备110可以周期性进行休眠或者定期进行休眠。比如,第一设备110可以每隔2分钟进行一次休眠。
在一些实施例中,第一设备110可以随机进行休眠或者不规则性进行休眠。比如,第一设备110某一次间隔2分钟进行了一次休眠,下次可以间隔3分钟进行休眠等。
在一些实施例中,第一设备110休眠或唤醒可以是基于事件触发的,或者说,第一设备可以基于某些事件的发生进入休眠状态或进入唤醒状态。以第一设备110为温度传感器或烟感传感器为例,温度传感器或烟感传感器处于唤醒状态时能够感测到报警事件(例如,感测到温度超过某一阈值,或感测到烟雾浓度高于某一阈值等),在温度传感器或烟感传感器感测到报警事件之后,温度传感器或烟感传感器可以在上报报警事件后进入休眠状态。
本申请实施例对第一设备110的休眠时间(或称,休眠时长、休眠持续时间等)和/或第一设备的唤醒时间(或称,唤醒时长、唤醒持续时间等)不做具体限定。以休眠时间为例,第一设备110每次休眠的时间可以相同。作为一个示例,第一设备110每次休眠的时间为1分钟。在一些实施例中,第一设备110的休眠时间可以变化。作为一个示例,第一设备110某一次休眠的时间为1分钟,下次休眠的时间变化为2分钟等。
本申请实施例对第一设备110的休眠时间和/或第一设备110的唤醒时间的配置方式不做具体限定。作为一种实现方式,第一设备110的休眠时间和/或第一设备110的唤醒时间可以是由第一设备的配置设备配置的。这种配置方式较为灵活,后续可以通过配置设备修改第一设备110的休眠时间和/或第一设备110的唤醒时间。作为另一种实现方式,第一设备110的休眠时间和/或第一设备110的唤醒时间可以是在第一设备中由固件或软件写死的,也就是说,第一设备110的休眠时间和/或第一设备110的唤醒时间是无法通过软件配置更改的,这种配置方式能够保证配置的安全性。
在一些实施例中,第一设备110可以在有限的电源(limited power)上运行。例如,第一设备110可以在电池供电的方式下运行。或者,第一设备110可以在有限的能量采集(limited energy scavenging)供电的方式下运行。
在一些实施例中,第一设备110可以是指ICD。ICD需要定期进行休眠以便节省电量。ICD一般使用电池供电。
在一些实施例中,第一设备110可以是指资源受限设备。本申请实施例对资源受限设备的资源受限的类型不做限定。例如,设备的资源受限可以是指设备的计算资源、存储资源、网络资源、电量资源中的一种或多种受限。或者,设备的资源受限可以是指设备的硬件资源和/或软件资源受限等。例如,第一设备110可以是计算资源、存储资源、网络资源中的一种或多种受限的设备;或者,第一设备110可以是硬件资源和/或软件资源受限的设备等。
在一些实施例中,第一设备110可以是指低功耗设备。例如,第一设备110可以是可穿戴设备等低功耗设备。
作为一个示例,第一设备110可以是间歇性休眠或间歇性唤醒的智能传感器,比如,烟感传感器、温度传感器等。以第一设备110为烟感传感器为例,第一设备110可能需要定期测量烟感数据,或在报警事件发生时向第二设备120发送报警信息;而第一设备110在不需要测量烟感数据或发送报警信息的情况下,可以进行休眠。
在一些实施例中,第一设备110可以是指没有采取节能措施的设备,例如,第一设备110可以是指某些正常工作的设备。第一设备110可能会由于突然断电或其他原因导致休眠,其重新唤醒后也会和多个设备建立连接。
第一设备110可以具有通信模块,例如,第一设备110可以是具有短距离通信功能的电子设备。该短距离通讯功能例如可以包括以下中的一种或多种:蓝牙,WIFI,Zigbee等。
在一些实施例中,第一设备可以在第一状态下与其他设备建立连接,在第二状态下不能与其他设备建立连接。
在一些实施例中,第一状态可以包括以下状态中的一项或多项:可连接状态,唤醒状态,开机状态,开启状态,激活(active)态,非节能状态,正常工作状态等。
在一些实施例中,第二状态可以包括以下状态中的一项或多项:不可连接状态,休眠状态,关机状态,关闭状态,空闲(idle)态,节能状态,非正常工作状态等。
在一些实施例中,第一设备110的状态可以包括可连接状态和不可连接状态。第一设备110处于可连接状态时,其可以与其他设备建立连接。第一设备110处于不可连接状态时,其不能与其他设备建立连接,或者无法与其他设备建立连接。
在一些实施例中,第一设备110的状态可以包括唤醒状态和休眠状态。第一设备处于唤醒状态时,
其可以与其他设备建立连接。第一设备110处于休眠状态时,其不能与其他设备建立连接,或者无法与其他设备建立连接。
第二设备120可以和第一设备110连接以进行信息交互。在一些实施例中,第二设备120例如可以是手持式智能终端,比如,智能手机、平板电脑等。在一些实施例中,第二设备120也可以是可穿戴设备,比如,智能手表、智能手环等。
在一些实施例中,第二设备120可以是第一设备110的中枢设备,比如本地中枢设备。第二设备120作为第一设备110的中枢设备时,第二设备120可以对第一设备110进行控制。应该理解,本申请实施例提及的“本地中枢设备”用于强调第二设备120是本地的、可以对第一设备110进行控制和管理的设备。
在一些实施例中,中枢设备可以存储对第一设备的请求,以便在第一设备的唤醒窗口期向第一设备发送存储的请求。
本申请实施例提及的中枢设备可以包括多种,本申请实施例对此并不限定。例如,中枢设备可以是终端设备,比如,手持式智能终端、电脑、平板电脑等。或者,中枢设备可以是智能网关(例如,前文提及的家庭智能网关)、路由器等其他设备。
在一些实施例中,第二设备120上可以包括第一设备110的“影子设备”。例如,第二设备120可以为中枢设备,该中枢设备上包括第一设备110的“影子设备”。这种情况下,第一设备改变为可连接状态或进入唤醒状态后,会与“影子设备”进行消息同步,以便用户通过操作“影子设备”来间接操作第一设备110。采用“影子设备”对第一设备110进行操作的方案中,对承载“影子设备”的物理设备要求很高,需要有支持数据孪生的一系列方案,包括但不限于“影子设备”载体的选择、“影子设备”的生成、第一设备110和“影子设备”对应的消息同步方案等,整个系统复杂性较高。
应该理解,第一设备110与“影子设备”进行消息同步可以替换为,第一设备110和其对应的“影子设备”(即虚拟设备)之间实现消息的同步。作为一种实现方式,第一设备110可以将其状态信息通过云端发送到“影子设备”,“影子设备”在云端保存第一设备110的状态信息,并将其同步到其他订阅了第一设备110的应用程序,以实现第一设备状态信息的共享和同步。这样,在第一设备110与云端之间出现通信问题时,应用程序仍然可以获得第一设备110的最新状态信息,从而保证第一设备110的可靠性和稳定性。
在一些实施例中,第二设备120可以是第一设备110的代理设备。
在一些实施例中,第二设备120可以是第一设备110的中继设备。
不过本申请实施例并不限定于此,第二设备120可以是任意和第一设备110进行通信或交互的设备,例如,第二设备120可以是第一设备110的管理员设备,即第二设备120具有第一设备110的管理员权限;或者,第二设备120可以和第一设备110之间存在订阅关系,以便第二设备120可以订阅第一设备110的资源数据。
图1示例性地示出了一个第一设备110和一个第二设备120,但本申请实施例对此并不限定。可选地,该无线通信系统100可以包括多个第一设备和/或多个第二设备,例如,第一设备可以向多个第二设备上报数据、与多个第二设备建立连接等;或者,一个第二设备可以接收多个第一设备上报的数据、与多个第一设备建立连接等。
可选地,该无线通信系统100还可以包括其他设备,本申请实施例对此不作限定。示例性地,第一设备110可以通过第二设备120实现与其他设备的通信,例如,第一设备110可以通过第二设备120来控制或访问其他设备。可选地,在该场景下,第二设备120可以理解为一种代理设备、中继设备、或桥接设备。
应理解,本申请实施例的技术方案可以应用于各种通信系统,例如:第五代(5th generation,5G)系统或新无线(new radio,NR)、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)、蓝牙系统、WIFI系统等。本申请提供的技术方案还可以应用于未来的通信系统,如第六代移动通信系统,又如卫星通信系统,等等。
在一些实施例中,本申请实施例中的第一设备和第二设备可以分别称为第一终端设备和第二终端设备。其中,终端设备也可以称为用户设备(user equipment,UE)、接入终端、用户单元、用户站、移动站、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。
本申请实施例中的第一设备和第二设备可以是指向用户提供语音和/或数据连通性的设备,可以用于连接人、物和机,例如具有无线连接功能的手持式设备、车载设备等。示例性地,本申请实施例中的第一设备和/或第二设备可以是手机(mobile phone)、平板电脑(Pad)、笔记本电脑、掌上电脑、移动
互联网设备(mobile internet device,MID)、可穿戴设备,物联网(internet of things,IoT)设备、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。
本申请实施例对IoT设备的类型不作限定。在一些实施例中,IoT设备可以包括车辆、船舶等智能出行工具。在一些实施例中,IoT设备可以包括智能电视、智能空调、智能冰箱、扫地机器人等智能家居设备。在一些实施例中,IoT设备可以包括监控摄像头、温度传感器、声音传感器等智能监控设备,等等。
进一步地,在IoT设备为车辆的情况下,车辆例如可以是家用汽车、出租车、公交车、摩托车等;在IoT设备为智能空调的情况下,智能空调例如可以是立式空调、挂式空调等,本申请对此并不限定。
在一些实施例中,第一设备110与第二设备120可以是不同类型的设备,以实现不同类型的设备之间的信息交互。例如,第一设备110可以是IoT设备(比如,智能传感器、智能空调等),第二设备120可以是手机、平板电脑等手持终端设备,基于此,可以实现手持终端设备对IoT设备(智能传感器、智能空调等)的控制。
在一些实施例中,第一设备110与第二设备120可以是来自不同制造商的设备,以实现不同制造商的设备之间的信息交互。例如,第一设备110可以是来自第一制造商的设备,第二设备120可以是来自第二制造商(与第一制造商不同)的设备。
本申请实施例对第一设备和第二设备所处的场景不作限定。示例性地,第一设备和第二设备可以部署在陆地上,包括室内或室外、手持或车载。
应理解,本申请中的通信设备的全部或部分功能也可以通过在硬件上运行的软件功能来实现,或者通过平台(例如云平台)上实例化的虚拟化功能来实现。
如前文所述,第一设备可以是间歇性休眠或间歇性唤醒的设备,第一设备处于前文提及的第一状态(可连接状态、唤醒状态等)或第二状态(如不可连接状态、休眠状态)时均会出现一些问题,下面以第一设备处于休眠状态和唤醒状态为例,对第一设备可能出现的问题进行介绍。
在一些场景中,第一设备处于休眠状态时,第一设备和其他设备(比如,第二设备)的业务的连续性会受到影响。也就是说,第一设备与其他设备的业务连续性会受到第一设备的休眠的破坏。这是因为,第一设备处于休眠状态时需要关闭与其他设备的连接,而该连接的关闭可能会造成对一些业务连续性的破坏。以订阅场景为例,假设订阅双方协商了每隔一段时间(比如,1分钟)需要被订阅者(被订阅设备)回复一个消息给订阅者(订阅设备),以确定订阅关系存在。那么如果被订阅者是间歇性休眠或间歇性唤醒的设备且被订阅者的休眠时间超过订阅双方协商的回复消息的时间(如,上文提及的1分钟),那么,订阅者可能会认为被订阅者已丢失或关闭了订阅关系,可能需要重新订阅,导致业务连续性遭到破坏。
在一些场景中,第一设备进入唤醒状态后,第一设备和其他设备(比如,第二设备)需要建立连接(比如,恢复连接、重新建立新连接等),以在第一设备的唤醒周期中完成信息交互。例如,第一设备唤醒后可能需要及时与中枢设备建立连接,以便向中枢设备通知信息或报告其上线状态;或者第一设备唤醒后可能需要及时与“影子设备”建立连接,以进行消息同步等。
在一些实施例中,第一设备进入唤醒状态后,可以主动和其他设备建立连接,例如,第一设备可以主动向其他设备发送连接请求。在一些实施例中,第一设备进入唤醒状态后,可以接收其他设备的连接请求,以便和其他设备建立连接。
需要说明的是,第一设备进入唤醒状态后,在恢复连接的必要信息完整的情况下,可以和其他设备恢复连接,否则需要重新建立连接。本申请实施例对恢复连接的必要信息不做具体限定,例如,包括设备之间的共享密钥、恢复对话ID、设备ID等。
从上文的描述可以看出,某些场景下,第一设备唤醒后可能会和多个设备建立连接。例如,间歇性连接设备(intermittently connected device,ICD)会间歇性休眠或间歇性唤醒,以便节省电量,这类设备每次唤醒可能会和多个设备建立连接;或者,某些设备由于临时断电导致休眠,重新唤醒后也可能会和多个设备建立连接。但是,有些连接的建立是不必要的,例如建立连接的双方可能并没有信息交互的需求,造成资源的浪费。
为了避免资源浪费,第一设备可能会选择与多个设备中的部分设备建立连接。那么,第一设备如何从多个设备中选择部分设备建立连接是需要解决的问题。
作为一种可能的实现方式,第一设备可能会随机选择部分设备建立连接。作为另一种可能的实现方式,第一设备可能会按照“先来先服务”的原则选择部分设备建立连接。但是,第一设备采用上述方式
选择建立连接的设备时,还是可能会导致不必要的连接的建立,造成资源浪费。例如,考虑到建立连接的流程较长,第一设备与多个设备中的部分设备建立连接的过程中或之后可能很快会进入休眠状态,或者两者建立连接后可能并没有信息交互的需求,造成资源的浪费。
另外,如果第一设备唤醒后由其他设备主动建立连接,第一设备可能会接收到大量连接请求消息,而对于其他设备而言,这种方式就是在大量的连接请求中随机碰撞能否接收到第一设备的响应,理论上也是需要浪费很多网络资源。
综上,设备变化为第一状态(如,可连接状态或进入唤醒状态)时如何选择部分设备建立连接是需要解决的问题。尤其是对于间歇性休眠或间歇性唤醒的设备而言,该设备唤醒之后如何从多个设备中选择部分设备建立连接是亟需解决的问题。
针对上述问题,本申请实施例提供了一种用于设备连接的方法和装置、芯片、存储介质和程序产品,以便第一设备变化为第一状态时,能够根据在第一设备处的设备注册的情况,针对性地选择与注册成功的设备建立连接,有利于避免不必要的连接的建立,从而有助于节省资源。下面以第一状态包括可连接状态或唤醒状态为例,结合附图对本申请的方法实施例进行介绍。
图2是本申请一实施例提供的用于设备连接的方法的流程示意图。图2所示的方法是站在第一设备和第二设备交互的角度进行描述的。该第一设备和第二设备例如可以分别是图1所示的第一设备110和第二设备120。
在一些实施例中,第一设备可以是指采取了某些节能措施的设备。例如,第一设备可以是间歇性处于休眠状态或间歇性处于唤醒状态的设备。作为一个示例,第一设备可以是物联网设备,比如可穿戴设备、智能传感器、智能空调等。
不过本申请实施例并不限定于此,第一设备可以是指任意需要与其他设备建立连接的设备。例如,在一些实施例中,第一设备可以是指没有采取节能措施的设备,比如,第一设备可以是指某些正常工作的设备,由于突然断电或其他原因导致休眠,其重新唤醒后也需要与其他设备建立连接。
第二设备可以与第一设备建立连接,以便两者进行信息交互,例如,第二设备可以是手持式智能终端,比如手机、平板电脑等。
作为一个示例,第二设备可以是第一设备的代理设备、中继设备、桥接设备等。作为另一个示例,第二设备可以是第一设备的订阅设备,即第二设备可以订阅第一设备的资源。作为又一个示例,第二设备可以是第一设备的“影子设备”等。
在本申请实施例中,第二设备是指在第一设备处待注册的设备。第二设备在第一设备处注册成功后,第一设备便可以在变化为可连接状态后进入唤醒状态的情况下通知第二设备,以便两者建立连接。
图2所示的方法可以包括步骤S210,下面对该步骤进行详细介绍。
在步骤S210,第一设备接收注册请求。该注册请求用于注册第二设备。
在一些实施例中,该注册请求用于注册第二设备可以理解为,该注册请求用于请求第一设备在变化为可连接状态时或进入唤醒状态时向第二设备发送第一消息,以便第二设备与第一设备建立连接。
在一些实施例中,该注册请求用于注册第二设备可以包括,该注册请求用于在第一设备处注册第二设备的相关信息,以便第一设备在由不可连接状态变化为可连接状态的情况下向注册成功的第二设备发送第一消息,或者以便第一设备在由休眠状态进入唤醒状态的情况下向注册成功的第二设备发送第一消息。
本申请实施例对发送注册请求的设备(或称,注册请求的发送设备、注册请求的发送方等)不做具体限定。在一些实施例中,该注册请求可以是第二设备自己发送的。在一些实施例中,该注册请求可以是第二设备之外的其他设备发送的,比如该注册请求可以是第三设备发送的。在一些实施例中,发送注册请求的第三设备可以是除第二设备之外的任意设备,例如,第三设备可以是对第一设备具有访问权限的任意设备。作为一种实现方式,发送注册请求的第三设备可以是第一设备的管理员设备,或者说,第三设备可以具有第一设备的管理员(administer)权限。不过本申请实施例并不限定于此,第三设备也可以是具有第一设备的操作(operate)权限、管理(manage)权限或其他权限的设备等。
关于在第一设备处注册第二设备的其他内容,后文将会详细介绍,为了简洁,此处暂不赘述。
在一些实施例中,第二设备的成功注册可以用于指示第一设备变化为可连接状态或进入唤醒状态时向第二设备发送第一消息,第一消息用于指示第二设备与所述第一设备建立连接。也就是说,第一设备可以根据第二设备在第一设备处的注册情况,确定是否在变化为可连接状态或进入唤醒状态时向第二设备发送第一消息。
作为一种实现方式,如果第二设备在第一设备处注册成功,响应于第一设备变化为可连接状态或进入唤醒状态,第一设备可以向第二设备发送第一消息。作为另一种实现方式,如果第二设备在第一设备处注册失败,则第一设备变化为可连接状态或进入唤醒状态后,并不会向第二设备发送第一消息。
因此,在本申请实施例中,在一些实施例中,该方法还可以包括第一设备基于第二设备的注册情况确定是否向第二设备发送第一消息的方案,下面继续结合图2对此进行介绍。
在一些实施例中,本申请实施例的方法还可以包括步骤S220,在步骤S220,在第二设备注册成功的情况下,响应于第一设备变化为可连接状态或进入唤醒状态时,第一设备向第二设备发送第一消息。第一消息用于指示第二设备与第一设备建立连接。
在一些实施例中,第一设备变化为可连接状态可以是指,第一设备当前可以与其他设备建立连接,即第一设备变化为可连接状态后可以与其他设备建立连接。在一些实施例中,第一设备变化为可连接状态可以替换为第一设备处于连接状态。
在一些实施例中,第一设备进入唤醒状态之后,第一设备也可以与其他设备建立连接。在一些实施例中,第一设备进入唤醒状态可以替换为,第一设备处于唤醒状态。这种情况下,在一些实施例中,第一消息可以用于指示第一设备处于唤醒状态,如此一来,第一消息的目的也可以解释为,第一消息用于通知第二设备,第一设备处于唤醒状态(唤醒周期),如果第二设备有需要可以与第一设备建立连接。
在一些实施例中,第一设备变化为可连接状态或进入唤醒状态时向第二设备发送第一消息可以是指,第一设备从其他状态(如前文提及的第二状态,包括不可连接状态、休眠状态等)切换为可连接状态的同时或切换为唤醒状态的同时便向第二设备发送第一消息,或者说,第一设备进入可连接状态或进入唤醒状态后立即向第二设备发送第一消息。
在一些实施例中,第一设备变化为可连接状态或进入唤醒状态时向第二设备发送第一消息可以是指,第一设备从其他状态(如前文提及的第二状态,包括不可连接状态、休眠状态)切换为可连接状态一段时间后或切换为唤醒状态一段时间后向第二设备发送第一消息,或者说,第一设备进入可连接状态一段时间后或进入唤醒状态一段时间后向第二设备发送第一消息。例如,第一设备进入可连接状态或进入唤醒状态10s后向第二设备发送第一消息,或者,第一设备进入可连接状态或进入唤醒状态30s后向第二设备发送第一消息等。
在一些实施例中,第一消息可以理解为提醒(check in)消息,其可以用于提醒第二设备与第一设备建立连接。
本申请实施例对第一消息用于指示第二设备与第一设备建立连接的实现方式不做限定,下面示例性给出两种实现方式。
作为一种实现方式,第一消息可以理解为通知消息,其可以用于向第二设备通知第一设备处于可连接状态或唤醒状态,以便第二设备向第一设备发起连接请求,从而建立连接。或者说,第二设备接收到第一设备发送的第一消息之后,可以进行下一步的业务,比如与第一设备建立连接,以便恢复与第一设备之间的订阅关系等。
本申请实施例对第一消息指示第一设备处于可连接状态或唤醒状态的实现方式不做具体限定。例如,本申请实施例可以利用第一消息的消息类型来指示第一消息为check in消息,从而指示第一设备处于可连接状态或唤醒状态。或者,本申请实施例可以在第一消息中增加第一字段,第一字段的取值用于指示第一设备处于可连接状态或唤醒状态等。
作为另一种实现方式,第一消息可以用于向第二设备发起连接请求,即第一消息可以是连接请求消息,以便第二设备对第一设备发起的连接请求进行响应,从而建立连接。
本申请实施例可以在第一设备处注册第二设备,以便第一设备变化为可连接状态或进入唤醒状态时可以针对性地与注册成功的第二设备建立连接。也就是说,第一设备变化为可连接状态或进入唤醒状态时,可以根据设备注册的情况,选择与注册成功的第二设备建立连接。如此一来,本申请实施例有利于避免不必要的连接的建立,从而有助于节省资源。
下面对在第一设备处注册第二设备进行详细介绍。首先,对注册请求包含的信息进行介绍。
如前文所述,注册请求可以用于请求对第二设备进行注册,因此,注册请求中可以包含与待注册设备(第二设备)相关的信息。不过本申请实施例并不限定于此,注册请求中还可以包含其他与本次注册相关的信息,例如,包含发送注册请求的设备的权限信息、包含第一设备向第二设备发送的第一消息的相关信息等。
在一些实施例中,注册请求可以用于指示以下信息中的一种或多种:第二设备的身份信息;第二设备在第一设备处的访问控制主体信息;第一消息关联的加密信息;验证码信息;以及第一优先级信息。下面对这些信息分别进行介绍。
本申请实施例中,指示第二设备的身份信息的实现方式有多种,本申请实施例对此并不限定。作为一种实现方式,第二设备的身份信息可以利用第二设备的设备标识(设备ID)来指示。需要说明的是,第二设备的设备ID可以理解为是第二设备在生态内的唯一标识,例如第二设备在一个网络(fabric)中的唯一标识。作为另一种实现方式,第二设备的身份信息可以利用第二设备的设备ID的别称来指示。
第二设备的设备ID的别称可以与第二设备的设备ID具有绑定关系,如此一来,可以通过第二设备的设备ID的别称识别第二设备的身份,且不暴露第二设备的设备ID(即,能够隐藏第二设备的设备ID)。
以第二设备的身份信息利用第二设备的设备ID指示为例,在一些实施例中,注册请求中携带的第二设备的设备ID可以与发送注册请求的设备的设备ID相同,也就是说,该注册请求可以是第二设备发送的。在一些实施例中,注册请求中携带的第二设备的设备ID可以与发送注册请求的设备的设备ID不同,也就是说,该注册请求可以是第二设备之外的其他设备发送的,比如,可以是第一设备的管理员设备发送的。
本申请实施例对指示第二设备的身份信息的字段的名称不做限定,例如,可以用字段RegisterClientID来指示,或者可以用字段ClientID来指示等。
第二设备在第一设备处的访问控制主体信息可以用于确定第二设备是否有权限与第一设备上的目标进行交互,或者说,第二设备在第一设备处的访问控制主体信息可以用于确定第二设备对第一设备上的资源具有什么样的权限。
在一些实施例中,第二设备在第一设备处的访问控制主体信息可以是指,第二设备在第一设备的访问控制列表(access control list,ACL)中的主体(subject)标识。或者说,第二设备在第一设备处的访问控制主体信息可以记录在第一设备的ACL中,例如,记录在第一设备的ACL中的subject字段中。
ACL中可以包含对策略进行编码的访问控制项(access control entry,ACE)。访问控制系统可以根据第一设备的ACL包含的ACE中的规则检查和验证所有尝试的访问。每条ACE都可以在第一设备上编码一个单独的权限授予,并由访问控制权限授予算法使用该ACE以确定一个主体(subject)是否有权限与节点上的目标(target)进行交互。也就是说,第二设备在第一设备处的访问控制主体信息可以记录在第一设备的一条ACE中,该ACE中的subject字段所指示的内容即为第二设备在第一设备处的访问控制主体信息。
在一些实施例中,ACE中的subject字段可以包括设备的设备ID。也就是说,第二设备在第一设备处的访问控制主体信息可以利用第二设备的设备ID来指示。
在一些实施例中,ACE中的subject字段可以包括设备的组ID。也就是说,第二设备在第一设备处的访问控制主体信息可以利用第二设备的组ID来指示。本申请实施例对第二设备的组ID的指示方式不做具体限定,示例性地,第二设备的组ID可以包括第二设备对应的CASE认证标签(CASE authenticated tag,CAT)。需要说明的是,第二设备可以对应一个或多个CAT,本申请实施例提及的第二设备的组ID可以是第二设备对应的一个或多个CAT中的任意一个或多个。
本申请实施例对指示第二设备在第一设备处的访问控制主体信息的字段的名称不做限定,例如,可以用字段AccessSubject来指示,或者可以用字段MonitoredSubject来指示等。
在一些实施例中,用于指示第二设备在第一设备处的访问控制主体信息的内容与用于指示第二设备的身份信息的内容可以相同,例如,两者均可以采用第二设备的设备ID来指示。在一些实施例中,用于指示第二设备在第一设备处的访问控制主体信息的内容与用于指示第二设备的身份信息的内容可以不同,例如,可以采用第二设备的组ID(如,第二设备对应的CAT)来指示第二设备在第一设备处的访问控制主体信息,采用第二设备的设备ID来指示第二设备的身份信息。
在一些实施例中,第一消息关联的加密信息可以用于对第一消息进行加密,例如,该加密信息可以是密钥。如此一来,第二设备在第一设备处注册成功后,第一设备变化为可连接状态或进入唤醒状态时,便可以向第二设备发送使用该加密信息进行加密的第一消息。
在一些实施例中,该加密信息可以是对称密钥。如此一来,第二设备后续接收第一设备发送的第一消息后,便可以使用相同的加密信息对第一消息进行解密。
在一些实施例中,该加密信息可以是非对称密钥,例如,该加密信息可以是密钥对中的公钥。如此一来,第二设备后续接收第一设备发送的第一消息后,便可以使用该公钥对应的私钥对第一消息进行解密。
本申请实施例对第一消息关联的加密信息的指示字段不做具体限定,例如,可以利用字段EncryptedKey来指示第一消息关联的加密信息,当然也可以利用其他字段(如KeyInfo)来指示第一消息关联的加密信息等。
注册请求中携带的验证码信息可以用于验证发送注册请求的设备的权限(注册权限)。也就是说,该验证码信息可以用于确定发送注册请求的设备是否有权限在第一设备处注册第二设备。
本申请实施例对上述验证码信息的实现方式不做限定,作为一种实现方式,验证码信息可以包括发送注册请求的设备的身份码(pincode),第一设备能够根据该身份码对应确定发送注册请求的设备是否有权限注册第二设备。作为另一种实现方式,验证码信息可以包括在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息,如此一来,第一设备可以根据注册请求中携带的验证码信息与在本次
注册之前第一设备向第二设备发送第一消息时使用的加密信息是否相同来确定发送注册请求的设备是否有权限注册第二设备。例如,如果注册请求中携带的验证码信息与在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息相同,则第一设备可以确定发送注册请求的设备有权限注册第二设备;如果注册请求中携带的验证码信息与在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息不同,则第一设备可以确定发送注册请求的设备没有权限注册第二设备。
需要说明的是,上述验证码信息包括在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息时,该验证码信息可以与注册请求中携带的第一消息关联的加密信息相同,也可以不同。例如,本次注册请求用于请求修改第一消息关联的加密信息的情况下,验证码信息与注册请求中携带的第一消息关联的加密信息可以不同。或者,本次注册请求并不修改第一消息关联的加密信息的情况下,验证码信息与注册请求中携带的第一消息关联的加密信息可以相同。
在一些实施例中,第一设备也可以存储验证码信息,以便第一设备比较存储的验证码信息与注册请求中携带的验证码信息,从而确定发送注册请求的设备是否有权限注册第二设备。
在一些实施例中,如果发送注册请求的设备具有第一设备的管理员权限,则注册请求中可以不携带验证码信息,也就是说,对具有第一设备的管理员权限的设备而言,发送注册请求时该验证码信息是非必要的。
在一些实施例中,如果发送注册请求的设备不具有第一设备的管理员权限,则注册请求中需要携带验证码信息,以便第一设备确定发送注册请求的设备的注册权限。
在一些实施例中,上述验证码信息可以保证不具有第一设备的管理员权限的设备仅能修改、更新或删除自己的注册信息,而不能修改、更新或删除其他设备的注册信息。
本申请实施例对验证码信息的指示字段不做具体限定,例如,可以利用字段PinCode来指示验证码信息,当然也可以利用其他字段(如VerificationInfo)来指示验证码信息等。
本申请实施例中,第一优先级信息可以用于指示第二设备请求的发送第一消息的优先级。例如,第二设备想让第一设备优先给第二设备发送第一消息,则第一优先级信息指示的优先级可以较高。
在一些实施例中,第一优先级信息可以省略。这种情况下,第一设备可以认为,第二设备对接收第一消息的优先级没有要求。这种情况下,在一些实施例中,第一设备可以为第二设备设置较低的优先级。
在一些实施例中,该注册请求中携带第一优先级信息之后,并不代表最终第一设备会按照该第一优先级信息向第二设备发送第一消息。例如,有多个待注册设备对应的第一优先级信息相同的情况下,第一设备可以确定向各个注册成功的设备发送第一消息的优先级。作为一个示例,第一设备可以根据第二优先级信息(关于第二优先级信息的相关介绍可以参见后文)向注册成功的设备(如第二设备)发送第一消息。
本申请实施例对第一优先级信息的指示字段不做具体限定,例如,可以利用字段PriorityLevel来指示第一优先级信息,也可以利用其他字段(如PriorityInfo)来指示第一优先级信息等。
本申请实施例中,注册请求中可以包括上述信息中的一种或多种。作为一个示例,注册请求可以包括第二设备的身份信息、第二设备在第一设备处的访问控制主体信息和验证码信息,例如,注册请求包括第二设备的设备ID、第二设备的组ID和验证码信息。作为另一个示例,注册请求可以包括第二设备的身份信息、第二设备在第一设备处的访问控制主体信息、第一消息关联的加密信息。作为又一个示例,注册请求可以包括第二设备的身份信息、第二设备在第一设备处的访问控制主体信息、第一消息关联的加密信息、验证码信息以及第一优先级信息等。
在一些实施例中,注册请求中除携带上述列举的信息之外,还可以携带其他信息,本申请实施例对此并不限定。例如,注册请求中可以携带发送注册请求的设备在第一设备处的访问控制主体信息,以便于第一设备确定发送注册请求的设备对第一设备的访问权限,例如,确定发送注册请求的设备是否具有第一设备的管理员权限。
在对注册请求包含的信息进行介绍的基础上,下文对在第一设备处注册第二设备的流程进行介绍。
图3是本申请一实施例提供的在第一设备处注册第二设备的流程示意图。如图3所示,该注册过程可以包括步骤S310和步骤S320。
在步骤S310,第一设备接收注册请求。该注册请求用于注册第二设备。
在图3的示例中,第一设备接收的注册请求可以是第二设备发送的,也可以是除第二设备之外的第三设备发送的。以该注册请求是第三设备发送的为例,该注册请求可以是具有第一设备的管理员权限的设备发送的,或者,该注册请求也可以是其他不具有第一设备的管理员权限的设备(比如,某个订阅第一设备的设备、具有第一设备的操作权限的设备等)发送的。
该注册请求中可以携带一种或多种信息,关于注册请求中可以携带的信息的内容可以参见前文的介绍,此处不再赘述。
在步骤S320,第一设备根据第一设备与第二设备之间的订阅关系,确定第二设备的注册策略。
在一些实施例中,第一设备接收注册请求后,在注册第二设备之前可以先确定第一设备与第二设备之间是否存在订阅关系,以便根据第一设备与第二设备之间的订阅关系确定第二设备的注册策略。
在一些实施例中,第一设备确定第一设备与第二设备之间是否存在订阅关系的目的是确认是否允许注册第二设备。也就是说,第二设备的注册策略可以包括允许注册第二设备和不允许(拒绝)注册第二设备,第一设备可以根据第一设备与第二设备之间的订阅关系确定是否允许注册第二设备。不过本申请实施例并不限定于此,在一些实施例中,第二设备的注册策略可以包括允许注册第二设备的哪些信息(比如,允许注册第二设备的身份信息、第二设备在第一设备处的访问控制主体信息等),不允许注册第二设备的哪些信息(比如,不允许注册第一优先级信息等)。
作为一种实现方式,如果第一设备确定第一设备与第二设备之间存在订阅关系,则第一设备可以允许注册第二设备;如果第一设备确定第一设备与第二设备之间不存在订阅关系,则第一设备可以不允许(拒绝)注册第二设备。第一设备根据第一设备与第二设备之间是否存在订阅关系来确认是否允许注册第二设备,一方面有利于保证第一设备与第二设备建立的连接是有用的,可以避免不必要的连接;另一方面有利于避免第一设备后续变化为可连接状态或进入唤醒状态后操作混乱。下面对第一设备如何根据第一设备与第二设备之间是否存在订阅关系来避免第一设备后续变化为可连接状态或进入唤醒状态后操作混乱进行介绍。
在一些实施例中,可以理解为,第一设备是否允许注册第二设备的目的是避免第一设备后续变化为可连接状态或进入唤醒状态后操作混乱,或者说,第一设备确定第一设备与第二设备之间是否存在订阅关系的目的是避免第一设备后续变化为可连接状态或进入唤醒状态后操作混乱。例如,第一设备确定第一设备与第二设备之间是否存在订阅关系的目的是确认第一设备变化为可连接状态或进入唤醒状态后下一次应该进入长休眠周期还是进入短休眠周期。
作为一种实现方式,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或,如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
或者说,如果第一设备允许注册第二设备,则第一设备变化为可连接状态或进入唤醒状态后,后续可以进入长休眠周期;如果第一设备不允许注册第二设备,则第一设备变化为可连接状态或进入唤醒状态后,后续可以进入短休眠周期(不可以进入长休眠周期),以保证第一设备可以及时被连接。
换句话说,如果第一设备确定第一设备与第二设备之间存在订阅关系,则第一设备变化为可连接状态或进入唤醒状态后,后续可以进入长休眠周期;如果第一设备确定第一设备与第二设备之间不存在订阅关系,则第一设备变化为可连接状态或进入唤醒状态后,后续可以进入短休眠周期。
在一些实施例中,本申请实施例提及的第一设备确定第一设备与第二设备之间是否存在订阅关系是指,第一设备确定第一设备与第二设备之间是否存在存活的订阅关系,或者说,第一设备确定当前第一设备与第二设备之间是否存在订阅关系。
本申请实施例对第一设备确定第一设备与第二设备之间是否存在订阅关系的实现方式不做具体限定,下面示例性给出两种实现方式。
实现方式1:
在该实现方式中,第一设备可以通过检查与第一设备相关联的订阅关系来确认第二设备是否有订阅第一设备,即确认第一设备与第二设备之间是否存在订阅关系。
应该理解,一般情况下,只要有设备(例如,第二设备)订阅了第一设备,则第一设备处可以保存对应的订阅关系。例如,第一设备处可以保存哪个设备订阅了第一设备的哪些资源以及订阅的其他参数(如,最大通知消息发送间隔、最小通知消息发送间隔等)。如此一来,第一设备便可以确定哪些设备与第一设备之间存在订阅关系。
例如,设备A、设备B和设备C均订阅了第一设备,则第一设备可以保存设备A、设备B和设备C分别对应的订阅关系,从而第一设备也可以确定设备A、设备B和设备C与第一设备之间均存在订阅关系。如此一来,如果第一设备需要确定设备B与第一设备之间是否存在订阅关系时,便可以根据该订阅关系进行检查,以便确定设备B与第一设备之间存在订阅关系;或者,如果第一设备需要确定设备D与第一设备之间是否存在订阅关系时,同样可以根据该订阅关系检查,以便确定设备D与第一设备之间不存在订阅关系。
第一设备通过检查与第一设备相关联的订阅关系来确定第一设备与第二设备之间是否存在订阅关系,流程少,实现简单。
实现方式2:
在该实现方式中,第一设备可以通过预注册的订阅设备的信息来确认第二设备是否有订阅第一设
备,即确认第一设备与第二设备之间是否存在订阅关系。
下面结合图4对实现方式2进行介绍。图4所示的方法是站在第一设备、订阅设备与发送注册请求的设备进行交互的角度进行介绍的。图4所示的方法可以包括步骤S410至步骤S440,下面对这些步骤进行介绍。
在步骤S410,第一设备接收订阅设备发送的订阅请求。该订阅请求用于请求订阅第一设备的资源。
该订阅设备可以是任意能够订阅第一设备的资源的设备,例如,订阅设备可以是第一设备的代理设备,或者可以是具有第一设备的视图(view)权限的设备等。作为一个示例,订阅设备可以包括本申请实施例提及的第二设备,也可以包括第二设备之外的其他设备。作为另一个示例,订阅设备可以不包括本申请实施例提及的第二设备。
在步骤S420,第一设备根据订阅设备发送的订阅请求,注册订阅设备的身份信息。
在一些实施例中,第一设备注册订阅设备的身份信息可以理解为,第一设备可以进行一次预注册,该预注册用于注册订阅设备的身份信息,以便后续根据预注册结果确定第一设备与第二设备之间是否存在订阅关系。
作为一种实现方式,第一设备根据订阅设备发送的订阅请求,注册订阅设备的身份信息可以包括:第一设备根据订阅请求的发送方的设备ID(订阅设备的设备ID),对订阅设备进行预注册。例如,第一设备可以仅注册订阅设备的设备ID,以指示该设备ID对应的设备订阅了第一设备的资源。
作为另一种实现方式,第一设备根据订阅设备发送的订阅请求,注册订阅设备的身份信息可以包括:第一设备根据订阅请求的发送方的设备ID(订阅设备的设备ID)和订阅请求中携带的其他参数,对订阅设备进行预注册。例如,第一设备可以注册订阅设备的设备ID、订阅设备订阅的资源、订阅关联的最大通知消息发送间隔等。
本申请实施例对第一设备存储预注册的订阅设备的身份信息的方式不做限定。示例性地,第一设备可以将订阅设备的身份信息预存储至第一消息关联的设备(如第二设备)的注册信息的存储位置处,关于第一消息关联的设备的注册信息的相关内容可以参见后文提及的用于注册第二设备的注册信息的相关内容。需要说明的是,此处提及的第一消息关联的设备可以是指,该设备注册成功后第一设备可以向该设备发送第一消息。作为一个示例,第一设备可以将订阅设备的设备ID写入第一消息关联的设备的注册信息中用于指示第一消息关联的设备的身份信息的字段(如本申请提及的RegisterClientID字段)中。下面给出一个具体示例。
第一设备对订阅设备进行预注册可以是指,第一设备将订阅设备的设备ID写入到注册客户(RegisterClient)属性中,该属性用于存储在第一设备处注册的设备(如第二设备)的设备ID。作为一个示例,该属性可以存储在第一设备的管理集群(management cluster)中,如存储在ICD的ICDmanagement cluster中。
应该理解,第一设备作为订阅关系中的被订阅者,其是可以知道订阅关系的,但是订阅关系的保存和维护都是第一设备自己管理的。而在实现方式2中,第一设备作为被订阅者,在订阅的过程中就可以在注册客户(RegisterClient)属性做个记录,那么后续进行第二设备的注册时,便可以直接查看注册客户(RegisterClient)属性的记录。考虑到第二设备的注册本身也是需要对注册客户(RegisterClient)属性进行操作,那么订阅过程中的预注册就不需要再去检查其他的与订阅管理相关的资源了,直接查看注册客户(RegisterClient)属性即可,从而可以提升效率。
不过本申请实施例并不限定于此,在一些实施例中,第一设备可以将订阅设备的身份信息预存储至其他存储位置,后续从该存储位置读取相关信息即可。
在一些实施例中,第一设备在根据订阅请求对订阅设备的身份信息进行预注册前,第一设备还可以对订阅请求进行鉴权。在订阅请求鉴权成功的情况下,第一设备可以根据订阅请求对订阅设备的身份信息进行预注册。
在步骤S430,第一设备接收注册请求。该注册请求用于注册第二设备。
关于步骤S430的相关介绍,可以参见前文对步骤S210或步骤S310的相关介绍,为了简洁,此处不再赘述。
在步骤S440,第一设备根据第一设备与第二设备之间的订阅关系,确定第二设备的注册策略。
例如,第一设备可以根据第一设备与第二设备之间的订阅关系,确定是否允许注册第二设备。
作为一种实现方式,第一设备可以根据步骤S420的预注册结果,确定第二设备的注册策略。例如,可以根据步骤S420的预注册结果,确定第一设备与第二设备之间是否存在订阅关系,以便在存在订阅关系的情况下允许注册第二设备,或者在不存在订阅关系的情况下不允许注册第二设备。也就是说,第一设备可以根据注册的订阅设备的身份信息,确定第一设备与第二设备之间是否存在订阅关系,从而确定是否允许注册第二设备。
在一些实施例中,第一设备可以根据注册的订阅设备的身份信息,确定第一设备与第二设备之间是否存在订阅关系可以包括:如果第一设备注册的订阅设备的身份信息包括第二设备的身份信息,则第一设备确定第一设备与第二设备之间存在订阅关系;和/或,如果第一设备注册的订阅设备的身份信息不包括第二设备的身份信息,则第一设备确定第一设备与第二设备之间不存在订阅关系。
例如,第一设备预注册的订阅设备的身份信息包括设备A、设备B和设备C,如果设备B与第二设备为同一设备(如设备ID相同),则第一设备可以确定第一设备与第二设备之间存在订阅关系;如果设备A、设备B和设备C与第二设备均是不同的设备(如设备ID均不相同),则第一设备可以确定第一设备与第二设备之间不存在订阅关系。
不过本申请实施例并不限定于上述实现方式,在一些实施例中,即使第一设备对订阅设备的身份信息进行了预注册,在确定与第二设备之间是否存在订阅关系时,仍然可以采用实现方式1的方法进行。也就是说,在一些实施例中,即使第一设备对订阅设备的身份信息进行了预注册,也可以不利用预注册的信息来确定第一设备与第二设备之间是否存在订阅关系。
在一些实施例中,第一设备与第二设备之间存在订阅关系的情况下,第一设备可以允许注册第二设备。在一些实施例中,第一设备与第二设备之间不存在订阅关系的情况下,第一设备可以不允许(拒绝)注册第二设备。
继续参见图4,在一些实施例中,图4的方法还可以包括步骤S425。在步骤S425,第一设备向订阅设备发送订阅成功通知消息。
第一设备能够通过预注册的订阅设备的信息更方便地确定第一设备与第二设备之间是否存在订阅关系。
图5是本申请另一实施例提供的在第一设备处注册第二设备的流程示意图。如图5所示,该注册过程可以包括步骤S510和步骤S520。
在步骤S510,第一设备接收注册请求。该注册请求用于注册第二设备。
在图5的示例中,第一设备接收的注册请求可以是第二设备发送的,也可以是除第二设备之外的第三设备发送的。以该注册请求是第三设备发送的为例,该注册请求可以是具有第一设备的管理员权限的设备发送的,或者,该注册请求也可以是其他不具有第一设备的管理员权限的设备(比如,某个订阅第一设备的设备、具有第一设备的操作权限的设备等)发送的。
该注册请求中可以携带一种或多种信息,关于注册请求中可以携带的信息的内容可以参见前文的介绍,此处不再赘述。
在步骤S520,第一设备确定是否有存储空间来存储用于注册第二设备的注册信息。或者说,第一设备确定是否有足够存储资源来保存用于注册第二设备的注册信息。
为了便于理解,下面先对用于注册第二设备的注册信息进行介绍。需要说明的是,前文提及的第一消息关联的设备的注册信息同样适用于下文描述的注册信息的内容。下文的注册信息可以用于注册想要接收第一消息的设备,比如用于注册第二设备。下面以注册信息用于注册第二设备为例进行介绍。
在一些实施例中,用于注册第二设备的注册信息可以包括以下信息中的一种或多种:第二设备的身份信息,第二设备在第一设备处的访问控制主体信息,第一消息关联的加密信息,以及第二优先级信息。
关于第二设备的身份信息、第二设备在第一设备处的访问控制主体信息、第一消息关联的加密信息的相关介绍可以参考前文介绍注册请求中携带的信息中的相关描述,为了简洁,此处不再赘述。
本申请实施例中,第二优先级信息可以用于指示第一设备向第二设备发送第一消息的优先级。例如,第一设备确定优先向第二设备发送第一消息,则第二优先级信息指示的优先级可以较高。
在一些实施例中,第二优先级信息是根据注册请求中携带的第一优先级信息确定的。例如,第二优先级信息可以与第一优先级信息相同。不过本申请实施例并不限定于此,在一些实施例中,第二优先级信息可以与第一优先级信息不同。例如,有多个待注册设备(包括第二设备)对应的第一优先级信息相同的情况下,第一设备可以自己确定第二设备对应的第二优先级信息。
在一些实施例中,在第一优先级信息省略的情况下,第一设备可以自己确定(分配)第二设备对应的第二优先级信息,或者可以省略第二优先级信息。
在一些实施例中,第一设备可以保存上述用于注册第二设备的注册信息,以便第一设备变化为可连接状态或下次进入唤醒状态后,根据该注册信息向第二设备发送第一消息。
下面对步骤S520进行介绍。
在一些实施例中,如果第一设备确定有存储空间来存储用于注册第二设备的注册信息,或者说,如果第一设备确定有足够存储资源来保存用于注册第二设备的注册信息,则第一设备可以允许注册第二设备。在一些实施例中,如果第一设备确定没有存储空间来存储用于注册第二设备的注册信息,或者说,如果第一设备确定没有足够的存储资源来保存用于注册第二设备的注册信息,则第一设备可以不允许
(拒绝)注册第二设备。
应该理解,一般情况下,第一设备会分配一定的存储空间来存储第一消息关联的设备的注册信息。作为一个示例,第一设备可以分配较小的存储空间来存储第一消息关联的设备的注册信息,比如,分配的存储空间最多能存储4个设备的注册信息,那么,在分配的存储空间不足的情况下,第一设备便可以拒绝注册第二设备。第一设备分配较小的存储空间来存储第一消息关联的设备的注册信息,一方面有利于保证注册成功的设备后续都能与第一设备建立连接,另一方面有利于节省存储资源。作为另一个示例,第一设备可以分配较大的存储空间来存储第一消息关联的设备的注册信息,但是,第一设备处已经存储了较多设备的注册信息,那么,第一设备仍然需要确定剩余的存储空间是否足够用于存储第二设备的注册信息,在剩余的存储空间不足的情况下,第一设备便可以拒绝注册第二设备。
图6是本申请又一实施例提供的在第一设备处注册第二设备的流程示意图。如图6所示,该注册过程可以包括步骤S610和步骤S620。
在步骤S610,第一设备接收注册请求。该注册请求用于注册第二设备。
在图6的示例中,第一设备接收的注册请求可以是第二设备发送的,也可以是除第二设备之外的第三设备发送的。以该注册请求是第三设备发送的为例,该注册请求可以是具有第一设备的管理员权限的设备发送的,或者,该注册请求也可以是其他不具有第一设备的管理员权限的设备(比如,某个订阅第一设备的设备、具有第一设备的操作权限的设备等)发送的。
该注册请求中可以携带一种或多种信息,关于注册请求中可以携带的信息的内容可以参见前文的介绍,此处不再赘述。
在步骤S620,第一设备根据发送注册请求的设备的权限,注册第二设备。
作为一种实现方式,如果发送注册请求的设备具有第一设备的管理员权限,则第一设备可以基于该设备发送的注册请求来注册第二设备。
例如,发送注册请求的设备是第三设备,第三设备是第一设备的管理员设备,则第一设备接收第三设备发送的注册请求后,确认第三设备是第一设备的管理员设备后,便直接对注册请求中携带的信息进行注册,以便于后续第一设备变化为可连接状态或进入唤醒状态时向注册的设备发送第一消息。
作为另一种实现方式,如果发送注册请求的设备不具有第一设备的管理员权限,则第一设备可以在对发送注册请求的设备的注册权限进行验证后,基于验证结果确定是否允许注册第二设备。
本申请实施例对第一设备验证发送注册请求的设备的注册权限的实现方式不做具体限定。作为一种实现方式,第一设备可以通过确定注册请求中的验证码信息与第一设备保存的验证码信息是否匹配(例如,是否一致)来确定发送注册请求的设备的注册权限。例如,如果注册请求中的验证码信息与第一设备保存的验证码信息匹配,则第一设备可以确定发送注册请求的设备是具有注册权限的,因此,第一设备可以基于该注册请求来注册第二设备。或者,如果注册请求中的验证码信息与第一设备保存的验证码信息不匹配,则第一设备可以确定发送注册请求的设备是不具有注册权限的,因此,第一设备可以拒绝注册第二设备。
也就是说,如果发送注册请求的设备不具有第一设备的管理员权限,则第一设备可以确定注册请求中的验证码信息与第一设备保存的验证码信息是否匹配;响应于注册请求中的验证码信息与第一设备保存的验证码信息匹配,第一设备可以基于注册请求来注册第二设备。
在一些实施例中,第一设备保存的验证码信息可以包括在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息。如此一来,第一设备可以确定注册请求中携带的验证码信息与在本次注册之前第一设备向第二设备发送第一消息时使用的加密信息是否一致来确定发送注册请求的设备是否具有注册权限。
本申请实施例对确定发送注册请求的设备是否具有第一设备的管理员权限的实现方式不做具体限定。作为一种实现方式,第一设备可以通过发送注册请求的设备在第一设备处的访问控制主体信息来确定该发送注册请求的设备是否具有第一设备的管理员权限。例如,发送注册请求的设备在第一设备处的访问控制主体信息用于指示发送注册请求的设备具有第一设备的管理员权限,则第一设备确定发送注册请求的设备具有第一设备的管理员权限;或者,发送注册请求的设备在第一设备处的访问控制主体信息用于指示发送注册请求的设备不具有第一设备的管理员权限(比如,发送注册请求的设备在第一设备处的访问控制主体信息用于指示发送注册请求的设备具有第一设备的视图权限),则第一设备确定发送注册请求的设备不具有第一设备的管理员权限。作为另一种实现方式,第一设备可以直接利用发送注册请求的设备的设备ID确定其是否具有第一设备的管理员权限。
在一些实施例中,在第一设备处的首次注册可以是具有管理员权限的设备在第一设备处进行的。后续的注册可以是具有管理员权限的设备进行的,也可以是不具有管理员权限的设备进行的。作为一个示例,具有管理员权限的设备在第一设备处首次进行注册后,后续可以通过某种方式将验证码信息发送给
不具有管理员权限的设备,那么该不具有管理员权限的设备便可以利用验证码信息来修改、更新或删除注册信息。
需要说明的是,本申请在不同实施例中提及的在第一设备处注册第二设备的方法可以进行任意结合,例如,图3、图5和图6所示的注册方法中的步骤可以任意结合。作为一个示例,注册流程可以包括步骤S310至步骤S330,以及步骤S520。作为另一个示例,注册流程可以包括步骤S310至步骤S330,以及步骤S620。作为又一个示例,注册流程可以包括步骤S310至步骤S330,步骤S520,以及步骤S620等。
还需要说明的是,不同实施例提及的注册方法的流程进行任意结合时,不同步骤之间的执行顺序并不受到限定。例如,注册流程包括步骤S310至步骤S330,以及步骤S520的情况下,步骤S520可以在步骤S320之前执行,也可以在步骤S320之后执行,也可以与步骤S320同时执行。或者,注册流程包括步骤S310至步骤S330,步骤S520,以及步骤S620的情况下,步骤S620可以在步骤S320或步骤S520之前执行,也可以在步骤S320或步骤S520之后执行,也可以与步骤S320和步骤S520同时执行等。
在一些实施例中,第二设备在第一设备处注册成功时,第一设备可以向发送注册请求的设备发送注册成功应答消息。
在一些实施例中,第二设备在第一设备处注册失败时,第一设备可以向发送注册请求的设备发送注册失败应答消息。
在一些实施例中,第二设备在第一设备处注册成功且第一设备向第二设备发送第一消息之后,第二设备可以基于第一消息与第一设备建立连接,并订阅(如重新订阅)第一设备。
作为一种实现方式,本申请的实施例中,第二设备在第一设备处注册成功且第一设备向第二设备发送第一消息之后,本申请实施例还可以包括如下步骤:第一设备基于第二设备发送的连接请求与第二设备建立连接;第二设备向第一设备发送订阅请求,该订阅请求用于订阅第一设备的资源。
在一些实施例中,第二设备向第一设备发送的连接请求是第二设备在根据第一消息确定需要和第一设备建立连接的情况下发送的。例如,第二设备接收第一消息后,确定其需要和第一设备建立连接(比如,需要更新订阅数据),则第二设备可以向第一设备发送连接请求。或者,第二设备接收第一消息后,确定其不需要和第一设备建立连接(比如,订阅数据未更新),则第二设备可以不向第一设备发送连接请求。
为了便于理解,下文结合几个实施例对本申请实施例的方法的流程进行示意性介绍。需要说明的是,下文实施例中未详细介绍的内容可以参见前文的介绍,比如注册请求包含的具体内容。还需要说明的是,下文实施例仅用于示例,并不用于对本申请的技术方案造成限定。
实施例一:
图7是本申请又一实施例提供的在第一设备处注册第二设备的流程示意图。图7所示的方法可以包括步骤S701至步骤S707。
在步骤S701,第一设备接收注册请求。该注册请求用于注册第二设备。
在一些实施例中,第二设备注册成功后,第一设备在变化为可连接状态或进入唤醒周期后,可以向注册成功的第二设备发送通知消息,以便第二设备根据该通知消息进行下一步业务,比如恢复与第一设备之间的连接,恢复与第一设备之间的订阅关系等。
在一些实施例中,该注册请求中可以携带以下信息中的一种或多种:第二设备的身份信息,第二设备在第一设备处的访问控制主体信息,第一消息关联的加密信息,验证码信息,以及第一优先级信息。
该注册请求可以是第二设备发送的,也可以是第二设备之外的第三设备(比如,第一设备的管理员设备)发送的。
在步骤S702,第一设备确定第一设备与第二设备之间是否存在订阅关系。
例如,第一设备确定第一设备与第二设备之间是否存在存活的订阅关系。作为一种实现方式,第一设备可以根据保存的订阅关系表,确定第一设备与第二设备之间是否存在存活的订阅关系。
在步骤S703,第一设备确定是否有存储空间来存储用于注册第二设备的注册信息。
例如,第一设备可以确定是否有足够的存储资源来保存本次注册信息。第一设备一般会为存储注册信息分配一定的存储空间,例如为存储注册信息分配存储4个设备的注册信息的空间,那么,第一设备需要确定是否有足够的存储空间来存储本次注册请求对应的注册信息。
在步骤S704,第一设备确定发送注册请求的设备的注册权限。
在一些实施例中,如果第一设备确定发送注册请求的设备具有第一设备的管理员权限,则第一设备执行步骤S705。
在一些实施例中,如果第一设备确定发送注册请求的设备不具有第一设备的管理员权限,则第一设
备执行步骤S706。
在步骤S705,第一设备基于注册请求来注册第二设备。
例如,第一设备基于注册请求中携带的信息,修改、更新或删除用于注册第二设备的注册信息。
在步骤S706,第一设备确定注册请求中的验证码信息与第一设备保存的验证码信息是否匹配。
在一些实施例中,如果注册请求中的验证码信息与第一设备保存的验证码信息匹配,则第一设备执行步骤S705。
在一些实施例中,如果注册请求中的验证码信息与第一设备保存的验证码信息不匹配,则第一设备拒绝注册第二设备。
在步骤S707,第一设备向发送注册请求的设备发送应答消息。
在一些实施例中,第一设备可以向发送注册请求的设备发送成功应答消息,以指示第二设备注册成功。例如,第一设备在执行步骤S705之后,可以向发送注册请求的设备发送成功应答消息。
在一些实施例中,第一设备可以向发送注册请求的设备发送失败应答消息,以指示第二设备注册失败。例如,第一设备在步骤S702确定第一设备与第二设备之间不存在订阅关系的情况下,可以向发送注册请求的设备发送失败应答消息。又例如,第一设备在步骤S703确定没有存储空间来存储用于注册第二设备的注册信息的情况下,可以向发送注册请求的设备发送失败应答消息。再例如,第一设备在步骤S706确定注册请求中的验证码信息与第一设备保存的验证码信息不匹配的情况下,可以向发送注册请求的设备发送失败应答消息。
实施例二:
图8是本申请又一实施例提供的在第一设备处注册第二设备的流程示意图。图8所示的方法可以包括步骤S801至步骤S810。
在步骤S801,第一设备接收订阅设备发送的订阅请求。
在步骤S802,第一设备注册订阅设备的身份信息。
或者说,第一设备可以进行预注册。例如,第一设备可以预注册订阅设备的身份信息,将订阅设备的设备ID写入字段RegisterClientID。
在步骤S803,第一设备向订阅设备发送订阅成功通知消息。
在步骤S804,第一设备接收注册请求。该注册请求用于注册第二设备。
在一些实施例中,第二设备注册成功后,第一设备在变化为可连接状态或进入唤醒周期后,可以向注册成功的第二设备发送通知消息,以便第二设备根据该通知消息进行下一步业务,比如恢复与第一设备之间的连接,恢复与第一设备之间的订阅关系等。
在一些实施例中,该注册请求中可以携带以下信息中的一种或多种:第二设备的身份信息,第二设备在第一设备处的访问控制主体信息,第一消息关联的加密信息,验证码信息,以及第一优先级信息。
该注册请求可以是第二设备发送的,也可以是第二设备之外的第三设备(比如,第一设备的管理员设备)发送的。
在步骤S805,第一设备确定第一设备与第二设备之间是否存在订阅关系。
例如,第一设备确定第一设备与第二设备之间是否存在存活的订阅关系。作为一种实现方式,第一设备可以根据步骤S802中的预注册结果确定第一设备与第二设备之间是否存在存活的订阅关系。作为另一种实现方式,第一设备可以根据保存的订阅关系表,确定第一设备与第二设备之间是否存在存活的订阅关系。
在步骤S806,第一设备确定是否有存储空间来存储用于注册第二设备的注册信息。
例如,第一设备可以确定是否有足够的存储资源来保存本次注册信息。第一设备一般会为存储注册信息分配一定的存储空间,例如为存储注册信息分配存储4个设备的注册信息的空间,那么,第一设备需要确定是否有足够的存储空间来存储本次注册请求对应的注册信息。
在步骤S807,第一设备确定发送注册请求的设备的注册权限。
在一些实施例中,如果第一设备确定发送注册请求的设备具有第一设备的管理员权限,则第一设备执行步骤S808。
在一些实施例中,如果第一设备确定发送注册请求的设备不具有第一设备的管理员权限,则第一设备执行步骤S809。
在步骤S808,第一设备基于注册请求来注册第二设备。
例如,第一设备基于注册请求中携带的信息,修改、更新或删除用于注册第二设备的注册信息。
在步骤S809,第一设备确定注册请求中的验证码信息与第一设备保存的验证码信息是否匹配。
在一些实施例中,如果注册请求中的验证码信息与第一设备保存的验证码信息匹配,则第一设备执行步骤S808。
在一些实施例中,如果注册请求中的验证码信息与第一设备保存的验证码信息不匹配,则第一设备拒绝注册第二设备。
在步骤S810,第一设备向发送注册请求的设备发送应答消息。
在一些实施例中,第一设备可以向发送注册请求的设备发送成功应答消息,以指示第二设备注册成功。例如,第一设备在执行步骤S808之后,可以向发送注册请求的设备发送成功应答消息。
在一些实施例中,第一设备可以向发送注册请求的设备发送失败应答消息,以指示第二设备注册失败。例如,第一设备在步骤S805确定第一设备与第二设备之间不存在订阅关系的情况下,可以向发送注册请求的设备发送失败应答消息。又例如,第一设备在步骤S806确定没有存储空间来存储用于注册第二设备的注册信息的情况下,可以向发送注册请求的设备发送失败应答消息。再例如,第一设备在步骤S809确定注册请求中的验证码信息与第一设备保存的验证码信息不匹配的情况下,可以向发送注册请求的设备发送失败应答消息。
上文结合图1至图8,详细描述了本申请的方法实施例,下面结合图9至图12,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。
图9是本申请一实施例提供的用于设备连接的装置的结构示意图。图9所示的装置900可以应用于前文任一所述的第一设备。该装置900可以包括第一接收模块910。
第一接收模块910可以用于接收注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
可选地,装置900还包括:第一确定模块920,用于根据所述第一设备与所述第二设备之间的订阅关系,确定所述第二设备的注册策略。
可选地,所述第一确定模块进一步用于:在所述第一设备与所述第二设备之间存在订阅关系的情况下,允许注册所述第二设备;和/或在所述第一设备与所述第二设备之间不存在订阅关系的情况下,不允许注册所述第二设备。
可选地,装置900还包括:第一注册模块,用于根据订阅设备发送的订阅请求,注册所述订阅设备的身份信息;其中,注册的订阅设备的身份信息被用于确定所述第一设备与所述第二设备之间是否存在订阅关系。
可选地,如果注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或,如果注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
可选地,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
可选地,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
可选地,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
可选地,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
可选地,所述第三设备具有所述第一设备的管理员权限。
可选地,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
可选地,装置900还包括:第二确定模块,用于确定是否有存储空间来存储用于注册所述第二设备的注册信息。
可选地,装置900还包括:第二注册模块,用于根据发送所述注册请求的设备的权限,注册所述第二设备。
可选地,所述第二注册模块进一步用于:如果发送所述注册请求的设备具有所述第一设备的管理员权限,基于所述注册请求来注册所述第二设备。
可选地,所述第二注册模块进一步用于:如果发送所述注册请求的设备不具有所述第一设备的管理员权限,确定所述注册请求中的验证码信息与所述第一设备保存的验证码信息是否匹配;响应于所述注
册请求中的验证码信息与所述第一设备保存的验证码信息匹配,基于所述注册请求来注册所述第二设备。
可选地,装置900还包括:连接模块,用于基于所述第二设备发送的连接请求与所述第二设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;第二接收模块,用于接收所述第二设备发送的订阅请求,所述第二设备发送的订阅请求用于订阅所述第一设备的资源。
可选地,所述第一设备为资源受限设备或ICD。
可选地,第一接收模块910可以为收发器1230。装置900还可以包括处理器1210和存储器1220,具体如图12所示。
图10是本申请另一实施例提供的用于设备连接的装置的结构示意图。图10所示的装置1000可以应用于前文任一所述的第二设备。该装置1000可以包括接收模块1010。
接收模块1010可以用于接收第一设备发送的第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接,所述第一消息是所述第二设备在所述第一设备处注册成功的情况下,所述第一设备变化为可连接状态或进入唤醒状态时发送的。
可选地,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
可选地,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备被允许在所述第一设备处注册;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备不被允许在所述第一设备处注册。
可选地,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
可选地,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或,如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
可选地,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
可选地,所述第二设备在所述第一设备处的注册是基于所述第一设备接收的注册请求触发的,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
可选地,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
可选地,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
可选地,所述第三设备具有所述第一设备的管理员权限。
可选地,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
可选地,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
可选地,装置1000还包括:第一发送模块1020,用于向所述第一设备发送连接请求,所述连接请求用于与所述第一设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;第二发送模块1030,用于向所述第一设备发送订阅请求,所述订阅请求用于订阅所述第一设备的资源。
可选地,所述第一设备为资源受限设备或ICD。
可选地,接收模块1010可以为收发器1230。装置1000还可以包括处理器1210和存储器1220,具体如图12所示。
图11是本申请又一实施例提供的用于设备连接的装置的结构示意图。图11所示的装置1100可以应用于前文任一所述的第三设备。该装置1100可以包括发送模块1110。
发送模块1110可以用于向第一设备发送注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
可选地,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
可选地,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备在所述第一设备处的注册是被允许的;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备在所述第一设备处的注册是不被允许的。
可选地,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
可选地,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或,如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
可选地,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
可选地,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
可选地,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
可选地,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
可选地,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
可选地,所述第三设备具有所述第一设备的管理员权限,
可选地,所述第一设备为资源受限设备或ICD。
可选地,发送模块1110可以为收发器1230。装置1100还可以包括处理器1210和存储器1220,具体如图12所示。
图12是本申请实施例的通信装置的示意性结构图。图12中的虚线表示该单元或模块为可选的。该装置1200可用于实现上述方法实施例中描述的方法。装置1200可以是芯片、终端设备或网络设备。
装置1200可以包括一个或多个处理器1210。该处理器1210可支持装置1200实现前文方法实施例所描述的方法。该处理器1210可以是通用处理器或者专用处理器。例如,该处理器可以为中央处理单元(central processing unit,CPU)。或者,该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
装置1200还可以包括一个或多个存储器1220。存储器1220上存储有程序,该程序可以被处理器1210执行,使得处理器1210执行前文方法实施例所描述的方法。存储器1220可以独立于处理器1210也可以集成在处理器1210中。
装置1200还可以包括收发器1230。处理器1210可以通过收发器1230与其他设备或芯片进行通信。例如,处理器1210可以通过收发器1230与其他设备或芯片进行数据收发。
本申请实施例还提供一种计算机可读存储介质,用于存储程序。该计算机可读存储介质可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
本申请实施例还提供一种计算机程序产品。该计算机程序产品包括程序。该计算机程序产品可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
本申请实施例还提供一种计算机程序。该计算机程序可应用于本申请实施例提供的终端或网络设备中,并且该计算机程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
应理解,本申请中术语“系统”和“网络”可以被可互换使用。另外,本申请使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。
在本申请的实施例中,提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关
联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。
在本申请实施例中,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
在本申请实施例中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。
本申请的实施例,提到的“包括”可以指直接包括,也可以指间接包括。可选地,可以将本申请实施例中提到的“包括”替换为“指示”或“用于确定”。例如,A包括B,可以替换为A指示B,或A用于确定B。
本申请实施例中,“预定义”或“预配置”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。
本申请实施例中,所述“协议”可以指通信领域的标准协议,例如可以包括LTE协议、NR协议以及应用于未来的通信系统中的相关协议,本申请对此不做限定。
本申请实施例中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够读取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (92)
- 一种用于设备连接的方法,其特征在于,包括:第一设备接收注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:所述第一设备根据所述第一设备与所述第二设备之间的订阅关系,确定所述第二设备的注册策略。
- 根据权利要求2所述的方法,其特征在于,所述第一设备根据所述第一设备与所述第二设备之间的订阅关系,确定所述第二设备的注册策略,包括:在所述第一设备与所述第二设备之间存在订阅关系的情况下,所述第一设备允许注册所述第二设备;和/或在所述第一设备与所述第二设备之间不存在订阅关系的情况下,所述第一设备不允许注册所述第二设备。
- 根据权利要求2或3所述的方法,其特征在于,所述方法还包括:所述第一设备根据订阅设备发送的订阅请求,注册所述订阅设备的身份信息;其中,注册的订阅设备的身份信息被用于确定所述第一设备与所述第二设备之间是否存在订阅关系。
- 根据权利要求4所述的方法,其特征在于,如果注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求2-5中任一项所述的方法,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求1-6中任一项所述的方法,其特征在于,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求7所述的方法,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求1-8中任一项所述的方法,其特征在于,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
- 根据权利要求9所述的方法,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求1-10中任一项所述的方法,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求1-11中任一项所述的方法,其特征在于,所述方法还包括:所述第一设备确定是否有存储空间来存储用于注册所述第二设备的注册信息。
- 根据权利要求1-12中任一项所述的方法,其特征在于,所述方法还包括:所述第一设备根据发送所述注册请求的设备的权限,注册所述第二设备。
- 根据权利要求13所述的方法,其特征在于,所述第一设备根据发送所述注册请求的设备的权限,注册所述第二设备,包括:如果发送所述注册请求的设备具有所述第一设备的管理员权限,所述第一设备基于所述注册请求 来注册所述第二设备。
- 根据权利要求13所述的方法,其特征在于,所述第一设备根据发送所述注册请求的设备的权限,注册所述第二设备,包括:如果发送所述注册请求的设备不具有所述第一设备的管理员权限,所述第一设备确定所述注册请求中的验证码信息与所述第一设备保存的验证码信息是否匹配;响应于所述注册请求中的验证码信息与所述第一设备保存的验证码信息匹配,所述第一设备基于所述注册请求来注册所述第二设备。
- 根据权利要求1-15中任一项所述的方法,其特征在于,所述方法还包括:所述第一设备基于所述第二设备发送的连接请求与所述第二设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;所述第一设备接收所述第二设备发送的订阅请求,所述第二设备发送的订阅请求用于订阅所述第一设备的资源。
- 根据权利要求1-16中任一项所述的方法,其特征在于,所述第一设备为资源受限设备或间歇性连接设备ICD。
- 一种用于设备连接的方法,其特征在于,包括:第二设备接收第一设备发送的第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接,所述第一消息是所述第二设备在所述第一设备处注册成功的情况下,所述第一设备变化为可连接状态或进入唤醒状态时发送的。
- 根据权利要求18所述的方法,其特征在于,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
- 根据权利要求19所述的方法,其特征在于,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备被允许在所述第一设备处注册;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备不被允许在所述第一设备处注册。
- 根据权利要求19或20所述的方法,其特征在于,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
- 根据权利要求21所述的方法,其特征在于,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求19-22中任一项所述的方法,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求18-23中任一项所述的方法,其特征在于,所述第二设备在所述第一设备处的注册是基于所述第一设备接收的注册请求触发的,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求24所述的方法,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求24或25所述的方法,其特征在于,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
- 根据权利要求26所述的方法,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求18-27中任一项所述的方法,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求18-28中任一项所述的方法,其特征在于,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
- 根据权利要求18-29中任一项所述的方法,其特征在于,所述方法还包括:所述第二设备向所述第一设备发送连接请求,所述连接请求用于与所述第一设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;所述第二设备向所述第一设备发送订阅请求,所述订阅请求用于订阅所述第一设备的资源。
- 根据权利要求18-30中任一项所述的方法,其特征在于,所述第一设备为资源受限设备或间歇性连接设备ICD。
- 一种用于设备连接的方法,其特征在于,包括:第三设备向第一设备发送注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
- 根据权利要求32所述的方法,其特征在于,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
- 根据权利要求33所述的方法,其特征在于,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备在所述第一设备处的注册是被允许的;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备在所述第一设备处的注册是不被允许的。
- 根据权利要求33或34所述的方法,其特征在于,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
- 根据权利要求35所述的方法,其特征在于,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求33-36中任一项所述的方法,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求32-37中任一项所述的方法,其特征在于,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求38所述的方法,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求32-39中任一项所述的方法,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求32-40中任一项所述的方法,其特征在于,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
- 根据权利要求32-41中任一项所述的方法,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求32-42中任一项所述的方法,其特征在于,所述第一设备为资源受限设备或间歇 性连接设备ICD。
- 一种用于设备连接的装置,其特征在于,所述装置应用于第一设备,所述装置包括:第一接收模块,用于接收注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
- 根据权利要求44所述的装置,其特征在于,所述装置还包括:第一确定模块,用于根据所述第一设备与所述第二设备之间的订阅关系,确定所述第二设备的注册策略。
- 根据权利要求45所述的装置,其特征在于,所述第一确定模块进一步用于:在所述第一设备与所述第二设备之间存在订阅关系的情况下,允许注册所述第二设备;和/或在所述第一设备与所述第二设备之间不存在订阅关系的情况下,不允许注册所述第二设备。
- 根据权利要求45或46所述的装置,其特征在于,所述装置还包括:第一注册模块,用于根据订阅设备发送的订阅请求,注册所述订阅设备的身份信息;其中,注册的订阅设备的身份信息被用于确定所述第一设备与所述第二设备之间是否存在订阅关系。
- 根据权利要求47所述的装置,其特征在于,如果注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求45-48中任一项所述的装置,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求44-49中任一项所述的装置,其特征在于,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求50所述的装置,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求44-51中任一项所述的装置,其特征在于,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
- 根据权利要求52所述的装置,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求44-53中任一项所述的装置,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求44-54中任一项所述的装置,其特征在于,所述装置还包括:第二确定模块,用于确定是否有存储空间来存储用于注册所述第二设备的注册信息。
- 根据权利要求44-55中任一项所述的装置,其特征在于,所述装置还包括:第二注册模块,用于根据发送所述注册请求的设备的权限,注册所述第二设备。
- 根据权利要求56所述的装置,其特征在于,所述第二注册模块进一步用于:如果发送所述注册请求的设备具有所述第一设备的管理员权限,基于所述注册请求来注册所述第二设备。
- 根据权利要求56所述的装置,其特征在于,所述第二注册模块进一步用于:如果发送所述注册请求的设备不具有所述第一设备的管理员权限,确定所述注册请求中的验证码信息与所述第一设备保存的验证码信息是否匹配;响应于所述注册请求中的验证码信息与所述第一设备保存的验证码信息匹配,基于所述注册请求来注册所述第二设备。
- 根据权利要求44-58中任一项所述的装置,其特征在于,所述装置还包括:连接模块,用于基于所述第二设备发送的连接请求与所述第二设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;第二接收模块,用于接收所述第二设备发送的订阅请求,所述第二设备发送的订阅请求用于订阅所述第一设备的资源。
- 根据权利要求44-59中任一项所述的装置,其特征在于,所述第一设备为资源受限设备或间歇性连接设备ICD。
- 一种用于设备连接的装置,其特征在于,所述装置应用于第二设备,所述装置包括:接收模块,用于接收第一设备发送的第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接,所述第一消息是所述第二设备在所述第一设备处注册成功的情况下,所述第一设备变化为可连接状态或进入唤醒状态时发送的。
- 根据权利要求61所述的装置,其特征在于,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
- 根据权利要求62所述的装置,其特征在于,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备被允许在所述第一设备处注册;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备不被允许在所述第一设备处注册。
- 根据权利要求62或63所述的装置,其特征在于,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
- 根据权利要求64所述的装置,其特征在于,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求62-65中任一项所述的装置,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求61-66中任一项所述的装置,其特征在于,所述第二设备在所述第一设备处的注册是基于所述第一设备接收的注册请求触发的,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求67所述的装置,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求67或68所述的装置,其特征在于,所述注册请求是所述第二设备发送的;或者,所述注册请求是除所述第二设备之外的第三设备发送的。
- 根据权利要求69所述的装置,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求61-70中任一项所述的装置,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求61-71中任一项所述的装置,其特征在于,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
- 根据权利要求61-72中任一项所述的装置,其特征在于,所述装置还包括:第一发送模块,用于向所述第一设备发送连接请求,所述连接请求用于与所述第一设备建立连接,所述连接请求是所述第二设备在根据所述第一消息确定需要和所述第一设备建立连接的情况下发送的;第二发送模块,用于向所述第一设备发送订阅请求,所述订阅请求用于订阅所述第一设备的资源。
- 根据权利要求61-73中任一项所述的装置,其特征在于,所述第一设备为资源受限设备或间歇性连接设备ICD。
- 一种用于设备连接的装置,其特征在于,所述装置应用于第三设备,所述装置包括:发送模块,用于向第一设备发送注册请求,所述注册请求用于注册第二设备;其中,所述第二设备的成功注册用于指示所述第一设备变化为可连接状态或进入唤醒状态时向所述第二设备发送第一消息,所述第一消息用于指示所述第二设备与所述第一设备建立连接。
- 根据权利要求75所述的装置,其特征在于,所述第二设备的注册策略是根据所述第一设备与所述第二设备之间的订阅关系确定的。
- 根据权利要求76所述的装置,其特征在于,如果所述第一设备与所述第二设备之间存在订阅关系,则所述第二设备在所述第一设备处的注册是被允许的;和/或如果所述第一设备与所述第二设备之间不存在订阅关系,则所述第二设备在所述第一设备处的注册是不被允许的。
- 根据权利要求76或77所述的装置,其特征在于,所述第一设备与所述第二设备之间是否存在订阅关系是根据在所述第一设备处注册的订阅设备的身份信息确定的。
- 根据权利要求78所述的装置,其特征在于,如果在所述第一设备处注册的订阅设备的身份信息包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间存在订阅关系;和/或如果在所述第一设备处注册的订阅设备的身份信息不包括所述第二设备的身份信息,则所述第一设备与所述第二设备之间不存在订阅关系。
- 根据权利要求76-79中任一项所述的装置,其特征在于,如果所述第一设备允许注册所述第二设备,则所述第一设备对应的休眠周期为长休眠周期;和/或如果所述第一设备不允许注册所述第二设备,则所述第一设备对应的休眠周期为短休眠周期。
- 根据权利要求75-80中任一项所述的装置,其特征在于,所述注册请求用于指示以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;验证码信息,所述验证码信息用于验证发送所述注册请求的设备的权限;以及第一优先级信息,所述第一优先级信息用于指示所述第二设备请求的发送所述第一消息的优先级。
- 根据权利要求81所述的装置,其特征在于,所述访问控制主体信息是利用所述第二设备的设备标识指示的;和/或,所述访问控制主体信息是利用所述第二设备的组标识指示的。
- 根据权利要求75-82中任一项所述的装置,其特征在于,用于注册所述第二设备的注册信息包括以下信息中的一种或多种:所述第二设备的身份信息;所述第二设备在所述第一设备处的访问控制主体信息;所述第一消息关联的加密信息;以及第二优先级信息,所述第二优先级信息用于指示所述第一设备向所述第二设备发送所述第一消息的优先级。
- 根据权利要求75-83中任一项所述的装置,其特征在于,所述第二设备是否被允许在所述第一设备处注册是根据所述第一设备是否有存储空间来存储用于注册所述第二设备的注册信息来确定的。
- 根据权利要求75-84中任一项所述的装置,其特征在于,所述第三设备具有所述第一设备的管理员权限。
- 根据权利要求75-85中任一项所述的装置,其特征在于,所述第一设备为资源受限设备或间歇性连接设备ICD。
- 一种用于设备连接的装置,其特征在于,包括收发器、存储器和处理器,所述存储器用于存储程序,所述处理器用于调用所述存储器中的程序,以使所述装置执行如权利要求1-43中任一项所述的方法。
- 一种装置,其特征在于,包括处理器,用于从存储器中调用程序,以使所述装置执行如权利要 求1-43中任一项所述的方法。
- 一种芯片,其特征在于,包括处理器,用于从存储器调用程序,使得安装有所述芯片的设备执行如权利要求1-43中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,其上存储有程序,所述程序使得计算机执行如权利要求1-43中任一项所述的方法。
- 一种计算机程序产品,其特征在于,包括程序,所述程序使得计算机执行如权利要求1-43中任一项所述的方法。
- 一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求1-43中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2023/101614 WO2024259618A1 (zh) | 2023-06-21 | 2023-06-21 | 用于设备连接的方法和装置、芯片、存储介质和程序产品 |
| CN202380095461.9A CN120814253A (zh) | 2023-06-21 | 2023-06-21 | 用于设备连接的方法和装置、芯片、存储介质和程序产品 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2023/101614 WO2024259618A1 (zh) | 2023-06-21 | 2023-06-21 | 用于设备连接的方法和装置、芯片、存储介质和程序产品 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024259618A1 true WO2024259618A1 (zh) | 2024-12-26 |
Family
ID=93934718
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/101614 Ceased WO2024259618A1 (zh) | 2023-06-21 | 2023-06-21 | 用于设备连接的方法和装置、芯片、存储介质和程序产品 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120814253A (zh) |
| WO (1) | WO2024259618A1 (zh) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0869640A1 (en) * | 1997-04-01 | 1998-10-07 | Hewlett-Packard Company | Intermittently connectable electronic device with unique identifier |
| US20090013064A1 (en) * | 2007-07-06 | 2009-01-08 | Questra Corporation | Managing distributed devices with limited connectivity |
| CN104662867A (zh) * | 2012-09-25 | 2015-05-27 | 瑞典爱立信有限公司 | 与受限互联网设备进行通信 |
| CN108307678A (zh) * | 2015-05-14 | 2018-07-20 | 索尼移动通讯有限公司 | 用于准许或不准许连接请求的方法和系统 |
| CN111131054A (zh) * | 2019-12-13 | 2020-05-08 | 欧普照明股份有限公司 | 实现大量终端间断性连接路由器的方法,路由器 |
| CN112543492A (zh) * | 2020-11-30 | 2021-03-23 | 青岛海信智慧家居系统股份有限公司 | 一种重新配网方法、装置及存储介质 |
-
2023
- 2023-06-21 WO PCT/CN2023/101614 patent/WO2024259618A1/zh not_active Ceased
- 2023-06-21 CN CN202380095461.9A patent/CN120814253A/zh active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0869640A1 (en) * | 1997-04-01 | 1998-10-07 | Hewlett-Packard Company | Intermittently connectable electronic device with unique identifier |
| US20090013064A1 (en) * | 2007-07-06 | 2009-01-08 | Questra Corporation | Managing distributed devices with limited connectivity |
| CN104662867A (zh) * | 2012-09-25 | 2015-05-27 | 瑞典爱立信有限公司 | 与受限互联网设备进行通信 |
| CN108307678A (zh) * | 2015-05-14 | 2018-07-20 | 索尼移动通讯有限公司 | 用于准许或不准许连接请求的方法和系统 |
| CN111131054A (zh) * | 2019-12-13 | 2020-05-08 | 欧普照明股份有限公司 | 实现大量终端间断性连接路由器的方法,路由器 |
| CN112543492A (zh) * | 2020-11-30 | 2021-03-23 | 青岛海信智慧家居系统股份有限公司 | 一种重新配网方法、装置及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120814253A (zh) | 2025-10-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12142265B2 (en) | Synchronization of remote context data | |
| CN111629427B (zh) | 多媒体数据处理方法、装置、电子设备及存储介质 | |
| CN109565658B (zh) | 订阅和通知服务 | |
| EP3831038B1 (en) | Automated relationship management of service layer entities in a communications network | |
| CN110691014A (zh) | 用于自动化环境的协调器设备的选择 | |
| US20140161118A1 (en) | Power save mechanism for low-power network devices | |
| TWI766035B (zh) | 用於裝置管理之系統及方法 | |
| CN111201804B (zh) | 启用数据连续性服务的方法、装置和计算机可读存储介质 | |
| EP2856698A1 (en) | Network presence offload | |
| CN112188227A (zh) | 一种流媒体数据分发方法和装置 | |
| KR101499307B1 (ko) | 액티브 상태와 슬립 상태 간을 천이함으로써 전력 절약을 구현하는 무선 개인 영역 네트워크 (pan) 조정자 | |
| CN109816830B (zh) | 一种解锁方法及装置 | |
| EP4138460B1 (en) | Key updating method, network device, system and storage medium | |
| WO2024259618A1 (zh) | 用于设备连接的方法和装置、芯片、存储介质和程序产品 | |
| CN114666196B (zh) | 低功耗设备的配网方法、装置、代理设备和存储介质 | |
| CN115150211B (zh) | 一种信息传输的方法、装置及电子设备 | |
| WO2024212155A1 (zh) | 设备连接的方法和装置、芯片、存储介质和计算机程序 | |
| WO2024212174A1 (zh) | 设备连接的方法和装置、芯片、存储介质和计算机程序 | |
| US20220334980A1 (en) | Secure Storage of Datasets in a Thread Network Device | |
| CN111667615A (zh) | 智能锁无线下行数据提醒方法、装置、终端及存储介质 | |
| US20240195644A1 (en) | Method for processing a request to activate at least one interface of an item of host equipment with at least one local area communication network managed by the host equipment, method for requesting activation of the at least one interface and corresponding devices, host equipment, terminal equipment, management system and computer programs | |
| US20260111284A1 (en) | Out-of-band management of communication modalities used by data processing systems | |
| US20260089634A1 (en) | Wake-up radio protocol for wireless communications | |
| CN119729725A (zh) | 物联网设备通信方法、装置、计算机设备、可读存储介质和程序产品 | |
| WO2025139497A9 (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: 23941922 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 202380095461.9 Country of ref document: CN |
|
| WWP | Wipo information: published in national office |
Ref document number: 202380095461.9 Country of ref document: CN |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |