CN113301542B - Pairing connection method and device, storage medium and electronic equipment - Google Patents

Pairing connection method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113301542B
CN113301542B CN202010108239.6A CN202010108239A CN113301542B CN 113301542 B CN113301542 B CN 113301542B CN 202010108239 A CN202010108239 A CN 202010108239A CN 113301542 B CN113301542 B CN 113301542B
Authority
CN
China
Prior art keywords
pairing
bluetooth
connection
bluetooth device
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010108239.6A
Other languages
Chinese (zh)
Other versions
CN113301542A (en
Inventor
龚金华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010108239.6A priority Critical patent/CN113301542B/en
Publication of CN113301542A publication Critical patent/CN113301542A/en
Application granted granted Critical
Publication of CN113301542B publication Critical patent/CN113301542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the application discloses a pairing connection method, a pairing connection device, a storage medium and electronic equipment, wherein the method comprises the following steps: when the electronic equipment communicates with Bluetooth equipment for the first time, acquiring a pairing function supported by the Bluetooth equipment and an identifier of the Bluetooth equipment based on the created asynchronous connection-oriented link; and after the safety authentication is passed, when the pairing function is determined to comprise a safe simple pairing function, completing pairing connection based on a pairing connection mode corresponding to the safe simple pairing function and the Bluetooth equipment indicated by the identification. Therefore, by adopting the embodiment of the application, the time required for executing the RNR operation once can be reduced, and the pairing connection speed can be improved.

Description

Pairing connection method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a pairing connection method and apparatus, a storage medium, and an electronic device.
Background
When the electronic device is in pairing Connection with the bluetooth device for the first time, the electronic device acquires a function and a device Name supported by the bluetooth device of the opposite party from the bluetooth device through the created temporary Asynchronous Connection-oriented (ACL) link, records whether the bluetooth device of the opposite party supports an SSP function according to a reply of the bluetooth device of the opposite party at the moment, and disconnects the temporary ACL link after successfully acquiring the information, so that the first (Remote Name Request, RNR) RNR operation is completed.
Then, the electronic device creates a formal ACL link with the Bluetooth device, and acquires the function and device name supported by the other party from the Bluetooth device again through the formal ACL link, namely, the RNR operation is performed again. And at the moment, updating the recorded SSP function whether supported or not according to the reply of the Bluetooth equipment of the opposite side, then performing pairing authentication according to the obtained function supported by the Bluetooth equipment of the opposite side and the updating result, and after the successful authentication, performing corresponding service connection and finally finishing the whole pairing connection operation.
In the above pairing connection process, two RNR operations are performed, and the information obtained by the two RNRs is the same, in fact, a certain time is required for each RNR operation, and especially, the first RNR operation sometimes needs more than 1s to be completed, thereby affecting the pairing connection speed.
Disclosure of Invention
The embodiment of the application provides a pairing connection method, a pairing connection device, a storage medium and an electronic device, which can reduce the time required for executing RNR operation once, so that the pairing connection speed can be increased. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a pairing connection method, where the method includes:
when the electronic equipment communicates with Bluetooth equipment for the first time, acquiring a pairing function supported by the Bluetooth equipment and an identifier of the Bluetooth equipment based on the created asynchronous connection-oriented link;
and after the electronic equipment and the Bluetooth equipment pass the safety certification, when the pairing function is determined to comprise a safe simple pairing function, completing pairing connection based on a pairing connection mode corresponding to the safe simple pairing function and the Bluetooth equipment indicated by the identification.
In a second aspect, an embodiment of the present application provides a mating connection device, including:
the information acquisition module is used for acquiring the pairing function supported by the Bluetooth equipment and the identification of the Bluetooth equipment based on the created asynchronous connection-oriented link when the electronic equipment is communicated with the Bluetooth equipment for the first time;
and the equipment pairing module is used for carrying out safety authentication on the electronic equipment and the Bluetooth equipment, and completing pairing connection based on a pairing connection mode corresponding to the safety simple pairing function and the Bluetooth equipment indicated by the identification when the pairing function is determined to comprise the safety simple pairing function after the safety authentication is passed.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
in this embodiment of the application, when the electronic device communicates with a bluetooth device for the first time, the pairing function supported by the bluetooth device and the identifier of the bluetooth device are acquired based on the created asynchronous connection-oriented link, and the electronic device and the bluetooth device are subjected to security authentication. By integrating the RNR operation performed before the creation of the formal ACL and the RNR operation performed after the creation of the formal ACL into one operation and deleting redundant operations, the time required to perform the RNR operation at one time can be reduced, so that the pairing connection speed can be increased.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a pairing connection method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a pairing connection system according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a security authentication process provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a pairing connection method according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an example RNR pre-search interface provided by an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating an example RNR post-search interface provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a mating connection device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a mating connection device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The mating connection method provided by the embodiment of the present application will be described in detail below with reference to fig. 1 to 6. The method may be implemented in dependence on a computer program, operable on a mating connection device based on a von neumann architecture. The computer program may be integrated into the application or may run as a separate tool-like application. The pairing connection device in the embodiment of the present application may be an electronic device.
Please refer to fig. 1, which is a flowchart illustrating a pairing connection method according to an embodiment of the present disclosure. As shown in fig. 1, the method of the embodiment of the present application may include the steps of:
s101, when the electronic equipment is communicated with Bluetooth equipment for the first time, a pairing function supported by the Bluetooth equipment and an identifier of the Bluetooth equipment are obtained on the basis of the created asynchronous connection-oriented link;
in order to ensure the convenience of use, the first communication authentication between two Bluetooth devices is completed in a pairing mode. After pairing, the appointed link key is established between the devices by the PIN code, and after pairing, the subsequent communication connection does not need to be paired every time, and the connection can be established according to the link key only by authentication. Therefore, the two devices cannot establish an authentication relationship without pairing, connection and subsequent operation cannot be performed, and the safety of Bluetooth communication is ensured to a certain extent through pairing.
In the embodiment of the application, one of the devices is an electronic device, and the other device is a bluetooth device. Both devices have a Bluetooth function and can complete pairing connection.
As shown in fig. 2, the system architecture 100 may include one or more of electronic devices 101, 102, 103, a bluetooth network 104 and a bluetooth device 105. The bluetooth network 104 is used to provide a medium for communication links between the electronic devices 101, 102, 103 and the bluetooth device 105.
Among them, bluetooth is a radio technology supporting short-range communication (generally within 10 m) of devices, and can perform wireless information exchange among a plurality of devices including mobile phones, PDAs, wireless headsets, notebook computers, related peripherals, and the like. By using the Bluetooth technology, the communication between the terminal devices can be effectively simplified, and the communication between the devices and the Internet can also be successfully simplified, so that the data transmission becomes faster and more efficient, and the way is widened for wireless communication.
It should be understood that the number of electronic devices, bluetooth networks, and bluetooth devices in fig. 2 are merely illustrative. There may be any number of electronic devices, bluetooth networks, and bluetooth devices, as desired for implementation. For example, the bluetooth device 105 may be a bluetooth device cluster formed by a plurality of bluetooth devices, or a plurality of independent bluetooth devices within a certain distance, etc.
A user may use the electronic devices 101, 102, 103 to interact with the bluetooth device 105 over the bluetooth network 104 to receive or send messages, etc. The electronic devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablets, laptops, desktops, bluetooth headsets, bluetooth car mounts, bluetooth headsets, bluetooth MP3, bluetooth flash drives, bluetooth adapters, bluetooth gateways, bluetooth CF cards, and the like. The bluetooth device may include, but is not limited to, a bluetooth headset, a bluetooth car, a bluetooth headset, a bluetooth MP3, a bluetooth flash disk, a bluetooth adapter, a bluetooth gateway, a bluetooth CF card, and the like.
When an electronic device is paired with a bluetooth device, an ACL link needs to be created first. After the ACL link is established, the electronic equipment acquires the pairing function supported by the Bluetooth equipment from the Bluetooth equipment through the link and acquires the identifier of the Bluetooth equipment through the link, so that the authentication and pairing can be completed based on the supported pairing function and the equipment identifier. The identifier is used for uniquely identifying the bluetooth device, and may be a device name or the like. It will be appreciated that the identification is derived based on a bluetooth address for presentation to the user.
The ACL link is a logical link of connection-oriented bluetooth asynchronous transmission. The data packets are sent directionally over the link, which supports both symmetric and asymmetric connections (either one-to-one or one-to-many). The master device (electronic device) is responsible for controlling the link bandwidth and decides how much bandwidth each slave device (bluetooth device) can occupy and the symmetry of the connection. The slave device can only transfer data if it is selected. The ACL link also supports the reception of broadcast messages sent by the master device to all slave devices. In addition, the ACL link is mainly used for transfer of packet data.
S102, performing security authentication on the electronic device and the Bluetooth device, and completing pairing connection based on a pairing connection mode corresponding to the security simple pairing function and the Bluetooth device indicated by the identification when the pairing function is determined to include the security simple pairing function after the security authentication is passed.
As any wireless communication technology has the possibility of being monitored and cracked, in order to ensure the safety of Bluetooth communication, data interaction is carried out in an authentication mode.
The bidirectional authentication is by challenge-response (challenge-response) means. As shown in fig. 3, the electronic device a is the responder and the bluetooth device B is the requester. The a device, which is the responder, generates a 128-bit random number AU _ RANDA and transmits it in clear to the B device. A. The B device uses the E1 algorithm to generate the 32-bit SRESA and SRESB respectively from the AU _ RANDA, Kab and BD _ ANDRB encryption operations obtained respectively. The device B transmits the result SRESB to the device a, which compares the SRESA and the SRESB, and if equal, the authentication passes, otherwise the authentication does not pass. After the authentication is performed, the roles of the device a and the device B are exchanged, that is, the device a serves as a requester and the device B serves as a responder, and the authentication is performed in the same manner. And after the two parties pass the authentication, confirming that the security authentication passes.
After the authentication is passed, whether a Secure Simple Pairing (SSP) function is included in Pairing functions supported by the bluetooth device is judged, if yes, a required function is determined in the supported Pairing functions according to a Pairing connection mode corresponding to the SSP function, and Pairing connection is completed with the bluetooth device indicated by the identifier.
SSP uses a more elaborate mechanism, called elliptic curve cryptography, to avoid using PIN codes as part of the link key calculation process, and instead uses extremely large random numbers to seed the link key calculation. Therefore, the number of possible link keys is no longer limited to a probability of less than 2^128, which far exceeds the capability of any real attacker, and the security is high.
To achieve this, the SSP process begins with the establishment of heterogeneous shared secrets between two devices. This shared secret, called the Diffie-Hellman key, is a 192-bit random number. As a prerequisite, the two devices each have a private key and a public key. The public key is propagated over the air and can be known by anyone, but the private key is never disclosed. These two keys are referred to as SSP public/private Key pairs, but these are also referred to as Diffie-Hellman public/private Key pairs.
In the embodiment of the application, when the electronic device and the bluetooth device are paired and connected for the first time, the electronic device does not execute the RNR operation before creating the ACL link, but directly creates the ACL link first, and after the ACL is successfully created, the electronic device acquires the support function and the RNR operation of the bluetooth device of the opposite party, records whether the bluetooth device of the opposite party supports the SSP function, and then performs the operations of pairing authentication and connection service. By integrating the RNR operation performed before the creation of the formal ACL and the RNR operation performed after the creation of the formal ACL into one operation and deleting redundant operations, the time required to perform the RNR operation at one time can be reduced, so that the pairing connection speed can be increased.
Please refer to fig. 2, which is a flowchart illustrating a pairing connection method according to an embodiment of the present disclosure. The pairing connection method may include the steps of:
s201, when the electronic equipment communicates with Bluetooth equipment for the first time, under the condition that a temporary asynchronous connection-oriented link is not established, initiating a connection request to the Bluetooth equipment to establish the asynchronous connection-oriented link;
first, an electronic device (master, i.e. a device initiating connection) pages a bluetooth device (slave, a device receiving connection), the master pages the slave in a frequency hopping manner, the slave scans an external page at regular intervals, and when the external page is scanned, the slave responds to the external page, so that a link connection, i.e. an ACL link connection, is established between the electronic device and the bluetooth device.
The timeout time for page is 40.9 seconds maximum and 0.625ms minimum. And when the Bluetooth device does not return Page Response within the non-Timeout time, returning a Page Timeout event.
The bluetooth device can only respond to the connection request of other bluetooth devices by starting the page scan mode. The page scan is a state, and the electronic device may be successfully connected only if the bluetooth device is in the page scan state.
The Page Scan comprises three parameters of Page Scan Interval, Page Scan Windows and Page Scan Type.
Here, Page Scan Interval represents how often the Interval is equal to, and the maximum value is 2560 ms.
Page Scan Windows indicates how long Scan lasts once, which is less than or equal to Interval.
There are two types of Page Scan Type, one is a mandatory standard Type and the other is an optional Interlace Type.
Under the condition that the temporary asynchronous connection-oriented link is not established, the pairing function supported by the Bluetooth device and the identification of the Bluetooth device do not need to be acquired based on the temporary asynchronous connection-oriented link, whether the safe and simple pairing function is supported or not is recorded based on the supported pairing function, and the temporary asynchronous connection-oriented link is disconnected.
Optionally, after the electronic device communicates with the bluetooth device for the first time, an environmental interference value needs to be obtained, and when the environmental interference value is greater than or equal to an interference threshold, the pairing function supported by the bluetooth device and the identifier of the bluetooth device are obtained based on the created asynchronous connection-oriented link. When the environmental interference value is smaller than an interference threshold value, a temporary asynchronous connection-oriented link needs to be established, a pairing function and an identifier of the Bluetooth device supported by the Bluetooth device are obtained based on the temporary asynchronous connection-oriented link, whether a safe and easy pairing function is supported or not is recorded based on the supported pairing function, the temporary asynchronous connection-oriented link is disconnected, and then the pairing function and the identifier of the Bluetooth device supported by the Bluetooth device are obtained based on the established asynchronous connection-oriented link in a triggering mode.
That is, when the environmental interference is large, the steps of S101-102 are adopted to perform the connection, and since a connection speed can be obtained without establishing the temporary asynchronous connection-oriented link, the problem of slow connection caused by the large environmental interference can be reduced.
S202, acquiring the pairing function supported by the Bluetooth equipment through the created asynchronous connection-oriented link;
the electronic equipment sends a function acquisition request to the Bluetooth equipment through the created ACL link, and receives a response message fed back by the Bluetooth equipment based on the function acquisition request, wherein the response message carries the pairing function supported by the Bluetooth equipment.
S203, judging whether the pairing function comprises a safe simple pairing function and recording;
traversing the received pairing function, and determining whether an SSP function exists, if so, recording as yes, otherwise, recording as no.
S204, acquiring the identifier of the Bluetooth equipment through the asynchronous connection-oriented link;
and sending an identification acquisition request to the Bluetooth equipment through the created ACL link, and receiving the identification of the Bluetooth equipment fed back by the Bluetooth equipment based on the identification acquisition request.
The identification is a device name.
It can be understood that the electronic device requests the bluetooth device to obtain the Name of the bluetooth device through the ACL link based on the bluetooth address of the bluetooth device, and after receiving the request, the bluetooth device returns the Name to the electronic device for display, thereby completing an rnr (remote Name request) operation. The user can distinguish different bluetooth devices more friendly by the name.
For example, as shown in fig. 5, the electronic device requests the bluetooth device with bluetooth address 10:4E:89:9D:3B: C8 to obtain the device name, and the bluetooth device feeds back the name of the electronic device as "my headset" as shown in fig. 6.
S205, performing security authentication on the Bluetooth device based on the identifier, and after the security authentication is passed, when it is determined that the pairing function includes a safe and simple pairing function, completing pairing connection with the Bluetooth device based on a pairing connection mode corresponding to the safe and simple pairing function and the pairing function;
bidirectional authentication uses a challenge-response approach. For a specific authentication process, see S102, which is not described herein.
After the authentication is passed, whether the pairing function supported by the Bluetooth device comprises an SSP function is judged, if yes, the required function is determined in the supported pairing function according to a pairing connection mode corresponding to the SSP function, and the pairing connection is completed with the Bluetooth device indicated by the identification.
Of course, if the security authentication fails, the pairing connection cannot be completed.
The secure Pairing connection Mode can be broadly divided into two types of Legacy Security Modes (1, 2, 3, also called Legacy Pairing) and Security Mode 4 (i.e., SSP). The device may support Security Mode 2 and Security Mode 4 simultaneously.
The several modes are specifically: security Mode 1: Non-Security; security Mode 2, Service level enabled Security; security Mode 3 is Link level enhanced Security; security Mode 4: Service level enhanced Security.
SSP uses a more elaborate mechanism, called elliptic curve cryptography, to avoid using PIN codes as part of the link key calculation process, and instead uses extremely large random numbers to seed the link key calculation. Therefore, the number of possible link keys is no longer limited to a probability of less than 2^128, which far exceeds the capability of any real attacker, and the security is high. SSP is a Bluetooth 2.0 after pairing mode, and there are four types in total, of which Out of Band is rarely used, as follows:
number company: both paired parties display a 6-digit number, the user checks whether the numbers are consistent and inputs Yes/No, and Yes at both ends shows consistency, thus the pairing can be realized, and man-in-the-middle attack can be prevented.
The use scenario is as follows: the two-terminal device may pop up a 6 digit decimal number and have yes and no buttons.
Passkey Entry: the pairing target inputs a 6-digit number displayed on the local equipment, and the pairing can be realized if the input is correct, and the man-in-the-middle attack can be prevented.
The use scenario is as follows: one end device may display and the other end device may input.
Just Works: authentication cannot be performed, man-in-the-middle attack cannot be prevented from being used for pairing equipment which is not displayed and has no input, pairing can be performed by actively initiating connection, a user cannot see the pairing process, and man-in-the-middle attack cannot be prevented, such as connection of a Bluetooth headset.
The use scenario is as follows: for devices that cannot display nor input 6-bit random numbers.
Out of Band: the two devices exchange pairing information through other ways, such as some NFC bluetooth speakers.
In this embodiment of the application, when the recording result indicates that the pairing function includes a safe and easy pairing function, the pairing mode is selected based on a specific use scenario of the electronic device and the bluetooth device.
S206, when the pairing function does not comprise the safe simple pairing function, the pairing connection with the Bluetooth equipment is completed based on a default pairing connection mode and the pairing function.
When the SSP is not included, the pairing is performed by adopting any pairing Mode supported by the electronic equipment (namely, the Security Mode 1, the Security Mode 2 or the Security Mode 3). Of course, if the device supports multiple pairing connection modes, the device may select according to the order of priority of each mode, so as to complete pairing connection with the bluetooth device.
Legacy Security models are used for bluetooth v2.0 and earlier, the device needs to input Pin Code, and when the Pin Code is the same, the pairing is successful. Pin Code is typically 4 bytes, such as 0000 and 1234.
It should be noted that, through verification, in general, by adopting the scheme, the speed of the first pairing connection can be increased by about 300ms to 800 ms; in extreme cases, namely when the interference of the surrounding environment is strong, the connection speed can be increased by 4s or more by adopting the scheme.
In the embodiment of the application, when the electronic device is paired and connected with the bluetooth device for the first time, the electronic device does not execute the RNR operation before creating the ACL link, but directly creates the ACL link first, and after the ACL is successfully created, the electronic device acquires the support function of the bluetooth device of the opposite party and the RNR operation, records whether the bluetooth device of the opposite party supports the SSP function, and then performs the pairing authentication and service connection operation. The RNR operation executed before the formal ACL is created and the RNR operation executed after the formal ACL is created are integrated into one operation, redundant operation is deleted, the time required for executing the RNR operation once can be shortened, particularly when the electronic equipment and the Bluetooth equipment are in an environment with strong interference, the pairing connection speed can be improved, and better use experience is brought to a user.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a schematic structural diagram of a mating connection device according to an exemplary embodiment of the present application is shown. The mating connection means may be implemented as all or part of an electronic device, in software, hardware or a combination of both. The apparatus 1 includes an information acquisition module 10 and a device pairing module 20.
The information acquisition module 10 is configured to acquire, when the electronic device communicates with a bluetooth device for the first time, a pairing function supported by the bluetooth device and an identifier of the bluetooth device based on the created asynchronous connection-oriented link;
and the device pairing module 20 is configured to perform security authentication on the bluetooth device based on the identifier, and after the security authentication is passed, when it is determined that the pairing function includes a secure simple pairing function, complete pairing connection with the bluetooth device based on a pairing connection mode corresponding to the secure simple pairing function and the pairing function.
Optionally, as shown in fig. 8, the apparatus further includes:
a link establishing module 30, configured to initiate a connection request to the bluetooth device to create the asynchronous connection-oriented link without establishing a temporary asynchronous connection-oriented link.
Optionally, as shown in fig. 8, the apparatus further includes:
and the function recording module 40 is configured to determine whether the pairing function includes a safe and easy pairing function and record the function.
Optionally, the information obtaining module 10 is specifically configured to:
acquiring a pairing function supported by the Bluetooth equipment through the created asynchronous connection-oriented link;
and acquiring the identifier of the Bluetooth equipment through the asynchronous connection-oriented link.
Optionally, the information obtaining module 10 is specifically configured to:
sending a function acquisition request to the Bluetooth device through the created asynchronous connection-oriented link;
and receiving a response message fed back by the Bluetooth equipment based on the function acquisition request, wherein the response message carries the pairing function supported by the Bluetooth equipment.
Optionally, the information obtaining module 10 is specifically configured to:
sending an identification acquisition request to the Bluetooth equipment through the created asynchronous connection-oriented link;
and receiving the identifier of the Bluetooth device fed back by the Bluetooth device based on the identifier acquisition request.
Optionally, the device pairing module 20 further includes:
when the pairing function is determined not to include the safe and easy pairing function, completing pairing connection with the Bluetooth device based on a default pairing connection mode and the pairing function.
Optionally, the apparatus further comprises:
an interference value obtaining module 50, configured to obtain an environmental interference value, and when the environmental interference value is greater than or equal to an interference threshold, trigger the information obtaining module 10 to obtain, based on the created asynchronous connection-oriented link, a pairing function supported by the bluetooth device and an identifier of the bluetooth device;
when the environmental interference value is smaller than an interference threshold value, establishing a temporary asynchronous connection-oriented link, and acquiring a pairing function supported by the Bluetooth device and an identifier of the Bluetooth device based on the temporary asynchronous connection-oriented link;
based on whether the supported pairing function records support of a secure easy pairing function and the temporary asynchronous connection-oriented link is disconnected, triggering the information acquisition module 10 to acquire the pairing function supported by the bluetooth device and the identifier of the bluetooth device based on the created asynchronous connection-oriented link.
It should be noted that, when the token authentication apparatus provided in the foregoing embodiment executes the token authentication method, only the division of each functional module is illustrated by way of example, and in practical applications, the above functions may be distributed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. In addition, the token verification apparatus and the token verification processing method provided in the above embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the embodiment of the application, when the electronic device is paired and connected with the bluetooth device for the first time, the electronic device does not execute the RNR operation before creating the ACL link, but directly creates the ACL link first, and after the ACL is successfully created, the electronic device acquires the support function of the bluetooth device of the opposite party and the RNR operation, records whether the bluetooth device of the opposite party supports the SSP function, and then performs the pairing authentication and service connection operation. The RNR operation executed before the formal ACL is created and the RNR operation executed after the formal ACL is created are integrated into one operation, redundant operation is deleted, the time required for executing the RNR operation once can be shortened, particularly when the electronic equipment and the Bluetooth equipment are in an environment with strong interference, the pairing connection speed can be improved, and better use experience is brought to a user.
An embodiment of the present application further provides a computer storage medium, where multiple instructions may be stored in the computer storage medium, where the instructions are suitable for being loaded by a processor and being executed in the method steps in the embodiments shown in fig. 1 to fig. 6, and specific execution processes may refer to specific descriptions in the embodiments shown in fig. 1 to fig. 6, which are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002.
Wherein a communication bus 1002 is used to enable connective communication between these components.
The user interface 1003 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 1003 may further include a standard wired interface and a wireless interface.
The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 1001 may include one or more processing cores, among other things. The processor 1001 interfaces various components throughout the electronic device 1000 using various interfaces and lines to perform various functions of the electronic device 1000 and to process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005 and invoking data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1001, but may be implemented by a single chip.
The Memory 1005 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable medium. The memory 1005 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 9, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a pairing-connection application program.
In the electronic device 1000 shown in fig. 9, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 1001 may be configured to call the pairing-connection application stored in the memory 1005, and specifically perform the following operations:
when the electronic equipment communicates with Bluetooth equipment for the first time, acquiring a pairing function supported by the Bluetooth equipment and an identifier of the Bluetooth equipment based on the created asynchronous connection-oriented link;
and after the safety authentication is passed, when the pairing function is determined to comprise a safe simple pairing function, completing pairing connection based on a pairing connection mode corresponding to the safe simple pairing function and the Bluetooth equipment.
In one embodiment, the processor 1001 further performs the following operations before performing the acquisition of the pairing function supported by the bluetooth device and the identification of the bluetooth device based on the created asynchronous connection-oriented link:
initiating a connection request to the Bluetooth device to create an asynchronous connection-oriented link without establishing a temporary asynchronous connection-oriented link.
In one embodiment, after the processor 1001 acquires the pairing function supported by the bluetooth device and the identification of the bluetooth device based on the created asynchronous connection-oriented link, the following operations are further performed:
and judging whether the pairing function comprises a safe and simple pairing function and recording.
In an embodiment, when the processor 1001 acquires the pairing function supported by the bluetooth device and the identifier of the bluetooth device based on the created asynchronous connection-oriented link, it specifically performs the following operations:
acquiring a pairing function supported by the Bluetooth equipment through the created asynchronous connection-oriented link;
and acquiring the identifier of the Bluetooth equipment through the asynchronous connection-oriented link.
In an embodiment, when executing the pairing function supported by the bluetooth device through the created asynchronous connection-oriented link, the processor 1001 specifically performs the following operations:
sending a function acquisition request to the Bluetooth device through the created asynchronous connection-oriented link;
and receiving a response message fed back by the Bluetooth equipment based on the function acquisition request, wherein the response message carries the pairing function supported by the Bluetooth equipment.
In an embodiment, when the processor 1001 acquires the identifier of the bluetooth device through the asynchronous connection-oriented link, it specifically performs the following operations:
sending an identification acquisition request to the Bluetooth equipment through the created asynchronous connection-oriented link;
and receiving the identifier of the Bluetooth device fed back by the Bluetooth device based on the identifier acquisition request.
In one embodiment, the processor 1001 further performs the following operations:
when the pairing function is determined not to include the safe and easy pairing function, completing pairing connection with the Bluetooth device based on a default pairing connection mode and the pairing function.
In one embodiment, the processor 1001 further performs the following operations:
acquiring an environmental interference value;
when the environmental interference value is larger than or equal to an interference threshold value, triggering the asynchronous connection-oriented link which is established based on the established to acquire the pairing function supported by the Bluetooth device and the identification of the Bluetooth device;
when the environmental interference value is smaller than an interference threshold value, establishing a temporary asynchronous connection-oriented link, and acquiring a pairing function supported by the Bluetooth device and an identifier of the Bluetooth device based on the temporary asynchronous connection-oriented link;
and recording whether a safe and easy pairing function is supported or not and disconnecting the temporary asynchronous connection-oriented link based on the supported pairing function, and triggering and executing the asynchronous connection-oriented link based on the created asynchronous connection-oriented link to acquire the pairing function supported by the Bluetooth device and the identifier of the Bluetooth device.
In the embodiment of the application, when the electronic device and the bluetooth device are paired and connected for the first time, the electronic device does not execute the RNR operation before creating the ACL link, but directly creates the ACL link first, and after the ACL is successfully created, the electronic device acquires the support function and the RNR operation of the bluetooth device of the opposite party, records whether the bluetooth device of the opposite party supports the SSP function, and then performs the operations of pairing authentication and connection service. The RNR operation executed before the formal ACL is created and the RNR operation executed after the formal ACL is created are integrated into one operation, redundant operation is deleted, the time required for executing the RNR operation once can be shortened, particularly when the electronic equipment and the Bluetooth equipment are in an environment with strong interference, the pairing connection speed can be improved, and better use experience is brought to a user.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a computer to implement the processes of the embodiments of the methods described above. The storage medium can be a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (11)

1. A pairing connection method is applied to electronic equipment, and is characterized by comprising the following steps:
when the electronic equipment communicates with Bluetooth equipment for the first time, acquiring a pairing function supported by the Bluetooth equipment and an identifier of the Bluetooth equipment based on the created asynchronous connection-oriented link;
and after the safety authentication is passed, when the pairing function is determined to comprise a safe simple pairing function, completing pairing connection based on a pairing connection mode corresponding to the safe simple pairing function and the Bluetooth equipment indicated by the identification.
2. The method of claim 1, wherein before the obtaining the pairing function supported by the bluetooth device and the identity of the bluetooth device based on the created asynchronous connection-oriented link, further comprises:
initiating a connection request to the Bluetooth device to create the asynchronous connection-oriented link without establishing a temporary asynchronous connection-oriented link.
3. The method of claim 1, wherein after acquiring the pairing function supported by the bluetooth device and the identity of the bluetooth device based on the created asynchronous connection-oriented link, further comprising:
and judging whether the pairing function comprises a safe and simple pairing function and recording.
4. The method according to claim 1, wherein the obtaining the pairing function supported by the bluetooth device and the identity of the bluetooth device based on the created asynchronous connection-oriented link comprises:
acquiring a pairing function supported by the Bluetooth equipment through the created asynchronous connection-oriented link;
and acquiring the identifier of the Bluetooth equipment through the asynchronous connection-oriented link.
5. The method of claim 4, wherein the obtaining the pairing functions supported by the Bluetooth device through the created asynchronous connection-oriented link comprises:
sending a function acquisition request to the Bluetooth equipment through the created asynchronous connection-oriented link;
and receiving a response message fed back by the Bluetooth equipment based on the function acquisition request, wherein the response message carries the pairing function supported by the Bluetooth equipment.
6. The method of claim 4, wherein the obtaining the identity of the Bluetooth device over the asynchronous connection-oriented link comprises:
sending an identification acquisition request to the Bluetooth equipment through the created asynchronous connection-oriented link;
and receiving the identifier of the Bluetooth device fed back by the Bluetooth device based on the identifier acquisition request.
7. The method of claim 1, further comprising:
when the pairing function is determined not to include the safe and easy pairing function, completing pairing connection with the Bluetooth device based on a default pairing connection mode and the pairing function.
8. The method of claim 1, further comprising, after the first communication between the electronic device and the bluetooth device:
acquiring an environmental interference value;
when the environmental interference value is larger than or equal to an interference threshold value, triggering the asynchronous connection-oriented link which is established based on the established to acquire the pairing function supported by the Bluetooth device and the identification of the Bluetooth device;
when the environmental interference value is smaller than an interference threshold value, establishing a temporary asynchronous connection-oriented link, and acquiring a pairing function supported by the Bluetooth device and an identifier of the Bluetooth device based on the temporary asynchronous connection-oriented link;
and recording whether a safe simple pairing function is supported or not and disconnecting the temporary asynchronous connection-oriented link based on the supported pairing function, and triggering and executing the asynchronous connection-oriented link based on the created to acquire the pairing function supported by the Bluetooth device and the identifier of the Bluetooth device.
9. A pair connecting device applied to electronic equipment is characterized in that the device comprises:
the information acquisition module is used for acquiring the pairing function supported by the Bluetooth equipment and the identifier of the Bluetooth equipment based on the established asynchronous connection-oriented link when the electronic equipment is communicated with the Bluetooth equipment for the first time;
and the equipment pairing module is used for carrying out security authentication on the electronic equipment and the Bluetooth equipment, and completing pairing connection based on a pairing connection mode corresponding to the security simple pairing function and the Bluetooth equipment indicated by the identification when the pairing function is determined to comprise the security simple pairing function after the security authentication is passed.
10. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 8.
11. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 8.
CN202010108239.6A 2020-02-21 2020-02-21 Pairing connection method and device, storage medium and electronic equipment Active CN113301542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010108239.6A CN113301542B (en) 2020-02-21 2020-02-21 Pairing connection method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010108239.6A CN113301542B (en) 2020-02-21 2020-02-21 Pairing connection method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113301542A CN113301542A (en) 2021-08-24
CN113301542B true CN113301542B (en) 2022-07-12

Family

ID=77317565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010108239.6A Active CN113301542B (en) 2020-02-21 2020-02-21 Pairing connection method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113301542B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202524388U (en) * 2011-12-21 2012-11-07 国民技术股份有限公司 Bluetooth pairing system and terminal
EP2725834A1 (en) * 2012-10-29 2014-04-30 Souffiane Houti Method for providing a device ID of a short distance communication device to an authentication process, computer programme at short distance communication receiver
CN105144826A (en) * 2013-03-27 2015-12-09 环汇系统有限公司 System and method for secure pairing of bluetooth devices
WO2016108646A1 (en) * 2014-12-30 2016-07-07 엘지전자(주) Method and apparatus for controlling device using bluetooth le technique

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9363108B2 (en) * 2008-06-05 2016-06-07 Cisco Technology, Inc. System for utilizing identity based on pairing of wireless devices
WO2016159678A1 (en) * 2015-04-01 2016-10-06 엘지전자(주) Method and device for controlling device using bluetooth low-power energy technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202524388U (en) * 2011-12-21 2012-11-07 国民技术股份有限公司 Bluetooth pairing system and terminal
EP2725834A1 (en) * 2012-10-29 2014-04-30 Souffiane Houti Method for providing a device ID of a short distance communication device to an authentication process, computer programme at short distance communication receiver
CN105144826A (en) * 2013-03-27 2015-12-09 环汇系统有限公司 System and method for secure pairing of bluetooth devices
WO2016108646A1 (en) * 2014-12-30 2016-07-07 엘지전자(주) Method and apparatus for controlling device using bluetooth le technique

Also Published As

Publication number Publication date
CN113301542A (en) 2021-08-24

Similar Documents

Publication Publication Date Title
US11611863B2 (en) Method and apparatus for low energy discovery
US20150024688A1 (en) Automatic Pairing of a Vehicle and a Mobile Communications Device
CN104982021A (en) Authenticating a wireless dockee to a wireless docking service
CN104540089B (en) A kind of main equipment and method, equipment and system from equipment progress Bluetooth pairing
JP6396589B2 (en) One-time credentials for secure automatic blue-two sparing
US20210076435A1 (en) Electronic device for receiving data packet in bluetooth network environment and method thereof
KR101568332B1 (en) Vehicle supporting efficient bluetooth connection and method for controlling thereof
US20210367942A1 (en) Method and Apparatus for Secure Interaction Between Terminals
KR102514692B1 (en) Electronic device suporting multiple wireless communication protocols and method therefor
KR20200106741A (en) Electronic device for transmitting response message in bluetooth network environment and method thereof
US10152587B2 (en) Device pairing method
US9949122B2 (en) Challenge-response-test image to phone for secure pairing
CN110602693B (en) Networking method and equipment of wireless network
CN113301542B (en) Pairing connection method and device, storage medium and electronic equipment
CN115801299B (en) Meta universe identity authentication method, device, equipment and storage medium
CN115174558B (en) Cloud network end integrated identity authentication method, device, equipment and storage medium
CN110460567B (en) Identity authentication method and device
CN113068190A (en) Information sharing method and device
CN109963281B (en) Authentication method, device and system
WO2019104989A1 (en) Terminal and communication method
CN116782234B (en) WiFi connection method and related equipment
CN113079502B (en) Information sharing method, device, terminal and storage medium
KR20230041746A (en) Bluetooth node pairing method and related device
CN116847319A (en) Device authentication networking method, communication device and readable storage medium
CN106416337B (en) Method, device and terminal for acquiring authentication information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant