Equipment unlocking method and device, electronic equipment and storage medium

By receiving broadcast messages from BLE devices and decrypting their encrypted device addresses, storing the key and plain text device addresses of the target BLE devices, the problem of reconnecting when the terminal device needs to unlock the BLE device again, and improving unlocking efficiency.

CN119946616APending Publication Date: 2025-05-06QUECLINK WIRELESS SOLUTIONS(SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998228.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, when the terminal device needs to unlock the BLE device again, the BLE device needs to be reselected in the Bluetooth list to connect, resulting in low unlocking efficiency.

Method used

By receiving the broadcast message of the BLE device, obtaining the BLE device list in the terminal device, determining the encryption device address of the target BLE device, and decrypting the encryption device address successfully through the key, storing the key and plain text device address of the target BLE device. Then, according to the device address of the target BLE device, it is controlled to unlock.

Benefits of technology

After the first pairing is successful, the target BLE device is saved to the BLE device list, so that when unlocking is required, no need to reconnect, and the unlocking efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946616A_ABST
    Figure CN119946616A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment unlocking method and device, electronic equipment and a storage medium. Relates to the field of Internet of Things. The method comprises the following steps: receiving at least one broadcast message broadcasted by at least one BLE device, wherein the broadcast message comprises an encrypted device address of the BLE device; acquiring a BLE device list stored in the terminal device, wherein the BLE device list comprises at least one key and a plaintext device address corresponding to each key; according to the at least one broadcast message and a BLE device list, determining a target BLE device, the HID feature permission of the target BLE device being a read encryption permission or a write authentication permission, the HID feature permission being used for storing a key and a plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time; and controlling the target BLE equipment to be unlocked according to the equipment address of the target BLE equipment. And the unlocking efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet of Things, and in particular to a method, apparatus, electronic device and storage medium for unlocking a device. Background Art

[0002] In some scenarios, you can unlock Bluetooth Low Energy (BLE) devices through terminal devices, for example, unlocking charging station switch locks and car door locks through terminal devices.

[0003] In related technologies, when a BLE device needs to be unlocked through a terminal device, the BLE device can first broadcast its own information. After the terminal device discovers the BLE device, it can perform a pairing operation and establish the first connection after exchanging pairing information. After the connection is successful, the terminal device can control the BLE device to unlock.

[0004] However, when the terminal device needs to unlock the BLE device again, it is necessary to reselect the BLE device in the Bluetooth list of the terminal device for connection in order to control the BLE device to unlock, resulting in low unlocking efficiency. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, electronic device and storage medium for unlocking a device, so as to achieve the effect of seamlessly unlocking the device when reconnecting.

[0006] In a first aspect, an embodiment of the present application provides a method for unlocking a device, comprising:

[0007] receiving at least one broadcast message broadcasted by at least one BLE device, the broadcast message including an encrypted device address of the BLE device;

[0008] Obtain a BLE device list stored in the terminal device, wherein the BLE device list includes at least one key and a plaintext device address corresponding to each key;

[0009] Determine a target BLE device according to the at least one broadcast message and the BLE device list, wherein the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to store a key and a plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time;

[0010] According to the device address of the target BLE device, the target BLE device is controlled to be unlocked.

[0011] In one possible design, determining a target BLE device according to the at least one broadcast message and the BLE device list includes:

[0012] Determine at least one to-be-selected BLE device and an encrypted device address of each to-be-selected BLE device according to the at least one broadcast message;

[0013] Decrypting each encrypted device address using the at least one key to obtain a decryption result corresponding to each encrypted device address, where the decryption result is a decryption success or a decryption failure;

[0014] The encrypted device address that is successfully decrypted is determined as the target encrypted device address;

[0015] The BLE device corresponding to the target encrypted device address is determined as the target BLE device.

[0016] In a possible design, for any encrypted device address, the encrypted device address is decrypted by using the at least one key to obtain a decryption result corresponding to each encrypted device address, including:

[0017] Decrypting the encrypted device address using each key respectively, and determining whether there is a key that successfully decrypts the encrypted device address;

[0018] If so, determining that the decryption result corresponding to the encryption device address is that the decryption is successful;

[0019] If not, it is determined that the decryption result corresponding to the encryption device address is the decryption failure.

[0020] In one possible design, controlling the target BLE device to be unlocked according to the device address of the target BLE device includes:

[0021] Sending a connection request to the target BLE device according to the device address of the target BLE device;

[0022] Receive a connection success response message sent by the target BLE device;

[0023] According to the connection success response message, an unlock request is sent to the target BLE device, so that the target BLE device is unlocked when it is detected that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

[0024] In one possible design, the method further includes:

[0025] Establishing a Bluetooth connection with the target BLE device for the first time;

[0026] Obtain the HID service information of the target BLE device;

[0027] According to the HID service information, pairing is performed with the target BLE device to obtain a first pairing result;

[0028] After pairing is successful, obtain the key and plaintext device address of the target BLE device;

[0029] According to the HID service information and the first pairing result, the key and the plaintext device address are correspondingly stored in the BLE device list.

[0030] In a possible design, pairing is performed with the target Bluetooth device according to the HID service information to obtain a first pairing result, including:

[0031] Obtaining the HID feature permission of the target BLE device in the HID service information;

[0032] In response to the HID feature permission being the read encryption permission or the write authentication permission, pairing is performed with the target Bluetooth device to obtain the first pairing result.

[0033] In one possible design, according to the HID service information and the first pairing result, the key and the plaintext device address are correspondingly stored in the BLE device list, including:

[0034] In response to the HID service information indicating that there is a HID service in the services of the BLE device, and the first pairing result is a successful pairing, the key and the plaintext device address are correspondingly stored in the BLE device list.

[0035] In a second aspect, an embodiment of the present application provides an unlocking device for a device, comprising: a receiving module, a first obtaining module, a determining module and a control module, wherein:

[0036] The receiving module is used to receive at least one broadcast message broadcast by at least one BLE device, wherein the broadcast message includes an encrypted device address of the BLE device;

[0037] The first acquisition module is used to acquire a BLE device list stored in the terminal device, wherein the BLE device list includes at least one key and a plaintext device address corresponding to each key;

[0038] The determination module is used to determine the target BLE device according to the at least one broadcast message and the BLE device list, the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to store the key and the plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time;

[0039] The control module is used to control the target BLE device to unlock according to the device address of the target BLE device.

[0040] In a possible design, the determining module is specifically used to:

[0041] Determine at least one to-be-selected BLE device and an encrypted device address of each to-be-selected BLE device according to the at least one broadcast message;

[0042] Decrypting each encrypted device address using the at least one key to obtain a decryption result corresponding to each encrypted device address, where the decryption result is a decryption success or a decryption failure;

[0043] The encrypted device address that is successfully decrypted is determined as the target encrypted device address;

[0044] The BLE device corresponding to the target encrypted device address is determined as the target BLE device.

[0045] In a possible design, the determining module is specifically used to:

[0046] Decrypting the encrypted device address using each key respectively, and determining whether there is a key that successfully decrypts the encrypted device address;

[0047] If so, determining that the decryption result corresponding to the encryption device address is that the decryption is successful;

[0048] If not, it is determined that the decryption result corresponding to the encryption device address is the decryption failure.

[0049] In a possible design, the control module is specifically used for:

[0050] Sending a connection request to the target BLE device according to the device address of the target BLE device;

[0051] Receive a connection success response message sent by the target BLE device;

[0052] According to the connection success response message, an unlock request is sent to the target BLE device, so that the target BLE device is unlocked when it is detected that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

[0053] In a possible design, the unlocking device of the device further includes: a connection module, a second acquisition module and a storage module, wherein:

[0054] The connection module is used to establish a Bluetooth connection with the target BLE device for the first time;

[0055] The second acquisition module is used to obtain the HID service information of the target BLE device;

[0056] According to the HID service information, pairing is performed with the target BLE device to obtain a first pairing result;

[0057] After pairing is successful, obtain the key and plaintext device address of the target BLE device;

[0058] The storage module is used to store the key and the plaintext device address in the BLE device list according to the HID service information and the first pairing result.

[0059] In a possible design, the second acquisition module is specifically used to:

[0060] Obtaining the HID feature permission of the target BLE device in the HID service information;

[0061] In response to the HID feature permission being the read encryption permission or the write authentication permission, pairing is performed with the target Bluetooth device to obtain the first pairing result.

[0062] In a possible design, the storage module is specifically used for:

[0063] In response to the HID service information indicating that there is a HID service in the services of the BLE device, and the first pairing result is a successful pairing, the key and the plaintext device address are correspondingly stored in the BLE device list.

[0064] In a third aspect, an embodiment of the present application provides an unlocking device for a device, comprising: a memory, a processor;

[0065] The memory stores computer-executable instructions;

[0066] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0068] The embodiment of the present application provides a method, apparatus, electronic device and storage medium for unlocking a device. When a terminal device needs to unlock a BLE device, it can receive at least one broadcast message broadcast by at least one BLE device. According to the at least one broadcast message, the target BLE device is determined in the BLE device list stored in the terminal device, wherein the target BLE device has read encryption or write authentication permissions, and the target BLE device is unlocked according to the device address of the target BLE device. Through the above method, after the first pairing is successful, the target BLE device with read encryption or write authentication permissions can be saved to the BLE device list, so that when the terminal device needs to unlock the BLE device, it only needs to control the unlocking of the BLE device according to the broadcast message broadcast by the BLE device and the BLE device list, thereby improving the unlocking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0070] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;

[0071] Figure 2 A schematic diagram of a method for unlocking a device provided in an embodiment of the present application

[0072] Figure 3 A schematic diagram of a terminal device receiving a broadcast message broadcast by a BLE device provided in an embodiment of the present application;

[0073] Figure 4 A schematic diagram of the process of unlocking a target BLE device provided in an embodiment of the present application;

[0074] Figure 5 A schematic diagram of the process of first pairing a terminal device and a target BLE device provided in an embodiment of the present application;

[0075] Figure 6 A schematic diagram of the interaction process of the first pairing of a terminal device and a target BLE device provided in an embodiment of the present application;

[0076] Figure 7 A schematic diagram of the interactive process of a terminal device controlling the unlocking of a target BLE device provided in an embodiment of the present application;

[0077] Figure 8 A schematic diagram of the structure of an unlocking device for a device provided in an embodiment of the present application;

[0078] Fig. 9 A schematic diagram of the structure of an unlocking device of another device provided in an embodiment of the present application;

[0079] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0080] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0083] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.

[0084] It should be noted that the unlocking method, device, electronic device and storage medium of a device in the present application can be used in the field of Internet of Things, and can also be used in any field other than the field of Internet of Things. The application field of the unlocking method, device, electronic device and storage medium of a device in the present application is not limited.

[0085] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0086] For ease of understanding, the following Figure 1 , the system architecture applicable to the embodiments of the present application is described.

[0087] Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of this application. Figure 1 , including a terminal device 101 and a BLE device 102. The terminal device 101 may refer to a mobile phone, etc. The BLE device 102 may refer to a charging pile lock, a car lock, etc. The BLE device 102 may broadcast its own information, and the terminal device 101 may scan the information broadcast by the BLE device 102 and pair with the BLE device 102. After the pairing is successful, the terminal device 101 may control the BLE device 102 to unlock.

[0088] In the related art, when a BLE device needs to be unlocked through a terminal device, the BLE device can first broadcast its own information. After the terminal device finds the BLE device, it can perform a pairing operation, and after exchanging pairing information, the first connection is established. After the connection is successful, the terminal device can control the BLE device to unlock. However, when the terminal device needs to unlock the BLE device again, it needs to reselect the BLE device in the Bluetooth list of the terminal device to connect before controlling the BLE device to unlock, resulting in low unlocking efficiency.

[0089] In response to the above problems, in an embodiment of the present application, when a terminal device needs to unlock a BLE device, it can receive at least one broadcast message broadcast by at least one BLE device, and determine the target BLE device in the BLE device list stored in the terminal device according to the at least one broadcast message, wherein the target BLE device has read encryption or write authentication permissions, and unlock the target BLE device according to the device address of the target BLE device. Through the above method, after the first pairing is successful, the target BLE device with read encryption or write authentication permissions can be saved to the BLE device list, so that when the terminal device needs to unlock the BLE device, it only needs to control the unlocking of the BLE device according to the broadcast message broadcast by the BLE device and the BLE device list, thereby improving the unlocking efficiency.

[0090] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0091] Figure 2 This is a flowchart of a method for unlocking a device provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:

[0092] S201. Receive at least one broadcast message broadcast by at least one BLE device.

[0093] The execution subject of the embodiment of the present application may be a terminal device, for example, a mobile terminal of an IOS system. It may also be an unlocking device of a device set in the terminal device. The unlocking device of the device may be implemented by software or by a combination of software and hardware.

[0094] A BLE device may refer to a device that uses Bluetooth low energy technology. For example, a BLE device may include a switch lock of a charging pile, a switch lock of a car, etc.

[0095] The broadcast message may include the encrypted device address of the BLE device.

[0096] The broadcast message broadcasted by the BLE device can be received in the following ways: the terminal device can enter the scanning mode, and the scanning mode can receive the broadcast message broadcasted by the BLE device; after the terminal device receives the broadcast message, it can obtain the encrypted device address of the BLE device in the broadcast message.

[0097] Next, combine Figure 3 , through a specific example, the terminal device receives the broadcast message broadcast by the BLE device to illustrate.

