Pairing connection method and device and storage medium

By pre-storing the connection information of trusted devices in Bluetooth low-power devices and authenticating it when the first connection is completed, reading the pairing connection information from the local cache file, the problems of slow pairing connection speed and high power consumption are solved, and users are improved Experience.

CN118900412APending Publication Date: 2024-11-05BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310499627.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

Bluetooth low-power human-computer interface device pairing connection is slower for the first time, and the power consumption is large, which affects the user experience.

Method used

By pre-storing the connection information of the trusted device in the first device, obtaining the device information of the second device for authentication, the matching connection information is read from the local cache file for pairing and connection, reducing the interaction process of the counterpart devices.

Benefits of technology

Speed ​​up the pairing connection, reduce power consumption between devices, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900412A_ABST
    Figure CN118900412A_ABST
Patent Text Reader

Abstract

The invention relates to a pairing connection method and device and a storage medium. The pairing connection method is applied to a first device, and the pairing connection method comprises the following steps: in response to determining that the first device is triggered to perform pairing connection with a second device, obtaining device information of the second device, and authenticating the second device based on the device information of the second device; reading pairing connection service information matched with the second equipment from pre-stored service information for pairing connection in response to passing of the authentication of the second equipment; and performing pairing connection with the second equipment based on the pairing connection service information. According to the method and the device, the problems of relatively low speed and relatively high power consumption of the first connection of the pairing connection are solved, and the use experience of the pairing connection of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Bluetooth communication technology, and more particularly to a pairing connection method, device and storage medium. Background Art

[0002] With the development of Bluetooth communication technology, pairing connection technology has entered our daily life with its own advantages. Pairing connection has also had greater demand and application scenarios. For example, it has been applied in the pairing connection scenario of Bluetooth low-power human-machine interface devices.

[0003] Bluetooth low-power devices include styluses, keyboards, etc. Currently, the initial connection speed of Bluetooth low-power human-machine interface devices is slow and consumes a lot of power, which affects the user experience of pairing and connection. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a pairing connection method, device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a pairing and connection method is provided, which is applied to a first device, comprising: in response to determining that the first device is triggered to pair and connect with a second device, obtaining device information of the second device, and authenticating the second device based on the device information of the second device; in response to the second device being authenticated successfully, reading pairing and connection service information matching the second device from pre-stored service information for pairing and connection; and pairing and connecting with the second device based on the pairing and connection service information.

[0006] In one embodiment, the obtaining of the device information of the second device and authenticating the second device based on the device information of the second device includes: obtaining a broadcast message broadcast by the second device, the broadcast message including the address information and private protocol information of the second device; scanning the second device based on the address information of the second device; in response to scanning the second device based on the address information of the second device, parsing the private protocol information; and determining the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device, so as to authenticate the second device.

[0007] In one implementation, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0008] In one embodiment, the reading of the pairing connection service information of the second device from the pre-stored service information for pairing connection includes: reading the cache information of the second device from the local database based on a connection callback event trigger of the protocol stack, and the cache information is used to cache the pairing connection service information of the second device; if the cache information of the second device exists in the local database, the pairing connection service information of the second device is read from the local database; if the cache information of the second device does not exist in the local database, loading a cache file, the cache file including a service identification field of the second device, and reading the pairing connection service information of the second device from the cache file based on the service identification field of the second device.

[0009] In one implementation, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0010] In one implementation, the first device is a terminal, and the second device is a stylus.

[0011] According to a second aspect of an embodiment of the present disclosure, a pairing and connection method is provided, which is applied to a second device, comprising: in response to determining that the second device is triggered to pair and connect with a first device, sending device information of the second device; and pairing and connecting with the first device based on pairing and connection service information, wherein the pairing and connection service information is read by the first device from pre-stored service information for pairing and connection when the second device is authenticated.

[0012] In one embodiment, sending the device information of the second device includes: broadcasting a broadcast message, wherein the broadcast message includes the address information and private protocol information of the second device; the address information is used by the first device to scan the second device, and the private protocol information is used by the first device to authenticate the second device based on the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device.

[0013] In one implementation, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0014] In one embodiment, the pre-stored service information for pairing connection is stored in cache information of a local database of the first device, and the cache information is used to cache the pairing connection service information of the second device; or the pre-stored service information for pairing connection is stored in a cache file, and the cache file includes a service identification field of the second device, and the service identification field of the second device is used to identify the pairing connection service information of the second device.

[0015] In one implementation, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0016] According to a third aspect of an embodiment of the present disclosure, a pairing connection apparatus is provided, which is applied to a first device, and the apparatus comprises: a processing unit, which is used to obtain device information of the second device in response to determining that the first device is triggered to pair with a second device, and authenticate the second device based on the device information of the second device. In response to the second device being authenticated, pairing connection service information matching the second device is read from pre-stored service information for pairing connection; and a connection unit, which is used to pair with the second device based on the pairing connection service information.

