Inter-device communication method, apparatus, and storage medium

By canceling feature data subscription based on the working status in the communication method between Bluetooth devices and terminals, the problem of increased power consumption in the terminal's sleep state is solved, thereby reducing power consumption and extending battery life, while ensuring that data can be recovered in a timely manner.

CN117500030BActive Publication Date: 2026-11-06BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210883504.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2026-11-06
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

The Bluetooth device continues to report feature data in real time after connecting to the terminal, even when the terminal is in sleep mode, which increases the terminal's power consumption.

Method used

By determining the terminal's working state as a preset working state, such as screen-off state, canceling the subscription of feature data whose number exceeds the threshold, sending a cancel subscription request to the Bluetooth device, modifying the descriptor attribute value to cancel the feature data subscription, and saving and restoring the subscription state through the mapping relationship.

Benefits of technology

It reduces power consumption of terminals and Bluetooth devices, extends battery life, and resumes feature data subscriptions when needed, ensuring users can access important data in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117500030B_ABST
    Figure CN117500030B_ABST
Patent Text Reader

Abstract

This disclosure relates to a device-to-device communication method, apparatus, and storage medium, and pertains to the field of communication technology. The method is used to reduce power consumption. The method includes: determining that the operating state of a first device is a preset operating state; determining that the first device receives target feature data in the preset operating state, wherein the target feature data is feature data sent by a second device to a target application and the quantity exceeds a quantity threshold; and sending an unsubscribe request to the second device, wherein the unsubscribe request is used to unsubscribe from the feature corresponding to the target feature data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to methods, apparatus and storage media for communication between devices. Background Technology

[0002] Bluetooth Low Energy (BLE) is a personal area network (LAN) technology designed and marketed by the Bluetooth Special Interest Group (SIG) for emerging applications in healthcare, fitness, beacons, security, and home entertainment. Compared to classic Bluetooth, BLE aims to significantly reduce power consumption and cost while maintaining the same communication range.

[0003] After a Bluetooth device connects to a terminal, if the terminal subscribes to features included in the Bluetooth device's service, the user does not need to view the feature data generated by the subscribed features when the terminal is in sleep mode. However, the Bluetooth device will still report the feature data in real time, thereby increasing the terminal's power consumption. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a device-to-device communication method, apparatus and storage medium.

[0005] According to a first aspect of the present disclosure, a device-to-device communication method is provided, applied to a first device, the first device having a target application installed thereon, the target application being used to subscribe to services provided by a second device and to acquire feature data sent by the second device, the feature data being data generated from features included in the service, the method comprising: determining that the working state of the first device is a preset working state; determining that the first device receives target feature data in the preset working state, the target feature data being feature data sent by the second device to the target application and exceeding a quantity threshold; and sending an unsubscribe request to the second device, the unsubscribe request being used to unsubscribe from one or more features corresponding to the target feature data.

[0006] In one embodiment, sending an unsubscribe request to the second device includes: determining a target descriptor corresponding to the target feature data in a first descriptor set; modifying the attribute value of the target descriptor to the attribute value corresponding to unsubscribe, and sending the attribute value corresponding to unsubscribe to the second device; the first descriptor set includes at least descriptors of features included in the services provided by the second device subscribed to by the target application.

[0007] In another embodiment, the first descriptor set is determined as follows: an initial descriptor set sent by the second device based on a service discovery request is obtained, the initial descriptor set being used to indicate features included in the services subscribed to by the second device; the initial descriptor set is saved; in response to the target application subscription service features, the descriptors in the initial descriptor set that match the features of the target application subscription are modified to the attribute values ​​corresponding to the subscription, thereby obtaining the first descriptor set.

[0008] In another embodiment, the method further includes: determining a link identifier corresponding to the target descriptor, the link identifier being used to identify a link established between the first device and the second device when providing features included in the subscription service; obtaining a descriptor handle and an initial descriptor attribute value corresponding to the target descriptor in the first descriptor set; creating a mapping relationship between the link identifier, the descriptor handle, and the initial descriptor attribute value, and saving the mapping relationship to a second descriptor set, the second descriptor set storing descriptor information for restoring the subscription to features corresponding to the feature data.

[0009] In another embodiment, the method further includes: periodically sending modification requests to the second device at preset time intervals, the modification requests including the attribute value of the target descriptor when the target feature is in a subscription state; in response to the attribute value of the target descriptor in the second device being modified to the attribute value corresponding to the target feature when it is in a subscription state, deleting the mapping relationship corresponding to the target descriptor in the second descriptor set; re-determining the working state of the first device, and receiving target feature data sent by the second device to the target application.

[0010] In another embodiment, the method further includes: if it is determined that the working state of the first device does not meet the preset working state, modifying the attribute values ​​of the descriptors in the second device one by one to the corresponding attribute values ​​of the subscription; and deleting all mapping relationships stored in the second descriptor combination.

[0011] In another embodiment, the method further includes: updating the attribute value of the corresponding descriptor in the first descriptor set in response to the modification of the attribute value of the descriptor to the corresponding attribute value of the subscription.

[0012] In another embodiment, the first device is a terminal, the second device is a Bluetooth device, and the preset working state is a screen-off state.

[0013] According to a second aspect of the present disclosure, an inter-device communication apparatus is provided, applied to a first device, the first device having a target application installed thereon, the target application being used to subscribe to services provided by a second device and to acquire feature data sent by the second device, the feature data being data generated from features included in the service, the apparatus comprising:

[0014] The determining module is used to determine that the working state of the first device is a preset working state; and to determine the target feature data received by the first device in the preset working state, wherein the target feature data is feature data sent by the second device to the target application and the quantity exceeds a quantity threshold;

[0015] The sending module is used to send an unsubscribe request to the second device, wherein the unsubscribe request is used to unsubscribe from one or more features corresponding to the target feature data.

[0016] In one embodiment, the sending module is specifically configured to determine the target descriptor corresponding to the target feature data in the first descriptor set; modify the attribute value of the target descriptor to the attribute value corresponding to unsubscribing; and send the attribute value corresponding to unsubscribing to the second device; the first descriptor set includes at least descriptors of features included in the services provided by the second device subscribed to by the target application.

[0017] In another embodiment, the first descriptor set is determined as follows: an initial descriptor set sent by the second device based on a service discovery request is obtained, the initial descriptor set being used to indicate features included in the services subscribed to by the second device; the initial descriptor set is saved; in response to the target application subscription service features, the descriptors in the initial descriptor set that match the features of the target application subscription are modified to the subscription attribute values ​​to obtain the first descriptor set.

[0018] In another embodiment, the apparatus further includes an acquisition module and a storage module; the determination module is further configured to determine a link identifier corresponding to the target descriptor, the link identifier being used to identify a link established between the first device and the second device when providing features included in the subscription service; the acquisition module is configured to acquire the descriptor handle and initial descriptor attribute value corresponding to the target descriptor in the first descriptor set; the storage module is configured to create a mapping relationship between the link identifier, the descriptor handle, and the initial descriptor attribute value, and save the mapping relationship to a second descriptor set, the second descriptor set storing descriptor information for restoring the subscription to features corresponding to the feature data.

[0019] In another embodiment, the sending module is further configured to periodically send modification requests to the second device at preset time intervals, the modification requests including the attribute value of the target descriptor when the target feature is in a subscription state; in response to the target descriptor attribute value in the second device being modified to the attribute value corresponding to the target feature when it is in a subscription state, the module deletes the mapping relationship corresponding to the target descriptor in the second descriptor set; redetermines the working state of the first device, and receives the target feature data sent by the second device to the target application.

[0020] In another embodiment, the device further includes a processing module; the processing module, if it determines that the working state of the first device does not meet the preset working state, modifies the attribute values ​​of the descriptors in the second device one by one to the corresponding attribute values ​​of the subscription; and deletes all mapping relationships stored in the second descriptor combination.

[0021] In another embodiment, the processing module is further configured to update the attribute value of the corresponding descriptor in the first descriptor set in response to the modification of the attribute value of the descriptor to the corresponding attribute value of the subscription.

[0022] In another embodiment, the first device is a terminal, the second device is a Bluetooth device, and the preset working state is a screen-off state.

[0023] According to a third aspect of the present disclosure, an inter-device communication apparatus is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to perform the inter-device communication method as described in the first aspect and its embodiments above.

[0024] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of a terminal, enables the terminal to perform the inter-device communication method as described in the first aspect and its embodiments above.

[0025] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects: determining that the first device receives target feature data sent by the second device in a preset working state and the number exceeds a quantity threshold, sending an unsubscribe request to the second device to unsubscribe from the feature corresponding to the target feature data, so that the second device will not send the target feature data to the first device, and further, since the first device will not receive the target feature data, the target application in the first device will not receive the target feature data, thereby reducing the power consumption of the first device and the second device and extending battery life.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0028] Figure 1 This is an information architecture diagram of a Bluetooth device according to an exemplary embodiment.

[0029] Figure 2 This is a flowchart illustrating a device-to-device communication method in the related art according to an exemplary embodiment.

[0030] Figure 3 This is a flowchart illustrating an inter-device communication method according to an exemplary embodiment.

[0031] Figure 4 This is a flowchart illustrating yet another device-to-device communication method according to an exemplary embodiment.

[0032] Figure 5 This is a schematic diagram illustrating a first descriptor set according to an exemplary embodiment.

