Bluetooth pairing method, electronic device, and storage medium

By generating a pairing window during the Bluetooth pairing process for devices without displays and buttons and using an NFC module to transmit the pairing code, the problem of low security in Bluetooth pairing between devices without displays and buttons is solved, enabling user confirmation and improving security.

WO2025246922A1PCT designated stage Publication Date: 2025-12-04PAX COMP TECH SHENZHEN
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/094675
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-30
Filing Date
2025-05-13
Publication Date
2025-12-04

AI Technical Summary

Technical Problem

Existing Bluetooth connection methods have low security during pairing between devices without displays or buttons, cannot meet the user's requirement to confirm the pairing code, and pose security risks.

Method used

The pairing code is displayed in a pairing window on an electronic device without a display screen or buttons, and the pairing code is transmitted using an NFC module, thereby enabling the confirmation and verification of the pairing code.

Benefits of technology

Ensuring that the user confirms the pairing code on both devices during the Bluetooth pairing process improves pairing security, avoids the involvement of third-party devices, and enhances both user experience and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025094675_04122025_PF_FP_ABST
    Figure CN2025094675_04122025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application are applicable to the technical field of Bluetooth, and provide a Bluetooth pairing method, an electronic device, and a storage medium. The method is applied to a first electronic device. The method comprises: when a connectable second electronic device is detected, sending a Bluetooth pairing request to a second electronic device, the second electronic device being a device not having a display screen or button, and the second electronic device being used to generate a first pairing code on the basis of the Bluetooth pairing request; generating a second pairing window on a terminal display screen of the first electronic device, the second pairing window displaying a second pairing code generated by the first electronic device; acquiring the first pairing code, and generating a first pairing window on the terminal display screen, the first pairing window displaying the first pairing code; performing Bluetooth pairing with the second electronic device on the basis of the first pairing code and the second pairing code. Using the described method can increase the security of Bluetooth pairing with a second electronic device not having a display screen or button.
Need to check novelty before this filing date? Find Prior Art

Description

Bluetooth pairing methods, electronic devices and storage media

[0001] This application claims priority to Chinese Patent Application No. 202410695698.7, filed on May 30, 2024, entitled "Bluetooth Pairing Method, Electronic Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application belongs to the field of Bluetooth technology, and in particular relates to a Bluetooth pairing method, electronic device and storage medium. Background Technology

[0003] With the development of wireless communication technology, Bluetooth and Near Field Communication (NFC) have been widely used in various fields to facilitate data exchange between two devices. For example, they are used in the field of mobile payment.

[0004] Specifically, while smartphones, tablets, and other smart devices can be used for payments via barcodes, some transaction venues require bank card payments. Therefore, smart devices need to be used in conjunction with card readers capable of reading and writing bank cards to complete bank card payments.

[0005] Since the purpose of connecting smart devices and card readers via Bluetooth is to facilitate bank card payments, the connection process between the two devices must meet payment security requirements. Currently, Bluetooth connections typically require users to confirm a pairing code on both devices. Alternatively, the smart device can proactively initiate a connection with the card reader and pair directly.

[0006] However, because the card reader lacks a display screen and buttons, it cannot meet the user's requirement to confirm the pairing code on both devices. Furthermore, if pairing is performed directly, the lack of a pairing code during the pairing process results in lower security. Summary of the Invention

[0007] This application provides a Bluetooth pairing method, an electronic device, and a storage medium, which can solve the problem of low security when pairing Bluetooth with electronic devices without a display screen and buttons.

[0008] In a first aspect, embodiments of this application provide a Bluetooth pairing method applied to a first electronic device, the method comprising:

[0009] Upon detecting a connectable second electronic device, a Bluetooth pairing request is sent to the second electronic device; the second electronic device is a device without a display screen and buttons; the second electronic device is used to generate a first pairing code based on the Bluetooth pairing request.

[0010] A second pairing window is generated on the terminal display screen of the first electronic device; the second pairing window displays the second pairing code generated by the first electronic device;

[0011] Obtain the first pairing code and generate the first pairing window on the terminal display screen; the first pairing window displays the first pairing code;

[0012] Bluetooth pairing is performed with the second electronic device based on the first pairing code and the second pairing code.

[0013] Secondly, embodiments of this application provide a Bluetooth pairing device applied to a first electronic device, the device comprising:

[0014] A first sending module is used to send a Bluetooth pairing request to a second electronic device when a connectable second electronic device is detected; the second electronic device is a device without a display screen and buttons; the second electronic device is used to generate a first pairing code based on the Bluetooth pairing request;

[0015] The first generation module is used to generate a second pairing window on the terminal display screen of the first electronic device; the second pairing window displays a second pairing code generated by the first electronic device.

[0016] The first acquisition module is used to acquire the first pairing code and generate a first pairing window on the terminal display screen; the first pairing window displays the first pairing code;

[0017] The first pairing module is used to pair with the second electronic device via Bluetooth based on the first pairing code and the second pairing code.

[0018] Thirdly, another embodiment of this application provides a Bluetooth pairing method applied to a second electronic device, the method comprising:

[0019] If a Bluetooth pairing request is received from the first electronic device, a first pairing code is generated based on the Bluetooth pairing request; the first electronic device generates a second pairing window on its terminal display screen after sending the Bluetooth pairing request; the second pairing window displays the second pairing code generated by the first electronic device.

