[go: up one dir, main page]

CN109587669B - Bluetooth pairing method and device, readable storage medium and terminal equipment - Google Patents

Bluetooth pairing method and device, readable storage medium and terminal equipment Download PDF

Info

Publication number
CN109587669B
CN109587669B CN201910041512.5A CN201910041512A CN109587669B CN 109587669 B CN109587669 B CN 109587669B CN 201910041512 A CN201910041512 A CN 201910041512A CN 109587669 B CN109587669 B CN 109587669B
Authority
CN
China
Prior art keywords
bluetooth
bluetooth terminal
terminal
verification information
list
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
CN201910041512.5A
Other languages
Chinese (zh)
Other versions
CN109587669A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910041512.5A priority Critical patent/CN109587669B/en
Publication of CN109587669A publication Critical patent/CN109587669A/en
Application granted granted Critical
Publication of CN109587669B publication Critical patent/CN109587669B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B11/00Transmission systems employing sonic, ultrasonic or infrasonic waves

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention belongs to the technical field of computers, and particularly relates to a Bluetooth pairing method and device, a computer readable storage medium and terminal equipment. The method comprises the following steps: a first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user; searching the equipment identifier of the second Bluetooth terminal in a preset equipment list; if the device identification of the second Bluetooth terminal is found in the device list, determining verification information and ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the device list; and adjusting the ultrasonic wave transmitting frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and transmitting a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave transmitting device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information, so that the safety in the Bluetooth pairing connection process is greatly improved.

Description

Bluetooth pairing method and device, readable storage medium and terminal equipment
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a Bluetooth pairing method and device, a computer readable storage medium and terminal equipment.
Background
With the development of wireless technology and the popularization of intelligent terminal devices, people have been accustomed to connecting different intelligent terminal devices in a wireless manner, wherein a bluetooth technology is widely applied to intelligent terminal devices as a current mature short-distance wireless technology, for example, the connection between a bluetooth sound box or a bluetooth earphone and an intelligent mobile phone is performed through bluetooth. However, when bluetooth pairing connection is performed at present, a safe bluetooth terminal is generally identified through an equipment identifier, but some malicious equipment can establish bluetooth connection in a mode of forging the equipment identifier, so that great potential safety hazards are caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a bluetooth pairing method and apparatus, a computer readable storage medium, and a terminal device, so as to solve the problem of potential safety hazard caused by a malicious device establishing a bluetooth connection in a manner of forging a device identifier.
A first aspect of an embodiment of the present invention provides a bluetooth pairing method, which may include:
the method comprises the steps that a first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
searching the device identification of the second Bluetooth terminal in a preset device list;
if the device identification of the second Bluetooth terminal is found in the device list, determining verification information and ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the device list;
and adjusting the ultrasonic wave sending frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and sending a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave sending device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information.
A second aspect of the embodiments of the present invention provides a bluetooth pairing apparatus, which may include:
the Bluetooth pairing instruction receiving module is used for receiving a Bluetooth pairing instruction issued by a user by a first Bluetooth terminal, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
the device identifier searching module is used for searching the device identifier of the second Bluetooth terminal in a preset device list;
a corresponding information determining module, configured to determine, according to the device list, verification information and ultrasonic wave receiving frequency corresponding to the second bluetooth terminal if the device identifier of the second bluetooth terminal is found in the device list;
the first pairing request sending module is used for adjusting the ultrasonic sending frequency of the first Bluetooth terminal according to the ultrasonic receiving frequency of the second Bluetooth terminal, and sending a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic sending device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information.
A third aspect of embodiments of the present invention provides a computer-readable storage medium storing computer-readable instructions, which when executed by a processor implement the steps of:
the method comprises the steps that a first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
searching the device identification of the second Bluetooth terminal in a preset device list;
if the device identification of the second Bluetooth terminal is found in the device list, determining verification information and ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the device list;
and adjusting the ultrasonic wave sending frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and sending a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave sending device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information.
A fourth aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, where the processor executes the computer-readable instructions to implement the following steps:
the method comprises the steps that a first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
searching the equipment identifier of the second Bluetooth terminal in a preset equipment list;
if the device identification of the second Bluetooth terminal is found in the device list, determining verification information and ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the device list;
and adjusting the ultrasonic wave sending frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and sending a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave sending device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: after receiving a bluetooth pairing instruction issued by a user, a first bluetooth terminal in the embodiment of the present invention first searches for an equipment identifier of a second bluetooth terminal in a preset equipment list, determines, according to the equipment list, verification information and ultrasonic receiving frequency corresponding to the second bluetooth terminal if the equipment identifier of the second bluetooth terminal is found in the equipment list, then adjusts the ultrasonic transmitting frequency of the first bluetooth terminal according to the ultrasonic receiving frequency of the second bluetooth terminal, and transmits a bluetooth pairing request (including the equipment identifier of the first bluetooth terminal and the verification information) to the second bluetooth terminal through a preset ultrasonic transmitting device, so as to establish a bluetooth connection with the second bluetooth terminal. Compared with the prior art, in the process of establishing the Bluetooth connection, the invention does not use a universal information transmission link in the prior art, but carries out information transmission based on ultrasonic waves, and further enhances the security by introducing check information, so that even if malicious equipment can forge equipment identification, the Bluetooth pairing connection still cannot be realized under the condition that the ultrasonic wave frequency and the check information are not clear, thereby greatly enhancing the security in the Bluetooth pairing connection process.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive labor.
Fig. 1 is a flowchart of an embodiment of a bluetooth pairing method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a bluetooth pairing method according to another embodiment of the present invention;
FIG. 3 is a diagram of an embodiment of a Bluetooth pairing apparatus according to the invention;
fig. 4 is a schematic block diagram of a terminal device in the embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of a bluetooth pairing method according to an embodiment of the present invention may include:
and S101, the first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user.
The Bluetooth pairing instruction comprises an equipment identifier of the second Bluetooth terminal. In this embodiment, the device identifier of a certain bluetooth terminal may be an International Mobile Equipment Identity (IMEI) of the bluetooth terminal or a Media Access Control Address (MAC) of the bluetooth terminal.
When a user of a first bluetooth terminal wants to establish bluetooth connection between the first bluetooth terminal and a second bluetooth terminal, a list of the bluetooth terminals which can be currently connected can be opened in a human-computer interaction interface provided by the first bluetooth terminal, the list includes all other bluetooth terminals which can detect signals at the current moment by the first bluetooth terminal, and the user can check the second bluetooth terminal which wants to be connected, namely, a bluetooth pairing instruction carrying an equipment identifier of the second bluetooth terminal can be issued to the first bluetooth terminal.
And S102, searching the equipment identifier of the second Bluetooth terminal in a preset equipment list.
Recording all the device identifiers of the bluetooth terminals which have successfully established the bluetooth connection with the first bluetooth terminal in the device list locally stored in the first bluetooth terminal, and if the device identifier of the second bluetooth terminal is found in the device list, indicating that the bluetooth connection has been successfully established between the first bluetooth terminal and the second bluetooth terminal, then step S103 and step S104 may be executed.
And step S103, determining the verification information and the ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the equipment list.
In this embodiment, in the process of establishing the bluetooth connection, not only the device identifier needs to be identified, but also security is further enhanced by introducing check information, for each bluetooth terminal with which the bluetooth connection was successfully established, there is a check information corresponding to the first bluetooth terminal, where the check information includes, but is not limited to, specific forms of numbers, character strings, pictures, sounds, and the like, and the check information of different bluetooth terminals is also different.
In the device list, the correspondence between the device identifier of each bluetooth terminal and the verification information is stored, as shown in the following table:
device identification Verification information
Device identification A Verification information1
Device identification B Verification information 2
Device identification C Verification information 3
…… ……
The check information corresponding to the second bluetooth terminal may be determined by querying the device list, for example, if the device identifier of the second bluetooth terminal is the device identifier C, the check information corresponding to the device identifier C may be determined to be the check information 3 by querying.
Similarly, for the first bluetooth terminal, each bluetooth terminal with which a bluetooth connection has been successfully established has an ultrasonic wave receiving frequency corresponding to the first bluetooth terminal, and the ultrasonic wave receiving frequencies of different bluetooth terminals are different.
In the device list, the correspondence between the device identifier of each bluetooth terminal and the ultrasonic wave receiving frequency is also stored, as shown in the following table:
device identification Frequency of ultrasonic reception
Device identification A Ultrasonic receiving frequency 1
Device identification B Ultrasonic reception frequency 2
Device identification C Ultrasonic receiving frequency 3
…… ……
The ultrasonic receiving frequency corresponding to the second bluetooth terminal can be determined by querying the device list, for example, if the device identifier of the second bluetooth terminal is the device identifier C, the ultrasonic receiving frequency corresponding to the second bluetooth terminal can be determined to be the ultrasonic receiving frequency 3 by querying.
And step S104, adjusting the ultrasonic wave transmitting frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and transmitting a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave transmitting device so as to establish Bluetooth connection with the second Bluetooth terminal.
The Bluetooth pairing request comprises the equipment identification of the first Bluetooth terminal and the verification information. Similar to the first bluetooth terminal, the second bluetooth terminal also stores a device list locally, the device list records all device identifiers of bluetooth terminals that have successfully established bluetooth connection with the second bluetooth terminal, the second bluetooth terminal searches the device identifier of the first bluetooth terminal in the locally stored device list after receiving the bluetooth pairing request sent by the first bluetooth terminal, if the device identifier of the first bluetooth terminal is found in the device list, it indicates that the first bluetooth terminal and the second bluetooth terminal have successfully established bluetooth connection, and at this time, the verification information corresponding to the first bluetooth terminal can be determined according to the device list. And finally, the second Bluetooth terminal compares the check information determined from the equipment list with the check information in the Bluetooth pairing request sent by the first Bluetooth terminal, and if the check information is consistent with the check information in the Bluetooth pairing request sent by the first Bluetooth terminal, the first Bluetooth terminal is trustable, and Bluetooth connection with the first Bluetooth terminal can be established.
It should be noted that the process shown in fig. 1 is a case where the first bluetooth terminal has successfully established a bluetooth connection with the second bluetooth terminal, and if the first bluetooth terminal and the second bluetooth terminal have not successfully established a bluetooth connection, in step S102, the device identifier of the second bluetooth terminal is not found in the device list, and at this time, the first bluetooth terminal may perform the steps shown in fig. 2:
step S201, a Bluetooth pairing request is sent to the second Bluetooth terminal so as to establish Bluetooth connection with the second Bluetooth terminal.
The Bluetooth pairing request comprises the equipment identification of the first Bluetooth terminal.
Preferably, before executing step S201, the first bluetooth terminal may first send a prompt to the user in a text or voice manner, so as to notify the user that the bluetooth connection between the first bluetooth terminal and the second bluetooth terminal has not been successfully established, which may have a certain potential safety hazard, and provide a selection key for the user to continue bluetooth pairing and abandon bluetooth pairing on the human-computer interaction interface. If the user is confused about the security of the second bluetooth terminal, the user may choose to abandon the bluetooth pairing, and then does not execute the subsequent steps, and if the user considers that the security of the second bluetooth terminal is guaranteed, for example, the second bluetooth terminal is owned by the user or a familiar parent or friend, the user may choose to continue the bluetooth pairing, and at this time, the first bluetooth terminal may send a bluetooth pairing request to the second bluetooth terminal.
It should be noted that, in this case, the first bluetooth terminal does not store the ultrasonic wave receiving frequency of the second bluetooth terminal, and cannot perform information transmission based on the ultrasonic wave, so the bluetooth pairing request is still transmitted through the information transmission link commonly used in the existing bluetooth technology.
If the second bluetooth terminal rejects the bluetooth pairing request of the first bluetooth terminal, the subsequent steps are not executed, and if the second bluetooth terminal receives the bluetooth pairing request of the first bluetooth terminal and the bluetooth connection is successfully established between the second bluetooth terminal and the first bluetooth terminal, the first bluetooth terminal continues to execute steps S202 to S204.
Step S202, obtaining the device identification of the first Bluetooth terminal, and generating verification information according to the device identification of the first Bluetooth terminal and the device identification of the second Bluetooth terminal.
In this embodiment, the first bluetooth terminal is preset with a check information base, where the check information base includes a plurality of pieces of check information that can be allocated to other bluetooth terminals, and generally, the first bluetooth terminal may download or update the check information base from a designated server.
After acquiring the device identifier of the first bluetooth terminal, the first bluetooth terminal may calculate the sequence number of the check information in the check information base according to the following formula:
CheckInfoSq=HashFunc[Linkage(EquipID1,EquipID2)]
wherein, the equlpid 1 is the device identifier of the first bluetooth terminal, the equlpid 2 is the device identifier of the second bluetooth terminal, link (equlpid 1, equlpid 2) is a character string formed by sequentially connecting the equlpid 1 and the equlpid 2, hashFunc is a preset hash function, and CheckInfoSq is a sequence number of check information obtained by calculation.
All hash functions have the following basic characteristics: if two hash values are not identical (according to the same hash function), then the original inputs for the two hash values are also not identical. This property gives the hash function a deterministic result. On the other hand, however, the input and output of a hash function are not unique correspondences, and if two hash values are the same, the two input values are likely to be the same, but may also be different, which is called "hash collision", which is usually two different input values, and the same output value is calculated intentionally. However, for the hash functions commonly used in the prior art, the probability of collision is very low and can be almost ignored, some data are input to calculate the hash value, then the input value is partially changed, and a hash function with strong confusion characteristics can generate a completely different hash value. The hash function in this embodiment may include, but is not limited to, any hash function commonly used in the prior art, such as MD4, MD5, SHA1, and the like.
After the calculation is completed, the first bluetooth terminal can search the check information corresponding to the calculated check information sequence number in the check information base.
Step S203, inquiring the ultrasonic receiving frequency of the second Bluetooth terminal from the second Bluetooth terminal, and storing the corresponding relation between the second Bluetooth terminal and the verification information and the ultrasonic receiving frequency into the equipment list.
Step S204, the checking information and the ultrasonic receiving frequency of the first Bluetooth terminal are sent to the second Bluetooth terminal, so that the second Bluetooth terminal stores the corresponding relation between the first Bluetooth terminal and the checking information and the ultrasonic receiving frequency.
In this way, the corresponding relationship between the second bluetooth terminal and the verification information and between the second bluetooth terminal and the ultrasonic wave receiving frequency is added to the device list locally stored in the first bluetooth terminal, and the corresponding relationship between the first bluetooth terminal and the verification information and between the first bluetooth terminal and the ultrasonic wave receiving frequency is added to the device list locally stored in the second bluetooth terminal, so that when the first bluetooth terminal and the second bluetooth terminal perform bluetooth pairing connection again, processing can be performed according to the process shown in fig. 1.
In the above process, the first bluetooth terminal is an initiator of the bluetooth pairing connection, and when the first bluetooth terminal is a receiver of the bluetooth pairing connection, the first bluetooth terminal may perform the following steps:
after the first Bluetooth terminal receives a Bluetooth pairing request sent by a third Bluetooth terminal through a preset ultrasonic receiving device, firstly, the device identification and the verification information of the third Bluetooth terminal are extracted from the Bluetooth pairing request.
The third bluetooth terminal may be the same bluetooth terminal as the second bluetooth terminal, or may be a different bluetooth terminal from the second bluetooth terminal.
If the bluetooth pairing request does not include the check information, it is indicated that the bluetooth connection between the first bluetooth terminal and the second bluetooth terminal is not successfully established, at this time, the first bluetooth terminal may first send a prompt to the user in a text or voice manner to notify the user that the bluetooth connection between the first bluetooth terminal and the third bluetooth terminal is not successfully established, that a certain potential safety hazard may exist, and provide a selection key for the user to accept the bluetooth pairing and reject the bluetooth pairing on the man-machine interaction interface. If the user is confused about the security of the third bluetooth terminal, the user can choose to refuse bluetooth pairing, and then does not execute the subsequent steps, if the user considers that the security of the third bluetooth terminal can be ensured, the user can choose to accept bluetooth pairing, and the first bluetooth connection can be successfully established between the third bluetooth terminal and the third bluetooth terminal. After the Bluetooth connection is established, the first Bluetooth terminal receives the verification information generated and sent by the third Bluetooth terminal, and adds the corresponding relation between the third Bluetooth terminal and the verification information into a local equipment list, so that when the first Bluetooth terminal and the third Bluetooth terminal are connected in a Bluetooth pairing mode again, the safety can be confirmed through comparison of the verification information.
If the bluetooth pairing request includes the verification information, it indicates that the bluetooth connection between the first bluetooth terminal and the third bluetooth terminal has been successfully established, and at this time, the first bluetooth terminal may search the device identifier of the third bluetooth terminal in the device list. If the device identifier of the third bluetooth terminal cannot be found in the device list, it is indicated that the third bluetooth terminal has potential safety hazard and is no longer in pairing connection with the third bluetooth terminal, and if the device identifier of the third bluetooth terminal is found in the device list, verification information corresponding to the third bluetooth terminal is determined according to the device list. If the check information in the bluetooth pairing request is consistent with the check information determined according to the device list, it indicates that the third bluetooth terminal is trustable, and then bluetooth connection with the third bluetooth terminal can be established, and if the check information in the bluetooth pairing request is inconsistent with the check information determined according to the device list, it indicates that the third bluetooth terminal has potential safety hazard and is no longer in pairing connection with the third bluetooth terminal.
Further, it is considered that if the same check information is always repeatedly used between two bluetooth terminals for check comparison, a risk of interception and forgery by a malicious device exists. In order to solve the problem, after the first bluetooth terminal and the second bluetooth terminal successfully establish the bluetooth connection for the first time, the first bluetooth terminal automatically generates check information which is not single, but is a check information set, and the check information set comprises more than two check information.
Specifically, a check information base preset in the first bluetooth terminal includes a plurality of check information sets that can be allocated to other bluetooth terminals, and the first bluetooth terminal can calculate a sequence number of the check information set corresponding to the second bluetooth terminal in the check information base according to the following formula:
CheckSetSq=HashFunc[Linkage(EquipID1,EquipID2)]
wherein, checkSetSq is the serial number of the check information set obtained by calculation.
After the calculation is completed, the first bluetooth terminal can search the check information set corresponding to the calculated check information set sequence number in the check information base. Then, the first bluetooth terminal stores the corresponding relationship between the second bluetooth terminal and the check information set into the device list, and sends the check information to the second bluetooth terminal, so that the second bluetooth terminal stores the corresponding relationship between the first bluetooth terminal and the check information set.
When the first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user and the first Bluetooth terminal and the second Bluetooth terminal perform Bluetooth pairing connection again, the device identifier of the second Bluetooth terminal is searched in the device list, and a check information set corresponding to the second Bluetooth terminal is further determined according to the device list.
True random numbers are generated using physical phenomena such as coin rolls, dice, wheels, noise using electronic components, nuclear fission, and the like. Such random number generators are called physical random number generators and they have the disadvantage of relatively high technical requirements. In practical applications it is often sufficient to use pseudo random numbers. These sequences are "seemingly" random numbers, which are actually generated by a fixed, repeatable calculation. They are not truly random because they can actually be computed, but they have statistical characteristics similar to random numbers. In this embodiment, a random number is preferably generated by a preset pseudo random number generator, and then preferred check information corresponding to the random number in the check information set is calculated according to the following formula:
SelInfoSq=MOD(RandomNum,N)+1
wherein, MOD is a remainder function, randomNum is the random number, N is the total number of the check information in the check information set, and sellnfosq is the sequence number of the preferred check information in the check information set.
For example, if the check information set is found as follows:
if the check information set = { check information 1, check information 2, check information 3, … …, check information 100} and the random number is 876, the 77 th check information is selected as the finally determined preferred check information.
After the preferred verification information is determined, the first Bluetooth terminal sends a Bluetooth pairing request to the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identification of the first Bluetooth terminal, the verification information and the random number RandomNum. Similar to the first bluetooth terminal, the second bluetooth terminal also stores a device list locally, the device list records all device identifiers of bluetooth terminals that have successfully established bluetooth connection with the second bluetooth terminal, after the second bluetooth terminal receives a bluetooth pairing request sent by the first bluetooth terminal, the device identifier of the first bluetooth terminal is searched in the locally stored device list, if the device identifier of the first bluetooth terminal is searched in the device list, it is indicated that the first bluetooth terminal and the second bluetooth terminal have successfully established bluetooth connection, at this time, a verification information set corresponding to the first bluetooth terminal can be determined according to the device list, and preferred verification information is selected according to the random number RandomNum, finally, the second bluetooth terminal compares the verification information determined from the device list with the verification information in the bluetooth pairing request sent by the first bluetooth terminal, if the two verification information are consistent, it is indicated that the first bluetooth terminal is trusted bluetooth terminal, and bluetooth connection with the first bluetooth terminal can be established.
Through the mode, even if malicious equipment intercepts the check information used when the first Bluetooth terminal and the second Bluetooth terminal are connected through Bluetooth at a certain time, the check information at each time is random, the check information at the next time is different from the check information at the last time, and if the malicious equipment conducts check by using the intercepted check information, the malicious equipment can still be identified because the check information cannot be successfully compared, so that the safety of Bluetooth connection is greatly improved.
In summary, in the embodiment of the present invention, after receiving a bluetooth pairing instruction issued by a user, a first bluetooth terminal first searches for an equipment identifier of a second bluetooth terminal in a preset equipment list, and if the equipment identifier of the second bluetooth terminal is found in the equipment list, determines, according to the equipment list, verification information and an ultrasonic wave receiving frequency corresponding to the second bluetooth terminal, then adjusts an ultrasonic wave transmitting frequency of the first bluetooth terminal according to the ultrasonic wave receiving frequency of the second bluetooth terminal, and transmits a bluetooth pairing request (including the equipment identifier of the first bluetooth terminal and the verification information) to the second bluetooth terminal through a preset ultrasonic wave transmitting device, so as to establish a bluetooth connection with the second bluetooth terminal. Compared with the prior art, in the process of establishing the Bluetooth connection, the invention does not use a universal information transmission link in the prior art, but carries out information transmission based on ultrasonic waves, and further enhances the security by introducing check information, so that even if malicious equipment can forge equipment identification, the Bluetooth pairing connection still cannot be realized under the condition that the ultrasonic wave frequency and the check information are not clear, thereby greatly enhancing the security in the Bluetooth pairing connection process.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not limit the implementation process of the embodiments of the present invention in any way.
Fig. 3 shows a structural diagram of an embodiment of a bluetooth pairing apparatus according to an embodiment of the present invention, which corresponds to the bluetooth pairing method described in the foregoing embodiment.
In this embodiment, a bluetooth pairing apparatus may include:
a bluetooth pairing instruction receiving module 301, configured to receive, by a first bluetooth terminal, a bluetooth pairing instruction issued by a user, where the bluetooth pairing instruction includes an equipment identifier of a second bluetooth terminal;
a device identifier searching module 302, configured to search a device identifier of the second bluetooth terminal in a preset device list;
a corresponding information determining module 303, configured to determine, according to the device list, verification information and ultrasonic wave receiving frequency corresponding to the second bluetooth terminal if the device identifier of the second bluetooth terminal is found in the device list;
a first pairing request sending module 304, configured to adjust an ultrasonic sending frequency of the first bluetooth terminal according to an ultrasonic receiving frequency of the second bluetooth terminal, and send a bluetooth pairing request to the second bluetooth terminal through a preset ultrasonic sending device to establish a bluetooth connection with the second bluetooth terminal, where the bluetooth pairing request includes the device identifier of the first bluetooth terminal and the verification information.
Further, the bluetooth pairing apparatus may further include:
the Bluetooth pairing request receiving module is used for receiving a Bluetooth pairing request sent by a third Bluetooth terminal through a preset ultrasonic receiving device by the first Bluetooth terminal and extracting equipment identification and verification information of the third Bluetooth terminal from the Bluetooth pairing request;
the device identifier searching module is used for searching the device identifier of the third Bluetooth terminal in the device list;
a corresponding information determining module, configured to determine, according to the device list, verification information corresponding to the third bluetooth terminal if the device identifier of the third bluetooth terminal is found in the device list;
and the Bluetooth connection establishing module is used for establishing Bluetooth connection with the third Bluetooth terminal if the verification information in the Bluetooth pairing request is consistent with the verification information determined according to the equipment list.
Further, the bluetooth pairing apparatus may further include:
a second pairing request sending module, configured to send a bluetooth pairing request to the second bluetooth terminal to establish a bluetooth connection with the second bluetooth terminal if the device identifier of the second bluetooth terminal is not found in the device list, where the bluetooth pairing request includes the device identifier of the first bluetooth terminal;
the verification information generating module is used for acquiring the equipment identifier of the first Bluetooth terminal and generating verification information according to the equipment identifier of the first Bluetooth terminal and the equipment identifier of the second Bluetooth terminal;
the corresponding information storage module is used for inquiring the ultrasonic receiving frequency of the second Bluetooth terminal from the second Bluetooth terminal and storing the corresponding relation between the second Bluetooth terminal and the verification information and the ultrasonic receiving frequency into the equipment list;
and the corresponding information sending module is used for sending the verification information and the ultrasonic receiving frequency of the first Bluetooth terminal to the second Bluetooth terminal so that the second Bluetooth terminal stores the corresponding relation between the first Bluetooth terminal and the verification information and the ultrasonic receiving frequency.
Further, the verification information generating module may include:
a sequence number calculating unit, configured to calculate a sequence number of the check information in a preset check information base according to the following formula:
CheckInfoSq=HashFunc[Linkage(EquipID1,EquipID2)]
wherein, equipID1 is the device identifier of the first Bluetooth terminal, equipID2 is the device identifier of the second Bluetooth terminal, link (EquipID 1, equipID 2) is a character string formed by sequentially connecting EquipID1 and EquipID2, hashFunc is a preset hash function, and CheckInfSq is a sequence number of check information obtained by calculation;
and the checking information searching unit is used for searching the checking information corresponding to the checking information sequence number in the checking information base.
Further, the correspondence information determining module may include:
a check information set determining unit, configured to determine, according to the device list, check information and an ultrasonic wave receiving frequency set corresponding to the second bluetooth terminal, where the check information set includes more than two pieces of check information;
a random number generation unit for generating a random number by a preset pseudo random number generator;
a preferred check information selecting unit, configured to calculate preferred check information corresponding to the random number in the check information set according to the following formula:
SelInfoSq=MOD(RandomNum,N)+1
wherein MOD is a remainder function, randomNum is the random number, N is a total number of the check information in the check information set, and sellnfosq is a sequence number of the preferred check information in the check information set.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 4 shows a schematic block diagram of a terminal device according to an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown.
In this embodiment, the terminal device 4 may be a computing device such as a mobile phone, a notebook, a tablet computer, and the like. The terminal device 4 may include: a processor 40, a memory 41, and computer readable instructions 42 stored in the memory 41 and executable on the processor 40, such as computer readable instructions to perform the bluetooth pairing method described above. The processor 40, when executing the computer readable instructions 42, implements the steps in the various bluetooth pairing method embodiments described above, such as steps S101 to S104 shown in fig. 1. Alternatively, the processor 40, when executing the computer readable instructions 42, implements the functions of the modules/units in the above device embodiments, such as the functions of the modules 301 to 304 shown in fig. 3.
Illustratively, the computer readable instructions 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer-readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer-readable instructions 42 in the terminal device 4.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store the computer readable instructions and other instructions and data required by the terminal device 4. The memory 41 may also be used to temporarily store data that has been output or is to be output.
Each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of computer readable instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, which can store computer readable instructions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A Bluetooth pairing method, comprising:
the method comprises the steps that a first Bluetooth terminal receives a Bluetooth pairing instruction issued by a user, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
searching the device identification of the second Bluetooth terminal in a preset device list;
if the device identification of the second Bluetooth terminal is found in the device list, determining verification information and ultrasonic wave receiving frequency corresponding to the second Bluetooth terminal according to the device list;
adjusting the ultrasonic wave transmitting frequency of the first Bluetooth terminal according to the ultrasonic wave receiving frequency of the second Bluetooth terminal, and transmitting a Bluetooth pairing request to the second Bluetooth terminal through a preset ultrasonic wave transmitting device so as to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the equipment identifier of the first Bluetooth terminal and the verification information;
if the device identifier of the second Bluetooth terminal is not found in the device list, sending a Bluetooth pairing request to the second Bluetooth terminal to establish Bluetooth connection with the second Bluetooth terminal, wherein the Bluetooth pairing request comprises the device identifier of the first Bluetooth terminal;
acquiring the equipment identifier of the first Bluetooth terminal, and generating verification information according to the equipment identifier of the first Bluetooth terminal and the equipment identifier of the second Bluetooth terminal;
inquiring the ultrasonic receiving frequency of the second Bluetooth terminal from the second Bluetooth terminal, and storing the corresponding relation between the second Bluetooth terminal and the verification information and the ultrasonic receiving frequency into the equipment list;
and sending the verification information and the ultrasonic receiving frequency of the first Bluetooth terminal to the second Bluetooth terminal so that the second Bluetooth terminal stores the corresponding relation between the first Bluetooth terminal and the verification information and the ultrasonic receiving frequency.
2. The bluetooth pairing method according to claim 1, further comprising:
the first Bluetooth terminal receives a Bluetooth pairing request sent by a third Bluetooth terminal through a preset ultrasonic receiving device, and extracts equipment identification and verification information of the third Bluetooth terminal from the Bluetooth pairing request;
searching the device identifier of the third Bluetooth terminal in the device list;
if the device identification of the third Bluetooth terminal is found in the device list, determining verification information corresponding to the third Bluetooth terminal according to the device list;
and if the verification information in the Bluetooth pairing request is consistent with the verification information determined according to the equipment list, establishing Bluetooth connection with the third Bluetooth terminal.
3. The bluetooth pairing method according to claim 1, wherein the generating of the check information according to the device identifier of the first bluetooth terminal and the device identifier of the second bluetooth terminal comprises:
calculating the serial number of the check information in a preset check information base according to the following formula:
CheckInfoSq=HashFunc[Linkage(EquipID1,EquipID2)]
wherein, equipID1 is the equipment identifier of the first Bluetooth terminal, equipID2 is the equipment identifier of the second Bluetooth terminal, linkage (EquipID 1, equipID 2) is a character string formed by sequentially connecting EquipID1 and EquipID2, hashFunc is a preset hash function, and CheckInfSq is a check information sequence number obtained by calculation;
and searching the verification information corresponding to the verification information serial number in the verification information base.
4. The bluetooth pairing method according to any one of claims 1 to 3, wherein the determining the check information corresponding to the second bluetooth terminal according to the device list comprises:
determining a check information set corresponding to the second Bluetooth terminal according to the equipment list, wherein the check information set comprises more than two check information;
generating a random number through a preset pseudo-random number generator;
calculating preferred check information corresponding to the random number in the check information set according to the following formula:
SelInfoSq=MOD(RandomNum,N)+1
wherein, MOD is a remainder function, randomNum is the random number, N is the total number of the check information in the check information set, and sellnfosq is the sequence number of the preferred check information in the check information set.
5. A Bluetooth pairing apparatus, comprising:
the Bluetooth pairing instruction receiving module is used for receiving a Bluetooth pairing instruction issued by a user by a first Bluetooth terminal, wherein the Bluetooth pairing instruction comprises a device identifier of a second Bluetooth terminal;
the device identifier searching module is used for searching the device identifier of the second Bluetooth terminal in a preset device list;
a corresponding information determining module, configured to determine, according to the device list, verification information and ultrasonic wave receiving frequency corresponding to the second bluetooth terminal if the device identifier of the second bluetooth terminal is found in the device list;
a first pairing request sending module, configured to adjust an ultrasonic sending frequency of the first bluetooth terminal according to an ultrasonic receiving frequency of the second bluetooth terminal, and send a bluetooth pairing request to the second bluetooth terminal through a preset ultrasonic sending device to establish a bluetooth connection with the second bluetooth terminal, where the bluetooth pairing request includes the device identifier of the first bluetooth terminal and the verification information;
a second pairing request sending module, configured to send a bluetooth pairing request to the second bluetooth terminal to establish a bluetooth connection with the second bluetooth terminal if the device identifier of the second bluetooth terminal is not found in the device list, where the bluetooth pairing request includes the device identifier of the first bluetooth terminal;
the verification information generating module is used for acquiring the equipment identifier of the first Bluetooth terminal and generating verification information according to the equipment identifier of the first Bluetooth terminal and the equipment identifier of the second Bluetooth terminal;
the corresponding information storage module is used for inquiring the ultrasonic receiving frequency of the second Bluetooth terminal from the second Bluetooth terminal and storing the corresponding relation between the second Bluetooth terminal and the verification information as well as the ultrasonic receiving frequency into the equipment list;
and the corresponding information sending module is used for sending the verification information and the ultrasonic receiving frequency of the first Bluetooth terminal to the second Bluetooth terminal so that the second Bluetooth terminal stores the corresponding relation between the first Bluetooth terminal and the verification information and the ultrasonic receiving frequency.
6. The bluetooth pairing apparatus as claimed in claim 5, further comprising:
the Bluetooth pairing request receiving module is used for receiving a Bluetooth pairing request sent by a third Bluetooth terminal through a preset ultrasonic receiving device by the first Bluetooth terminal and extracting equipment identification and verification information of the third Bluetooth terminal from the Bluetooth pairing request;
the device identifier searching module is used for searching the device identifier of the third Bluetooth terminal in the device list;
a corresponding information determining module, configured to determine, according to the device list, verification information corresponding to the third bluetooth terminal if the device identifier of the third bluetooth terminal is found in the device list;
and the Bluetooth connection establishing module is used for establishing Bluetooth connection with the third Bluetooth terminal if the check information in the Bluetooth pairing request is consistent with the check information determined according to the equipment list.
7. A computer readable storage medium storing computer readable instructions, which when executed by a processor implement the steps of the bluetooth pairing method as claimed in any one of claims 1 to 4.
8. A terminal device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, characterized in that the processor when executing the computer readable instructions implements the steps of the bluetooth pairing method as claimed in any one of claims 1 to 4.
CN201910041512.5A 2019-01-16 2019-01-16 Bluetooth pairing method and device, readable storage medium and terminal equipment Active CN109587669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910041512.5A CN109587669B (en) 2019-01-16 2019-01-16 Bluetooth pairing method and device, readable storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910041512.5A CN109587669B (en) 2019-01-16 2019-01-16 Bluetooth pairing method and device, readable storage medium and terminal equipment

Publications (2)

Publication Number Publication Date
CN109587669A CN109587669A (en) 2019-04-05
CN109587669B true CN109587669B (en) 2022-10-25

Family

ID=65915168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910041512.5A Active CN109587669B (en) 2019-01-16 2019-01-16 Bluetooth pairing method and device, readable storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN109587669B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111654772B (en) * 2020-05-21 2021-08-03 头领科技(昆山)有限公司 Bluetooth headset amplifier and use bluetooth headset of this amplifier
CN111918255B (en) * 2020-07-10 2022-09-16 威海北洋电气集团股份有限公司 Equipment query method and system
US11558914B2 (en) 2021-05-07 2023-01-17 Cisco Technology, Inc. Device pairing in hot desking environments
CN115915037A (en) * 2021-09-24 2023-04-04 Oppo广东移动通信有限公司 Call control method and device, electronic equipment and computer readable storage medium
CN114007278B (en) * 2021-10-29 2024-06-07 歌尔科技有限公司 Multi-device pairing method, system, device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011199381A (en) * 2010-03-17 2011-10-06 Kddi Corp Radio communication method and system, and radio communication device of the same
CN105578386A (en) * 2015-11-26 2016-05-11 小米科技有限责任公司 Bluetooth device management method and device
CN106878917A (en) * 2015-12-11 2017-06-20 比亚迪股份有限公司 The transfer control method of information, system, terminal and data acquisition unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011199381A (en) * 2010-03-17 2011-10-06 Kddi Corp Radio communication method and system, and radio communication device of the same
CN105578386A (en) * 2015-11-26 2016-05-11 小米科技有限责任公司 Bluetooth device management method and device
CN106878917A (en) * 2015-12-11 2017-06-20 比亚迪股份有限公司 The transfer control method of information, system, terminal and data acquisition unit

Also Published As

Publication number Publication date
CN109587669A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109587669B (en) Bluetooth pairing method and device, readable storage medium and terminal equipment
CN102523213B (en) Server and terminal authenticating method and server and terminal
CN105900466B (en) Message processing method and device
CN109213781B (en) Wind control data query method and device
CN106602654A (en) Charging authentication method, correlation devices and system
CN104219050A (en) Voiceprint verification method and system, voiceprint verification server and voiceprint verification client side
CN104092653B (en) Data processing method and system
CN109905366B (en) Terminal equipment safety verification method and device, readable storage medium and terminal equipment
CN104253818A (en) Server and terminal authentication method, server, terminal
CN104901805A (en) Identity authentication method and device and system
CN113961961A (en) Privacy set intersection method and device based on scalable-ot
CN109886670B (en) Payment method, device, system, mobile terminal, payment machine and server
CN103546887A (en) Application software transmitting method, device and terminal and server
CN111310393B (en) Simulation clock generation method and related product
CN110868374A (en) Security authentication method, server and client device
CN109246214B (en) Prompt tone obtaining method and device, terminal and server
CN116501997B (en) Short link generation method, device, electronic equipment and storage medium
CN109660988B (en) Communication authentication processing method and device and electronic equipment
CN108882239B (en) Information sending method and device
CN106921972B (en) Intelligent terminal and safety shielding method thereof
CN107248929B (en) Strong correlation data generation method of multi-dimensional correlation data
CN113677039B (en) Bluetooth-based device connection method and device, electronic device and storage medium
CN105512563A (en) Method and device for determining trusted device, and method and device for risk release
CN106535300A (en) Network access method and device
CN110544099A (en) Payment method, payment processing system and payment acceptance terminal based on block chain

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