[0033] Figure 6 This is a flowchart illustrating yet another device-to-device communication method according to an exemplary embodiment.

[0034] Figure 7 This is a schematic diagram illustrating a second set of descriptors according to an exemplary embodiment.

[0035] Figure 8 This is a flowchart illustrating yet another device-to-device communication method according to an exemplary embodiment.

[0036] Figure 9 This is a flowchart illustrating yet another device-to-device communication method according to an exemplary embodiment.

[0037] Figure 10 This is a flowchart illustrating yet another device-to-device communication method according to an exemplary embodiment.

[0038] Figure 11 This is a block diagram illustrating an inter-device communication method apparatus according to an exemplary embodiment.

[0039] Figure 12 This is a block diagram illustrating an inter-device communication apparatus according to an exemplary embodiment. Detailed Implementation

[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.

[0041] According to the design of the Bluetooth Special Interest Group (Bluetooth SIG) and Google's Open Access Platform (AOSP), applications on the terminal can subscribe to notification events (indications or notifications) of a Bluetooth device's characteristic (such as step count data). These characteristics of Bluetooth devices are stored in their own profiles (which can be understood as communication protocols or data configuration tables). Figure 1 As shown, the Profile records multiple services / functions supported by the Bluetooth device. Generally, one function corresponds to one service, such as battery information service and system information service. Each service contains multiple characteristics. Communication between the terminal and the Bluetooth device is achieved through these characteristics, which can be understood as tags. These tags allow the device to read or write necessary information. For example, if the Bluetooth device's current battery level is 80%, this information will be stored in the Bluetooth device's Profile through the battery information service's characteristics. The terminal can then use these characteristics to read the 80% battery level data.

[0042] Each feature consists of feature properties, feature value, and descriptor. The descriptor contains the feature's client characteristic configuration and feature's characteristic user description. The descriptor is an additional attribute that provides more information about the feature; it provides a human-readable instance of the feature description. A feature must contain at least a property and a value; the descriptor is optional.

[0043] One particular descriptor deserves special mention: the Client Characteristic Configuration Descriptor (CCCD), with a UUID of 0x2902. This descriptor is added extra for any feature that supports notification or indication functionality. Writing "01" to the CCCD enables notification functionality, writing "10" enables indication functionality, and writing "00" disables both notification and indication functionality. In the embodiments of this application, all descriptors represent descriptors with a UUID of 0x2902.

[0044] Furthermore, each descriptor contains an attribute handle, an attribute type, an attribute value, and attribute permissions. The attribute handle represents the index within the profile, and each descriptor has a unique handle. The attribute type, also known as a UUID (Universally Unique Identifier), describes the meaning represented by the descriptor. The attribute value can be up to 512 fields long. Attribute permissions typically include Read, Write, notifications, and indications, used to restrict whether and how a terminal can access the descriptor's attribute value.

[0045] The above has introduced the relevant knowledge involved in this application. Based on this, the following will further explain the communication method between Bluetooth devices and terminals in related technologies, such as... Figure 2As shown, after an application in the first device registers with the first device, the user initiates a connection instruction through the application on the first device, enabling the system of the first device to establish a connection with the second device. After a successful connection, the system of the first device performs service discovery on the second device according to the service discovery instruction initiated by the application. Accordingly, the second device returns its supported services to the system of the first device. The system of the first device uploads the services supported by the second device to the application, which stores the set of services supported by the second device. The user selects the services to be subscribed to and the features included in the services through the application. The application sends the features to be subscribed to and the descriptor attribute values ​​to be modified to the system of the first device. The system of the first device sends the descriptor attribute values ​​to be modified to the second device, enabling the second device to modify the corresponding descriptor attribute values. After modification, when the second device detects that data has been generated for the subscribed features, the second device sends the feature data to the system of the first device, which then reports it to the application. When it is necessary to unsubscribe from a feature, the application sends the feature to be unsubscribed from and the descriptor attribute value to be modified to the system of the first device. The system of the first device then sends the descriptor attribute value to be modified to the second device, so that the second device can modify the corresponding descriptor attribute value. After the modification is successful, the second device will not send feature data to the system of the first device.

[0046] It is worth noting that the "system of the first device" mentioned above and below refers to the Bluetooth architecture system within the operating system of the first device. This Bluetooth architecture system enables the connection and data exchange between the first device and the second device. Specifically, the actual Bluetooth operations are implemented through the Bluedroid (Bluetooth protocol stack) layer within the Bluetooth architecture system, including turning Bluetooth on and off, Bluetooth management, search management, link management, and the implementation of various profiles.

[0047] However, as described in the background section, when the terminal (first device) is in a sleep state, the user does not need to view the feature data at this time. However, if the user does not unsubscribe from the feature, the Bluetooth device (second device) will still report the feature data in real time, thereby increasing the power consumption of the terminal.

[0048] Based on this, embodiments of this disclosure provide a device-to-device communication method that can intelligently control feature subscriptions and cancel subscriptions when users do not need to view feature data, thereby reducing terminal power consumption.

[0049] Figure 3 This is a flowchart illustrating an inter-device communication method according to an exemplary embodiment, such as... Figure 3As shown, the application is used in a first device, the first device has a target application installed, the target application is used to subscribe to the services provided by the second device, and is used to obtain feature data sent by the second device. The feature data is data generated by the features included in the service, including the following steps.

[0050] In step S11, the working state of the first device is determined to be the preset working state.

[0051] Optionally, the operating state of the first device includes screen-off state, screen-on state, and power-off state. In this embodiment of the present disclosure, the preset operating state of the first device is screen-off state.

[0052] In step S12, the target feature data received by the first device under the preset working state is determined.

[0053] Among them, the target feature data refers to the feature data sent by the second device to the target application, and the quantity exceeds the quantity threshold.

[0054] Optionally, the feature data refers to the feature data generated by the service subscribed to by the target application. For example, if the target application subscribes to a health service and further subscribes to the heartbeat feature in the health service, when the second device detects the user's heartbeat feature, it generates heartbeat data and sends it to the first device. The heartbeat data is the feature data.

[0055] Furthermore, after receiving the feature data sent by the second device to the target application, the first device reports the feature data to the target application so that the user can be aware of the feature data.

[0056] Optionally, the first device can be a terminal, and the second device can be a Bluetooth device.

[0057] In step S13, an unsubscribe request is sent to the second device.

[0058] The unsubscribe request is used to unsubscribe from one or more features corresponding to the target feature data.

[0059] Specifically, when the target feature data corresponds to a single feature, the unsubscribe request is used to unsubscribe from that single feature. When the target feature data corresponds to multiple features, the unsubscribe request is used to unsubscribe from all the features corresponding to the target feature data.

[0060] Optionally, when the terminal is in a preset working state, such as a screen-off state, it indicates that the user does not need to view the feature data at this time. The data in the received feature data whose quantity exceeds the quantity threshold is identified as the target feature data (the quantity threshold can be a user-defined threshold), and the reception of the target feature data is canceled.

[0061] This embodiment of the disclosure determines that the first device receives target feature data sent by the second device in a preset working state, and the number exceeds a quantity threshold. Then, it sends an unsubscribe request to the second device to unsubscribe from the feature corresponding to the target feature data. As a result, the second device will not send the target feature data to the first device, and the first device will not report the target feature data to the target application. This reduces the power consumption of the first and second devices and extends battery life.

[0062] Optionally, a blacklist and a whitelist are pre-set in the terminal device. The blacklist stores features that can be unsubscribed from, and the whitelist stores features that cannot be unsubscribed from. When the first device determines the target feature data, it first determines the type of the target feature data. If the feature corresponding to the target feature data belongs to a feature in the whitelist, the solution of this embodiment is not executed, and the target feature data is not unsubscribed from. If the target feature data belongs to a service feature in the blacklist, the solution of this embodiment is executed.

[0063] There is also a special case: since all features in this embodiment include descriptors, when the feature data does not include a descriptor, the solution of this embodiment is not executed, and the feature data is uploaded to the target application at all times.

[0064] In some embodiments, sending an unsubscribe request to the second device is achieved through steps S21-S22, such as... Figure 4 As shown, it includes the following steps.

[0065] In step S21, the target descriptor corresponding to the target feature data is determined from the first descriptor set.

[0066] The first set of descriptors includes at least descriptors of features included in the services provided by the second device subscribed to by the target application.

[0067] Optionally, one feature corresponds to one descriptor. If multiple target feature data belong to one feature, then the descriptors for the multiple target feature data are the same, that is, multiple target feature data correspond to one descriptor. The first descriptor set does not involve feature data, but only features and their corresponding descriptors. Therefore, in the first descriptor set, one feature corresponds to one descriptor.

[0068] Optionally, since the first device can connect to multiple second devices, to avoid confusion between the descriptors of multiple second devices, a link identifier for the second device is set in the first descriptor set. This link identifier is used to determine the sub-descriptor set corresponding to the second device within the first descriptor set. Based on the link identifier, the descriptors of the features provided by the second device are saved to the sub-descriptor set corresponding to the second device within the first descriptor set. For example, Figure 5A schematic diagram of a first set of descriptors is shown.

[0069] Optionally, after the second device establishes a connection with the first device, the initial descriptor set sent by the second device based on the service discovery request is obtained. The initial descriptor set is used to indicate the features included in the services that the second device supports for subscription. The initial descriptor set is saved. In response to the target application subscription features, the descriptors in the initial descriptor set that match the features of the target application subscription are modified to the attribute values ​​corresponding to the subscription, thus obtaining the first descriptor set.

[0070] It is worth noting that, since some features do not contain descriptors, in order to avoid ambiguity, all feature data involved in the embodiments of this disclosure contain descriptors, and some special cases have been explained above.

[0071] In step S22, the target descriptor attribute value is modified to the attribute value corresponding to unsubscribe, and the attribute value corresponding to unsubscribe is sent to the second device.

[0072] Optionally, upon receiving the attribute value corresponding to unsubscribe, the second device modifies the attribute value of the target descriptor in the second device to the attribute value corresponding to unsubscribe, at which point the feature corresponding to the target feature data is unsubscribed. Furthermore, in this embodiment, the result of unsubscribing from the feature corresponding to the target feature data will not be displayed in the target application.

[0073] Optionally, when initiating a subscription feature through the target application, the attribute value of the corresponding descriptor is transmitted. After obtaining the attribute value, the first device updates the attribute value of the corresponding descriptor in the first descriptor set. At the same time, the target application can also read the descriptor attribute values ​​stored in the second device and update the first descriptor set accordingly.

[0074] In this embodiment of the disclosure, by setting a first descriptor set in the first device, the first device can know the target descriptor corresponding to the target feature data without going through the target application, thereby directly unsubscribing from the target feature data, saving the step of the target application sending a notification to the first device and saving the power consumption of the first device.

[0075] Optionally, after canceling the target feature data, embodiments of this disclosure also provide a method for inter-device communication to restore subscription to the target feature data, such as... Figure 6 As shown, it includes the following steps:

[0076] In step S31, the link identifier corresponding to the target descriptor is determined.

[0077] The link identifier is used to identify the link established between the first device and the second device when providing features included in the subscription service.

[0078] It should be understood that one link identifier uniquely corresponds to one second device.

[0079] In step S32, the descriptor handle and initial descriptor attribute value corresponding to the target descriptor in the first descriptor set are obtained.

[0080] The descriptor handle is used to represent a descriptor, and a descriptor can be uniquely identified based on the descriptor handle. The initial descriptor attribute value represents the attribute value before the target descriptor attribute value is modified to the attribute value corresponding to unsubscribing; it can also be understood as the initial descriptor attribute value being the attribute value when the target descriptor is in the subscribed state.

[0081] In step S33, a mapping relationship is created between the link identifier, the descriptor handle, and the initial descriptor attribute value, and the mapping relationship is saved to the second descriptor set.

[0082] The second descriptor set stores descriptor information used to recover features corresponding to the subscribed feature data.

[0083] Specifically, a link identifier is generated when providing features included in the subscription service between the first device and the second device, and a sub-descriptor set is determined in the second descriptor set based on the link identifier. The descriptor handle and initial descriptor attribute values ​​are then stored in the sub-descriptor set. For example, Figure 7 A schematic diagram of a second set of descriptors is shown.

[0084] This embodiment of the disclosure sets up a second descriptor set, which stores descriptor handles and initial descriptor attribute values ​​for features corresponding to the restored subscription feature data. Thus, when it is necessary to restore the subscription feature in the future, the initial descriptor attribute value can be obtained from the second descriptor set, and the attribute value of the target descriptor in the second device can be further modified to the initial descriptor attribute value, so that the feature corresponding to the target descriptor can be restored to subscription.

[0085] The following explains how and when to restore the target feature data of the subscription. Figure 8 As shown, it includes the following steps:

[0086] In step S41, modification requests are periodically sent to the second device at preset time intervals.

[0087] The modification request includes the attribute values ​​of the target descriptor when the target feature is in a subscription state.

[0088] In step S42, in response to the target descriptor attribute value in the second device being modified to the attribute value corresponding to the target feature being in the subscription state, the mapping relationship corresponding to the target descriptor in the second descriptor set is deleted.

[0089] In step S43, the working state of the first device is redefined, and the target feature data sent by the second device to the target application is received.

[0090] This embodiment of the disclosure enables the second device to periodically modify the target descriptor attribute value, allowing the user to receive target feature data at preset intervals. This avoids completely blocking the target feature data when the first device is in a preset working state, and prevents the user from viewing the target feature data when the first device exits the preset working state.

[0091] Furthermore, this disclosure also provides a method for resuming subscription to target feature data when the first device switches from a preset working state to a non-preset working state, such as... Figure 9 As shown, it includes the following steps:

[0092] In step S51, if it is determined that the working state of the first device does not meet the preset working state, the attribute values ​​of the descriptors in the second device are modified one by one to the corresponding attribute values ​​of the subscription.

[0093] In step S52, all mapping relationships stored in the second descriptor set are deleted.

[0094] In this embodiment of the disclosure, when the working state of the first device does not meet the preset working state, the subscription to the target feature data is restored in a timely manner, so that the user can receive the target feature data in a timely manner.

[0095] Based on the above embodiments, when the attributes of a descriptor are modified, in response to the modification of the attribute value of the descriptor to the corresponding attribute value of the subscription, the attribute value of the corresponding descriptor in the first descriptor set is updated.

[0096] In a special case, when the connection between the first device and the second device is broken, the sub-descriptor set corresponding to the second device in the first descriptor set and the second descriptor set is cleared.

[0097] To provide a more detailed explanation of the inter-device communication method provided in the embodiments of this disclosure, the following description is provided in conjunction with flowcharts, such as... Figure 10As shown, after the first device and the second device establish a connection, the target application in the first device sends a service discovery request to the second device. Based on the service discovery request, the second device sends an initial descriptor set to the system of the first device and stores the initial descriptor set in the first device's system. When a user subscribes to features included in the Bluetooth device's services through the target application, and the system of the first device receives the subscribed features, it modifies the attribute values ​​of the corresponding descriptors in the second device. In response to the successful modification of the descriptor attribute values, the system of the first device uploads a message indicating successful subscription of feature data to the target application, so that the user can be notified of the successful subscription through the target application. When the second device generates feature data, it notifies the system of the first device of the feature data, which then reports the feature data to the target application. When the first device is in a preset working state, and the number of target feature data received by the first device in the preset working state exceeds a certain threshold, the first device's system sends an unsubscribe request to the second device. It then modifies the attribute value of the descriptor corresponding to the target feature data in the second device to the attribute value corresponding to the unsubscribe request. Simultaneously, the first device's system updates the attribute value of the descriptor corresponding to the target feature data in its initial descriptor set to the attribute value corresponding to the unsubscribe request. In response to the successful modification of the descriptor attribute value in the second device, the feature corresponding to the target feature data is unsubscribed, and the unsubscribe notification is blocked from the target application. The initial descriptor attribute value and descriptor handle corresponding to the target feature data are saved to the second descriptor set in the first device's system. When the second device generates target feature data again, it no longer sends it to the first device's system. After a preset time, it resubscribes to the feature corresponding to the target feature data, deletes the initial descriptor attribute value and descriptor handle corresponding to the target feature data from the second descriptor set, modifies the attribute value of the descriptor corresponding to the target feature data in the second device to the attribute value corresponding to the subscription request, successfully subscribes but blocks the descriptor attribute value modification result from the target application, and re-determines the working state of the first device.

[0098] This embodiment of the disclosure determines that the first device receives target feature data sent by the second device in a preset working state, and the quantity exceeds a quantity threshold. It then sends an unsubscribe request to the second device to unsubscribe from the feature corresponding to the target feature data. This prevents the second device from sending the target feature data to the first device, and further prevents the first device from reporting the target feature data to the target application, reducing power consumption and extending battery life for both devices. Furthermore, this embodiment of the disclosure sets a second descriptor set so that after unsubscribing from the feature, if the first device's working state does not meet the preset working state, and / or the number of feature data received by the first device in the preset working state does not exceed the quantity threshold, the subscription to the feature can be resumed, allowing the user to receive the feature data promptly.

[0099] Based on the same concept, embodiments of this disclosure also provide an inter-device communication device.

[0100] It is understood that the device-to-device communication apparatus provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.

[0101] Figure 11 This is a block diagram illustrating an inter-device communication apparatus according to an exemplary embodiment. (Refer to...) Figure 11 The device includes a determining module 101, a sending module 102, an acquiring module 103, a saving module 104, and a processing module 105.

[0102] The determining module 101 is configured to determine that the working state of the first device is a preset working state; and to determine the target feature data received by the first device in the preset working state, wherein the target feature data is feature data sent by the second device to the target application and the quantity exceeds a quantity threshold;

[0103] The sending module 102 is configured to send an unsubscribe request to the second device, the unsubscribe request being used to unsubscribe from one or more features corresponding to the target feature data.

[0104] In one embodiment, the sending module 102 is specifically configured to determine the target descriptor corresponding to the target feature data in the first descriptor set; modify the attribute value of the target descriptor to the attribute value corresponding to unsubscribing; and send the attribute value corresponding to unsubscribing to the second device; the first descriptor set includes at least descriptors of features included in the services provided by the second device subscribed to by the target application.

[0105] In one embodiment, the first descriptor set is determined as follows: an initial descriptor set sent by the second device based on a service discovery request is obtained, the initial descriptor set being used to indicate the features included in the services subscribed to by the second device; the initial descriptor set is saved; in response to the target application subscription features, the descriptors in the initial descriptor set that match the features of the target application subscription are modified to the attribute values ​​corresponding to the subscription, thereby obtaining the first descriptor set.

[0106] In one embodiment, the determining module 101 is further configured to determine a link identifier corresponding to the target descriptor, the link identifier being used to identify a link established when the first device and the second device provide features included in the subscription service;

[0107] The acquisition module 103 is configured to acquire the descriptor handle and initial descriptor attribute value corresponding to the target descriptor in the first descriptor set;

[0108] The storage module 104 is configured to create a mapping relationship between the link identifier, the descriptor handle, and the initial descriptor attribute value, and save the mapping relationship to the second descriptor set, which stores descriptor information for restoring the features corresponding to the subscribed feature data.

[0109] In one embodiment, the sending module 102 is further configured to periodically send modification requests to the second device at preset time intervals, the modification requests including the attribute value of the target descriptor when the target feature is in a subscription state; in response to the target descriptor attribute value in the second device being modified to the attribute value corresponding to the target feature when it is in a subscription state, the mapping relationship corresponding to the target descriptor in the second descriptor set is deleted; the working state of the first device is re-determined, and the target feature data sent by the second device to the target application is received.

[0110] In one embodiment, the device further includes a processing module 105; the processing module 105 is further configured to, if it is determined that the working state of the first device does not meet the preset working state, modify the attribute values ​​of the descriptors in the second device one by one to the corresponding attribute values ​​of the subscription; and delete all mapping relationships stored in the second descriptor combination.

[0111] In one embodiment, the processing module 105 is further configured to update the attribute value of the corresponding descriptor in the first descriptor set in response to the modification of the attribute value of the descriptor to the corresponding attribute value of the subscription.

[0112] In one embodiment, the first device is a terminal, the second device is a Bluetooth device, and the preset working state is a screen-off state.

[0113] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0114] Figure 12 This is a block diagram illustrating an apparatus 200 for inter-device communication according to an exemplary embodiment. For example, apparatus 200 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0115] Reference Figure 12 The device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input / output (I / O) interface 212, sensor component 214, and communication component 216.

[0116] Processing component 202 typically controls the overall operation of device 200, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 202 may include one or more modules to facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.

[0117] Memory 204 is configured to store various types of data to support the operation of device 200. Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0118] The power supply component 206 provides power to the various components of the device 200. The power supply component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 200.

[0119] Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 208 includes a front-facing camera and / or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0120] Audio component 210 is configured to output and / or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or transmitted via communication component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.

[0121] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0122] Sensor assembly 214 includes one or more sensors for providing status assessments of various aspects of device 200. For example, sensor assembly 214 may detect the on / off state of device 200, the relative positioning of components such as the display and keypad of device 200, changes in the position of device 200 or a component of device 200, the presence or absence of user contact with device 200, the orientation or acceleration / deceleration of device 200, and temperature changes of device 200. Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 214 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0123] Communication component 216 is configured to facilitate wired or wireless communication between device 200 and other devices. Device 200 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 216 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0124] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0125] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, which can be executed by a processor 220 of the device 200 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0126] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0127] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.

[0128] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0129] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0130] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for communication between devices, characterized in that, The method is applied to a first device, on which a target application is installed, the target application being used to subscribe to services provided by a second device, wherein features included in the services generate feature data. The method includes: The target feature data received by the first device in a preset working state is determined, and the target feature data is the feature data sent by the second device to the target application. If the number of target feature data exceeds the quantity threshold, an unsubscribe request is sent to the second device. The unsubscribe request is used to unsubscribe from one or more features corresponding to the target feature data. Sending an unsubscribe request to the second device includes: Determine the target descriptor corresponding to the target feature data from the first descriptor set; Modify the target descriptor attribute value to the attribute value corresponding to unsubscribe, and send the attribute value corresponding to unsubscribe to the second device; The first set of descriptors includes at least descriptors of features included in the services provided by the second device that the target application subscribes to.

2. The method according to claim 1, characterized in that, The first set of descriptors is determined in the following manner: Obtain the initial descriptor set sent by the second device based on the service discovery request, the initial descriptor set being used to indicate the features included in the services that the second device supports subscribing to; Save the initial set of descriptors; In response to the target application subscription feature, the descriptors in the initial descriptor set that match the feature of the target application subscription are modified to the attribute values ​​corresponding to the subscription, thus obtaining the first descriptor set.

3. The method according to claim 1, characterized in that, The method further includes: Determine the link identifier corresponding to the target descriptor, the link identifier being used to identify the link established when the first device and the second device provide features included in the subscription service; Obtain the descriptor handle and initial descriptor attribute value corresponding to the target descriptor in the first descriptor set; A mapping relationship is created between the link identifier, the descriptor handle, and the initial descriptor attribute value, and the mapping relationship is saved to a second descriptor set, which stores descriptor information for restoring subscription to the features corresponding to the feature data.

4. The method according to claim 3, characterized in that, The method further includes: At preset time intervals, modification requests are periodically sent to the second device, and the modification requests include the attribute values ​​of the target descriptor when the target feature is in a subscription state; In response to the modification of the attribute value of the target descriptor in the second device to the attribute value corresponding to the target feature when it is in the subscription state, the mapping relationship corresponding to the target descriptor in the second descriptor set is deleted; The operating state of the first device is redefined, and target feature data sent by the second device to the target application is received.

5. The method according to claim 3 or 4, characterized in that, The method further includes: If it is determined that the working state of the first device does not meet the preset working state, the attribute values ​​of the descriptors in the second device are modified one by one to the corresponding attribute values ​​of the subscription; Delete all mappings stored in the second descriptor set.

6. The method according to claim 5, characterized in that, The method further includes: In response to the modification of the attribute value of a descriptor to the corresponding attribute value of the subscription, the attribute value of the corresponding descriptor in the first descriptor set is updated.

7. The method according to claim 1, characterized in that, The first device is a terminal, the second device is a Bluetooth device, and the preset working state is the screen-off state.

8. A device-to-device communication apparatus, characterized in that, An apparatus for use in a first device, wherein a target application is installed, the target application is used to subscribe to services provided by a second device and to obtain feature data sent by the second device, the feature data being data generated from features included in the service, the apparatus comprising: The determining module is used to determine that the working state of the first device is a preset working state; and to determine the target feature data received by the first device in the preset working state, wherein the target feature data is feature data sent by the second device to the target application and the quantity exceeds a quantity threshold; The sending module is configured to send an unsubscribe request to the second device, wherein the unsubscribe request is used to unsubscribe from one or more features corresponding to the target feature data; Specifically, the sending module is configured to determine the target descriptor corresponding to the target feature data in the first descriptor set; modify the attribute value of the target descriptor to the attribute value corresponding to unsubscribing; and send the attribute value corresponding to unsubscribing to the second device; the first descriptor set includes at least descriptors of features included in the services provided by the second device subscribed to by the target application.