[0020] Send a first pairing code to a first electronic device; the first electronic device generates a first pairing window on a terminal display screen after receiving the first pairing code, and performs Bluetooth pairing with a second electronic device according to the first pairing code and the second pairing code; the first pairing window displays the first pairing code.

[0021] Fourthly, another embodiment of this application provides a Bluetooth pairing device for use in a second electronic device, the device comprising:

[0022] The third generation module is used to generate a first pairing code based on the Bluetooth pairing request if it receives a Bluetooth pairing request from the first electronic device; the first electronic device is used to generate a second pairing window on the terminal display screen of the first electronic device after sending the Bluetooth pairing request; the second pairing window displays the second pairing code generated by the first electronic device.

[0023] The third sending module is used to send a first pairing code to the first electronic device; the first electronic device is used to generate a first pairing window on the terminal display screen after receiving the first pairing code, and to perform Bluetooth pairing with the second electronic device according to the first pairing code and the second pairing code; the first pairing window displays the first pairing code.

[0024] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described in the first or third aspects above.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described in the first or third aspects above.

[0026] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the methods described in the first or third aspect.

[0027] The beneficial effects of this application embodiment compared to the prior art are as follows: In a Bluetooth connection method based on pairing codes, when a connectable second electronic device is detected, the first electronic device can send a Bluetooth pairing request to the second electronic device and generate a second pairing window on its terminal display screen to display its second pairing code for Bluetooth pairing. Correspondingly, after receiving the Bluetooth pairing request, the second electronic device also needs to generate a first pairing code based on the Bluetooth pairing request and display it on its own (second electronic device's) display screen. However, since the second electronic device lacks a display screen and buttons, it cannot display the first pairing code for user confirmation, or input the second pairing code for confirmation by the second electronic device itself. Therefore, the first electronic device can obtain the first pairing code generated by the second electronic device and generate a first pairing window on its terminal display screen to display the first pairing code. That is, the first pairing window that the second electronic device needs to display is shifted to the first electronic device. At this time, both the first pairing window and the second pairing window will exist simultaneously in the first electronic device. Therefore, when pairing with the second electronic device via Bluetooth according to the first and second pairing codes, not only is the requirement for the user to confirm the pairing code on both electronic devices satisfied, ensuring security during Bluetooth pairing, but also no third-party device is required. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 is a flowchart of a Bluetooth pairing method provided in an embodiment of this application;

[0030] Figure 2 is a schematic diagram of the format of NFC tag data in a Bluetooth pairing method provided in an embodiment of this application;

[0031] Figure 3 is a flowchart illustrating the implementation of a Bluetooth pairing method according to another embodiment of this application;

[0032] Figure 4 is a schematic diagram of an application scenario in which a first pairing window and a second pairing window are displayed in a Bluetooth pairing method provided in an embodiment of this application.

[0033] Figure 5 is a schematic diagram of a Bluetooth pairing device provided in an embodiment of this application;

[0034] Figure 6 shows a flowchart of a Bluetooth pairing method provided in another embodiment of this application;

[0035] Figure 7 shows an interaction flowchart of the first electronic device and the second electronic device in a Bluetooth pairing method provided in an embodiment of this application;

[0036] Figure 8 is a structural block diagram of a Bluetooth pairing device provided in another embodiment of this application;

[0037] Figure 9 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0038] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0039] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0040] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0041] With the development of wireless communication technology, Bluetooth and Near Field Communication (NFC) have been widely used in various fields to facilitate data exchange between two devices. For example, they are used in the field of mobile payment.

[0042] Specifically, while smartphones, tablets, and other smart devices can be used for payments via barcodes, some transaction venues require bank card payments. Therefore, smart devices need to be used in conjunction with card readers capable of reading and writing bank cards to complete bank card payments.

[0043] Since the purpose of connecting smart devices and card readers via Bluetooth is to facilitate bank card payments, the connection process between the two devices must meet payment security requirements. Currently, Bluetooth connections typically include the following methods:

[0044] 1. Pairing Code Comparison: Both devices display a 6-digit number, which the user verifies by checking if they match and entering Yes / No. Pairing can proceed when both devices enter Yes.

[0045] 2. Passkey Entry: On the slave device to be paired, enter a 6-digit number that will be displayed on the master device. If the number is entered correctly, pairing will be successful.

[0046] 3. Just Works: Used to pair devices without a screen or buttons. Pairing can be initiated by the host device itself, without the need for a pairing code authentication.

[0047] 4. Out-of-Band (OOB): OOB allows the master and slave devices to send authentication information through the device's out-of-band channels, such as serial port, NFC, UWB (Ultra Wide Band), etc., for pairing.

[0048] However, the first method requires users to confirm a pairing code on both devices for Bluetooth connection, and the second method also requires users to enter a pairing code on the slave device. Therefore, devices without displays and buttons cannot use either method for pairing. Furthermore, the third method, where the user cannot see the pairing process, presents security vulnerabilities. For example, it lacks authentication and cannot prevent attacks from intermediate devices. Finally, while the fourth method (OOB) allows master and slave devices to create authenticated pairings without input / output capabilities, this method involves other communication modules. Therefore, separate low-level drivers need to be developed for both the master and slave devices. However, due to the complexity of low-level driver development, many master and slave devices may not currently support transmitting the aforementioned authentication information through other communication modules. Therefore, using the fourth method for authentication pairing has significant limitations.