[0017] In one embodiment, the processing unit obtains the device information of the second device in the following manner, and authenticates the second device based on the device information of the second device: obtain a broadcast message broadcast by the second device, the broadcast message including the address information and private protocol information of the second device; scan the second device based on the address information of the second device; in response to scanning the second device based on the address information of the second device, parse the private protocol information; determine the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device, so as to authenticate the second device.

[0018] In one implementation, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0019] In one embodiment, the processing unit reads the pairing connection service information of the second device from the pre-stored service information for pairing connection in the following manner: based on the connection callback event trigger of the protocol stack, the cache information of the second device is read from the local database, and the cache information is used to cache the pairing connection service information of the second device; if the cache information of the second device exists in the local database, the pairing connection service information of the second device is read from the local database; if the cache information of the second device does not exist in the local database, the cache file is loaded, and the cache file includes the service identification field of the second device, and the pairing connection service information of the second device is read from the cache file based on the service identification field of the second device.

[0020] In one implementation, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0021] In one implementation, the first device is a terminal, and the second device is a stylus.

[0022] According to a fourth aspect of an embodiment of the present disclosure, a pairing and connection device is provided, which is applied to a second device, and the device includes: a sending unit, which is used to send device information of the second device in response to determining that the second device is triggered to pair and connect with the first device; and a connecting unit, which is used to pair and connect with the first device based on pairing and connection service information, and the pairing and connection service information is read by the first device from pre-stored service information for pairing and connection when the second device is authenticated.

[0023] In one embodiment, the sending unit sends the device information of the second device in the following manner: broadcasting a broadcast message, wherein the broadcast message includes the address information and private protocol information of the second device; the address information is used by the first device to scan the second device, and the private protocol information is used by the first device to authenticate the second device based on the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device.

[0024] In one implementation, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0025] In one embodiment, the pre-stored service information for pairing connection is stored in cache information of a local database of the first device, and the cache information is used to cache the pairing connection service information of the second device; or the pre-stored service information for pairing connection is stored in a cache file, and the cache file includes a service identification field of the second device, and the service identification field of the second device is used to identify the pairing connection service information of the second device.

[0026] In one implementation, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0027] According to a fifth aspect of the present disclosure, a pairing connection device is provided, comprising a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the method described in the aforementioned first aspect or any one of the embodiments of the first aspect.

[0028] According to a sixth aspect of the present disclosure, a pairing connection device is provided, comprising a processor; a memory for storing processor executable instructions; wherein the processor is configured to: execute the method described in the aforementioned second aspect or any one of the embodiments of the second aspect.

[0029] According to a seventh aspect of the present disclosure, a storage medium is provided, wherein the storage medium stores instructions, and when the instructions are executed by a processor in a first device, the pairing connection method described in the first aspect or any one of the embodiments of the first aspect is executed.

[0030] According to an eighth aspect of the present disclosure, a storage medium is provided, wherein the storage medium stores instructions, and when the instructions are executed by a processor in a second device, the pairing connection method described in the aforementioned second aspect or any one of the embodiments of the second aspect is executed.

[0031] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: through the present disclosure, the first device can authenticate the information of the trusted second device, and after the authentication is passed, the service connection information can be read from the local cache file in which the first device has pre-saved information to connect, thereby eliminating the need to cache the information of the opposite device during the first pairing connection, reducing the interaction process between devices and speeding up the pairing connection. Therefore, the present disclosure solves the problem of slow initial connection speed and high power consumption of the pairing connection, and improves the user experience of the pairing connection.

[0032] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0034] Figure 1 The figure is a flowchart of a pairing connection method according to an exemplary embodiment.

[0035] Figure 2 The present invention is a flowchart of a method for authenticating a second device based on device information of the second device according to an exemplary embodiment.

[0036] Figure 3 The present invention is a flowchart showing a method for reading pairing connection service information of a second device from pre-stored service information for pairing connection according to an exemplary embodiment.

[0037] Figure 4 The figure is a flowchart of a pairing connection method according to an exemplary embodiment.

[0038] Figure 5 The figure is a schematic diagram showing a process of a pairing connection method according to an exemplary embodiment.

[0039] Figure 6 The figure is a block diagram showing a device for connecting equipment according to an exemplary embodiment.

[0040] Figure 7 The figure is a block diagram showing a device for connecting equipment according to an exemplary embodiment.

[0041] Figure 8 The figure is a block diagram showing a device for connecting equipment according to an exemplary embodiment.

[0042] Fig. 9 The figure is a block diagram showing a device for connecting equipment according to an exemplary embodiment. DETAILED DESCRIPTION

[0043] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.

[0044] The pairing connection method provided in the embodiment of the present disclosure is applied to the scenario of pairing and connecting devices for data transmission, for example, in the scenario of pairing and connecting a human-machine interface (Human Interface Device, HID) of Bluetooth Low Energy (Bluetooth Low Energy, BLE).