9. The apparatus according to claim 8, characterized in that, The first set of descriptors is determined in the following manner: Obtain the initial descriptor set sent by the second device based on the service discovery request, the initial descriptor set being used to indicate the features included in the services that the second device supports subscribing to; Save the initial set of descriptors; In response to the target application subscription feature, the descriptors in the initial descriptor set that match the feature of the target application subscription are modified to the attribute values ​​corresponding to the subscription, thus obtaining the first descriptor set.

10. The apparatus according to claim 8, characterized in that, The device further includes an acquisition module and a storage module; The determining module is further configured to determine the link identifier corresponding to the target descriptor, wherein the link identifier is used to identify the link established when the first device and the second device provide features included in the subscription service; The acquisition module is used to acquire the descriptor handle and initial descriptor attribute value corresponding to the target descriptor in the first descriptor set; The saving module is used to create a mapping relationship between the link identifier, the descriptor handle and the initial descriptor attribute value, and save the mapping relationship to the second descriptor set, which stores descriptor information for restoring the subscription of the feature data corresponding to the feature data.

11. The apparatus according to claim 10, characterized in that, The sending module is further configured to periodically send modification requests to the second device at preset time intervals, wherein the modification requests include the attribute values ​​of the target descriptor when the target feature is in a subscription state; In response to the modification of the target descriptor attribute value in the second device to the attribute value corresponding to the target feature when it is in the subscription state, the mapping relationship corresponding to the target descriptor in the second descriptor set is deleted; the working state of the first device is re-determined, and the target feature data sent by the second device to the target application is received.

12. The apparatus according to claim 10 or 11, characterized in that, The device also includes a processing module; The processing module is further configured to, if it is determined that the working state of the first device does not meet the preset working state, modify the attribute values ​​of the descriptors in the second device one by one to the corresponding attribute values ​​of the subscription; and delete all mapping relationships stored in the second descriptor set.

13. The apparatus according to claim 12, characterized in that, The processing module is further configured to update the attribute value of the corresponding descriptor in the first descriptor set in response to the modification of the attribute value of the descriptor to the corresponding attribute value of the subscription.

14. A device-to-device communication apparatus, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the inter-device communication method as described in any one of claims 1-7.

15. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the terminal, the terminal is able to perform the inter-device communication method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Devices, method and system for notifying user state

    CN103746897A

  • Transmitting method and device for user mode subscription information based on RCS client

    CN105915448A