[0049] Based on this, in order to improve the security of Bluetooth pairing with electronic devices without displays and buttons, this application provides a Bluetooth pairing method. This method can be applied to first electronic devices such as mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of the first electronic device.

[0050] Please refer to Figure 1, which shows a flowchart of a Bluetooth pairing method provided in an embodiment of this application. The method includes the following steps:

[0051] S101. When a connectable second electronic device is detected, a Bluetooth pairing request is sent to the second electronic device.

[0052] The second electronic device is a device without a display screen and buttons. For example, it can be a card reader / writer capable of reading and writing bank cards. It can also be an access control device; there is no limitation on this.

[0053] It should be noted that the second electronic device is a Bluetooth-enabled device with an internal Bluetooth module, enabling Bluetooth pairing based on the Bluetooth protocol. Therefore, upon receiving a Bluetooth pairing request, the second electronic device can generate a first pairing code based on the request. The method by which a Bluetooth-enabled electronic device generates a pairing code is an existing method and will not be described in detail here.

[0054] In one embodiment, the Bluetooth pairing request may be a request carrying information such as the Bluetooth display name, physical address, and serial number of the first electronic device. Specifically, when Bluetooth pairing is required, the Bluetooth pairing request is automatically generated by the terminal system of the first electronic device based on the Bluetooth protocol.

[0055] For ease of explanation, this embodiment uses a card reader as an example to illustrate the concept of the second electronic device. Typically, a card reader has only one power button. When the card reader is powered on, it automatically activates its Bluetooth module to broadcast device information. At this time, the first electronic device can automatically detect nearby devices that can be paired via Bluetooth. Then, based on the user's confirmation command, it identifies the user-selected device as the connectable second electronic device and sends a Bluetooth pairing request to the second electronic device (card reader).

[0056] S102, A second pairing window is generated on the terminal display screen of the first electronic device.

[0057] In one embodiment, the second pairing window is a window displaying a second pairing code generated by the first electronic device. It is understood that when Bluetooth is enabled, the first electronic device's terminal system typically also has a Bluetooth module to perform Bluetooth pairing based on the Bluetooth protocol. Therefore, during Bluetooth pairing, the first electronic device also needs to generate a second pairing code through its own terminal system's Bluetooth module and display it through the second pairing window.

[0058] Similarly, as described in S101, the method for generating a pairing code by a Bluetooth-enabled electronic device is an existing method. Therefore, this embodiment will not provide a detailed description of the generation of the second pairing window by the first electronic device.

[0059] S103. Obtain the first pairing code and generate the first pairing window on the terminal display screen.

[0060] In one embodiment, the first pairing window is used to display the first pairing code. It is understood that, under normal circumstances, if the second electronic device has a screen, the second electronic device will automatically generate the first pairing window to display the first pairing code.

[0061] However, since the second electronic device lacks a screen, it cannot display the first pairing code itself. That is, verification cannot be performed using the first pairing code comparison method. Furthermore, the second electronic device also lacks buttons; therefore, the user cannot input the second pairing code displayed by the first electronic device into the second electronic device. That is, verification cannot be performed using the pairing method that inputs the second pairing code.

[0062] Therefore, in order to improve the security of pairing, the first electronic device can obtain the first pairing code generated by the second electronic device and generate a first pairing window on the terminal display screen for display.

[0063] It should be noted that since the first and second electronic devices are still in the Bluetooth pairing process at this time, a Bluetooth connection has not yet been established. Therefore, the first electronic device cannot obtain data from the second electronic device based on Bluetooth functionality. In other words, it cannot obtain the first pairing code based on the Bluetooth connection.

[0064] Therefore, in order to obtain the first pairing code, the first electronic device and the second electronic device need to transmit data through other communication modules. For example, this can be done using modules such as USB or NFC.

[0065] However, data transfer via USB requires a cable connection between the first and second electronic devices. That is, a third-party device is needed. Therefore, in this embodiment, the first and second electronic devices can transfer data via an NFC module. In other words, both the first and second electronic devices need to be devices with NFC modules.

[0066] For example, when the second electronic device is a card reader, the card reader needs to accept bank cards (and establish an inductive connection with the internal chip of the bank card). Therefore, the card reader usually has an NFC module installed inside.

[0067] Typically, NFC modules have the ability to simulate and parse NFC tag data; therefore, the first pairing code can be transmitted in the form of an NFC tag.

[0068] Specifically, the first electronic device can read NFC tag data when it detects that the second electronic device is located within its NFC sensing area. Then, it parses the NFC tag data to obtain a first pairing code.

[0069] The NFC tag data can be generated by a second electronic device based on the first pairing code. In this case, the generated NFC tag data will contain the first pairing code. The NFC tag data format can be a Type 2 tag format.

[0070] Specifically, referring to Figure 2, which is a schematic diagram of the NFC tag data format in a Bluetooth pairing method provided by an embodiment of this application. In the Type 2 tag format, data is stored in blocks, with each block consisting of 4 bytes (ByteNumber). Furthermore, tags such as UID / Internal; CC; Serial Number; Internal / Lock; and Lock Reserved define the functions of the remaining data bytes in the tag format, which will not be described in detail here.

[0071] It should be noted that, since the first electronic device may only be able to read 4 blocks (16 bytes) of data at a time when actually reading NFC tag data, the first electronic device needs to read NFC tag data from the second electronic device multiple times until the read data contains the end tag, at which point it stops reading NFC tag data from the second electronic device.

[0072] Since the NFC tag data is generated by the second electronic device based on the first pairing code, it can be assumed that the time when the second electronic device generates the NFC tag data is at least later than the time when the first electronic device sends the Bluetooth pairing request to the second electronic device. Therefore, to avoid the first electronic device wasting energy by keeping its NFC module on for an extended period, the first electronic device can activate its own NFC module after executing step S101 to detect the NFC tag data.

[0073] The NFC sensing area and the method of parsing NFC tag data are functions of the NFC module in the first electronic device, and will not be described in detail.

[0074] It should be noted that steps S102 and S103 can be executed simultaneously, or steps S102 can be executed first and then steps S103, or steps S103 can be executed first and then steps S102. In this embodiment, the execution order of steps S102 and S103 is not limited.

[0075] S104. Pair with the second electronic device via Bluetooth according to the first pairing code and the second pairing code.

[0076] It is understandable that, since both the first pairing code and the second pairing code are displayed on the terminal screen, the first electronic device can pair with the second electronic device via Bluetooth based on the first pairing code and the second pairing code.

[0077] For example, the first electronic device can pair with the second electronic device via Bluetooth when it detects that the first pairing code and the second pairing code are the same; otherwise, it can refuse to pair with the second electronic device via Bluetooth when it detects that the first pairing code and the second pairing code are different.

[0078] Alternatively, the system can acquire a first operation command from the user for the first pairing window and a second operation command for the second pairing window. Then, based on the first and second operation commands, it can perform Bluetooth pairing with the second electronic device.

[0079] For example, if both the first operation instruction and the second operation instruction are pairing instructions, then Bluetooth pairing is performed with the second electronic device; otherwise, if the first operation instruction and / or the second operation instruction are cancellation instructions, Bluetooth pairing with the second electronic device is refused.

[0080] In this embodiment, the Bluetooth connection method based on pairing codes shows that when a connectable second electronic device is detected, the first electronic device can send a Bluetooth pairing request to the second electronic device and generate a second pairing window on the terminal display screen to display its second pairing code for Bluetooth pairing. Correspondingly, after receiving the Bluetooth pairing request, the second electronic device also needs to generate a first pairing code based on the Bluetooth pairing request and display it on its own (second electronic device's) display screen. However, since the second electronic device does not have a display screen or buttons, it cannot display the first pairing code for user confirmation, or it cannot input the second pairing code for confirmation by the second electronic device itself. Therefore, the first electronic device can obtain the first pairing code generated by the second electronic device and generate a first pairing window on the terminal display screen to display the first pairing code. That is, the first pairing window that the second electronic device needs to display is shifted to the first electronic device. At this time, the first electronic device will simultaneously have a first pairing window and a second pairing window. Therefore, when pairing with the second electronic device via Bluetooth according to the first and second pairing codes, not only is the requirement for the user to confirm the pairing code on both electronic devices satisfied, ensuring security during Bluetooth pairing, but no third-party device is required.

[0081] In another embodiment, as described above, the first electronic device can acquire data based on a USB or NFC module. Since the second electronic device generates NFC tag data based on the NFC module, and transmitting the NFC tag data to the first electronic device takes time, while the second pairing window can be directly generated by the Bluetooth module of the first electronic device's terminal system without transmission, it can be assumed that the rate at which the second pairing window is generated is typically much greater than the rate at which the first electronic device acquires the NFC tag data and displays the first pairing window.

[0082] Furthermore, displaying the first pairing window requires not only Bluetooth module support but also NFC module support. Therefore, the first electronic device typically needs to have application software installed to handle the Bluetooth connection with the second electronic device. For example, Bluetooth pairing software.

[0083] At this point, if the first electronic device displays the first pairing code obtained from the second electronic device based on the application software, the first electronic device needs to perform NFC data interaction with the second electronic device to obtain the first pairing code. Therefore, while the first electronic device is displaying the first pairing code, its terminal system may first generate and display a second pairing window. Consequently, the process of the application software displaying the first pairing code is interrupted by the second pairing window generated by the terminal system, which is detrimental to Bluetooth pairing.

[0084] Similarly, if the first pairing code is acquired and the first pairing window is generated on the terminal display screen of the first electronic device at the same time as the second pairing window is generated, the terminal display screen will have to wait for a certain period of time before the first pairing window and the second pairing window can be displayed simultaneously, because the acquisition of the first pairing code by the first electronic device (which requires NFC-based data interaction and a certain amount of data interaction time) takes a long time. However, if no pairing window is displayed for a long time and the second electronic device has no screen or buttons, the user may suspect that the pairing process is abnormal, causing the user to re-pair, thus reducing the user experience.

[0085] Therefore, in this embodiment, in order to successfully perform Bluetooth pairing, the first electronic device can also pair with the second electronic device according to steps S301-S307 as shown in Figure 3, as detailed below:

[0086] S301. Generate a transparent interface on the terminal display screen.

[0087] In one embodiment, the transparent interface is used to shield the generated second pairing window. That is, after performing steps S101 and S102, the first electronic device will perform step S301 to generate a transparent interface that shields the second pairing window.

[0088] It should be noted that disabling the second pairing window prevents the user from operating the first electronic device during the pairing process, causing the second pairing window to disappear during pairing. Consequently, the user cannot simultaneously view both the first and second pairing windows.

[0089] Additionally, while using a transparent interface to block the second pairing window may hide it, the user can still see it because the interface itself is transparent.

[0090] It should be noted that the first electronic device is equipped with application software responsible for establishing a Bluetooth connection with the second electronic device. Therefore, the transparent interface can be considered as the interface pop-up function of the application software, displayed on the terminal screen of the first electronic device. In this case, the transparent interface generated by the application software can be used to display the first pairing window of the second electronic device, while the second pairing window is generated by the terminal system of the first electronic device. Therefore, during the pairing process, the application software cannot obtain the data (second pairing code) generated by the terminal system, and consequently cannot modify the data, ensuring the security of the Bluetooth pairing process.

[0091] S302. When the first pairing code is obtained, the first pairing window is generated on the transparent interface.

[0092] Based on the description in S301 above, after generating the transparent interface, the first electronic device can display the first pairing window on the transparent interface.

[0093] Specifically, referring to Figure 4, which is a schematic diagram of an application scenario showing a first pairing window and a second pairing window in a Bluetooth pairing method provided by an embodiment of this application. In this figure, the transparent interface blocks the second pairing window, but the user can still view the second pairing code. Simultaneously, the first pairing window is also displayed on the transparent interface.

[0094] It should be noted that after step S301 and before step S302, the first electronic device may also perform a prompting operation to prompt the user to place the second electronic device in the NFC sensing area of ​​the first electronic device.

[0095] The prompting operations include, but are not limited to, displaying text on a transparent interface, vibrating the first electronic device, or emitting voice commands, and are not limited to these operations.

[0096] It is understandable that, because the second pairing window is hidden by the transparent interface, the first electronic device cannot directly pair via Bluetooth based on the first and second pairing codes. Therefore, in order to successfully complete Bluetooth pairing, the first electronic device can pair according to the following steps when performing step S104 above. Details are as follows:

[0097] S303. Obtain the user's first operation command for the first pairing window, and send the first operation command to the second electronic device.

[0098] The second electronic device is used to generate a response request based on the first operation instruction.

[0099] It should be noted that since the first and second electronic devices are in the Bluetooth pairing process (pairing not yet complete), the first operation command at this time should also be in NFC tag format and sent to the second electronic device via the NFC module. The second electronic device can then parse the first operation command using its own NFC module and generate a Bluetooth pairing request if it determines the first operation command is a pairing command. Otherwise, it generates a pairing rejection request if it determines the first operation command is a cancellation command.

[0100] For example, the first operation instruction mentioned above can be:

[0101] "YES:123456"

[0102] That is, the first pairing code is successfully paired, and the first operation command is the pairing command.

[0103] S304. Obtain the response request and close the transparent interface that blocks the second pairing window.

[0104] It is understood that the aforementioned response request is a request from the second electronic device to agree to or refuse Bluetooth pairing with the first electronic device. At this point, the pairing code comparison process between the first and second electronic devices has been completed. Therefore, the response request can be sent directly through the Bluetooth module of the second electronic device, enabling the second electronic device to complete the subsequent Bluetooth pairing normally.

[0105] For example, if the first operation command is determined to be a pairing command, the generated response request will be a Bluetooth pairing request. Otherwise, if the first operation command is determined to be a cancellation command, the generated response request will be a pairing rejection request.

[0106] It should be noted that upon receiving a response request, the first electronic device can close the transparent interface that blocks the second pairing window, allowing the user to operate the second pairing window. For example, the first electronic device can respond to the application software's close command and close the transparent interface.

[0107] S305, Obtain the user's second operation command for the second pairing window.

[0108] Based on the above explanation, after the transparent interface is closed, the second pairing window will not be blocked, thus allowing the user's second operation command to be obtained. This second operation command is similar to the first, consisting of a pairing command and a cancel command. Whether the first electronic device needs to pair with the second electronic device via Bluetooth at this point depends on the second electronic device's response request and the second operation command. Details are as follows:

[0109] S306. If the response request is a Bluetooth pairing request and the second operation command is a pairing command, then a Bluetooth connection with the second electronic device is established.

[0110] S307. If the response request is a rejection of the pairing request, and / or the second operation instruction is a cancellation instruction, then Bluetooth pairing with the second electronic device is rejected.

[0111] In one embodiment, when the response request is determined to be a Bluetooth pairing request and the second operation instruction is a pairing instruction, it can be assumed that the user has confirmed that the first pairing code and the second pairing code generated by the first electronic device and the second electronic device, respectively, are both correct. Therefore, the first electronic device can establish a Bluetooth connection with the second electronic device. Otherwise, if the response request is a rejection of pairing request, and / or the second operation instruction is a cancellation instruction, it can be assumed that the first pairing code and / or the second pairing code are problematic. Therefore, to ensure pairing security, the first electronic device can refuse to pair with the second electronic device via Bluetooth.

[0112] Therefore, in this embodiment, the first pairing window is displayed on the transparent interface in the above manner, and the second pairing window can be operated by the user after the transparent interface disappears. This ensures that the application software cannot obtain and modify the data (second pairing code) generated by the terminal system during the pairing process. Consequently, the security of the Bluetooth pairing process can be guaranteed.

[0113] In another embodiment, the first electronic device may, upon detecting the second electronic device, first send a Bluetooth pairing request containing a second pairing code to the second electronic device. Then, the first electronic device may generate a second pairing window on its terminal display and create a transparent interface to mask the second pairing window. Subsequently, when the second electronic device receives the Bluetooth pairing request, it may only generate a pairing code input box to display in the transparent interface. At this time, the first electronic device can obtain the second pairing code entered by the user in the pairing code input box and send it to the second electronic device via the NFC module (which encapsulates the second pairing code in NFC tag format for transmission).

[0114] Next, the second electronic device can compare and authenticate the second pairing code sent by the NFC module with the second pairing code previously obtained from the Bluetooth pairing request. If the two second pairing codes match, the second electronic device can output a Bluetooth pairing request to the first electronic device. Otherwise, it outputs a pairing rejection request to the first electronic device. Finally, the first electronic device can directly establish a Bluetooth connection with the second electronic device based on the Bluetooth pairing request, or refuse to establish a Bluetooth connection with the second electronic device based on the pairing rejection request. Therefore, even if the second electronic device lacks a display screen and buttons, the above method can improve the security of the Bluetooth pairing process between the first and second electronic devices.

[0115] Please refer to Figure 5, which is a structural block diagram of a Bluetooth pairing device provided in an embodiment of this application. In this embodiment, the modules included in the Bluetooth pairing device are used to execute the steps in the embodiments corresponding to Figures 1 and 3. Please refer to Figures 1 and 3 and the relevant descriptions in the embodiments corresponding to Figures 1 and 3 for details. For ease of explanation, only the parts relevant to this embodiment are shown. The Bluetooth pairing device is applied to a second electronic device. Referring to Figure 5, the Bluetooth pairing device 500 may include: a first transmitting module 510, a first generating module 520, a first acquiring module 530, and a first pairing module 540, wherein:

[0116] The first sending module 510 is used to send a Bluetooth pairing request to the second electronic device when a connectable second electronic device is detected; the second electronic device is a device without a display screen and buttons; the second electronic device is used to generate a first pairing code based on the Bluetooth pairing request.

[0117] The first generation module 520 is used to generate a second pairing window on the terminal display screen of the first electronic device; the second pairing window displays a second pairing code generated by the first electronic device.

[0118] The first acquisition module 530 is used to acquire the first pairing code and generate a first pairing window on the terminal display screen; the first pairing window displays the first pairing code.

[0119] The first pairing module 540 is used to pair with the second electronic device via Bluetooth based on the first pairing code and the second pairing code.

[0120] In one embodiment, the Bluetooth pairing device 500 further includes:

[0121] The second generation module is used to generate a transparent interface on the terminal display screen; the transparent interface is used to hide the generated second pairing window.

[0122] The first acquisition module 530 is also used for:

[0123] Upon obtaining the first pairing code, the first pairing window is generated on the transparent interface.

[0124] In one embodiment, the first acquisition module 530 is further configured to:

[0125] When the second electronic device is detected to be located in the NFC sensing area of ​​the first electronic device, the NFC tag data is read; the NFC tag data is generated by the second electronic device based on the first pairing code; the NFC tag data is parsed to obtain the first pairing code.

[0126] In one embodiment, the Bluetooth pairing device 500 further includes:

[0127] The prompting module is used to perform a prompting operation; the prompting operation is used to prompt the user to place the second electronic device in the NFC sensing area of ​​the first electronic device.

[0128] In one embodiment, the first pairing module 540 is further configured to:

[0129] Obtain the user's first operation command for the first pairing window and the second operation command for the second pairing window; based on the first operation command and the second operation command, perform Bluetooth pairing with the second electronic device.

[0130] In one embodiment, the Bluetooth pairing device 500 further includes:

[0131] The second sending module is used to send a first operation instruction to a second electronic device; the second electronic device is used to generate a response request based on the first operation instruction.

[0132] The second acquisition module is used to acquire the response request and close the transparent interface that blocks the second pairing window.

[0133] In one embodiment, the first pairing module 540 is further configured to:

[0134] If the response request is a Bluetooth pairing request and the second operation instruction is a pairing instruction, a Bluetooth connection with the second electronic device is established; if the response request is a rejection pairing request, and / or the second operation instruction is a cancellation instruction, Bluetooth pairing with the second electronic device is rejected.

[0135] It should be understood that in the structural block diagram of the Bluetooth pairing device shown in Figure 5, each module is used to perform the steps in the embodiments corresponding to Figures 1 and 3. The steps in the embodiments corresponding to Figures 1 and 3 have been explained in detail in the above embodiments. Please refer to Figures 1 and 3 and the relevant descriptions in the embodiments corresponding to Figures 1 and 3 for details. They will not be repeated here.

[0136] In another embodiment, the Bluetooth pairing method described above can also be applied to a second electronic device, which can be a device without a display screen and buttons. For example, it can be a card reader or access control device as described above, and there is no limitation thereto.

[0137] Specifically, referring to Figure 6, which shows a flowchart of another embodiment of the Bluetooth pairing method provided in this application, the method includes the following steps:

[0138] S601. If a Bluetooth pairing request is received from the first electronic device, a first pairing code is generated based on the Bluetooth pairing request; the first electronic device generates a second pairing window on its terminal display screen after sending the Bluetooth pairing request; the second pairing window displays the second pairing code generated by the first electronic device.

[0139] S602, Send a first pairing code to a first electronic device; The first electronic device is used to generate a first pairing window on the terminal display screen after receiving the first pairing code, and to perform Bluetooth pairing with the second electronic device according to the first pairing code and the second pairing code; The first pairing window displays the first pairing code.

[0140] In one embodiment, the first electronic device, the second electronic device, the Bluetooth pairing request, the first pairing code, the second pairing code, the first pairing window, the second pairing window, and the method by which the first electronic device performs Bluetooth pairing based on the first pairing code and the second pairing code in steps S601 and S602 have all been explained in the above embodiments and will not be described again.

[0141] In this embodiment, using the above method, even when the second electronic device has no display screen and buttons, the self-generated first pairing code can still be displayed on the terminal display screen of the first electronic device. This satisfies the user's requirement to confirm the pairing code on both electronic devices, ensuring security during Bluetooth pairing without the need for third-party devices.

[0142] Referring to Figure 7, which illustrates an interaction flowchart between a first electronic device and a second electronic device in a Bluetooth pairing method according to an embodiment of this application, after the second electronic device is powered on, it can automatically run its Bluetooth module to broadcast device information. At this time, the first electronic device can automatically search for nearby devices that can be paired via Bluetooth based on its Bluetooth function. Then, it identifies the device selected by the user as the second electronic device and sends a Bluetooth pairing request to the second electronic device.

[0143] Subsequently, upon receiving the Bluetooth pairing request, the second electronic device can generate a first pairing code. Based on the configured NFC module, it then simulates the first pairing code as NFC tag data.

[0144] Furthermore, after sending a Bluetooth pairing request to the second electronic device, the first electronic device can generate a second pairing window on the terminal display screen and create a transparent interface to shield the second pairing window. Then, a prompt can be executed to guide the user to place the second electronic device on the NFC sensing area of ​​the first electronic device. Subsequently, upon detecting that the second electronic device is located within the NFC sensing area of ​​the first electronic device, the NFC tag data in the second electronic device is read, and the first pairing code is parsed from the NFC tag data to generate the first pairing window in the transparent interface.

[0145] At this point, the first electronic device will simultaneously display the first pairing code and the second pairing code. Then, the first electronic device can obtain the user's first operation command for the first pairing window and send the first operation command to the second electronic device based on its own NFC module.

[0146] When the second electronic device receives the first operation command, it can generate a corresponding response request and return the response request to the first electronic device through the set Bluetooth module.

[0147] Upon receiving a response request, the first electronic device can close the transparent interface that blocks the second pairing window and obtain the user's second operation command for the second pairing window. Then, if the response request is a Bluetooth pairing request and the second operation command is a pairing command, a Bluetooth connection with the second electronic device is established. Otherwise, if the response request is a rejection pairing request, and / or the second operation command is a cancellation command, Bluetooth pairing with the second electronic device is refused.

[0148] Please refer to Figure 8, which is a structural block diagram of a Bluetooth pairing device according to another embodiment of this application. In this embodiment, the modules included in the Bluetooth pairing device are used to perform the steps in the embodiments corresponding to Figures 6 and 7. Please refer to Figures 6 and 7 and the relevant descriptions in the embodiments corresponding to Figures 6 and 7 for details. For ease of explanation, only the parts relevant to this embodiment are shown. The Bluetooth pairing device is applied to a second electronic device. Referring to Figure 8, the Bluetooth pairing device 800 may include: a third generating module 810 and a third transmitting module 820, wherein:

[0149] The third generation module 810 is used to generate a first pairing code based on the Bluetooth pairing request if it receives a Bluetooth pairing request from the first electronic device; the first electronic device is used to generate a second pairing window on the terminal display screen of the first electronic device after sending the Bluetooth pairing request; the second pairing window displays the second pairing code generated by the first electronic device.

[0150] The third sending module 820 is used to send a first pairing code to the first electronic device; the first electronic device is used to generate a first pairing window on the terminal display screen after receiving the first pairing code, and to perform Bluetooth pairing with the second electronic device according to the first pairing code and the second pairing code; the first pairing window displays the first pairing code.

[0151] It should be understood that in the structural block diagram of the Bluetooth pairing device shown in Figure 8, each module is used to perform the steps in the embodiments corresponding to Figures 6 and 7. The steps in the embodiments corresponding to Figures 6 and 7 have been explained in detail in the above embodiments. Please refer to Figures 6 and 7 and the relevant descriptions in the embodiments corresponding to Figures 6 and 7 for details. They will not be repeated here.

[0152] Figure 9 is a structural block diagram of an electronic device according to an embodiment of this application. As shown in Figure 9, the electronic device 900 of this embodiment includes: a processor 910, a memory 920, and a computer program 930 stored in the memory 920 and executable by the processor 910, such as a program for a Bluetooth pairing method. When the processor 910 executes the computer program 930, it implements the steps in the various embodiments of the Bluetooth pairing method described above, such as S101 to S104 shown in Figure 1, or S601 to S602 shown in Figure 6. Alternatively, when the processor 910 executes the computer program 930, it implements the functions of each module in the embodiments corresponding to Figure 5 or Figure 8, for example, the functions of each module shown in Figure 5 or Figure 8. For details, please refer to the relevant descriptions in the embodiments corresponding to Figure 5 or Figure 8.

[0153] For example, the computer program 930 can be divided into one or more modules, one or more of which are stored in the memory 920 and executed by the processor 910 to implement the Bluetooth pairing method provided in the embodiments of this application. One or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 930 in the electronic device 900. For example, the computer program 930 can implement the Bluetooth pairing method provided in the embodiments of this application.

[0154] Electronic device 900 may include, but is not limited to, processor 910 and memory 920. Those skilled in the art will understand that FIG9 is merely an example of electronic device 900 and does not constitute a limitation on electronic device 900. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, electronic device may also include input / output devices, network access devices, buses, etc.

[0155] The processor 910 may be a central processing unit, or it may be other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0156] The memory 920 can be an internal storage unit of the electronic device 900, such as a hard disk or RAM of the electronic device 900. The memory 920 can also be an external storage device of the electronic device 900, such as a plug-in hard disk, smart memory card, flash memory card, etc., equipped on the electronic device 900. Furthermore, the memory 920 can include both internal storage units and external storage devices of the electronic device 900.

[0157] This application provides a computer-readable storage medium, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the Bluetooth pairing method as described in the above embodiments.

[0158] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the Bluetooth pairing method described in the above embodiments.

[0159] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A Bluetooth pairing method, characterized by, The method is applied to a first electronic device, and the method comprises: When a connectable second electronic device is detected, a Bluetooth pairing request is sent to the second electronic device; the second electronic device is a device without a display screen and a key; the second electronic device is configured to generate a first pairing code based on the Bluetooth pairing request; A second pairing window is generated on a terminal display screen of the first electronic device; the second pairing window displays a second pairing code generated by the first electronic device; The first pairing code is obtained, and a first pairing window is generated on the terminal display screen; the first pairing window displays the first pairing code; Bluetooth pairing is performed with the second electronic device according to the first pairing code and the second pairing code.

2. The method of claim 1, wherein, After the second pairing window is generated on the terminal display screen of the first electronic device, the method further comprises: A transparent interface is generated on the terminal display screen; the transparent interface is configured to shield the generated second pairing window; The first pairing code is obtained, and a first pairing window is generated on the terminal display screen; the first pairing window displays the first pairing code; When the first pairing code is obtained, the first pairing window is generated on the transparent interface.

3. The method according to claim 1 or 2, characterized in that, The first pairing code is obtained, and a first pairing window is generated on the terminal display screen; the first pairing window displays the first pairing code; When the second electronic device is detected to be located in an NFC sensing area of the first electronic device, NFC tag data is read; the NFC tag data is generated by the second electronic device based on the first pairing code; The NFC tag data is parsed to obtain the first pairing code.