[0045] HID is a commonly used device type in Universal Serial Bus (USB) devices. It is a USB device that interacts directly with people. Among USB devices, HID devices have a lower cost. In addition, HID devices do not necessarily have to have human-computer interaction functions. As long as the device meets the HID category specification, it is a HID device.

[0046] Currently, there are two caches for BLE HID devices in Android Bluetooth: during the pairing process, a service query operation will be performed, and all services supported by the peer device will be saved in a local cache file. After that, all services that need to be obtained will be returned from the local cache file, and there is no need to query the peer device again. This is the first cache; when the pairing is completed and the first HID connection is made, the HID main service and the information contained will be queried, and the information obtained from the peer device will be stored in another cache file. Subsequent connections will be read directly from this file, and there is no need to query the peer device again. This is the second cache. Subsequent non-first connections only need to read the corresponding required information from the local cache file cached in the first connection, which saves the time of querying the peer device each time.

[0047] Therefore, the current technology is that when HID is first connected, it will query the peer device and store all the services supported by the peer device in a local cache file. When the pairing is completed and connected, the HID main service and the information contained will be queried again and stored in another cache file for subsequent reading. The first pairing connection speed is slow and the power consumption is high, which affects the user's pairing connection experience.

[0048] In view of this, the embodiment of the present disclosure provides a pairing connection method, which can be applied to the pairing connection of a Bluetooth low energy human-machine interface device. Through the present disclosure, the problem of slow speed and high power consumption of the first pairing connection can be solved, and the user experience of pairing connection can be improved.

[0049] In the pairing connection method provided by the present disclosure, when a first device is paired with a second device, there is pre-cached connection information about the second device in the first device, and when connecting, the information of the second device that matches can be read from the local cache file of the first device to perform the pairing connection. Among them, the connection information of the trusted second device is pre-stored in the first device, and the first device needs to authenticate and confirm the second device according to the information sent by the second device before executing the connection process.

[0050] Among them, the two devices that need to be paired and connected are called the first device and the second device. The first device has processing and storage functions, and the second device is the device that needs to be paired and connected. For the convenience of description, the device with processing and storage functions is called the first device, and the device that needs to be paired and connected is called the second device. For example: the first device is a terminal, and the second device is a stylus.

[0051] The first device confirms the trigger to pair with the second device, obtains the device information of the second device, the first device performs authentication based on the information of the second device, reads the connection information matching the second device from the cache file pre-cached by the first device, connects with the second device according to the pairing connection information, and completes the pairing connection process.

[0052] Figure 1 is a flow chart showing a pairing connection method according to an exemplary embodiment. Figure 1 As shown, the pairing connection method is applied in a terminal, and includes the following steps.

[0053] In step S11, in response to determining that the first device is triggered to pair with the second device, device information of the second device is acquired, and the second device is authenticated based on the device information of the second device.

[0054] In one example, the first device being triggered means that the first device and the second device trigger an imperceptible data interaction behavior through magnetic attraction at a fixed position, and the user does not need to perform other operations to confirm the pairing connection with the second device.

[0055] The device information of the second device includes but is not limited to information about the model, type and version number of the second device.

[0056] In one example, acquiring the device information of the second device may be understood to include but is not limited to acquiring the device information of the second device through broadcast information of the second device.

[0057] The first device authenticates the second device based on the device information of the second device, which can be understood as the first device identifying the identification information of the second device and authenticating and confirming it as the second device.

[0058] In step S12, in response to the second device being authenticated successfully, pairing connection service information matching the second device is read from pre-stored service information for pairing connection.

[0059] In step S13, pairing and connection are performed with the second device based on the pairing and connection service information.

[0060] Among them, the connection service information can be understood as functional service information such as handwriting function, power reporting, and customization function.

[0061] In one example, reading the pairing connection information that matches the second device from the pre-stored service information for pairing refers to the relevant service information about the second device that has been pre-matched in the first device. If the authentication is successful, the call-related information can be directly read without querying and confirming the relevant information of the other end, that is, the second device.

[0062] In one example, the first device confirms the connection of the relevant configuration file through the interactive data of the pairing connection service information, so that the first device establishes a communication connection with the second device, completing the entire pairing connection process.

[0063] In the pairing connection method provided in the embodiment of the present disclosure, the first device is triggered to pair with the second device, and the second device is authenticated according to the device information acquired in the broadcast of the second device. After the second device is authenticated, the first device can directly read the relevant pairing connection information of the second device through the pre-stored service information for pairing connection. Based on the processed and confirmed pairing connection information, the first device connects with the second device to complete the entire pairing connection process.

[0064] The following embodiment of the present disclosure describes the execution process of the pairing connection method involved in the above embodiment.

[0065] The embodiment of the present disclosure describes an implementation process in which a first device obtains device information of a second device and authenticates the second device based on the device information of the second device.