[0098] Figure 3 For a schematic diagram of a terminal device receiving a broadcast message broadcast by a BLE device provided in an embodiment of the present application, see Figure 3 , including a terminal device, a BLE device 1, a BLE device 2, and a BLE device 3. The BLE device 1, the BLE device 2, and the BLE device 3 can broadcast broadcast messages, and the terminal device can receive the messages broadcast by the BLE device 1, the BLE device 2, and the BLE device 3.

[0099] S202. Obtain a list of BLE devices stored in the terminal device.

[0100] The BLE device list may include at least one key and a plaintext device address corresponding to each key, wherein the BLE device list may be stored in a storage space of the terminal device.

[0101] The key may refer to a symmetric key, and the key may be used to encrypt a plaintext device address or may be used to decrypt a plaintext device address.

[0102] The plaintext device address may refer to a unique identifier of a BLE device. For example, the plaintext device address may refer to a Media Access Control Address (MAC address) of a BLE device. According to the plaintext device address, a unique corresponding BLE device may be determined. For example, the plaintext device address may be "C8:3A:3F:2D:1B:09".

[0103] For example, the BLE device list may be as shown in Table 1. See Table 1.

[0104] Table 1

[0105]

[0106] S203: Determine a target BLE device according to at least one broadcast message and a BLE device list.

[0107] The target BLE device can be determined in the following manner: based on at least one broadcast message, at least one to-be-selected BLE device and the encrypted device address of each to-be-selected BLE device are determined; each encrypted device address is decrypted using at least one key to obtain a decryption result corresponding to each encrypted device address, wherein the decryption result includes a successful decryption and a failed decryption; the successfully decrypted encrypted device address is determined as the target encrypted device address; and the BLE device corresponding to the target encrypted device address is determined as the target BLE device.

[0108] Among them, the HID feature permission of the target BLE device is read encryption permission or write authentication permission.

[0109] The HID feature permission can be determined in the following way: access the Human Interface Device Service (HID service) of the BLE device, obtain the first identification code and the second identification code, the first identification code is used to indicate the read encryption permission, and the second identification code is used to indicate the write authentication permission; determine the values ​​corresponding to the first identification code and the second identification code in the HID service, if the value corresponding to the first identification code or the second identification code is 1, it can be determined that the BLE device has the HID feature permission, and the HID feature permission is the read encryption permission or the write authentication permission.

[0110] The HID feature permission can be used to store the key and plaintext device address of the target BLE device in the BLE device list after the terminal device is successfully paired with the target BLE device for the first time.

[0111] S204: Control the target BLE device to unlock according to the device address of the target BLE device.

[0112] The target BLE device can be controlled to be unlocked in the following manner: sending a connection request to the target BLE device according to the device address of the target BLE device; receiving a connection success response message sent by the target BLE device; sending an unlock request to the target BLE device according to the connection success response message, so that the target BLE device is unlocked when it detects that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

[0113] The preset threshold may be a value set in advance by the user in the BLE device.

[0114] In an embodiment of the present application, when a terminal device needs to unlock a BLE device, it can first receive at least one broadcast message broadcast by at least one BLE device, and obtain a BLE device list stored in the terminal device, wherein the BLE device list may include at least one key and a plaintext device address corresponding to each key; according to at least one broadcast message and the BLE device list, a target BLE device is determined in at least one BLE device, and the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to make the terminal device and the target BLE device successfully paired for the first time, and the key and plaintext device address of the target BLE device are stored in the BLE device list; according to the device address of the target BLE device, the target BLE device is controlled to be unlocked. Through the above method, the terminal device can save the target BLE device that has been successfully paired for the first time and has the read encryption permission or the write authentication permission to the BLE device list, so that when the terminal device needs to unlock the target BLE device again, the target BLE device can be controlled to be unlocked according to the address of the target BLE device, thereby improving the efficiency of unlocking.

[0115] Based on any of the above embodiments, Figure 4 , the process of unlocking the target BLE device ( Figure 2 S203-S204) in the embodiment are described in detail.

[0116] Figure 4 This is a schematic diagram of the process of unlocking the target BLE device provided in the embodiment of the present application. Figure 4 , the method may include:

[0117] S401. Receive at least one broadcast message broadcast by at least one BLE device.

[0118] It should be noted that the execution process of the above S401 can refer to S201 and will not be described in detail here.

[0119] S402: Determine at least one to-be-selected BLE device and an encrypted device address of each to-be-selected BLE device according to at least one broadcast message.

[0120] The broadcast message includes the encrypted device address of the BLE device.

[0121] The BLE device to be selected and the encrypted device address of the BLE device to be selected can be determined in the following manner: for any broadcast message, the BLE device corresponding to the broadcast message is determined as the BLE device to be selected; the encrypted device address of the BLE device included in the broadcast message is determined as the encrypted device address of the BLE device to be selected.

[0122] S403: For any encrypted device address, decrypt the encrypted device address using a key.

[0123] The decryption process can be performed in the following manner: obtain a BLE device list stored in the terminal device, the BLE device list including at least one key; use the keys to decrypt the encrypted device addresses in turn to obtain multiple data to be verified; perform verification operations on the multiple data to be verified to obtain verification results of the multiple data to be verified, and the verification results may include verification success and verification failure.

[0124] The verification operation may include data format verification and device address verification.

[0125] The verification operation can be performed in the following manner: for any data to be verified, if the data format of the data to be verified conforms to the preset data format, the data to be verified is determined as the target data to be verified; if the data format of the data to be verified does not conform to the preset data format, the verification result of the data to be verified is determined to be verification failure; the target key for decrypting the target data to be verified is obtained, the plaintext device address corresponding to the target key is determined in the BLE device list, and the plaintext device address is compared with the target data to be verified to see if they are the same. If they are the same, the verification result of the data to be verified is determined to be verification success. The preset data format may refer to a fixed format of a MAC address.

[0126] S404: Determine whether there is a verification result obtained through decryption processing that is a successful verification.

[0127] If yes, execute S405.

[0128] If not, execute S406.

[0129] S405: Determine that the decryption result corresponding to the encryption device address is a successful decryption.

[0130] S406: Determine that the decryption result corresponding to the encryption device address is decryption failure.

[0131] S407. Determine the target encryption device address and the corresponding target BLE device according to the decryption result.

[0132] The target encrypted device address and the corresponding target BLE device can be determined in the following manner: obtain the successfully decrypted encrypted device address, and determine the successfully decrypted encrypted device address as the target encrypted device address; based on the target encrypted device address, determine the BLE device corresponding to the target encrypted device address as the target BLE device.

[0133] S408. Send a connection request to the target BLE device according to the device address of the target BLE device, and receive a connection success response message sent by the target BLE device.

[0134] The terminal device obtains the target encryption device address of the target BLE device and generates a connection request to be encrypted; uses the key to encrypt the connection request to be encrypted to obtain an encrypted connection request; sends the encrypted connection request to the target BLE device according to the target encryption device address; after receiving the encrypted connection request, the target BLE device uses the key to decrypt the encrypted connection request. If the decryption is successful, a connection success response message is sent to the terminal device; if the decryption fails, no operation is performed.

[0135] S409: Send an unlock request to the target BLE device according to the connection success response message, so that the target BLE device is unlocked when it detects that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

[0136] After receiving the unlock request, the target BLE device detects the Bluetooth signal strength with the terminal device at a preset frequency. If the Bluetooth signal strength is greater than or equal to the preset threshold, the unlock operation is performed. The preset frequency can be a frequency set by the user in the target BLE device in advance, for example, once per second.

[0137] In an embodiment of the present application, when the terminal device needs to unlock the target BLE device, at least one to-be-selected BLE device and the encrypted device address of each to-be-selected BLE device can be determined based on at least one received broadcast message; for any encrypted device address, the encrypted device address is decrypted using the key stored in the BLE device list, and it is determined whether the verification result of the data to be verified obtained by the decryption process is a successful verification; if so, the decryption result corresponding to the encrypted device address is determined to be a successful decryption; if not, the decryption result corresponding to the encrypted device address is determined to be a failed decryption; based on the decryption result, the target encrypted device address and the corresponding target BLE device are determined; based on the device address of the target BLE device, a connection request is sent to the target BLE device, and a successful connection response message is received from the target BLE device; based on the successful connection response message, an unlock request is sent to the target BLE device, so that the target BLE device is unlocked when it detects that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold. Through the above method, the terminal device can decrypt the encrypted device address. When the decryption result is successful, it can be determined that the terminal device and the target BLE device have been successfully paired for the first time. Therefore, when the Bluetooth signal strength between the target BLE device and the terminal device is greater than or equal to the preset threshold, the target BLE device is automatically unlocked, thereby improving the unlocking efficiency.

[0138] Based on any of the above embodiments, Figure 5 , describes in detail the process of first pairing between the terminal device and the target BLE device.

[0139] Figure 5 This is a schematic diagram of the process of first pairing the terminal device and the target BLE device provided in the embodiment of the present application. Figure 5 , the method may include:

[0140] S501: Establish a Bluetooth connection with a target BLE device for the first time.

[0141] The Bluetooth connection can be established for the first time in the following manner: receiving at least one broadcast message broadcast by at least one BLE device, determining a target BLE device in at least one BLE device; sending a connection request to the target BLE device, and receiving a connection success response sent by the target BLE device, and establishing a Bluetooth connection with the target BLE device for the first time.

[0142] S502: Obtain HID service information of the target BLE device.

[0143] The HID service information of the target BLE device can be obtained in the following manner: the terminal device sends a request to obtain the HID service information to the target BLE device. After receiving the request, the target BLE device obtains the HID service information in the database and sends the HID service information to the terminal device.

[0144] S503: Perform pairing processing with the target BLE device according to the HID service information to obtain the first pairing result.

[0145] According to the HID service information sent by the target BLE device, the first identification code and the second identification code are searched in the HID service information, wherein the first identification code is used to indicate the read encryption permission and the second identification code is used to indicate the write authentication permission; if the first identification code and / or the second identification code exists in the HID service information and the value corresponding to the first identification code and / or the second identification code is 1, it can be determined that the target BLE device has the HID feature permission, and the HID feature permission is the read encryption permission or the write authentication permission.

[0146] If the target BLE device has HID feature permissions, a pairing request is sent to the target BLE device to pair the terminal device with the target BLE device.

[0147] The pairing process can be performed in the following manner: the target BLE device receives the pairing request, generates a first pairing code, and displays the first pairing code on the display module of the target BLE device; the user inputs the second pairing code into the terminal device according to the first pairing code displayed on the display module; the terminal device receives the second pairing code, and randomly generates a first random number, uses a preset algorithm for the second pairing code and the first random number, and generates a first confirmation value; the BLE device randomly generates a second random number, uses a preset algorithm for the first pairing code and the second random number, generates a second confirmation value, and sends the second confirmation value to the terminal device; after receiving the second confirmation value, the terminal device compares whether the first confirmation value and the second confirmation value are the same, if they are the same, the pairing result is a successful pairing, if they are different, the pairing result is a failed pairing. Among them, the preset algorithm can refer to an elliptic curve algorithm, etc.

[0148] S504: After the pairing result is successful, obtain the key and plaintext device address of the target BLE device.

[0149] After successful pairing, the terminal device sends a pairing success message to the target BLE device; after receiving the pairing success message, the target BLE device sends the second random number and the plaintext device address of the target BLE device to the terminal device; the terminal device receives the second random number and the plaintext device address, and uses a preset algorithm for the second random number and the second pairing code to generate a key.

[0150] S505. The key and the plaintext device address are stored correspondingly in the BLE device list.

[0151] The key and plaintext device address corresponding to the target BLE device are stored in the BLE device list. The BLE device list is located in the storage space of the terminal device.

[0152] In an embodiment of the present application, before the terminal device needs to unlock the target BLE device, the terminal device also needs to pair with the target BLE device for the first time. After the terminal device establishes a Bluetooth connection with the target BLE device for the first time, the HID service information of the target BLE device is obtained, and according to the HID service information, it is determined whether the target BLE device has read encryption permission or write authentication permission. If so, the terminal device and the target BLE device are paired to obtain the first pairing result; after the pairing result is a successful pairing, the key and plaintext device address of the target BLE device are obtained, and the key and plaintext device address are stored correspondingly in the BLE device list. Through the above method, the key and plaintext device address of the target BLE device with read encryption or write authentication HID feature permission and the pairing result is a successful pairing are stored in the BLE device list at the time of the first connection, so that when the terminal device needs to unlock the target BLE device again, the target BLE device can be automatically unlocked without feeling, thereby improving the efficiency of unlocking.

[0153] Based on any of the above embodiments, Figure 6 , describes in detail the interaction process of the first pairing between the terminal device and the target BLE device.

[0154] Figure 6 This is a schematic diagram of the interaction process of the first pairing of the terminal device and the target BLE device provided in the embodiment of the present application. Figure 6 , the method may include:

[0155] S601. The terminal device sends a connection request to the target BLE device.

[0156] S602: The target BLE device sends a connection success response to the terminal device.

[0157] S603: The terminal device sends a request to obtain HID service information to the target BLE device.

[0158] S604: The target BLE device obtains HID service information.

[0159] S605: The target BLE device sends HID service information to the terminal device.

[0160] S606: The terminal device determines, based on the HID service information, that the target BLE device has HID feature permissions.

[0161] S607: The terminal device sends a pairing request to the target BLE device.

[0162] S608: The target BLE device generates a first pairing code and a second random number, and uses a preset algorithm on the first pairing code and the second random number to generate a second confirmation value.

[0163] S609: The terminal device obtains a second pairing code, generates a first random number, and uses a preset algorithm on the second pairing code and the first random number to generate a first confirmation value.

[0164] S610. The target BLE device sends a second confirmation value to the terminal device.

[0165] S611. The terminal device compares whether the first confirmation value and the second confirmation value are the same. If they are the same, the pairing result is a successful pairing; if they are different, the pairing result is a failed pairing.

[0166] The unlocking method of a device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0167] Based on any of the above embodiments, Figure 7 , the interactive process of the terminal device controlling the unlocking of the target BLE device is described in detail.

[0168] Figure 7 Schematic diagram of the interactive process of the terminal device controlling the target BLE device to unlock provided in the embodiment of the present application. Figure 7 , the method may include:

[0169] S701. The terminal device obtains the device address of the target BLE device.

[0170] S702: The terminal device sends a connection request to the target BLE device according to the device address.

[0171] S703: The target BLE device sends a connection success response message to the terminal device.

[0172] S704: The target BLE device detects the Bluetooth signal strength between the target BLE device and the terminal device. When the Bluetooth signal strength is greater than or equal to a preset threshold, the target BLE device is unlocked.

[0173] The unlocking method of a device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0174] Figure 8 This is a schematic diagram of the structure of an unlocking device for a device provided in an embodiment of the present application. Figure 8 The unlocking device 10 of the device includes: a receiving module 11, a first obtaining module 12, a determining module 13 and a control module 14, wherein:

[0175] The receiving module 11 is used to receive at least one broadcast message broadcast by at least one BLE device, where the broadcast message includes the encrypted device address of the BLE device;

[0176] The first acquisition module 12 is used to acquire a BLE device list stored in the terminal device, wherein the BLE device list includes at least one key and a plaintext device address corresponding to each key;

[0177] The determination module 13 is used to determine the target BLE device according to the at least one broadcast message and the BLE device list, the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to store the key and the plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time;

[0178] The control module 14 is used to control the target BLE device to unlock according to the device address of the target BLE device.

[0179] An unlocking device of a device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0180] In a possible design, the determining module 13 is specifically configured to:

[0181] Determine at least one to-be-selected BLE device and an encrypted device address of each to-be-selected BLE device according to the at least one broadcast message;

[0182] Decrypting each encrypted device address using the at least one key to obtain a decryption result corresponding to each encrypted device address, where the decryption result is a decryption success or a decryption failure;

[0183] The encrypted device address that is successfully decrypted is determined as the target encrypted device address;

[0184] The BLE device corresponding to the target encrypted device address is determined as the target BLE device.

[0185] In a possible design, the determining module 13 is specifically configured to:

[0186] Decrypting the encrypted device address using each key respectively, and determining whether there is a key that successfully decrypts the encrypted device address;

[0187] If so, determining that the decryption result corresponding to the encryption device address is that the decryption is successful;

[0188] If not, it is determined that the decryption result corresponding to the encryption device address is the decryption failure.

[0189] In a possible design, the control module 14 is specifically used for:

[0190] Sending a connection request to the target BLE device according to the device address of the target BLE device;

[0191] Receive a connection success response message sent by the target BLE device;

[0192] According to the connection success response message, an unlock request is sent to the target BLE device, so that the target BLE device is unlocked when it is detected that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

[0193] Fig. 9 A schematic diagram of the structure of an unlocking device of another device provided in an embodiment of the present application. Figure 8 Based on the examples shown, see Fig. 9 The unlocking device 10 of the device further includes: a connection module 15, a second acquisition module 16 and a storage module 17, wherein:

[0194] The connection module 15 is used to establish a Bluetooth connection with the target BLE device for the first time;

[0195] The second acquisition module 16 is used to obtain the HID service information of the target BLE device;

[0196] According to the HID service information, pairing is performed with the target BLE device to obtain a first pairing result;

[0197] After pairing is successful, obtain the key and plaintext device address of the target BLE device;

[0198] The storage module 17 is used to store the key and the plaintext device address in the BLE device list according to the HID service information and the first pairing result.

[0199] In a possible design, the second acquisition module 16 is specifically configured to:

[0200] Obtaining the HID feature permission of the target BLE device in the HID service information;

[0201] In response to the HID feature permission being the read encryption permission or the write authentication permission, pairing is performed with the target Bluetooth device to obtain the first pairing result.

[0202] In a possible design, the storage module 17 is specifically used for:

[0203] In response to the HID service information indicating that there is a HID service in the services of the BLE device, and the first pairing result is a successful pairing, the key and the plaintext device address are correspondingly stored in the BLE device list.

[0204] An unlocking device of a device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0205] Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device 20 may include: a transceiver 21 , a processor 22 , and a memory 23 .

[0206] The processor 22 executes the computer execution instructions stored in the memory, so that the processor 22 executes the scheme in the above embodiment. The processor 22 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0207] The memory 23 is connected to the processor 22 via a system bus and completes communication between them. The memory 23 is used to store computer program instructions.

[0208] The transceiver 21 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0209] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0210] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0211] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the technical solution of the unlocking method of the device in the above embodiment.

[0212] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the unlocking method of the device in the above embodiment.

[0213] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0214] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0215] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0216] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for unlocking a device, characterized in that: Applied to a terminal device, the method comprises: receiving at least one broadcast message broadcasted by at least one BLE device, the broadcast message including an encrypted device address of the BLE device; Obtain a BLE device list stored in the terminal device, wherein the BLE device list includes at least one key and a plaintext device address corresponding to each key; Determine a target BLE device according to the at least one broadcast message and the BLE device list, wherein the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to store a key and a plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time; According to the device address of the target BLE device, the target BLE device is controlled to be unlocked.

2. The method according to claim 1, characterized in that Determining a target BLE device according to the at least one broadcast message and the BLE device list includes: Determine at least one to-be-selected BLE device and an encrypted device address of each to-be-selected BLE device according to the at least one broadcast message; Decrypting each encrypted device address using the at least one key to obtain a decryption result corresponding to each encrypted device address, where the decryption result is a decryption success or a decryption failure; The encrypted device address that is successfully decrypted is determined as the target encrypted device address; The BLE device corresponding to the target encrypted device address is determined as the target BLE device.

3. The method according to claim 2, characterized in that For any encrypted device address; decrypting the encrypted device address by using the at least one key to obtain a decryption result corresponding to each encrypted device address, including: Decrypting the encrypted device address using each key respectively, and determining whether there is a key that successfully decrypts the encrypted device address; If so, determining that the decryption result corresponding to the encryption device address is that the decryption is successful; If not, it is determined that the decryption result corresponding to the encryption device address is the decryption failure.

4. The method according to any one of claims 1 to 3, characterized in that: Controlling the target BLE device to unlock according to the device address of the target BLE device includes: Sending a connection request to the target BLE device according to the device address of the target BLE device; Receive a connection success response message sent by the target BLE device; According to the connection success response message, an unlock request is sent to the target BLE device, so that the target BLE device is unlocked when it is detected that the Bluetooth signal strength of the terminal device is greater than or equal to a preset threshold.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Establishing a Bluetooth connection with the target BLE device for the first time; Obtain the HID service information of the target BLE device; According to the HID service information, pairing is performed with the target BLE device to obtain a first pairing result; After pairing is successful, obtain the key and plaintext device address of the target BLE device; According to the HID service information and the first pairing result, the key and the plaintext device address are correspondingly stored in the BLE device list.

6. The method according to claim 5, characterized in that According to the HID service information, pairing is performed with the target Bluetooth device to obtain a first pairing result, including: Obtaining the HID feature permission of the target BLE device in the HID service information; In response to the HID feature permission being the read encryption permission or the write authentication permission, pairing is performed with the target Bluetooth device to obtain the first pairing result.

7. The method according to claim 5 or 6, characterized in that: According to the HID service information and the first pairing result, the key and the plaintext device address are correspondingly stored in the BLE device list, including: In response to the HID service information indicating that there is a HID service in the services of the BLE device, and the first pairing result is a successful pairing, the key and the plaintext device address are correspondingly stored in the BLE device list.

8. An unlocking device for a device, characterized in that: Applied to a terminal device, the device comprises: a receiving module, a first acquisition module, a determination module and a control module, wherein: The receiving module is used to receive at least one broadcast message broadcast by at least one BLE device, wherein the broadcast message includes an encrypted device address of the BLE device; The first acquisition module is used to acquire a BLE device list stored in the terminal device, wherein the BLE device list includes at least one key and a plaintext device address corresponding to each key; The determination module is used to determine the target BLE device according to the at least one broadcast message and the BLE device list, the HID feature permission of the target BLE device is a read encryption permission or a write authentication permission, and the HID feature permission is used to store the key and the plaintext device address of the target BLE device in the BLE device list after the terminal device and the target BLE device are successfully paired for the first time; The control module is used to control the target BLE device to unlock according to the device address of the target BLE device.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.