4. The method of claim 2, wherein After the transparent interface is generated on the terminal display screen, the method further comprises: A prompt operation is performed; the prompt operation is configured to prompt a user to place the second electronic device in the NFC sensing area of the first electronic device.

5. The method according to claim 2 or 4, characterized in that, The first pairing code and the second pairing code are obtained, and Bluetooth pairing is performed with the second electronic device according to the first pairing code and the second pairing code. After the first operation instruction of the user for the first pairing window is obtained, the method further comprises: The first operation instruction is sent to the second electronic device; the second electronic device is configured to generate a response request based on the first operation instruction; 6. The method of claim 5, wherein, The response request is obtained, and the transparent interface shielding the second pairing window is closed. The first pairing code and the second pairing code are obtained, and Bluetooth pairing is performed with the second electronic device according to the first pairing code and the second pairing code. If the response request is a Bluetooth pairing request and the second operation instruction is a pairing instruction, a Bluetooth connection with the second electronic device is established; 7. The method of claim 6, wherein, If the response request is a pairing rejection request and / or the second operation instruction is a cancellation instruction, Bluetooth pairing with the second electronic device is rejected. The method is applied to a second electronic device, and the second electronic device has no display screen and key, and the method comprises: ​ 8. A Bluetooth pairing method, characterized by, ​ If a Bluetooth pairing request sent by the first electronic device is received, a first pairing code is generated based on the Bluetooth pairing request; the first electronic device is configured to generate a second pairing window on a terminal display screen of the first electronic device after sending the Bluetooth pairing request; the second pairing window displays a second pairing code generated by the first electronic device; The first pairing code is sent to the first electronic device; the first electronic device is configured to generate a first pairing window on the terminal display screen after receiving the first pairing code, and to perform Bluetooth pairing with the second electronic device according to the first pairing code and the second pairing code; the first pairing window displays the first pairing code.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1 to 7 or 8 when executing the computer program.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program, when executed by the processor, implements the method of any one of claims 1 to 7 or 8.

Citation Information

Patent Citations

  • Bluetooth pairing method and device for mobile phone and payment terminal

    CN106131771A

  • IOS equipment and bluetooth peripheral equipment pairing method and device

    CN106257940A

  • Bluetooth pairing method, electronic equipment and storage medium

    CN118433723A

  • Communication method and system for bluetooth pairing of multiple devices

    WO2022062739A1