[0066] Figure 2 FIG. 1 is a flowchart of a method for authenticating a second device based on device information of the second device according to an exemplary embodiment. Figure 2 As shown, the following steps are included.

[0067] In step S21, a broadcast message broadcast by the second device is obtained, where the broadcast message includes address information and private protocol information of the second device.

[0068] The acquisition of the broadcast message of the second device can be understood as the first device confirming the pairing connection with the second device through triggering. The first device acquires the device information of the second device through the broadcast message broadcast by the second device.

[0069] The private protocol information includes at least one of a data content identifier, a second device identifier, and second device version information. The private protocol content can be understood as identification information, and whether it is the second device is confirmed based on the private protocol information.

[0070] The content of the private agreement is shown in Table 1:

[0071] Table 1

[0072]

[0073]

[0074] The data content identifier is used to identify the specific data content of the corresponding protocol, such as broadcast field length, broadcast type, data length, etc. For example, in Table 1, AD Type indicates the broadcast type, and Service UUID can be understood as a data content identifier, which is used to identify the specific data content of the corresponding protocol.

[0075] The second device identifier refers to the unique identifier of the specific device of the second device, and different devices use different identifiers. For example: the product identifier (ProductID), major number (Major ID), and minor number (Minor ID) in Table 1. Among them, the product identifier, major number, and minor number can be used to identify the device, that is, the second device identifier involved in the above-mentioned embodiment of the present disclosure, in which the unique identifier of the specific device is allocated by the same server, and different devices use different identifiers.

[0076] The second device version information is used to identify the version of information in the current device that can be identified by the first device, such as version type, service version number, etc. For example, Type in Table 1 indicates the version type, and Version is used to identify the version of information in the current device that can be queried by the first device.

[0077] In one example, the broadcast content includes private protocol content, and also includes the major number and minor number of the specific device assigned by the same server and the version number of the second device's own information.

[0078] In one example, the broadcast message includes the address information and private protocol information of the second device. The address information and private protocol information are dedicated to the second device broadcast message and are used to confirm the identification information of the model, type and version number of the second device.

[0079] In step S22, the second device is scanned based on the address information of the second device.

[0080] Among them, the first device can scan the address information of the second device, which reduces the interaction process between the first device and the second device and reduces the power consumption when the devices are paired and connected to a certain extent.

[0081] In step S23, in response to scanning the second device based on the address information of the second device, parsing the private protocol information;

[0082] The first device will automatically identify the content in the private protocol, confirm whether it is the second device, and parse the acquired private protocol content of the relevant second device.

[0083] In step S24, the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device is determined to authenticate the second device.

[0084] In one example, when the first device scans the broadcast of the second device, it will parse the content of the relevant fields from the broadcast data, determine whether it is the second device and what the information version number in the current device is, and load different local caches for connection according to the corresponding version number during subsequent connections.

[0085] The first device parses the private protocol content of the second device to obtain the parsed information content. The parsed information content is compared with the information content stored in the first device to confirm whether they are consistent. If the parsed information content is consistent with the information content stored in the first device, the authentication is passed. If the parsed information content is inconsistent with the information content stored in the first device, it is directly returned and the query work is performed for pairing.

[0086] For example: the first device parses the private protocol content of the second device and obtains the model, type, version number and other information of the second device after parsing. The obtained model, type and version number of the second device are compared with the model, type and version number of the second device saved by the first device. If the model, type and version number are consistent, the authentication is passed. If there is a difference in the model, type and version number, it is directly returned to perform the original query and pairing service for the opposite device.

[0087] In the disclosed embodiment, the first device obtains the device information of the second device through a broadcast message, and the device information of the second device includes address information and private protocol content. The first device scans the second device through the address information. The first device obtains the parsed information content by parsing the private protocol content. Confirm whether the parsed information content is consistent with the information content saved by the first device. If the parsed information content is consistent with the information content saved by the first device, the authentication is passed. If the parsed information content is inconsistent with the information content saved by the first device, it directly returns to query the pairing service. Through the present disclosure, the interaction process between the first device and the second device is reduced, the power consumption of the device is reduced to a certain extent, and the speed of the pairing connection is improved.

[0088] In the embodiment of the present disclosure, the first device retrieves the pre-stored service information about the second device pairing connection after the second device is authenticated. The first device reads the matching pairing service information of the second device from the pre-stored pairing connection service information to implement the process described below.

[0089] Figure 3FIG. 1 is a flowchart showing a method for reading the pairing connection service information of the second device from the pre-stored service information for pairing connection according to an exemplary embodiment. Figure 3 As shown, the following steps are included.

[0090] In step S31, cache information of the second device is read from a local database based on a connection callback event trigger of the protocol stack, where the cache information is used to cache pairing connection service information of the second device.

[0091] Among them, the pairing connection service information can be understood as functional service information such as handwriting function, power reporting, and customization function.

[0092] Among them, the protocol stack can be understood as the sum of all layers of protocols in the network, which vividly reflects the process of file transmission in a network, from the upper layer protocol to the bottom layer protocol, and then from the bottom layer protocol to the upper layer protocol.

[0093] The connection callback event may be understood as a physical channel, through which the second device may read the cached pairing connection information.

[0094] In step S32a, if the cache information of the second device exists in the local database, the pairing connection service information of the second device is read from the local database.

[0095] In step S32b, if the cache information of the second device does not exist in the local database, a cache file is loaded, the cache file includes a service identification field of the second device, and the pairing connection service information of the second device is read from the cache file based on the service identification field of the second device.

[0096] The service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0097] Among them, the cache file can be understood as when an application needs to access a certain file, the system will first search for the file in the temporary folder. If it is found, it will be used directly, otherwise it will be read from the hard disk.

[0098] In one example, when a connection callback event is received from the protocol stack, the current database is first checked to see if there is cache information of the device. If the cache data of the device is empty, the local cache file / data / misc / bluetooth / gatt_cache_SmartPen is opened through file operations. Compared with the cache file gatt_cache_XXXXXXXX (XXXXXX is the specific MAC address of the device) generated after the system is paired and connected, this file has a [SmartPen] field added. When loading the file, the content after the [SmartPen] field is directly queried to load the local data and read the storage information of the relevant device for use in subsequent processes. There is no need to find the corresponding file according to the device MAC address for file operations, nor is there any need to trigger the query (discover) process to query which functional services the device supports.

[0099] Before loading the local cache file, first obtain the version number of the device information saved before pairing through the persistent Bluetooth specification ("persist.bluetooth.spechid") and compare it with the current device. If they are the same, continue to load the local information, otherwise return. The caller will check whether the return value is empty. If it is empty, continue to execute the query (discover) process.

[0100] After the pairing process is completed, the HID configuration file will be connected. When the security check is completed (Security checkcompleted), if it is a newly connected device, the local cache file / data / misc / bluedroid / bt_spec_config.conf will be loaded through file operations first. Compared with the cache file bt_config.conf generated after the system pairing connection, [XX:XX:XX:XX:XX:XX] (XXXXXX is the specific MAC address of the device) content will be added for each device. When loading, it is necessary to traverse all [XX:XX:XX:XX:XX:XX] contents to find the information under the corresponding device address. The [SmartPen] general field is added to this newly added file. When loading the file, directly query the content after the [SmartPen] field to load the local data and read the storage information of the relevant device. There is no need to traverse all the storage information according to the device MAC address and then perform file operations to obtain the HID report (HidReport) and HID descriptor (HidDescriptor) information of the second device stored locally.

[0101] Similarly, before loading the file, the device and information version numbers saved before pairing will be obtained through the persistent Bluetooth specification ("persist.bluetooth.spechid") and compared with the current device. If they are the same, the local information will continue to be loaded. Otherwise, failure will be returned directly. The caller will check whether the return value meets the requirements. If not, a primary service discovery will be initiated for the HID service. If it is satisfied, the connection is returned directly.

[0102] In an embodiment of the present disclosure, a first device is triggered to pair and connect with a second device, and the authentication of the second device is completed based on the acquired device information of the second device. The first device reads the pairing service information of the matched second device from the pre-stored service information for pairing and connection. The first device reads the cache information of the second device from the local database triggered by the connection callback event of the protocol stack. If the local cache file library contains cache information, the pairing connection service information of the second device can be read directly. If there is no cache information, the cache file of the local specific device can be loaded based on the service identification segment, and the pairing connection information contained in the cache file of the local specific device can be read to perform pairing and connection. Through the present disclosure, the interaction process between the device and the opposite device is reduced, the speed of pairing and connection is accelerated, and the power consumption of the device during pairing and connection is reduced to a certain extent.

[0103] Based on the same concept, an embodiment of the present disclosure also provides a pairing connection method applied to a second device.

[0104] The following embodiment of the present disclosure describes a pairing connection method involved in the above embodiment, and its execution process applied to a second device.

[0105] Figure 4 FIG. 1 is a flow chart showing a pairing connection method according to an exemplary embodiment. Figure 4 As shown, the following steps are included.

[0106] In step S41, in response to determining that the second device is triggered to pair with the first device, device information of the second device is sent.

[0107] In step S42, pairing and connection are performed with the first device based on the pairing and connection service information. The pairing and connection service information is read by the first device from pre-stored service information for pairing and connection when the second device is authenticated.

[0108] In one example, the second device information sent is a broadcast message broadcast by the second device, and the broadcast message includes address information and private protocol information of the second device. The private protocol information includes at least one of the following: data content identification, second device identification, and second device version information.

[0109] Among them, the data content identifier, the second device identifier, and the second device version information have been described in detail in the above embodiments and will not be repeated here.

[0110] The first device reads the pairing connection service information matching the second device from the pre-stored service information for pairing connection in the above embodiment, which will not be described in detail here.

[0111] In the embodiment of the present disclosure, the second device triggers a pairing connection with the first device and sends device broadcast information to the first device. After the second device is authenticated, the first device directly calls the service information matched to the second device from the cache file of the pre-stored service information about the second device connection. Based on the processed and confirmed pairing connection information, the second device connects to the first device to complete the entire pairing connection process. Through the present disclosure, the interaction process between the device and the peer device is reduced, and the user experience of the pairing connection is improved.

[0112] The pairing and connection method involved in the above embodiments of the present disclosure is described by taking the first device as a terminal and the second device as a stylus as an example.

[0113] Figure 5 The figure is a schematic diagram showing a process of a pairing connection method according to an exemplary embodiment.

[0114] See also Figure 5 As shown, the stylus can be paired and connected after it is magnetically attached to the terminal, without the user having to perform other operations. The terminal and the stylus start pairing and connecting to the peer device. The terminal obtains the stylus information from the stylus broadcast and authenticates whether it is a stylus. If it is not a stylus, the attribute protocol main query service search is performed according to the normal procedure, and the connection action is performed after all the supported service information of the peer device is queried. If it is a stylus, the information of the stylus of this type stored in the local memory is directly read, the local information is used to create a connection, the connection is confirmed to be complete, and the pairing connection is ended.

[0115] In the disclosed embodiment, before pairing the terminal and the stylus, the terminal will first obtain the stylus device that needs to be paired, obtain the model, type and version number of the device from the paired stylus broadcast information, and verify whether it is a supported device type. After the authentication is passed, during the pairing connection process, when a connection callback event of the protocol stack is received, first check whether there is cache information in the current database. If there is cache information, call it directly. If the cache information is empty, load the cache file containing the service identification field of the local specific device, read the cache information, and confirm that the pairing connection function is supported, otherwise trigger the query service. After the pairing process is completed, the configuration file will be connected, and the pairing connection service information in the cache file containing the service identification field will be read. The service identification field contains the service report and descriptor information of all the services of the stylus. The terminal and the stylus complete the entire pairing connection process.

[0116] Through the present disclosure, the first device can authenticate the relevant information of the trusted second device. If the identification authentication is successful, the pairing connection service information of the relevant second device can be read from the cache information about the second device pre-stored by the first device and / or the cache file of the specific device, so that there is no need to query the opposite device during the first pairing connection. Therefore, the interaction process between the device and the opposite device is reduced, the speed of the first pairing connection is accelerated, and the power consumption of the device during the pairing connection is reduced.

[0117] Based on the same concept, an embodiment of the present disclosure also provides a pairing connection device.

[0118] It is understandable that the pairing connection device provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or 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 to exceed the scope of the technical solution of the embodiment of the present disclosure.

[0119] Figure 6 FIG. 1 is a block diagram of a pairing connection device 100 according to an exemplary embodiment. Figure 6 The device includes: a processing unit 101 and a connecting unit 102.

[0120] The processing unit 101 is configured to, in response to determining that the first device is triggered to pair with the second device, obtain device information of the second device, and authenticate the second device based on the device information of the second device. In response to the second device being authenticated, read the pairing connection service information matching the second device from the pre-stored service information for pairing connection;

[0121] The connecting unit 102 is configured to perform a pairing connection with a second device based on the pairing connection service information.

[0122] In one example, the processing unit 101 obtains the device information of the second device in the following manner, and authenticates the second device based on the device information of the second device: obtain a broadcast message broadcast by the second device, the broadcast message including address information and private protocol information of the second device; scan the second device based on the address information of the second device; in response to scanning the second device based on the address information of the second device, parse the private protocol information; determine the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device, so as to authenticate the second device.

[0123] In one example, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0124] In one example, the processing unit 101 reads the pairing connection service information of the second device from the pre-stored service information for pairing connection in the following manner, including: reading the cache information of the second device from the local database based on the connection callback event trigger of the protocol stack, and the cache information is used to cache the pairing connection service information of the second device; if the cache information of the second device exists in the local database, the pairing connection service information of the second device is read from the local database; if the cache information of the second device does not exist in the local database, the cache file is loaded, and the cache file includes the service identification field of the second device, and the pairing connection service information of the second device is read from the cache file based on the service identification field of the second device.

[0125] In one example, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0126] In one example, the first device is a terminal, and the second device is a stylus.

[0127] Figure 7 FIG. 2 is a block diagram of a pairing connection device according to an exemplary embodiment. Figure 7 The device includes: a sending unit 201 and a connecting unit 202.

[0128] The sending unit 201 is configured to send device information of the second device in response to determining that the second device is triggered to pair with the first device;

[0129] The connecting unit 202 is configured to perform pairing connection with the first device based on the pairing connection service information, where the pairing connection service information is read by the first device from pre-stored service information for pairing connection when the second device is authenticated successfully.

[0130] In one example, the sending unit 201 sends the device information of the second device in the following manner: broadcasting a broadcast message, the broadcast message including the address information and private protocol information of the second device; the address information is used by the first device to scan the second device, and the private protocol information is used by the first device to authenticate the second device based on the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device.

[0131] In one example, the private protocol information includes at least one of the following: a data content identifier, a second device identifier, and second device version information.

[0132] In one example, the pre-stored service information for pairing connection is stored in cache information of a local database of the first device, and the cache information is used to cache the pairing connection service information of the second device; or the pre-stored service information for pairing connection is stored in a cache file, and the cache file includes a service identification field of the second device, and the service identification field of the second device is used to identify the pairing connection service information of the second device.

[0133] In one example, the service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

[0134] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0135] Figure 8 1 is a block diagram of a device 300 for pairing and connecting according to an exemplary embodiment. For example, the device 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0136] Reference Figure 8, the device 300 may include one or more of the following components: a processing component 302 , a memory 304 , a power component 306 , a multimedia component 308 , an audio component 310 , an input / output (I / O) interface 312 , a sensor component 314 , and a communication component 316 .

[0137] The processing component 302 generally controls the overall operation of the device 300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.

[0138] The memory 304 is configured to store various types of data to support operations on the device 300. Examples of such data include instructions for any application or method operating on the device 300, contact data, phone book data, messages, pictures, videos, etc. The memory 304 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 memory, flash memory, magnetic disk or optical disk.

[0139] The power component 306 provides power to the various components of the device 300. The power component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 300.

[0140] The multimedia component 308 includes a screen that provides an output interface between the device 300 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 touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front camera and / or a rear camera. When the device 300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0141] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), and when the device 300 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 304 or sent via the communication component 316. In some embodiments, the audio component 310 also includes a speaker for outputting audio signals.

[0142] I / O interface 312 provides an interface between processing component 302 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0143] The sensor assembly 314 includes one or more sensors for providing various aspects of the status assessment of the device 300. For example, the sensor assembly 314 can detect the open / closed state of the device 300, the relative positioning of components, such as the display and keypad of the device 300, the sensor assembly 314 can also detect the position change of the device 300 or a component of the device 300, the presence or absence of user contact with the device 300, the orientation or acceleration / deceleration of the device 300, and the temperature change of the device 300. The sensor assembly 314 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 314 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 314 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0144] The communication component 316 is configured to facilitate wired or wireless communication between the device 300 and other devices. The device 300 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0145] In an exemplary embodiment, the apparatus 300 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 above method.

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

[0147] Fig. 9 4 is a block diagram of a device 400 for configuring a connection according to an exemplary embodiment. For example, the device 400 may be provided as a server. Fig. 9 , the apparatus 400 includes a processing component 422, which further includes one or more processors, and a memory resource represented by a memory 432 for storing instructions executable by the processing component 422, such as an application. The application stored in the memory 432 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 422 is configured to execute instructions to perform the above method...

[0148] The device 400 may also include a power supply component 426 configured to perform power management of the device 400, a wired or wireless network interface 450 configured to connect the device 400 to a network, and an input / output (I / O) interface 458. The device 400 may operate based on an operating system stored in the memory 432, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0149] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.

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

[0151] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.

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

[0153] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

[0154] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.

Claims

1. A pairing connection method, characterized in that: Applied to a first device, the method includes: In response to determining that the first device is triggered to pair with a second device, acquiring device information of the second device, and authenticating the second device based on the device information of the second device; In response to the second device being authenticated successfully, reading pairing connection service information matching the second device from pre-stored service information for pairing connection; Perform pairing and connection with the second device based on the pairing and connection service information.

2. The method according to claim 1, characterized in that The acquiring device information of the second device and authenticating the second device based on the device information of the second device includes: Acquire a broadcast message broadcast by the second device, where the broadcast message includes address information and private protocol information of the second device; scanning the second device based on the address information of the second device; In response to scanning the second device based on the address information of the second device, parsing the private protocol information; Determine the consistency between information content obtained by parsing the private protocol information and information content stored in the first device to authenticate the second device.

3. The method according to claim 2, characterized in that The private protocol information includes at least one of the following: Data content identifier, second device identifier, and second device version information.

4. The method according to any one of claims 1 to 3, characterized in that The reading the pairing connection service information of the second device from the pre-stored service information for pairing connection includes: Reading cache information of the second device from a local database based on a connection callback event trigger of the protocol stack, where the cache information is used to cache pairing connection service information of the second device; If the cache information of the second device exists in the local database, reading the pairing connection service information of the second device from the local database; If the cache information of the second device does not exist in the local database, a cache file is loaded, the cache file includes a service identification field of the second device, and the pairing connection service information of the second device is read from the cache file based on the service identification field of the second device.

5. The method according to claim 4, characterized in that The service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

6. The method according to any one of claims 1 to 4, characterized in that: The first device is a terminal, and the second device is a stylus.

7. A pairing connection method, characterized in that: Applied to the second device, the method includes: In response to determining that the second device is triggered to pair with the first device, sending device information of the second device; Pairing and connecting with the first device is performed based on the pairing and connecting service information, where the pairing and connecting service information is read by the first device from pre-stored service information for pairing and connecting when the second device is authenticated successfully.

8. The method according to claim 7, characterized in that The sending the device information of the second device includes: Broadcasting a broadcast message, wherein the broadcast message includes address information and private protocol information of the second device; The address information is used by the first device to scan the second device, and the private protocol information is used by the first device to authenticate the second device based on the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device.

9. The method according to claim 8, characterized in that The private protocol information includes at least one of the following: Data content identifier, second device identifier, and second device version information.

10. The method according to any one of claims 7 to 9, characterized in that The pre-stored service information for pairing connection is stored in cache information of a local database of the first device, and the cache information is used to cache the pairing connection service information of the second device; or The pre-stored service information for pairing connection is stored in a cache file, and the cache file includes a service identification field of the second device, and the service identification field of the second device is used to identify the pairing connection service information of the second device.

11. The method according to claim 10, characterized in that The service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

12. A pairing connection device, characterized in that: Applied to a first device, the apparatus comprises: a processing unit, configured to, in response to determining that the first device is triggered to pair and connect with a second device, obtain device information of the second device, and authenticate the second device based on the device information of the second device; and in response to the second device being authenticated successfully, read pairing and connection service information matching the second device from pre-stored service information for pairing and connection; A connecting unit is configured to perform a pairing connection with the second device based on the pairing connection service information.

13. The device according to claim 12, characterized in that The processing unit obtains the device information of the second device in the following manner, and authenticates the second device based on the device information of the second device: Acquire a broadcast message broadcast by the second device, where the broadcast message includes address information and private protocol information of the second device; scanning the second device based on the address information of the second device; In response to scanning the second device based on the address information of the second device, parsing the private protocol information; Determine the consistency between information content obtained by parsing the private protocol information and information content stored in the first device to authenticate the second device.

14. The device according to claim 13, characterized in that The private protocol information includes at least one of the following: Data content identifier, second device identifier, and second device version information.

15. The device according to any one of claims 12 to 14, characterized in that The processing unit reads the pairing connection service information of the second device from the pre-stored service information for pairing connection in the following manner: Reading cache information of the second device from a local database based on a connection callback event trigger of the protocol stack, where the cache information is used to cache pairing connection service information of the second device; If the cache information of the second device exists in the local database, reading the pairing connection service information of the second device from the local database; If the cache information of the second device does not exist in the local database, a cache file is loaded, the cache file includes a service identification field of the second device, and the pairing connection service information of the second device is read from the cache file based on the service identification field of the second device.

16. The device according to claim 15, characterized in that The service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

17. The device according to any one of claims 12 to 15, characterized in that The first device is a terminal, and the second device is a stylus.

18. A pairing connection device, characterized in that: Applied to a second device, the apparatus comprises: a sending unit, configured to send device information of the second device in response to determining that the second device is triggered to pair with the first device; The connecting unit is used to perform pairing connection with the first device based on pairing connection service information, where the pairing connection service information is read by the first device from pre-stored service information for pairing connection when the second device is authenticated successfully.

19. The device according to claim 17, characterized in that The sending unit sends the device information of the second device in the following manner: Broadcasting a broadcast message, wherein the broadcast message includes address information and private protocol information of the second device; The address information is used by the first device to scan the second device, and the private protocol information is used by the first device to authenticate the second device based on the consistency between the information content obtained by parsing the private protocol information and the information content stored in the first device.

20. The device according to claim 18, characterized in that The private protocol information includes at least one of the following: Data content identifier, second device identifier, and second device version information.

21. The device according to any one of claims 18 to 20, characterized in that The pre-stored service information for pairing connection is stored in cache information of a local database of the first device, and the cache information is used to cache the pairing connection service information of the second device; or The pre-stored service information for pairing connection is stored in a cache file, and the cache file includes a service identification field of the second device, and the service identification field of the second device is used to identify the pairing connection service information of the second device.

22. The device according to claim 20, characterized in that The service identification field is used to identify the report and descriptor information of each service among all services provided by the second device.

23. A pairing connection device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to: execute the method described in any one of claims 1-6.

24. A pairing connection device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method described in any one of claims 7 to 11.

25. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by a processor in the first device, the first device executes the method according to any one of claims 1 to 6.

26. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by a processor in the second device, the second device executes the method according to any one of claims 7 to 11.

Citation Information

Cited By

  • Equipment connection method and device, electronic equipment and computer readable storage medium

    CN120812583A